Skip to content

Running Without Composer! #826

Description

@abmmhasan

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/"] }
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions