zendframework1-doctrine2 icon indicating copy to clipboard operation
zendframework1-doctrine2 copied to clipboard

Composer autoloader

Open shaneiseminger opened this issue 12 years ago • 6 comments

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?

shaneiseminger avatar Nov 13 '13 21:11 shaneiseminger

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

emiliodeg avatar Jan 27 '14 22:01 emiliodeg

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

holtkamp avatar Mar 02 '14 22:03 holtkamp

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.

naroga avatar Sep 15 '14 17:09 naroga

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"

halfpastfouram avatar Jul 03 '18 12:07 halfpastfouram

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.

naroga avatar Jul 03 '18 13:07 naroga

Well, better late than never, right?

halfpastfouram avatar Jul 03 '18 13:07 halfpastfouram