dreadnip/php-inotify
Composer 安装命令:
composer require dreadnip/php-inotify
包简介
Wraps php inotify module into object and dispatch them using event dispatcher.
关键字:
README 文档
README
This is a PHP8.1 fork of the excellent package by krowinski.
Installation
composer require dreadnip/php-inotify
Installing inotify extension for php
To listen on event we need php extension called inotify. In most cases you just need to install using pecl:
pecl install inotify
(example in dockerfile)
Example
You can find example in example.php and events that you can listen to InotifyEventCodeEnum.php Event implement JsonSerializable and __toString.
Array ( [id] => 1 [eventCode] => 256 [eventDescription] => ON_CREATE - File or directory created in watched directory [uniqueId] => 0 [fileName] => 2 [pathName] => /tmp [customName] => test [pathWithFile] => /tmp/2 [timestamp] => 1565610455 ) Array ( [id] => 1 [eventCode] => 32 [eventDescription] => ON_OPEN - File was opened [uniqueId] => 0 [fileName] => 2 [pathName] => /tmp [customName] => test [pathWithFile] => /tmp/2 [timestamp] => 1565610455 ) Array ( [id] => 1 [eventCode] => 4 [eventDescription] => ON_ATTRIB - Metadata changed (e.g. permissions, mtime, etc.) [uniqueId] => 0 [fileName] => 2 [pathName] => /tmp [customName] => test [pathWithFile] => /tmp/2 [timestamp] => 1565610455 ) Array ( [id] => 1 [eventCode] => 8 [eventDescription] => ON_CLOSE_WRITE - File opened for writing was closed [uniqueId] => 0 [fileName] => 2 [pathName] => /tmp [customName] => test [pathWithFile] => /tmp/2 [timestamp] => 1565610455 ) Array ( [id] => 1 [eventCode] => 512 [eventDescription] => ON_DELETE - File or directory deleted in watched directory [uniqueId] => 0 [fileName] => 2 [pathName] => /tmp [customName] => test [pathWithFile] => /tmp/2 [timestamp] => 1565610456 )
Where:
[id] => watch descriptor
[eventCode] => bit mask of events
[eventDescription] => human readable event description (can be UNKNOWN if not found in InotifyEventCodeEnum)
[uniqueId] => is a unique id to connect related events (e.g. IN_MOVE_FROM and IN_MOVE_TO)
[fileName] => name of a file (e.g. if a file was modified in a watched directory)
[pathName] => watched resource you give in configuration
[customName] => custom resource name for external parsing like "form-upload-dir" etc
[pathWithFile] => helper that contact pathName and fileName
[timestamp] => ...
dreadnip/php-inotify 适用场景与选型建议
dreadnip/php-inotify 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 154 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 04 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「inotify」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dreadnip/php-inotify 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dreadnip/php-inotify 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dreadnip/php-inotify 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Wraps php inotify module into object and dispatch them using event dispatcher.
A react PHP implementation for inotify, an filesystem change monitor
🚀 LaravelS: Speed up Laravel/Lumen by Swoole, 'S' means Swoole, Speed, High performance.
🚀 LaravelS is an out-of-the-box adapter between Swoole and Laravel/Lumen.
🚀 LaravelS: speed up Laravel/Lumen by Swoole, let's fly.
Provides the ability to watch folders for changes and call a binary in response.
统计信息
- 总下载量: 154
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-01