Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

Autoloader #8

Open
dagio opened this issue Mar 5, 2015 · 11 comments
Open

Autoloader #8

dagio opened this issue Mar 5, 2015 · 11 comments

Comments

@dagio
Copy link

dagio commented Mar 5, 2015

Any chance to support an autoloader in the near future ?

@Ocramius
Copy link
Owner

Ocramius commented Mar 5, 2015

@dag-io please elaborate

@dagio
Copy link
Author

dagio commented Mar 5, 2015

Right now we need to put all files in the specified directory and include them using a "require_once". In order to use it on existing project we would need a way break this limitation. I did not spent much time looking for, I guess it's about using an autoloader ?

@Ocramius
Copy link
Owner

Ocramius commented Mar 5, 2015

Yes, but the current assumption is that the tool is installed in the app it's used in

@cordoval
Copy link
Contributor

cordoval commented Mar 7, 2015

this is working i think just that @Ocramius did not correctly document the symfony console command. check #9 and please close if need be 👴

@basz
Copy link

basz commented Apr 26, 2016

current assumption is that the tool is installed in the app

no easy way to have it work from a globally installed version then? Couldn't it include the autoload/vendor.php if it exists?

@Ocramius
Copy link
Owner

I could probably use Roave/BetterReflection for that. @asgrim is there a way to emulate autoloading, given a composer.lock is found?

@asgrim
Copy link

asgrim commented Apr 26, 2016

@Ocramius at the moment you can only use the ComposerSourceLocator directly, but you need to pass it an instance of the ClassLoader (returned by vendor/auload.php). There's not much point in re-inventing the wheel here imo.

@Ocramius
Copy link
Owner

Yes, but when running with a different autoloader (finalizer installed as
phar, for example)...
On Apr 26, 2016 14:51, "James Titcumb" [email protected] wrote:

@Ocramius https://github.com/Ocramius at the moment you can only use
the ComposerSourceLocator directly, but you need to pass it an instance
of the ClassLoader (returned by vendor/auload.php). There's not much
point in re-inventing the wheel here imo.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#8 (comment)

@basz
Copy link

basz commented Apr 26, 2016

Not sure what the issue is here, but might I simply suggest a cli option with a path to autoloader?

@Ocramius
Copy link
Owner

I'd rather not autoload anything at all, and scan arbitrary paths...
On Apr 26, 2016 14:54, "Bas Kamer" [email protected] wrote:

Not sure what the issue is here, but might I simply suggest a cli option
with a path to autoloader?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#8 (comment)

@asgrim
Copy link

asgrim commented Apr 26, 2016

@Ocramius yeah, I expect you'd have to write a SourceLocator for it, but I can't imagine it'd be difficult; just not supported out the box

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants