Lecture
The keywords “MUST” (“MUST”), “MUST NOT” (“MUST NOT”), “REQUIRED”, “NEED” (“SHALL”), “NOT ALLOW” (“SHALL NOT”), "SHOULD" ("SHOULD"), "DO NOT SUBJECT" ("SHOULD NOT"), "RECOMMENDED" ("RECOMMENDED"), "CAN" ("MAY") and "OPTIONAL" ("OPTIONAL") in this document should regarded as described in RFC 2119.
This PSR describes the specification for autoloading classes based on file paths. It is completely interchangeable and can be used in addition to any other autoloader specification, including PSR-0. This PSR also describes where to place the files that will be loaded in accordance with the specification.
The term "class" refers to both classes and interfaces, traits and other similar structures.
The absolute class name has the following form:
\<ИмяПространстваИмён>(\<ИменаПодпространствИмён>)*\<ИмяКласса>
When loading a file corresponding to an absolute class name:
.php
. The file name MUST be the same case as the terminating class name. In autoloader implementations, it is NOT ALLOWABLE to throw exceptions, NOT to cause errors at any level, and DO NOT return a value.
The table below shows the correspondence between the file path, the absolute class name, the namespace prefix, and the base directory.
Absolute class name | Namespace prefix | Base directory | The path to the file |
---|---|---|---|
\ Acme \ Log \ Writer \ File_Writer | Acme \ Log \ Writer | ./acme-log-writer/lib/ | ./acme-log-writer/lib/File_Writer.php |
\ Aura \ Web \ Response \ Status | Aura \ Web | / path / to / aura-web / src / | /path/to/aura-web/src/Response/Status.php |
\ Symfony \ Core \ Request | Symfony \ core | ./vendor/Symfony/Core/ | ./vendor/Symfony/Core/Request.php |
\ Zend \ Acl | Zend | / usr / includes / Zend / | /usr/includes/Zend/Acl.php |
Examples of the implementation of autoloaders that meet the specifications are given in the examples file. DO NOT consider them as part of the specification. Examples MAY change at any time.
Additional Info:The keywords “MUST” (“MUST”), “MUST NOT” (“MUST NOT”), “REQUIRED”, “NEED” (“SHALL”), “NOT ALLOW” (“SHALL NOT”), "SHOULD" ("SHOULD"), "DO NOT SUBJECT" ("SHOULD NOT"), "RECOMMENDED" ("RECOMMENDED"), "CAN" ("MAY") and "OPTIONAL" ("OPTIONAL") in this document should regarded as described in RFC 2119.
This PSR describes the specification for autoloading classes based on file paths. It is completely interchangeable and can be used in addition to any other autoloader specification, including PSR-0. This PSR also describes where to place the files that will be loaded in accordance with the specification.
The term "class" refers to both classes and interfaces, traits and other similar structures.
The absolute class name has the following form:
\<ИмяПространстваИмён>(\<ИменаПодпространствИмён>)*\<ИмяКласса>
When loading a file corresponding to an absolute class name:
.php
. The file name MUST be the same case as the terminating class name. In autoloader implementations, it is NOT ALLOWABLE to throw exceptions, NOT to cause errors at any level, and DO NOT return a value.
The table below shows the correspondence between the file path, the absolute class name, the namespace prefix, and the base directory.
Absolute class name | Namespace prefix | Base directory | The path to the file |
---|---|---|---|
\ Acme \ Log \ Writer \ File_Writer | Acme \ Log \ Writer | ./acme-log-writer/lib/ | ./acme-log-writer/lib/File_Writer.php |
\ Aura \ Web \ Response \ Status | Aura \ Web | / path / to / aura-web / src / | /path/to/aura-web/src/Response/Status.php |
\ Symfony \ Core \ Request | Symfony \ core | ./vendor/Symfony/Core/ | ./vendor/Symfony/Core/Request.php |
\ Zend \ Acl | Zend | / usr / includes / Zend / | /usr/includes/Zend/Acl.php |
Examples of the implementation of autoloaders that meet the specifications are given in the examples file. DO NOT consider them as part of the specification. Examples MAY change at any time.
Additional Info:
Comments
To leave a comment
Software and information systems development
Terms: Software and information systems development