Hafif bir PHP Framework için ipuçları

0 Cevap php


I'm trying to write down some concrete ideas for a light framework (on PHP5), with the purpose to handle a lot of requests and to make it scale well in terms of high traffic eventualities. I've already started it, but I'm not really satisfied about the coding style, which is basically composed by simple classes and helpers, with a main one to load them all.

class Settings {
    // I provide settings for everyone and I'm called by everyone via singleton.
     // $settings = instance(Settings);
}

class Database {
    // I provide the db connection.
}

class Session {
    // I handle the sessions.
}

[...]

class Core {
    // I start every class we need.
}

Yapı bir tür basit olanıdır. APP SİSTEMİ özel bir ağaçtır, bir kamu ağaçtır.

app
 |-- css
 |-- js
 |-- page_name
       |-- index.php
 [...]

system
 |-- settings
 |-- libs
 |-- helpers
 |-- langs
 [...]

Basically what I do is setting the paths in the constants on the index.php file, which calles a boot.php file that includes the libraries that we need (Settings, Database, Session), then includes the core.php file that starts every class using objects. Of course this is a synthesis.
I designed everything to be more independent from the core, so if I need, for example, some settings, I just refer to the settings class (by singleton), instead recall the core and then get the data.

The main problem is that I don't know if this "style" could be good for my goals, 'cause it looks nooby to me, compared to the others main frameworks. I don't also get why everyone uses things like Implements, Extends, Interface, or others, which I find more confusing than putting everything into a single class with public and private visibility or just using functions.
Can I get some advanced tips, examples, or whatever can help reaching my goals?

Thanks!

0 Cevap