Tracking of which configuration file PHP contains or reads.

Source: Internet
Author: User
Tags inotify
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.