zendframework / ZFTool

Utility module for maintaining modular Zend Framework 2 applications.
187 stars 101 forks source link

Create classmap on Windows OS #132

Open dafap opened 8 years ago

dafap commented 8 years ago

On windows, command php vendor\zendframework\zftool\zf.php classmap generate module/DafapMail -w product wrong file autoload_classmap.php :

return array(
'DafapMail\Module'                                    => __DIR__ . '/../../../../../../../D:\dafap\Developpements Eclipse\sbm\sources\module\DafapMail/D:/dafap/Developpements Eclipse/sbm/sources/module/DafapMail/Module.php',
'DafapMail\Controller\IndexController'                => __DIR__ . '/../../../../../../../D:\dafap\Developpements Eclipse\sbm\sources\module\DafapMail/D:/dafap/Developpements Eclipse/sbm/sources/module/DafapMail/src/DafapMail/Controller/IndexController.php',
'DafapMail\Controller\Service\IndexControllerFactory' => __DIR__ . '/../../../../../../../D:\dafap\Developpements Eclipse\sbm\sources\module\DafapMail/D:/dafap/Developpements Eclipse/sbm/sources/module/DafapMail/src/DafapMail/Controller/Service/IndexControllerFactory.php',
'DafapMail\Form\Mail'                                 => __DIR__ . '/../../../../../../../D:\dafap\Developpements Eclipse\sbm\sources\module\DafapMail/D:/dafap/Developpements Eclipse/sbm/sources/module/DafapMail/src/DafapMail/Form/Mail.php',
'DafapMail\Model\EnvoiMail'                           => __DIR__ . '/../../../../../../../D:\dafap\Developpements Eclipse\sbm\sources\module\DafapMail/D:/dafap/Developpements Eclipse/sbm/sources/module/DafapMail/src/DafapMail/Model/EnvoiMail.php',
'DafapMail\Model\Exception'                           => __DIR__ . '/../../../../../../../D:\dafap\Developpements Eclipse\sbm\sources\module\DafapMail/D:/dafap/Developpements Eclipse/sbm/sources/module/DafapMail/src/DafapMail/Model/Exception.php',
'DafapMail\Model\Service\ConfigServiceFactory'        => __DIR__ . '/../../../../../../../D:\dafap\Developpements Eclipse\sbm\sources\module\DafapMail/D:/dafap/Developpements Eclipse/sbm/sources/module/DafapMail/src/DafapMail/Model/Service/ConfigServiceFactory.php',
'DafapMail\Model\Service\EnvoiMailFactory'            => __DIR__ . '/../../../../../../../D:\dafap\Developpements Eclipse\sbm\sources\module\DafapMail/D:/dafap/Developpements Eclipse/sbm/sources/module/DafapMail/src/DafapMail/Model/Service/EnvoiMailFactory.php',
'DafapMail\Model\Template'                            => __DIR__ . '/../../../../../../../D:\dafap\Developpements Eclipse\sbm\sources\module\DafapMail/D:/dafap/Developpements Eclipse/sbm/sources/module/DafapMail/src/DafapMail/Model/Template.php',
);

Path is wrong.

The problem is calculating on $relativePath because DIRECTORY_SEPARATOR is not '/'.

adamlundrigan commented 8 years ago

That does appear to be the problem. There are quite a few places in ClassmapController::generate where the directory separator is hard-coded to forward-slash.

Honestly, this module doesn't appear to be actively maintained and in the intervening time ZF has moved from Zend\Loader to Composer for it's autoloading. I would suggest adding your module namespace to the autoload section of your project's composer.json instead, or check out this nifty new tool on the zfcampus side which automates the task: https://github.com/zfcampus/zf-composer-autoloading

dafap commented 8 years ago

Thank you for your advice. So I registered my namespaces in composer.json Best regard.

Alain POMIROL DAFAP Informatique Tel. 06 07 87 94 44

----- Mail original ----- De: "Adam Lundrigan" notifications@github.com À: "zendframework/ZFTool" ZFTool@noreply.github.com Cc: "Pomirol Alain" dafap@free.fr, "Author" author@noreply.github.com Envoyé: Lundi 15 Août 2016 23:43:27 Objet: Re: [zendframework/ZFTool] Create classmap on Windows OS (#132)

That does appear to be the problem. There are quite a few places in ClassmapController::generate where the directory separator is hard-coded to forward-slash.

Honestly, this module doesn't appear to be actively maintained and in the intervening time ZF has moved from Zend\Loader to Composer for it's autoloading. I would suggest adding your module namespace to the autoload section of your project's composer.json instead, or check out this nifty new tool on the zfcampus side which automates the task: https://github.com/zfcampus/zf-composer-autoloading

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .