PHP code example of cydrickn / php-watcher

1. Go to this page and download the library: Download cydrickn/php-watcher library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cydrickn / php-watcher example snippets




her = new \Cydrickn\PHPWatcher\Watcher(
    [__DIR__],
    [__DIR__ . '/vendor/'],
    function (array $changes) {
        echo json_encode($changes) . PHP_EOL;
    }
);

$watcher->tick();

public \Cydrickn\PHPWatcher\Watcher::__construct(
    array $watchFor,
    array $excludes,
    callable $handler,
    int $interval = 1000
)

public \Cydrickn\PHPWatcher\Watcher::checkChanges(): void

public \Cydrickn\PHPWatcher\Watcher::tick(
    ?callable $handler = null
): void
shell
composer