Feedback on PHP Framework
Results 1 to 3 of 3

Thread: Feedback on PHP Framework

  1. #1
    Self Proclaimed King rulian's Avatar
    Join Date
    Feb 2001
    Location
    New Jersey
    Posts
    907

    Feedback on PHP Framework

    Hello Guys,
    I've been building projects on a home brewed PHP framework I built called Nobel (aka NO Bull***) framework.
    I've gotten quite happy with it but wanted other peoples opinion on what sucks about it or is missing.
    Its open sourced on github found here https://github.com/82rules/noble
    thanks in advance
    NogDog no cheating!
    new site, check it http://www.rockstarcode.com/

  2. #2
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,974
    I'm telling the TPM's you must have too much free time.
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because hes a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

  3. #3
    Senior Member
    Join Date
    Aug 2002
    Location
    Norway
    Posts
    160
    OK! I can start

    I have scanned your lib directory and 26 of 73 class methods is defined static. That indicates code smell and anti-pattern.

    I dont understand why you are building your autoloader that way...
    PHP Code:
        public function __construct()
        {
            
    spl_autoload_register(array($this,'app'));
            
    spl_autoload_register(array($this,'library'));
            
    spl_autoload_register(array($this,'controller'));
            
    spl_autoload_register(array($this,'model'));
            
    spl_autoload_register(array($this,'name_space'));
        } 
    You are using namespaces so why not let them do the job for you?
    What about using a standard psr-0 autoload function that is implemented in 15 lines and supports nerly all new components found on the interwebz this days? I guess you want others to use your framework, and maybe expand it, as you have posted it on github?

    Why are you defining constants of superglobals that already is available everywhere?

    In the file 'noble':
    PHP Code:
    /// web request
        
    DEFINE("_REQUEST_URI",$_SERVER["REQUEST_URI"]);
        
    DEFINE("_REQUEST_METHOD",$_SERVER["REQUEST_METHOD"]);
        
    DEFINE("_REQUEST",http_build_query($_REQUEST));
        
    DEFINE("_SERVER_NAME",$_SERVER["SERVER_NAME"]);
        
    DEFINE("_REMOTE_ADDR",$_SERVER["REMOTE_ADDR"]);
        
    DEFINE("_HTTPS",isset($_SERVER['HTTPS'])); 
    Why not use some basic coding standards(psr-1) as uppercase first letter in both class names(you already do) and class files and just one file for each class(you have two classes in the file route.php)? In your autoloader you lowercase your class name so it fits your filename...

    Why not init your autoloader(Autoload::init()) in your nobel-file where you include it? You initialize it after the implementation in the autoloader class file and who other than you have a clue about that? Its also a bad mix of OO and procedural programming.

    psr-1: 2.3. Side Effects
    A file SHOULD declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it SHOULD execute logic with side effects, but SHOULD NOT do both.
    That was a start. If you want more just tell me
    Last edited by gammaster; 05-04-2014 at 10:20 AM.
    have a nice OO day!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •