-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Suggestions for a few naming rules and some other stuff
- Corresponding file name for for files that can exist in both site and core.
Example: In core controllers are named {name}_controller.class.php, but in site it is {name}.class.php.
- Stop using .class.php, and use only .php instead
- Stop using underscore ('_') in classnames, especially MVC classes.
Example: AppController.php, not App_Controller.php.
- Classfiles and classnames should be in ucwords.
Example, Init.php. AppController.php. Not init.php or APPController.php. The same goes for classname. class AppController{}, not class APPController{}
- Stop prefixing lib files with app.
This is UNLESS there is a good reason for it, meaning that the prefixing of 'app' should not be some sort of convention.
The same goes for classnames.
Example, app_request.php => request.php. class APP_Request {} => class Request {}.
- Php files that are not classes, just plain script files is named in lowercase,
Words split by underscore ('_').
Maybe also in their own folder?
Example site_tools.php
- Avoid creating classes within classes/or files.
Example site_tools.php->Timer().
- Implement bootstrap file
Should do some of the logic that is done in php-site/index.php. This file can then be in php-core, and php-site would no longer be tied with bootstrapping logic to core.
Everything after the define statements should be moved to this file.