Local Projects
A local project is a folder on your Mac that Runlet runs PHP in. Open a Laravel, Symfony, WordPress, or Composer project, and every snippet runs inside it, with the PHP you choose: Herd, Homebrew, the php on your PATH, or Runlet's own.
Opening a Project
Choose File ▸ Open Project… (⇧⌘O) and pick the project's folder: the one with artisan, bin/console, wp-config.php, or composer.json. The current tab switches to the project. From a terminal, the runlet command does the same:
cd ~/Code/shop
runlet .Runlet remembers the project. Opening the same folder again reuses it, and the target menu and Open Anything (⌘P) list it from then on, most recently used first.
Then write a snippet and press ⌘R. Runlet detects the framework and boots it for every run, so the snippet starts with your application ready:
use App\Models\Order;
Order::query()->where('status', 'paid')->sum('total');Frameworks lists what Runlet detects and what each framework's snippets start with.
Project Options
To change a project's settings, choose Project Options… in the target menu, or Edit… next to it in Settings ▸ Targets.
| Option | What it does |
|---|---|
| Name | Shown in the target menu, tabs, and history. It starts as the folder's name. |
| PHP | The PHP for this project's runs. Default uses the default from Settings ▸ PHP. See Choosing PHP. |
| PHP version for completion | The PHP version completion and diagnostics assume. Leave it empty to read it from composer.json. |
| Strict types | Whether runs declare strict_types=1. Default follows Settings ▸ General ▸ Running. |
| Intercept records mail without sending it; Send sends it. Default follows Settings ▸ General ▸ Run Inspector. See Mail interception. | |
| Environment and Colour | Development, staging, or production, and a colour for the project's tabs and status bar. See Environments & Production. |
| Databases | Database connections you save for this project, for SQL tabs. They're saved at once, apart from the options above. |
Remove Project… removes the project from Runlet. The folder itself is untouched, and tabs that used the project switch to the Laravel Sandbox.
Choosing PHP
Runlet looks for PHP when it launches: every php on your PATH, Herd's PHP versions, and Homebrew's php formulas. Settings ▸ PHP ▸ Discovered Installations lists what it found, with Rescan for PHP you installed since.
A project's runs use, in this order:
- the PHP in the project's options;
- the Default PHP in Settings ▸ PHP;
- automatically, the first PHP 7.4 or later with the tokenizer extension that Runlet found: your
phponPATHfirst, stable releases before betas.
To use a PHP Runlet didn't find, click Choose Executable… under the PHP picker and pick the binary. Runlet checks that it's a working PHP, and tells you when it's older than 7.4, the oldest version Runlet runs.
Runlet's Own PHP
If your Mac has no PHP, Runlet offers to download its own: click Download PHP 8.5.8 in the banner above the editor, or in Settings ▸ PHP ▸ Runlet's PHP. It's a self-contained PHP for your Mac's processor (about 26 MB), with the usual extensions for Laravel, Symfony, and WordPress (including mysqli, intl, and sodium), mongodb, and Excimer for Profile Run.
- Runlet downloads it only when you click, and checks it against its published checksum.
- It lives in Runlet's data folder. Settings ▸ PHP shows it, updates it, and removes it.
- Runlet uses it only when no installed PHP fits, unless you pick it as the default or in a project's options.
What Runs on Your Mac
A local project runs the PHP you chose, in the project's folder, as your user. The runner arrives on PHP's standard input: Runlet writes no files into your project, and it never runs Composer there. If vendor/ is missing, the run says to run composer install.
Because the project is on your Mac, Runlet reads it directly:
- Completion and diagnostics index the project (PHPantom), without running its code. Models, relations, and columns complete as you type.
- Framework detection for the tab card and status bar reads the project's files, without running anything.
- The Commands panel lists the project's commands while it's open (never for a production target), and runs them in a terminal tab in the project's folder.
- File links in dumps, errors, and stack traces open at their line in your editor.
- Project snippets in
.runlet/snippets/and project drivers in.runlet/are read from the folder. See Project Snippets and Project Drivers.
Stop ends PHP and everything the snippet started, such as a child process from exec() or proc_open().