panique / huge

Simple user-authentication solution, embedded into a small framework.
2.14k stars 788 forks source link

Running Without Composer! #826

Closed abmmhasan closed 7 years ago

abmmhasan commented 8 years ago

Well, I'm not a fan of composer! Though, for some, cases it is great too! Anyone who is looking for to run this framework without composer: Replace the following in public/index.php require '../vendor/autoload.php'; with

spl_autoload_register(function($class_name) {
  $classesDir = array('../application/core/', '../application/model/');
    $class_name = str_replace("\\", DIRECTORY_SEPARATOR, $class_name);
    foreach ($classesDir as $directory) {
        if (file_exists($directory . $class_name . '.php')) {
            require_once ($directory . $class_name . '.php');
            return;
        }
    }
});

Though keep one thing in mind, the main framework will run without issue but other plugins that is loaded via composer had to be loaded via require/include/composer. In that case remove these line before running composer.json:

 "autoload": {
        "psr-4": { "": ["application/core/", "application/model/"] }
    }
panique commented 7 years ago

Ok thanks, i'll link this in the readme!