User Tools

Site Tools


en:dev:all:psr:psr-0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:dev:all:psr:psr-0de [25.05.2015 16:47] – [Verbindliches] translated and renamed to Mandatory mrbasemanen:dev:all:psr:psr-0 [25.05.2015 18:36] – [Mandatory] 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://www.php-fig.org/psr/psr-0/|PHP-FIG PSR-0]][/size] [size=10]originating from [[http://www.php-fig.org/psr/psr-0/|PHP-FIG PSR-0]][/size]
 ====== Autoloading Standard ====== ====== Autoloading Standard ======
  
-In the following the mandatory requirements which must be complied with for the interoperability of the autoloader are described+The following describes the mandatory requirements that must be adhered to for autoloader interoperability.
  
 ===== Mandatory ===== ===== Mandatory =====
- +  * A fully qualified namespace and class name must have the following structure: ''\<Vendor Name>\(<Namespace>\)*<Class Name>''
-   * A fully qualified namespace and class name must have the following structure: ''\<Vendor Name>\(<Namespace>\)*<Class Name>''+
   * Each namespace must have a top-level namespace ("Vendor Name").   * Each namespace must have a top-level namespace ("Vendor Name").
-  * Each namespace can define any number of sub-namespaces. +  * Each namespace can have as many sub-namespaces as it wishes
-  * Each namespace separator is converted to a DIRECTORY_SEPARATOR loading from the file system. +  * Each namespace separator is converted to a DIRECTORY_SEPARATOR when loading from the file system. 
-  * Each **_** in the class name is converted to a DIRECTORY_SEPARATOR. :!: //Adaptation for WB:// The **_** has no special meaning in the __normal__ definition of a namespace, with pseudo-namespaces (see [[en:dev:all:psr-1de|PSR-1]]) it will be converted to a DIRECTORY_SEPERATOR which forbids in this case, folder and file names containing **_**. +  * Each **_** character in the CLASS NAME is converted to a DIRECTORY_SEPARATOR. :!: //Adaptation for WB:// The **_** has no special meaning in the __normal__ definition of a namespace, with pseudo-namespaces (see [[en:dev:all:psr:psr-1|PSR-1]]) it will be converted to a DIRECTORY_SEPERATOR which forbids in this case, folder and file names containing **_**. 
-  * When accessing the file system the extension **.php** is added to the fully qualified namespace and class name+  * The fully-qualified namespace and class is suffixed with **.php** when loading from the file system
-  * Alphabetic characters (AZ) in vendor names, namespaces and classes can be any combination of uppercase and lowercase letters. :!: In [[en:dev:all:psr-1de|PSR-1]] this will be further restricted!+  * Alphabetic characters (AZ) in vendor names, namespaces and classes can be any combination of uppercase and lowercase letters. :!: In [[en:dev:all:psr:psr-1|PSR-1]] this will be further restricted!
  
  
-===== Beispiele =====+===== Examples =====
  
     \Doctrine\Common\IsolatedClassLoader => /path/to/project/lib/vendor/Doctrine/Common/IsolatedClassLoader.php     \Doctrine\Common\IsolatedClassLoader => /path/to/project/lib/vendor/Doctrine/Common/IsolatedClassLoader.php
Line 24: Line 21:
     \Zend\Mail\Message                   => /path/to/project/lib/vendor/Zend/Mail/Message.php     \Zend\Mail\Message                   => /path/to/project/lib/vendor/Zend/Mail/Message.php
  
-===== Unterstriche in Namespaces and Klassennamen =====+===== Underscores in Namespaces and Class Names =====
  
     \namespace\package\Class_Name      => /path/to/project/lib/vendor/namespace/package/Class/Name.php     \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     \namespace\package_name\Class_Name => /path/to/project/lib/vendor/namespace/package_name/Class/Name.php
  
-Die Standards die wir hier setzen sollten der kleinste gemeinsame Nenner zum problemlosen Zusammenspiel der Autoloader seinMit der Beispielimplementation des SplClassLoader können Sie testen, ob ihre Implementation den Standards entspricht.+The standards we set here should be the lowest common denominator for painless autoloader interoperabilityYou can test that you are following these standards by utilizing this sample SplClassLoader implementation which is able to load PHP 5.3 classes.
  
-===== Beispiel Implementation =====+===== Example Implementation =====
  
-Unten ist eine einfache Beispiel-Funktion, die aufzeigen soll, wie die oben +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 54:
 ===== SplClassLoader Implementation ===== ===== SplClassLoader Implementation =====
  
-Die folgende GIST ist eine Beispielimplementierung, wie SplClassLoader Ihre Klassen laden können, wenn sie den oben vorgegebenen Standards folgenEs ist der aktuell empfohlene Weg, um PHP-5.3 Klassen zu laden.+The following gist is a sample SplClassLoader implementation that can load your classes if you follow the autoloader interoperability standards proposed aboveIt is the current recommended way to load PHP 5.3 classes that follow these standards.
  
 [[http://gist.github.com/221634|gist.github.com/221634]] [[http://gist.github.com/221634|gist.github.com/221634]]
- 
- 
  
en/dev/all/psr/psr-0.txt · Last modified: 28.12.2018 23:23 by Manuela v.d.Decken