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!

    I'm telling the TPM's you must have too much free time.

      a month later

      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...

          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':

      /// 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 :p

        Write a Reply...