Skip to content

Commit 2d2e123

Browse files
committed
Adding doc about our PSR compliance
1 parent 9940ea1 commit 2d2e123

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

user_guide_src/source/intro/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ CodeIgniter is right for you if:
4343
self
4444
requirements
4545
credits
46+
psr
4647

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
**************
2+
PSR Compliance
3+
**************
4+
5+
The `PHP-FIG <http://www.php-fig.org/>`_ was created in 2009 to help make code more interoperable between frameworks
6+
by ratifying Interfaces, style guides, and more that members were free to implement or not. While CodeIgniter is
7+
not a member of the FIG, we are compatible with a number of their proposals. This guide is meant to list the
8+
status of our compliance with the various accepted, and some draft, proposals.
9+
10+
**PSR-1: Basic Coding Standard**
11+
12+
This recommendation covers basic class, method, and file-naming standards. Our :doc:`style guide </contributing/styleguide>`
13+
meets PSR-1 and adds its own requirements on top of it.
14+
15+
**PSR-2: Coding Style Guide**
16+
17+
This PSR was fairly controversial when it first came out. CodeIgniter meets many of the recommendations within,
18+
but does not, and will not, meet all of them.
19+
20+
**PSR-3: Logger Interface**
21+
22+
CodeIgniter's :doc:`Logger </general/logging>` implements all of the interfaces provided by this PSR.
23+
24+
**PSR-4: Autoloading Standard**
25+
26+
This PSR provides a method for organizing file and namespaces to allow for a standard method of autoloading
27+
classes. Our :doc:`Autoloader </concepts/autoloader>` meets the PSR-4 recommendations.
28+
29+
**PSR-6: Caching Interface**
30+
31+
CodeIgniter will not be trying to meet this PSR, as we believe it oversteps its needs. The newly proposed
32+
`SimpleCache Interfaces <https://github.com/dragoonis/fig-standards/blob/psr-simplecache/proposed/simplecache.md>`_
33+
do look like something we would consider.
34+
35+
**PSR-7: HTTP Message Interface**
36+
37+
This PSR standardizes a way of representing the HTTP interactions. While many of the concepts became part of our
38+
HTTP layer, CodeIgniter does not strive for compatibility with this recommendation.
39+
40+
---
41+
42+
If you find any places that we claim to meet a PSR but have failed to execute it correctly, please let us know
43+
and we will get it fixed, or submit a pull request with the required changes.

0 commit comments

Comments
 (0)