TypeRocket / core

TypeRocket core source files where all the magic lives.
https://typerocket.com
36 stars 21 forks source link

Galaxy fail because of previously declared function #101

Closed gregoryBonnardel closed 3 years ago

gregoryBonnardel commented 3 years ago

https://github.com/TypeRocket/core/blob/274c5a1b72a3dee3d05c408baca1249f92c5921f/src/Console/GalaxyConsoleLauncher.php#L90

As said in the titleof the issue, when I try to use php galaxy, php throw an error : PHP Fatal error: Cannot redeclare wp_install_maybe_enable_pretty_permalinks() (previously declared in /home/www/public_html/wp-admin/includes/upgrade.php:523) in /home/www/public_html/wp-admin/includes/upgrade.php on line 523 PHP Stack trace: PHP 1. {main}() /home/www/public_html/wp-content/mu-plugins/typerocket/galaxy:0 PHP 2. TypeRocket\Console\GalaxyConsoleLauncher->__construct() /home/www/public_html/wp-content/mu-plugins/typerocket/galaxy:20 PHP 3. require() /home/www/public_html/wp-content/mu-plugins/typerocket/vendor/typerocket/core/src/Console/GalaxyConsoleLauncher.php:63 PHP 4. require_once() /home/www/public_html/wp-load.php:37 PHP 5. require_once() /home/www/public_html/wp-config.php:106 PHP 6. do_action($tag = 'after_setup_theme') /home/www/public_html/wp-settings.php:538 PHP 7. WP_Hook->do_action($args = [0 => '']) /home/www/public_html/wp-includes/plugin.php:484 PHP 8. WP_Hook->apply_filters($value = '', $args = [0 => '']) /home/www/public_html/wp-includes/class-wp-hook.php:316 PHP 9. TypeRocket\Console\GalaxyConsoleLauncher->loadWordPressFunctions() /home/www/public_html/wp-includes/class-wp-hook.php:290

It seems that "upgrade.php" file has already been loaded.

Maybe a simple replacement byrequire_once would be enough ?