This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:dev:all:psr:psr-0de [25.05.2015 16:47] – [Verbindliches] translated and renamed to Mandatory mrbaseman | en:dev:all:psr:psr-0 [28.12.2018 23:23] (current) – [Autoloading Standard] Manuela v.d.Decken | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | FIXME **This page is not fully translated, yet. Please help completing the translation.**\\ //(remove this paragraph once the translation is finished)// | ||
- | |||
[size=10]originating from [[http:// | [size=10]originating from [[http:// | ||
====== Autoloading Standard ====== | ====== Autoloading Standard ====== | ||
- | In the following the mandatory requirements | + | <span important> |
+ | The following | ||
===== Mandatory ===== | ===== Mandatory ===== | ||
- | + | * A fully qualified namespace and class name must have the following structure: '' | |
- | * A fully qualified namespace and class name must have the following structure: '' | + | |
* Each namespace must have a top-level namespace (" | * Each namespace must have a top-level namespace (" | ||
- | * Each namespace can define any number of sub-namespaces. | + | * Each namespace can have as many sub-namespaces |
- | * Each namespace separator is converted to a DIRECTORY_SEPARATOR loading from the file system. | + | * Each namespace separator is converted to a DIRECTORY_SEPARATOR |
- | * Each **_** in the class name is converted to a DIRECTORY_SEPARATOR. :!: // | + | * Each **_** character |
- | * When accessing the file system the extension | + | * The fully-qualified namespace and class is suffixed with **.php** |
- | * Alphabetic characters (AZ) in vendor names, namespaces and classes can be any combination of uppercase and lowercase letters. :!: In [[en: | + | * Alphabetic characters (AZ) in vendor names, namespaces and classes can be any combination of uppercase and lowercase letters. :!: In [[en: |
- | ===== Beispiele | + | ===== Examples |
\Doctrine\Common\IsolatedClassLoader => / | \Doctrine\Common\IsolatedClassLoader => / | ||
Line 24: | Line 22: | ||
\Zend\Mail\Message | \Zend\Mail\Message | ||
- | ===== Unterstriche | + | ===== Underscores |
\namespace\package\Class_Name | \namespace\package\Class_Name | ||
\namespace\package_name\Class_Name => / | \namespace\package_name\Class_Name => / | ||
- | Die Standards die wir hier setzen sollten der kleinste gemeinsame Nenner zum problemlosen Zusammenspiel der Autoloader sein. Mit der Beispielimplementation des SplClassLoader | + | 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 |
- | ===== Beispiel | + | ===== Example |
- | Unten ist eine einfache Beispiel-Funktion, | + | Below is an example function to simply demonstrate how the above proposed standards are autoloaded. |
- | vorgeschlagenen Standards automatisch geladen werden. | + | |
<file php ExampleAutoloader.php> | <file php ExampleAutoloader.php> | ||
Line 58: | Line 55: | ||
===== SplClassLoader Implementation ===== | ===== SplClassLoader Implementation ===== | ||
- | Die folgende GIST ist eine Beispielimplementierung, | + | The following gist is a sample |
[[http:// | [[http:// | ||
- | |||
- | |||