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

Composer autoloader #62

Open
shaneiseminger opened this issue Nov 13, 2013 · 6 comments
Open

Composer autoloader #62

shaneiseminger opened this issue Nov 13, 2013 · 6 comments

Comments

@shaneiseminger
Copy link

I'm not clear if this is an issue, or if I'm just missing something.

I had trouble getting Bisna's Doctrine.php to autoload when everything is installed via composer. I kept getting "unable to resolve plugin". My workaround was to use a full path for the Bisna plugin in my application.ini:

pluginPaths.Bisna\Application\Resource\ = APPLICATION_PATH "vendor/guilhermeblanco/zendframework1-doctrine2/library/Bisna/Application/Resource"

. . . which really, works fine, though it seems to me that the Composer autoloader should help out here. I am including that in my ZF index.php. Any idea why it's not working in this instance?

@emiliodeg
Copy link
Contributor

oh god!
I spent the whole day trying to fix this problem
@shaneiseminger is right path has to be absolute

@holtkamp
Copy link
Contributor

holtkamp commented Mar 2, 2014

When trying to reduce the amount of entries in the deprecated 'include-path' section of my composer.json I stumbled upon this as well.

The resource autoloader uses the include() statement and therefore either:

  • the path should be absolute
  • the path is relative and on the include-path

Also see: https://github.com/zendframework/zf1/blob/master/library/Zend/Loader/Autoloader/Resource.php#L201

@naroga
Copy link

naroga commented Sep 15, 2014

I too am experiencing this. 'Unable to resolve plugin "doctrine"'.

I'm not sure whether I'm doing this right or not, but changing pluginPaths.Bisna\Application\Resource\ = "Bisna/Application/Resource" to pluginPaths.Bisna\Application\Resource\ = APPLICATION_PATH "vendor/guilhermeblanco/zendframework1-doctrine2/library/Bisna/Application/Resource" did not work for me.

@halfpastfouram
Copy link

I'm a bit late to the party, but @naroga your path is incorrect. You're missing a hop backwards from the APPLICATION_PATH.

It should be like this:

pluginPaths.Bisna\Application\Resource\ = APPLICATION_PATH "/../vendor/guilhermeblanco/zendframework1-doctrine2/library/Bisna/Application/Resource"

@naroga
Copy link

naroga commented Jul 3, 2018

Thanks @halfpastfouram.

I believe the issue was solved. I'm no longer working in that project (or at that same company), so I can't really confirm.

@halfpastfouram
Copy link

Well, better late than never, right?

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

5 participants