Livereload package for php.
Run this command in terminal from root folder your project:
composer require sbkinfo/livereload
Run this command in terminal from root folder your project:
wget https://raw.githubusercontent.com/silverreve23/livereload/master/livestart
Insert next code in your project main file.
use LiveReloadPHP\LiveReload;
LiveReload::initReload();
Execute next command in terminal from root folder your project:
livestart
Default path watcher / (root project). Example config:
$config = array(
'host' => 'localhost',
'port' => '9060',
'sleep' => '1', #seconds
'folders' => array(
'/test',
'/recursive',
)
);
Pass config to methods:
- LiveReload::initReload($config) # in main file
- Server::runServer($config) # in livestart file