studioemma / pimcore-plugin-migrations

A Pimcore Plugin to manage (database) migrations and more.
MIT License
3 stars 1 forks source link

Pimcore install command - fatal error #1

Closed christophluehr closed 8 years ago

christophluehr commented 8 years ago

Executing:

php plugins/Migrations/cli/console.php install     --db-adapter Pdo_Mysql     --db-host mysql     --db-username root     --db-password toor     --db-database pimcore     --admin-username admin     --admin-password admin
PHP Fatal error:  Class 'Migrations\Console\Command\MigrateCommand' not found in /var/www/sites/pimcore/htdocs/plugins/Migrations/cli/console.php on line 12

Results in

PHP Fatal error:  Class 'Migrations\Console\Command\MigrateCommand' not found in /var/www/sites/pimcore/htdocs/plugins/Migrations/cli/console.php on line 12

On my system (Ubuntu 14.04 LTS w/ PHP 5.5.9.

Am i missing something? The issue is the try{} which can not catch the fatal error. If i extract the relevant code into, e.g. a cli/install.php, it works:

include_once(__DIR__ . "/../../../pimcore/cli/startup.php");
use Symfony\Component\Console\Application;
$application = new Application('Pimcore Migrations', '1.0.0');
include_once(
    realpath(
        __DIR__ . "/../lib/Migrations/Console/Command/InstallCommand.php"
    )
);
$application->add(new \Migrations\Console\Command\InstallCommand());
$application->run();

Any advice on how to proceed? PS: Kudos for publishing the plugin!

BlackIkeEagle commented 8 years ago

@christophluehr could you give us the pimcore version, we only tested in pimcore4 development

BlackIkeEagle commented 8 years ago

@christophluehr We need to investigate further but my first guess is the catch works in PHP7

christophluehr commented 8 years ago

Yup, i've used the latest Pimcore4. Regarding the catch - yup, AFAIK PHP7 allows to catch Fatal errors. How should to proceed? Either change the code and use some other kind of detection (if pimcore is already installed) or change/add a "require" statement for PHP7 to the plugins composer.json to indicate that? Thanks for the swift response!

BlackIkeEagle commented 8 years ago

@christophluehr We should add a mechanism for php5 that works