Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc refactoring and cleaning up #3

Open
8 tasks
aleksanderakero opened this issue Mar 26, 2016 · 3 comments
Open
8 tasks

Misc refactoring and cleaning up #3

aleksanderakero opened this issue Mar 26, 2016 · 3 comments
Assignees

Comments

@aleksanderakero
Copy link
Collaborator

aleksanderakero commented Mar 26, 2016

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.

@aleksanderakero aleksanderakero self-assigned this Mar 26, 2016
@aleksanderakero aleksanderakero added this to the php-core-1.0.0 milestone Mar 26, 2016
@aleksanderakero aleksanderakero changed the title Refactor so classes and class files to uppercase camel Misc refactoring and cleaning up Mar 27, 2016
@aleksanderakero
Copy link
Collaborator Author

aleksanderakero commented Jun 14, 2016

@Dalisra do these look ok? if so I'll start implementation.

@Dalisra
Copy link
Owner

Dalisra commented Jun 14, 2016

Everything sounds good, only bootstrap file needs a bot more explanation.

@aleksanderakero
Copy link
Collaborator Author

Nice. Will have a closer look at bootstrap later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants