ZF2-47: Classmap generator doesn't work if you use -l switch and -o to store the file in another folder

Issue Type: Bug Created: 2011-08-10T08:40:09.000+0000 Last Updated: 2011-12-21T22:17:20.000+0000 Status: Resolved Fix version(s): Reporter: Rob Allen (rob) Assignee: Ralph Schindler (ralph) Tags: - Zend\Loader

Related issues: Attachments:


When in library/ folder run this command:

<pre class="highlight">
php /zf2/bin/classmap_generator.php -l ./App/ -o .classmap.php -w

This all generates a .classmap.php file in library containing the following:

<pre class="highlight">
return array (
  'App\\Mvc\\Route\\RegexRoute' => __DIR__ . DIRECTORY_SEPARATOR . 'Mvc' . DIRECTORY_SEPARATOR . 'Route' . DIRECTORY_SEPARATOR . 'RegexRoute.php',

This class map is unusable as the path to RegexRoute.php is missing the App directory name and so the autoloader cannot find the folder as the path it has created is relative to the App folder, not the folder where the .classmap.php file actually is.

Update: The same thing happens with this command when run from the App/ directory directly:

<pre class="highlight">
php /zf2/bin/classmap_generator.php  -o ../.classmap.php -w


Posted by Rob Allen (rob) on 2011-08-10T20:33:04.000+0000

Looking into this, I think that the first case is the one worth looking at as if symlink'd directories are involved using relative paths with -o causes a world of complexity.

Posted by Rob Allen (rob) on 2011-08-10T21:41:39.000+0000

Pull request 336 solves common use-case.

Posted by Evan Coury ( on 2011-12-21T22:17:20.000+0000

This seems to be resolved now.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.