Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog (1) | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2023-09-18 (3 months ago) ![]() | Not yet rated by the users | Total: 41 | All time: 10,758 This week: 118![]() |
Version | License | PHP version | Categories | |||
swotch 1.0.0 | Shareware | 8 | System information, Files and Folders, P... |
Description | Author | ||||||||||||||
This package can watch file changes in PHP Swoole applications. Innovation Award |
|
Swoole file system changes watcher.
composer require ahmard/swotch
use Swotch\Watcher;
require 'vendor/autoload.php';
$paths = [
__DIR__ . '/app/',
__DIR__ . '/views/',
];
Watcher::watch($paths)->onAny(function (){
echo "File changes detected\n";
});
use Swoole\Http\Request;
use Swoole\Http\Response;
use Swoole\Http\Server;
use Swotch\Watcher;
require 'vendor/autoload.php';
$server = new Server('0.0.0.0', 9000);
$server->on('request', function (Request $request, Response $response) {
$response->end('Hello world');
});
$server->on('start', function (Server $server) {
echo "Server started at http://0.0.0.0:9000\n";
$paths = [
__DIR__ . '/app/',
__DIR__ . '/views/',
];
Watcher::watch($paths)->onAny(fn() => $server->reload());
});
$server->start();
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation |
![]() |
/ | src |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.