File Alteration Monitor Functions
簡介
FAM monitors files and directories, notifying interested applications of changes. More information about FAM is available at » https://oss.sgi.com/projects/fam/.
A PHP script may specify a list of files for FAM to monitor using the functions provided by this extension.
The FAM process is started when the first connection from any application to it is opened. It exits after all connections to it have been closed.
Note: 本擴充功能已被移動到 » PECL 函式庫中且自以下版本起不再被包含到 PHP 中:5.1.0.
Note: 本擴充功能在 Windows 平台下不可用。
需求
This extension uses the functions of the » FAM library, developed by SGI. Therefore you have to download and install the FAM library.
安裝
To use PHP's FAM support you must compile PHP --with-fam[=DIR] where DIR is the location of the directory containing the lib and include directories.
執行時期設定
本擴充功能在 php.ini 中未定義任何設定選項。
資源類型
There are two resource types used in the FAM module. The first one is the connection to the FAM service returned by fam_open(), the second a monitoring resource returned by the fam_monitor_XXX functions.
預設常數
以下常數由擴充功能定義,因此只有在擴充功能被編譯到 PHP 中,或者在執行時被動態載入後才有效。
Constant | Description |
---|---|
FAMChanged (integer) | Some value which can be obtained with fstat(1) changed for a file or directory. |
FAMDeleted (integer) | A file or directory was deleted or renamed. |
FAMStartExecuting (integer) | An executable file started executing. |
FAMStopExecuting (integer) | An executable file that was running finished. |
FAMCreated (integer) | A file was created in a directory. |
FAMMoved (integer) | This event never occurs. |
FAMAcknowledge (integer) | An event in response to fam_cancel_monitor(). |
FAMExists (integer) | An event upon request to monitor a file or directory. When a directory is monitored, an event for that directory and every file contained in that directory is issued. |
FAMEndExist (integer) | Event after the last FAMEExists event. |
Table of Contents
- fam_cancel_monitor — Terminate monitoring
- fam_close — Close FAM connection
- fam_monitor_collection — Monitor a collection of files in a directory for changes
- fam_monitor_directory — Monitor a directory for changes
- fam_monitor_file — Monitor a regular file for changes
- fam_next_event — Get next pending FAM event
- fam_open — Open connection to FAM daemon
- fam_pending — Check for pending FAM events
- fam_resume_monitor — Resume suspended monitoring
- fam_suspend_monitor — Temporarily suspend monitoring