CI Framework source code reading, system constant file constants.php configuration _php Tips

Source: Internet
Author: User
Configuring System Constants
1. Check and configure these preferences when the file system is working
When the file system is running, these defaults will increase the security of the system appropriately, but the value of using octal is always correct when a single process is opened for each user at the bottom of PHP or Apache.
File_read_mode Mode of reading files
File_write_mode Write to file mode
Dir_read_mode Mode of reading directory
Dir_write_mode Write to Directory mode


2, File flow mode
These patterns are required when we use the fopen ()/popen ()
Define (' Fopen_read ', ' RB ');
Define (' Fopen_read_write ', ' r+b ');
Define (' fopen_write_create_destructive ', ' WB ');
Define (' fopen_read_write_create_destructive ', ' w+b ');
Define (' Fopen_write_create ', ' ab ');
Define (' Fopen_read_write_create ', ' a+b ');
Define (' fopen_write_create_strict ', ' xb ');
Define (' fopen_read_write_create_strict ', ' x+b ');

File Source:
Copy Code code as follows:

[PHP]
<?php if (! defined (' BasePath ')) exit (' No Direct script access allowed ');

/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------

| These prefs consoles, preferences are used when checking and setting modes when working
|  With the file system. The defaults are fine fine on servers with proper
| Security, but/may wish (or even need) to change the values in
| Certain environments (Apache running a separate process for each
|  User, PHP under CGI with Apache suexec, etc. Octal values should
| Always is used to set the mode correctly.

*/
Define (' File_read_mode ', 0644);
Define (' File_write_mode ', 0666);
Define (' Dir_read_mode ', 0755);
Define (' Dir_write_mode ', 0777);

/*
|--------------------------------------------------------------------------
| File stream Modes Streaming mode
|--------------------------------------------------------------------------

| These modes are used if working with fopen ()/popen ()

*/

Define (' Fopen_read ', ' RB ');
Define (' Fopen_read_write ', ' r+b ');
Define (' fopen_write_create_destructive ', ' WB '); Truncates existing file data, use with care
Define (' fopen_read_write_create_destructive ', ' w+b '); Truncates existing file data, use with care
Define (' Fopen_write_create ', ' ab ');
Define (' Fopen_read_write_create ', ' a+b ');
Define (' fopen_write_create_strict ', ' xb ');
Define (' fopen_read_write_create_strict ', ' x+b ');


/* End of File constants.php * *
/* Location:./application/config/constants.php * *

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.