xploita Posted May 5, 2007 Share Posted May 5, 2007 i've developed a simple framework for handling my simple projects.however,each class does it job separatly.they are not united in a good way. directory structure: /framework |-/cache |-/classes |-i18n class |-Errors class |-templates(template engine) class |-database class |-files class |/languages | -english |-french |-/templates -index.php -bluh.php -files_for_my_new_app.php -I use singleton for every class on it's own. -Every application i create depends on most of the classes all the time(i ALWAYS need i18n,errors,templates classes loaded) some other times i load database and files classes when needed. how do i manage those classes? any ideas about how to optimize my directory structure? should i create an Father class that extends all needed classes,and then extend that father class in my new app? i develop in php4. Quote Link to comment https://forums.phpfreaks.com/topic/50179-my-framework-alltogether/ Share on other sites More sharing options...
redbullmarky Posted May 6, 2007 Share Posted May 6, 2007 as for structure, i'm a big fan of having a "rigid" structure with only one single file being required by the main site itself which pulls all the pieces of the framework/site together. i can see a template class and a database class, but i cant tell how you have each page in your site. do you have a "regular" directory structure for your website itself, or do you send every request through a single index.php? if it's the former, take a look at the resources sticky, notably the resources under 'MVC' - these will help you or perhaps give you some ideas in terms of how to structure things. Also, MVC frameworks such as CakePHP, CodeIgniter, Symfony, Rails (for Ruby), etc will give you some good ideas to keep things nice and structured. in my own classes directory, i keep non-essential classes (image manipulation, RSS, email, dictionaries, etc) and i have a 'core' directory within 'classes' (that holds essential things required each time, eg the template, input handling, abstract controller, config, router, db, etc). It doesn't actually matter how you personally structure things, just as long as they make sense to you and things are kept consistent, notably stuff like filenames/classnames - this way it makes it much easier to automate things or even keep things more like a "plugin" system Quote Link to comment https://forums.phpfreaks.com/topic/50179-my-framework-alltogether/#findComment-246503 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.