laminas-api-tools / api-tools

Laminas API Tools module for Laminas
https://api-tools.getlaminas.org/documentation
BSD 3-Clause "New" or "Revised" License
37 stars 19 forks source link

The application.config.php packaged version contains absolute path to autoload config folder #17

Open weierophinney opened 4 years ago

weierophinney commented 4 years ago

After packaging the created API, the application.config.php which originally contains the key => value of : 'config_glob_paths' => [realpath(__DIR__) . '/autoload/{,*.}{global,local}.php'], getting replaced by 'config_glob_paths' => array ( 0 => '/tmp/ZFDeploy_57c06a6d3c68a/config/autoload/{,*.}{global,local}.php', ),

Which causes the DB connected REST services to fail with an exception

PHP Fatal error: Uncaught Zend\\ServiceManager\\Exception\\ServiceNotFoundException: ZF\\Rest\\Factory\\RestControllerFactory::canCreate requires that a valid "listener" service be specified for controller TodoBackend\\V1\\Rest\\Todo\\Controller; no service found in /home/tacsiazuma/shared/www/todobackend/vendor/zfcampus/zf-rest/src/Factory/RestControllerFactory.php:

as it's cannot resolve the DB adapters configured in local.php inside the autoload folder.


Originally posted by @letscodehu at https://github.com/zfcampus/zf-apigility/issues/176