The autoload specification of PSR-4 describes how the class should load into your project. In Composer when defining json we have these two parts:
{ "Namespace\Base\" : "diretorio/raiz" }
So by using this setting in your composer.json
, you allow the rest of the files to be loaded to have this kind of "prefix".
Example: When you make a use Namespace\Base\Http\BaseController
it will include the diretorio/raiz/http/BaseController.php
file in your code.
Some other examples can be seen on the PSR-4 specification
Fully Qualified Class Name | Namespace Prefix | Base Directory | Resulting File Path
----------------------------- |--------------------|--------------------------|-------------------------------------------
\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