Skip to content

Commit 143599b

Browse files
committed
docs: fix title level
1 parent 3711b49 commit 143599b

5 files changed

Lines changed: 53 additions & 49 deletions

File tree

user_guide_src/source/concepts/autoloader.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ The autoloader is always active, being registered with ``spl_autoload_register()
2828
beginning of the framework's execution.
2929

3030
Configuration
31-
=============
31+
*************
3232

3333
Initial configuration is done in **app/Config/Autoload.php**. This file contains two primary
3434
arrays: one for the classmap, and one for PSR-4 compatible namespaces.
3535

3636
Namespaces
37-
==========
37+
**********
3838

3939
The recommended method for organizing your classes is to create one or more namespaces for your
4040
application's files. This is most important for any business-logic related classes, entity classes,
@@ -61,7 +61,7 @@ You will need to modify any existing files that are referencing the current name
6161
namespace has changed.
6262

6363
Classmap
64-
========
64+
********
6565

6666
The classmap is used extensively by CodeIgniter to eke the last ounces of performance out of the system
6767
by not hitting the file-system with extra ``is_file()`` calls. You can use the classmap to link to
@@ -72,7 +72,7 @@ third-party libraries that are not namespaced:
7272
The key of each row is the name of the class that you want to locate. The value is the path to locate it at.
7373

7474
Composer Support
75-
================
75+
****************
7676

7777
Composer support is automatically initialized by default. By default, it looks for Composer's autoload file at
7878
``ROOTPATH . 'vendor/autoload.php'``. If you need to change the location of that file for any reason, you can modify

user_guide_src/source/concepts/factories.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Factories
77
:depth: 2
88

99
Introduction
10-
============
10+
************
1111

1212
What are Factories?
13-
-------------------
13+
===================
1414

1515
Like :doc:`./services`, **Factories** are an extension of autoloading that helps keep your code
1616
concise yet optimal, without having to pass around object instances between classes.
@@ -25,7 +25,7 @@ to work on or transmit common data. The framework itself uses Factories internal
2525
make sure the correct configuration is loaded when using the ``Config`` class.
2626

2727
Differences from Services
28-
-------------------------
28+
=========================
2929

3030
Factories require a concrete class name to instantiate and do not have code to create instances.
3131

@@ -37,7 +37,7 @@ that needs other services or class instances. When you get a service, Services r
3737
not a class name, so the returned instance can be changed without changing the client code.
3838

3939
Example
40-
-------
40+
=======
4141

4242
Take a look at **Models** as an example. You can access the Factory specific to Models
4343
by using the magic static method of the Factories class, ``Factories::models()``.
@@ -69,26 +69,26 @@ you get back the instance as before:
6969
.. literalinclude:: factories/003.php
7070

7171
Convenience Functions
72-
=====================
72+
*********************
7373

7474
Two shortcut functions for Factories have been provided. These functions are always available.
7575

7676
config()
77-
--------
77+
========
7878

7979
The first is ``config()`` which returns a new instance of a Config class. The only required parameter is the class name:
8080

8181
.. literalinclude:: factories/008.php
8282

8383
model()
84-
--------
84+
=======
8585

8686
The second function, ``model()`` returns a new instance of a Model class. The only required parameter is the class name:
8787

8888
.. literalinclude:: factories/009.php
8989

9090
Factory Parameters
91-
==================
91+
******************
9292

9393
``Factories`` takes as a second parameter an array of option values (described below).
9494
These directives will override the default options configured for each component.
@@ -106,7 +106,7 @@ class instance that uses the alternate database connection.
106106
.. _factories-options:
107107

108108
Factories Options
109-
==================
109+
*****************
110110

111111
The default behavior might not work for every component. For example, say your component
112112
name and its path do not align, or you need to limit instances to a certain type of class.
@@ -127,7 +127,7 @@ preferApp boolean Whether a class with the same basename in the App name
127127
========== ============== ============================================================ ===================================================
128128

129129
Factories Behavior
130-
==================
130+
******************
131131

132132
Options can be applied in one of three ways (listed in ascending priority):
133133

@@ -136,7 +136,7 @@ Options can be applied in one of three ways (listed in ascending priority):
136136
* Passing options directly at call time with a parameter.
137137

138138
Configurations
139-
--------------
139+
==============
140140

141141
To set default component options, create a new Config files at **app/Config/Factory.php**
142142
that supplies options as an array property that matches the name of the component.
@@ -154,7 +154,7 @@ This would prevent conflict of an third-party module which happened to have an
154154
unrelated ``Filters`` path in its namespace.
155155

156156
setOptions Method
157-
-----------------
157+
=================
158158

159159
The ``Factories`` class has a static method to allow runtime option configuration: simply
160160
supply the desired array of options using the ``setOptions()`` method and they will be
@@ -163,7 +163,7 @@ merged with the default values and stored for the next call:
163163
.. literalinclude:: factories/006.php
164164

165165
Parameter Options
166-
-----------------
166+
=================
167167

168168
``Factories``'s magic static call takes as a second parameter an array of option values.
169169
These directives will override the stored options configured for each component and can be
@@ -175,4 +175,4 @@ a component. By adding a second parameter to the magic static call, you can cont
175175
that single call will return a new or shared instance:
176176

177177
.. literalinclude:: factories/007.php
178-
:lines: 2-
178+
:lines: 2-

user_guide_src/source/concepts/http.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The first part of this chapter gives an overview. After the concepts are out of
1010
how to work with the requests and responses within CodeIgniter.
1111

1212
What is HTTP?
13-
=============
13+
*************
1414

1515
HTTP is simply a text-based convention that allows two machines to talk to each other. When a browser
1616
requests a page, it asks the server if it can get the page. The server then prepares the page and sends
@@ -22,7 +22,8 @@ you develop web applications is to always understand what the browser is request
2222
respond appropriately.
2323

2424
The Request
25-
-----------
25+
===========
26+
2627
Whenever a client (a web browser, smartphone app, etc) makes a request, it sends a small text message
2728
to the server and waits for a response.
2829

@@ -42,7 +43,7 @@ client accepts, and much more. Wikipedia has an article that lists `all header f
4243
<https://en.wikipedia.org/wiki/List_of_HTTP_header_fields>`_ if you want to look it over.
4344

4445
The Response
45-
------------
46+
============
4647

4748
Once the server receives the request, your application will take that information and generate some output.
4849
The server will bundle your output as part of its response to the client. This is also represented as
@@ -64,7 +65,7 @@ wasn't found (404). Head over to IANA for a `full list of HTTP status codes
6465
<https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml>`_.
6566

6667
Working with Requests and Responses
67-
-----------------------------------
68+
***********************************
6869

6970
While PHP provides ways to interact with the request and response headers, CodeIgniter, like most frameworks,
7071
abstracts them so that you have a consistent, simple interface to them. The :doc:`IncomingRequest class </incoming/incomingrequest>`

user_guide_src/source/concepts/security.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ the input data from the client to the application. Attack vectors include SQL,
2424
XML, ORM, code & buffer overflows.
2525

2626
OWASP recommendations
27-
---------------------
27+
=====================
2828

2929
- Presentation: set correct content type, character set & locale
3030
- Submission: validate fields and provide feedback
3131
- Controller: sanitize input; positive input validation using correct character set
3232
- Model: parameterized queries
3333

3434
CodeIgniter provisions
35-
----------------------
35+
======================
3636

3737
- :doc:`HTTP library <../incoming/incomingrequest>` provides for input field filtering & content metadata
3838
- Form validation library
@@ -45,7 +45,7 @@ Inadequate authentication or improper session management can lead to a user
4545
getting more privileges than they are entitled to.
4646

4747
OWASP recommendations
48-
---------------------
48+
=====================
4949

5050
- Presentation: validate authentication & role; send CSRF token with forms
5151
- Design: only use built-in session management
@@ -54,7 +54,7 @@ OWASP recommendations
5454
- Tip: consider the use of a request governor
5555

5656
CodeIgniter provisions
57-
----------------------
57+
======================
5858

5959
- :doc:`Session <../libraries/sessions>` library
6060
- :doc:`Security </libraries/security>` library provides for CSRF validation
@@ -68,14 +68,14 @@ Insufficient input validation where one user can add content to a web site
6868
that can be malicious when viewed by other users to the web site.
6969

7070
OWASP recommendations
71-
---------------------
71+
=====================
7272

7373
- Presentation: output encode all user data as per output context; set input constraints
7474
- Controller: positive input validation
7575
- Tips: only process trustworthy data; do not store data HTML encoded in DB
7676

7777
CodeIgniter provisions
78-
----------------------
78+
======================
7979

8080
- esc function
8181
- Form validation library
@@ -90,14 +90,14 @@ attackers can bypass authorization and access resources in the system directly,
9090
for example database records or files.
9191

9292
OWASP recommendations
93-
---------------------
93+
=====================
9494

9595
- Presentation: don't expose internal data; use random reference maps
9696
- Controller: obtain data from trusted sources or random reference maps
9797
- Model: validate user roles before updating data
9898

9999
CodeIgniter provisions
100-
----------------------
100+
======================
101101

102102
- Form validation library
103103
- Easy to add third party authentication
@@ -110,14 +110,14 @@ Improper configuration of an application architecture can lead to mistakes
110110
that might compromise the security of the whole architecture.
111111

112112
OWASP recommendations
113-
---------------------
113+
=====================
114114

115115
- Presentation: harden web and application servers; use HTTP strict transport security
116116
- Controller: harden web and application servers; protect your XML stack
117117
- Model: harden database servers
118118

119119
CodeIgniter provisions
120-
----------------------
120+
======================
121121

122122
- Sanity checks during bootstrap
123123

@@ -131,14 +131,14 @@ if data must be protected when it is stored, it must be protected also during
131131
transmission.
132132

133133
OWASP recommendations
134-
---------------------
134+
=====================
135135

136136
- Presentation: use TLS1.2; use strong ciphers and hashes; do not send keys or hashes to browser
137137
- Controller: use strong ciphers and hashes
138138
- Model: mandate strong encrypted communications with servers
139139

140140
CodeIgniter provisions
141-
----------------------
141+
======================
142142

143143
- Session keys stored encrypted
144144

@@ -152,14 +152,14 @@ if data must be protected when it is stored, it must be protected also during
152152
transmission.
153153

154154
OWASP recommendations
155-
---------------------
155+
=====================
156156

157157
- Presentation: ensure that non-web data is outside the web root; validate users and roles; send CSRF tokens
158158
- Controller: validate users and roles; validate CSRF tokens
159159
- Model: validate roles
160160

161161
CodeIgniter provisions
162-
----------------------
162+
======================
163163

164164
- Public folder, with application and system outside
165165
- :doc:`Security </libraries/security>` library provides for CSRF validation
@@ -172,14 +172,14 @@ CSRF is an attack that forces an end user to execute unwanted actions on a web
172172
application in which he/she is currently authenticated.
173173

174174
OWASP recommendations
175-
---------------------
175+
=====================
176176

177177
- Presentation: validate users and roles; send CSRF tokens
178178
- Controller: validate users and roles; validate CSRF tokens
179179
- Model: validate roles
180180

181181
CodeIgniter provisions
182-
----------------------
182+
======================
183183

184184
- :doc:`Security </libraries/security>` library provides for CSRF validation
185185

@@ -191,12 +191,12 @@ Many applications have known vulnerabilities and known attack strategies that
191191
can be exploited in order to gain remote control or to exploit data.
192192

193193
OWASP recommendations
194-
---------------------
194+
=====================
195195

196196
- Don't use any of these
197197

198198
CodeIgniter provisions
199-
----------------------
199+
======================
200200

201201
- Third party libraries incorporated must be vetted
202202

@@ -208,14 +208,14 @@ Faulty business logic or injected actionable code could redirect the user
208208
inappropriately.
209209

210210
OWASP recommendations
211-
---------------------
211+
=====================
212212

213213
- Presentation: don't use URL redirection; use random indirect references
214214
- Controller: don't use URL redirection; use random indirect references
215215
- Model: validate roles
216216

217217
CodeIgniter provisions
218-
----------------------
218+
======================
219219

220220
- :doc:`HTTP library <../incoming/incomingrequest>` provides for ...
221221
- :doc:`Session <../libraries/sessions>` library provides flashdata

0 commit comments

Comments
 (0)