pw-maintenance
Use when toggling the application's maintenance mode (down/up) in ProcessWire and managing downtime configuration.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when toggling the application's maintenance mode (down/up) in ProcessWire and managing downtime configuration.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when building, structuring, or refactoring native backend modules for ProcessWire using PHP 8.4 and strict typing.
Use when designing, structuring, or rendering HTML for ProcessWire Admin interfaces, custom Process modules, or Inputfields.
Use when brainstorming or designing ProcessWire modules, templates, field schemas, or hooks to resolve ambiguity and validate architecture before implementation.
Use when creating, executing, or managing Pest tests within ProcessWire or ProcessWire modules, including Test-Driven Development (TDD) tasks.
Use when encountering any bug, test failure, blank screen of death, or unexpected behavior in ProcessWire before proposing fixes.
Use when creating or updating module documentation, package READMEs, architecture guides, or CLI command references for ProcessWire projects.
| name | pw-maintenance |
| description | Use when toggling the application's maintenance mode (down/up) in ProcessWire and managing downtime configuration. |
| risk | moderate |
| source | processwire-boost |
| date_added | 2026-04-09 |
This implements a managed maintenance mode for ProcessWire driven by CLI commands, mimicking Laravel's artisan down behavior.
The wire down command writes a down.json payload into ProcessWire's $config->paths->assets directory. The wire up command deletes this file.
Because processwire-console operates independently of HTTP requests, it cannot stop requests directly. To make it work, the site/init.php file MUST be configured to intercept traffic when down.json exists.
site/init.php)To ensure the website goes down for visitors during maintenance, verify or place this snippet inside site/init.php:
// Intercept down.json if exists
$downFile = $config->paths->assets . 'down.json';
if (file_exists($downFile) && php_sapi_name() !== 'cli') {
$down = json_decode(file_get_contents($downFile), true);
// Support secret bypassing (e.g. ?secret=dev123)
$providedSecret = wire('input')->get('secret') ?: wire('session')->get('maintenance_secret');
if (empty($down['secret']) || $providedSecret !== $down['secret']) {
if (!empty($down['redirect'])) wire('session')->redirect($down['redirect']);
http_response_code($down['status'] ?? 503);
die('Site is under maintenance. Please check back soon.');
} else {
// Save the secret in session so they don't have to keep it in the URL
if ($providedSecret === $down['secret']) {
wire('session')->set('maintenance_secret', $down['secret']);
}
}
}
wire down
--redirect=/some-url - Where to push visitors.--status=503 - Explicit HTTP code.--secret=developerToken123 - Very critical. If passed, the developer visits example.com/?secret=developerToken123 and can still use the site normally to verify fixes.wire up
index.php. Do not place the check logic there. Place it in site/init.php (earliest site hook).php_sapi_name() !== 'cli' inside site/init.php or you will lock yourself out of the wire CLI commands while down!