10quality / wpmvc-commands

Ayuco commands for Wordpress MVC,
MIT License
2 stars 4 forks source link

No configuration file found on linux host #90

Closed amostajo closed 4 years ago

amostajo commented 4 years ago

Reported by @hebinet at wpmvc: https://github.com/10quality/wpmvc/issues/12

When I run the php ayuco setup command on my linux machine i get the following error

PHP Fatal error:  Uncaught Ayuco\Exceptions\NoticeException: addCommand: No configuration file found. in /www/app/wp-content/plugins/....../vendor/10quality/wpmvc-commands/src/Base/BaseCommand.php:58
Stack trace:
#0 /www/app/wp-content/plugins/....../vendor/10quality/wpmvc-core/src/lib/functions.php(114): WPMVC\Commands\Base\BaseCommand->__construct()
#1 /www/app/wp-content/plugins/....../ayuco(18): get_ayuco()
#2 {main}
  thrown in //www/app/wp-content/plugins/....../vendor/10quality/wpmvc-commands/src/Base/BaseCommand.php on line 58

This is due to case sensititve filesystems in Linux. I fixed it by changing the following lines in BaseCommand.php constructor

// Check for MVC configuration file
$this->configFilename = file_exists($this->rootPath . '/app/config/app.php')
? $this->rootPath . '/app/config/app.php'
: null;

like this:

// Check for MVC configuration file
$this->configFilename = file_exists($this->rootPath . '/app/Config/app.php')
? $this->rootPath . '/app/Config/app.php'
: null;