namespaces - Storing PHP OPP classes -
i have site uses library file lib.client.php
stored in php
folder in standard website root , contains series of classes have built.
the library file contains 5 or classes, should leave file 1 or break classes own files , include them individually? there best practice naming conventions should utilize these file(s)?
(as can see @ moment i'm using lib. , utilize inc. - because have seen done few times before).
update:
i remodelling construction comply psr-0 standard. have:
ccall (vendor) core connection gateway.php gatewaydsn.php gatewayexception.php components environment.php environmentrequest.php centre.php access user.php usersession.php renderexception.phpi want create new environment()
in index.php, , __construct
method calls gateway::checkinstance()
.
i using https://gist.github.com/jwage/221634/download#
break classes own files , follow psr-0 standard best practice. http://phpmaster.com/autoloading-and-the-psr-0-standard/
php namespaces directory-structure
No comments:
Post a Comment