I DON’T WANT TO COMPILE PHP TO NATIVE EXES OR ANYTHING LIKE THAT, ONLY COMPILE/CACHE (both words don’t reflect what I mean) THE FRAMEWORK LOGIC ITSELF
Is there anything like a compiled PHP Framework?
What I mean is take Kohana as an example. It’s extensible, overrideable, fun, etc. But it ends up loading 200 files to show one page!
What I would think is best is if you have Controller_Admin extends Controller_Admin_Template extends Controller_Template extends Kohana_Controller_Template extends Controller extends Kohana_Controller. This isn’t needed… if we just copypasted method bodies to $parent->whatever() it would end up in one nice, smaller, faster file.
We already do it for JS and CSS to minimise assets downloaded; why not the whole framework? 😀
Also I am looking for a compileable ORM. The Kohana ORM is very… slow… it uses magic methods, loads tables, generally is fun to work with but a pain in the… circuitry of the server. 😛
If we could make ORM::factory('test')->compiled()->where('bla','=','1)->execute(); to compile into ORMC::factory('test','SELECT * FROM test WHERE bla=1')->execute(); in the production server it would be cool. This applies to a bunch of other stuff besides ORM but ORM would benefit greatly.
The overhead of dynamic frameworks doesn’t seem to tip the scales by the ease of use in my opinion. With this we lose no ease and speed it up a lot. 😉
So my question is: Does something like this exist? If not, is my logic flawed?
Edit:
Because of failed answers I’ll show more straight what I want to do.
We have an /application/ where there is the EXACT SAME code as without “compiling”, and a /compiled_app/ where all (for example) queries that can be SIMPLIFIED are SIMPLIFIED (not object Query_Builder but SELECT blablablabla etc).
Also as much as having 50 files for one class adds a lot of umm… override vectors? 😀 it is an UNNEEDED 100% GUARANTEED BOTTLENECK PERFORMANCE OVERHEAD. Maybe it’s not much but it’s there always. And it doesn’t have to.
You can check Flow3 framework and how it works. Its not really what you want but maybe you will find it interesting..