0
I have a PHP application with my mvc framework and follow the following template:
Namespace Diretorio Desc
Nautilus\ root/Nautilus/src/Nautilus_Web/ Aplicação principal
Nautilus\Service root/Nautilus/src/Nautilus_Service/ Serviços
Nautilus\Domain root/Nautilus/src/Nautilus_Domain/ Modelos e repositórios
I am standardizing my project according to PHP-Fig and as the documentation the namespace should correspond to the physical directory.
I wonder if the standardization is being done the wrong way since the Nautilus Service and Nautilus Domain should include the classes from the directory of the Nautilus namespace that would be:
root/Nautilus/src/Nautilus_web/....
If my namespace calls Nautilus the physical directory should be:
root/Nautilus/src/Nautilus_Web/Nautilus
no? or else rename the namespace to Nautilus\Web
then the directory .../src/Nautilus_web would correspond, correct?
Thank you!
What standard are you implemented, psr-4 or psr-0 ?
– gmsantos
I am implementing all PSR-0 to PSR-4!
– Premiere
psr-4 overrides psr-0, so why you implement both?
– gmsantos
The PSR-4 does not overlay everything but redefines some specifications!
– Premiere
@gmsantos You’re right, in the PS4 description it says that is an improvement in definitions but reset everything without exception!
– Premiere
reset everything without exception? Wrong. na psr-0,
_
are converted to directories, which does not happen in psr-4 for example: http://www.php-fig.org/psr/psr-0/– gmsantos
On PSR0 _ was converted into directories, as you said, on PSR4 _ is treated as part of the namespace so the attribution given to _ has been reset. Thanks for the help!
– Premiere