slimphp / Slim-Console

Slim Framework Console
https://slimframework.com
MIT License
28 stars 12 forks source link

Improve Composer autoloader including. #10

Closed ABGEO closed 4 years ago

ABGEO commented 4 years ago

If we want to require Slim Console globally, require __DIR__ . '/../vendor/autoload.php'; won't work, because in this case the Composer autoloader has a different path.

ABGEO commented 4 years ago

@l0gicgate in my practice one of these files always existed. I can add additional check, if you consider it necessary.

ABGEO commented 4 years ago

I mean, files always existed, if composer install was executed :smile:

l0gicgate commented 4 years ago

I just want to get this right. Are there any instances where autoload.php is not present but our bin file could exist? That else block makes the assumption that it always would @ABGEO07

ABGEO commented 4 years ago

Are there any instances where autoload.php is not present but our bin file could exist?

I can’t imagine a situation where this can happen, except when the vendor directory has been deleted.

That else block makes the assumption that it always would

As far as I remember, there are only those two paths where autoload.php can be placed.

l0gicgate commented 4 years ago

Alright we can always add onto this condition later if an issue arises.