Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Without Composer! #826

Closed
abmmhasan opened this issue Sep 30, 2016 · 1 comment
Closed

Running Without Composer! #826

abmmhasan opened this issue Sep 30, 2016 · 1 comment

Comments

@abmmhasan
Copy link
Contributor

abmmhasan commented Sep 30, 2016

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
Copy link
Owner

panique commented Dec 4, 2016

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

@panique panique closed this as completed Dec 4, 2016
panique added a commit that referenced this issue Dec 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants