-
Notifications
You must be signed in to change notification settings - Fork 315
Configuration
While PsySH strives to detect the right settings automatically, you might want to fine-tune the configuration yourself. Add a file to ~/.config/psysh/config.php (or C:\Users\{USER}\AppData\Roaming\PsySH\config.php on Windows):
<?php
return [
'commands' => [
new \Psy\Command\ParseCommand,
],
'defaultIncludes' => [
__DIR__ . '/include/bootstrap.php',
],
'startupMessage' => sprintf('<info>%s</info>', shell_exec('uptime')),
];See the full list of configuration options and a sample config file for further explanation of the available options.
When PsySH starts, it checks for a per-project .psysh.php config file in the current directory. Both the global and the local config files are used if they exist, with global config.php being loaded first.
Pass --config PATH when launching PsySH to use a custom config file path. You can specify your config file location in the PSYSH_CONFIG environment variable as well.
PsySH config files are PHP, so you can do pretty much anything you want in there.
Add something like this to the top of your PsySH config:
// Automatically autoload Composer dependencies
if (is_file(getcwd() . '/vendor/autoload.php')) {
require_once getcwd() . '/vendor/autoload.php';
}This shouldnβt be necessary if youβve installed PsySH as a Composer dependency (or dev dependency) for your project. It will already be using the Composer autoloader in that case.