Logging support
Log user input, command invocations, and executed code to a PSR-3 logger or callback.
// Simple callback
$config->setLogging(function ($kind, $data) {
file_put_contents('/tmp/psysh.log', "[$kind] $data\n", FILE_APPEND);
});
// PSR-3 logger with granular control
$config->setLogging([
'logger' => $psrLogger,
'level' => [
'input' => 'info',
'command' => false, // disable
'execute' => 'debug',
],
]);This has been one of our longest-requested features (🙈) and it fixes #821, #651, and #565.
Huge documentation improvements!
This release adds a new PHP-based manual data format (v3), replacing the previously used sqlite db. The new format:
- Allows runtime formatting (especially wrapping) rather than pre-rendering at build time.
- Adds OSC 8 links to php.net!
- Is smaller, faster, and more flexible than the sqlite format.
- ... and no longer requires sqlite support to use!
The phar builds now bundle the PHP manual, so these changes work out of the box. There are also automatic update notifications, an an --update-manual command to keep docs current.
If you've already got a manual file installed, remove it then run psysh --update-manual (or psysh --update-manual=LANG) after upgrading!
Other improvements
- Prettier formatting for
--helpoutput - Standardized user-facing path pretty printing