Skip to content

Commit

Permalink
health-check
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbeaty committed Oct 7, 2024
1 parent e2d724a commit 2cbd30a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
$loader = require_once BP . '/vendor/autoload.php';

if ($loader->getUseIncludePath() === false) {
die('Run: composer config use-include-path true; composer dump;');
die('Fatal error, please run: ./maho health-check');
}


Expand Down
13 changes: 13 additions & 0 deletions lib/MahoCLI/Commands/HealthCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
{
$hasErrors = false;

// Check for use-include-path in composer.json
$output->write('Checking composer.json... ');
$loader = require MAHO_ROOT_DIR . '/vendor/autoload.php';
if ($loader->getUseIncludePath() === true) {
$output->writeln('<info>OK</info>');
} else {
$hasErrors = true;
$output->writeln('');
$output->writeln('<error>Error: Detected invalid composer.json config:</error>');
$output->writeln('Run: composer config use-include-path true; composer dump;');
$output->writeln('');
}

// Check for M1 core files
$output->write('Checking Magento/OpenMage core... ');
$folders = [
Expand Down

0 comments on commit 2cbd30a

Please sign in to comment.