With $padReload = 'local' in an application's _config/config.php,
every page of a local request carries a small script that asks the server once a second
whether a file behind the page has changed - and reloads the page when one has. Save a
template, a page's PHP or a stylesheet, and the browser shows it.
<?php
// _config/config.php
$padReload = 'local';
?>
'local' (or TRUE) - the application's directory, its entry point directory in www/ (stylesheets, scripts, images), and _common when the application uses it.'engine' - pad/ as well, for work on the engine itself.The script asks ?page&padReload, which the engine answers with the
newest file time before it runs any page. Together with pad serve (see
Pad command) no other tool is needed.
Only a local request gets it - the command line, or this machine asking itself with
nothing forwarded - whatever the setting. It is left out of a bare fragment
(&padInclude), of anything that is not an HTML page answering 200, of the
page cache, which stores the page before the script is added, and of a pad export.
Set it in the configuration rather than in a page's PHP: the poll is answered before any
page runs.