Legacy PHP: Difference between revisions

From Rixort Wiki
Jump to navigation Jump to search
Line 2: Line 2:


PSR-0 autoloading uses file and class naming conventions to map a class to a file path.
PSR-0 autoloading uses file and class naming conventions to map a class to a file path.
* Namespace separators map to directory separators.
* Class name underscores map to directory separators.


<code>Vendor\Package_Name\Class_Name</code> maps to: <code>Vendor/Package_Name/Class/Name.php</code>
<code>Vendor\Package_Name\Class_Name</code> maps to: <code>Vendor/Package_Name/Class/Name.php</code>


[[Category:PHP]]
[[Category:PHP]]

Revision as of 18:45, 24 March 2020

Converting classes to PSR-0

PSR-0 autoloading uses file and class naming conventions to map a class to a file path.

  • Namespace separators map to directory separators.
  • Class name underscores map to directory separators.

Vendor\Package_Name\Class_Name maps to: Vendor/Package_Name/Class/Name.php