{"record":{"id":"8c9427e8abca7c83","repo":"passbolt/passbolt_api","slug":"and-that-psy-shell-is-registered-in-your-autoloader","errorCode":null,"errorMessage":"and that Psy\\Shell is registered in your autoloader.","messagePattern":"and that Psy\\\\Shell is registered in your autoloader\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/Command/ConsoleCommand.php","lineNumber":45,"sourceCode":"/**\n * Simple console wrapper around Psy\\Shell.\n */\nclass ConsoleCommand extends Command\n{\n    /**\n     * Start the Command and interactive console.\n     *\n     * @param \\Cake\\Console\\Arguments $args The command arguments.\n     * @param \\Cake\\Console\\ConsoleIo $io The console io\n     * @return int|null|void The exit code or null for success\n     */\n    public function execute(Arguments $args, ConsoleIo $io) // phpcs:ignore\n    {\n        if (!class_exists('Psy\\Shell')) {\n            $io->err('<error>Unable to load Psy\\Shell.</error>');\n            $io->err('');\n            $io->err('Make sure you have installed psysh as a dependency,');\n            $io->err('and that Psy\\Shell is registered in your autoloader.');\n            $io->err('');\n            $io->err('If you are using composer run');\n            $io->err('');\n            $io->err('<info>$ php composer.phar require psy/psysh</info>');\n            $io->err('');\n\n            return static::CODE_ERROR;\n        }\n\n        $io->out('You can exit with <info>`CTRL-C`</info> or <info>`exit`</info>');\n        $io->out();\n\n        Log::drop('debug');\n        Log::drop('error');\n        $io->setLoggers(false);\n        restore_error_handler();\n        restore_exception_handler();\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/src/Command/ConsoleCommand.php#L27-L63","documentation":"Third guidance line from ConsoleCommand: 'and that Psy\\Shell is registered in your autoloader.' It points out that even with psysh on disk, the composer autoloader must know the class. Informational stderr output only.","triggerScenarios":"`bin/cake passbolt console` where Psy\\Shell is absent from the loaded autoloader — either not installed or autoload files stale/not regenerated.","commonSituations":"Manually copying vendor directories, using a custom autoloader, or editing composer.json without running composer install/update.","solutions":["Run composer install/update so the autoloader includes psysh.","Run composer dump-autoload after manual vendor changes.","Confirm the app uses the generated vendor/autoload.php (APP/composer settings)."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Verify autoload coverage before invoking console\nrequire CONFIG . '../vendor/autoload.php';\nvar_dump(class_exists('Psy\\Shell'));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always regenerate the autoloader after vendor changes (composer dump-autoload)","Do not manually edit vendor/","Ensure vendor/autoload.php is the registered autoloader"],"tags":["cli","console","autoload","composer"],"backgroundTag":"missing-dependency","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}