As a result of the tips I received on these issues, I searched a little more and found good resources to find out.
What is autoload?
- , . ( PHP). , , , , , , / .
__ autoload() vs spl_autoload_register()
PHP ( PHP.). - __ autoload(), spl_autoload_register(). ? __autoload() , , , spl_autoload_ *. spl_autoload_register() , , , ( , , , ).
: spl_autoload_register() __autoload(), .
( PHP): PSR-0 PSR-4
, PSR-4 , , PSR-0, 4 0, (PSR-4) :
, PSR-0.
, ?
, PSR-4 "" PSR-0, . , , , PSR-0 :
\vendor\(sub_namespaces\)class_name
_. :
path/to/project/vendor/sub/namespaces/class/name.php
, YourLibrary
\YourDeveloper\YourLibrary\YourFunction
/path/to/project/YourDeveloper/YourLibrary/YourFunction
, , :
/path/to/project/vendor/vendor_name
PSR-0 , , ( ), :
/path/to/project/vendor/YourDeveloper/src/YourDeveloper/YourLibrary/YourFunction
? , PSR-4,
/path/to/project/vendor/YourDeveloper/YourLibrary/YourFunction
. PSR-4. , , PSR-4 . , PSR-0/4, this .
?
, , , . , , , , , .
-, , - . , . - , , ; , SIM-, , , ( ).