Background:
I'm reading a new PHP Program Like dropping to a zhonglin, a black box containing/reading a file appears. How can I track PHP to read or include a file at one execution? (For example, in a configuration file, the configuration file may include the file, but it may be read directly, but it is unclear. What should I do ?)
The PHP Advanced Programming Group has made the following moves:
1. You are advised to use the find command to find the access time (the last time the document was read ).
2. If you have a brother, we suggest get_included_files to see which file is print_r (get_included_files ());,
By the way, we also mention the other three exquisite functions: get_included_files, get_included_path, get_loaded_extensions.
3. Also some brothers proposed to use the installation extension method to achieve: http://pecl.php.net/package/inotify
You can also use the last mentioned php_aop
Aop_add_after ("file_get_contents ()", 'file _ open_call ');
File_get_contents ("./test. php ");
If you include the file, you can use get_included_files directly to determine the file. (This function is very powerful. We recommend it again .)
For more information about AOP, see:
Http://hi.baidu.com/bise86/item/a396eed5c8fae8cc1a72b4a1
Http://www.croes.org/gerald/projects/aop/documentation_aop_extension_php.pdf
Use inotify to prevent PHP Trojans: http://hi.baidu.com/ostech/item/f729c8c2fa8a392447d5c089
PHP uses inotify for queue processing: http://blog.jiunile.com/php%E4%BD%BF%E7%94%A8inotify%E5% AE %9E%E7%8E%B0%E9%98%9F%E5%88%97%E5%A4%84%E7%90%86.html
Real-time Data Backup through rsync + inotify: http://ixdba.blog.51cto.com/2895551/580280