Manual Formats
PsySH supports two manual formats:V3 Format (Current)
The current format stores documentation in a single PHP file (php_manual.php):
- Storage: Single
.phpfile with embedded data - Performance: Fast load times, optimized structure
- Size: ~3-5 MB depending on language
- Format version:
3.x
src/Manual/V3Manual.php:19-22:
V2 Format (Legacy)
The legacy format uses SQLite database (php_manual.sqlite):
- Storage: SQLite database file
- Performance: Requires database queries
- Size: ~5-8 MB depending on language
- Format version:
2.x
src/Manual/V2Manual.php:17-18:
V3 format is recommended for new installations. V2 SQLite format is maintained for backward compatibility.
Downloading the Manual
Using the doc Command
Download the manual from within PsySH:Specifying a Language
Download a localized version:en- English (default)fr- Frenchde- Germanes- Spanishpt_BR- Portuguese (Brazil)ja- Japanesezh- Chinese- And more…
Command-Line Download
You can also download from the command line:Manual Installation
PsySH looks for manual files in your data directory:Default Locations
Linux/Unix:~/.local/share/psysh/php_manual.php~/.local/share/psysh/php_manual.sqlite
~/.local/share/psysh/php_manual.php~/.local/share/psysh/php_manual.sqlite
%APPDATA%\PsySH\php_manual.php%APPDATA%\PsySH\php_manual.sqlite
Manual Installation Process
Fromsrc/ManualUpdater/Installer.php:61-62:
- Downloads the manual archive from GitHub releases
- Extracts the manual file
- Moves it to the data directory
- Validates the file format
Using the Manual
Viewing Function Documentation
Viewing Class Documentation
Language Construct Documentation
Manual Update Checking
PsySH can automatically check for manual updates.Automatic Update Checks
Configure automatic checking in.psysh.php:
src/Configuration.php:88:
Check Frequency Options
'daily'- Check once per day'weekly'- Check once per week'monthly'- Check once per month (default)null- Never check automatically
Manual Update Status
PsySH stores update check timestamps in a cache file to avoid excessive checks.Manual Metadata
Each manual file contains metadata about version, language, and build date.Reading Manual Info
Fromsrc/Manual/ManualInterface.php:40-43:
Example Metadata
Manual Format Migration
When upgrading from V2 to V3 format, PsySH offers migration assistance.From SQLite to PHP Format
Fromsrc/ManualUpdater/ManualUpdate.php:247-267:
When you have a legacy SQLite manual, PsySH prompts:
- Download the new PHP format
- Keep the SQLite format (optional)
- Update both formats if both exist
Invalid Manual Handling
If a manual file becomes corrupted, PsySH detects it and offers to remove it.Detection
Fromsrc/Manual/V3Manual.php:59-76:
Recovery Prompt
Fromsrc/ManualUpdater/ManualUpdate.php:217-244:
Configuration Options
Manual Database File
Explicitly set the manual file path:src/Configuration.php:2056-2066:
Data Directory
Change where PsySH stores data files:Bundled Manual (PHAR)
When PsySH is installed as a PHAR, it can include a bundled manual.How It Works
Fromsrc/Configuration.php:2157-2168:
PsySH checks for a manual in this order:
- Explicitly configured
manualDbFile - Manual files in the data directory
- Bundled manual in the PHAR
Building a PHAR with Manual
When building PsySH:Troubleshooting
Manual not found
Manual not found
If PsySH can’t find the manual:Solution: Download the manual:
Download fails
Download fails
If manual download fails:Possible causes:
- No internet connection
- GitHub releases unavailable
- Firewall blocking downloads
Multiple manual files warning
Multiple manual files warning
.sqlite file if you don’t need it:Invalid manual file
Invalid manual file
Wrong language downloaded
Wrong language downloaded
If you downloaded the wrong language:Solution: Download the correct language:This will replace the existing manual file.