Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #12 from artnez/master

Fixed Markdown Formatting
  • Loading branch information...
commit 3b127b31a66e8f069ae949c2cd3260aac443b1b8 2 parents 37de4ee + 0ac3a82
@fabpot fabpot authored
Showing with 23 additions and 14 deletions.
  1. +23 −14 accepted/PSR-0.md
View
37 accepted/PSR-0.md
@@ -1,37 +1,44 @@
The following describes the mandatory requirements that must be adhered
to for autoloader interoperability.
-## Mandatory:
+Mandatory
+---------
+
* A fully-qualified namespace and class must have the following
- structure \<Vendor Name>\(<Namespace>\)*<Class Name>
+ structure `\<Vendor Name>\(<Namespace>\)*<Class Name>`
* Each namespace must have a top-level namespace ("Vendor Name").
* Each namespace can have as many sub-namespaces as it wishes.
-* Each namespace separator is converted to a DIRECTORY_SEPARATOR when
+* Each namespace separator is converted to a `DIRECTORY_SEPARATOR` when
loading from the file system.
* Each "\_" character in the CLASS NAME is converted to a
- DIRECTORY_SEPARATOR. The "\_" character has no special meaning in the
+ `DIRECTORY_SEPARATOR`. The "\_" character has no special meaning in the
namespace.
* The fully-qualified namespace and class is suffixed with ".php" when
loading from the file system.
* Alphabetic characters in vendor names, namespaces, and class names may
be of any combination of lower case and upper case.
-## Examples:
-* \Doctrine\Common\IsolatedClassLoader => /path/to/project/lib/vendor/Doctrine/Common/IsolatedClassLoader.php
-* \Symfony\Core\Request => /path/to/project/lib/vendor/Symfony/Core/Request.php
-* \Zend\Acl => /path/to/project/lib/vendor/Zend/Acl.php
-* \Zend\Mail\Message => /path/to/project/lib/vendor/Zend/Mail/Message.php
+Examples
+--------
+
+* `\Doctrine\Common\IsolatedClassLoader` => `/path/to/project/lib/vendor/Doctrine/Common/IsolatedClassLoader.php`
+* `\Symfony\Core\Request` => `/path/to/project/lib/vendor/Symfony/Core/Request.php`
+* `\Zend\Acl` => `/path/to/project/lib/vendor/Zend/Acl.php`
+* `\Zend\Mail\Message` => `/path/to/project/lib/vendor/Zend/Mail/Message.php`
-## Underscores in namespaces and class names:
-* \namespace\package\Class_Name => /path/to/project/lib/vendor/namespace/package/Class/Name.php
-* \namespace\package_name\Class_Name => /path/to/project/lib/vendor/namespace/package_name/Class/Name.php
+Underscores in Namespaces and Class Names
+-----------------------------------------
+
+* `\namespace\package\Class_Name` => `/path/to/project/lib/vendor/namespace/package/Class/Name.php`
+* `\namespace\package_name\Class_Name` => `/path/to/project/lib/vendor/namespace/package_name/Class/Name.php`
The standards we set here should be the lowest common denominator for
painless autoloader interoperability. You can test that you are
following these standards by utilizing this sample SplClassLoader
implementation which is able to load PHP 5.3 classes.
-## Example Implementation
+Example Implementation
+----------------------
Below is an example function to simply demonstrate how the above
proposed standards are autoloaded.
@@ -53,7 +60,8 @@ proposed standards are autoloaded.
require $fileName;
}
-## SplClassLoader Implementation
+SplClassLoader Implementation
+-----------------------------
The following gist is a sample SplClassLoader implementation that can
load your classes if you follow the autoloader interoperability
@@ -61,3 +69,4 @@ standards proposed above. It is the current recommended way to load PHP
5.3 classes that follow these standards.
* [http://gist.github.com/221634](http://gist.github.com/221634)
+
Please sign in to comment.
Something went wrong with that request. Please try again.