Hi, I'm building a framework similar to ASP.NET framework but for PHP + Integrated module/security management + Integrated Session management and more. So far, everything is working fine but i was wondering if the following was possible and if it would be recommended.
In ASP.NET you call the ASPX files and when it loads IIS attaches the ASPX rendering engine to it by reading the content of the page at the top such as the class name, class file etc. I'd like to make that same concept so for example:
1. All my pages would be PHPX extensions
2. I'd need apache to be able to serve these (Using HTAccess that could be possible if i remember right)
3. I'd need apache to print a bit of generic code at the top of the PHPX extensions that will contain a framework initialization
3.1. I'd need to setup an include path from that initialization code so that all includes don't need to be path specific, can that be done from an HTAccess file?
Can all this be done and what do you think of it? What are the flaws? i see a load of dependencies such as LAMP only architecture, specific apache modules, etc.
What are the good sides? I also see the good side of it such as real template and code seperation (and don't talk to me about those templating engines out there such as smarty) with encapsulation of code and access to control centric templates.
The door is open, hit on me...
Framework design
Moderator: General Moderators
-
crazycoders
- Forum Contributor
- Posts: 260
- Joined: Tue Oct 28, 2008 7:48 am
- Location: Montreal, Qc, Canada
-
crazycoders
- Forum Contributor
- Posts: 260
- Joined: Tue Oct 28, 2008 7:48 am
- Location: Montreal, Qc, Canada
Re: Framework design
Solved one of the problems already:
php_value auto_prepend_file /path/to/file/php_pre.inc
php_value auto_append_file /path/to/file/php_post.inc
As long as HTAccess is enabled and php_value is authorized, this is not a problem and most of the web hosters allow php value override using HTAccess.
php_value auto_prepend_file /path/to/file/php_pre.inc
php_value auto_append_file /path/to/file/php_post.inc
As long as HTAccess is enabled and php_value is authorized, this is not a problem and most of the web hosters allow php value override using HTAccess.
-
crazycoders
- Forum Contributor
- Posts: 260
- Joined: Tue Oct 28, 2008 7:48 am
- Location: Montreal, Qc, Canada
Re: Framework design
And again, setting the include dir seems to be as simple as this:
php_value include_dir "dir"
I guess the only thing left to discusss is the availability of these technologies in general and the advantages over disadvantages in terms of performance, functionnality, existing packages and framework...
php_value include_dir "dir"
I guess the only thing left to discusss is the availability of these technologies in general and the advantages over disadvantages in terms of performance, functionnality, existing packages and framework...
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Framework design
Check out Prado framework which I believe emulates much of ASP.NET
-
crazycoders
- Forum Contributor
- Posts: 260
- Joined: Tue Oct 28, 2008 7:48 am
- Location: Montreal, Qc, Canada
Re: Framework design
Prado is now named Yii and i looked at it quite fast, it does seem to be an event driven framework but i have yet to test it. I'll come back to you all later when i have been able to test it.
Thanks
Thanks
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Re: Framework design
Code: Select all
AddType application/x-httpd-php .phpx