CI framework source code reading, system constant file constants. php configuration

Source: Internet
Author: User

Configure system Constants
1. Check and configure these preferences when the file system is working.
When the file system is running, these default values will increase the security of the system. However, when the underlying layer of php or apache separately opens a process for each user, the octal value is always correct.
FILE_READ_MODE: file reading mode
FILE_WRITE_MODE: file writing mode
DIR_READ_MODE: Directory reading mode
DIR_WRITE_MODE: Directory writing mode

2. file stream mode
These modes are required when we use 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 Code:Copy codeThe Code is as follows: [php]
<? Php if (! Defined ('basepath') exit ('no direct script access allowed ');

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

| These prefs console, preferences are used when checking and setting modes when working
| With the file system. The defaults are fine on servers with proper
| Security, but you 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 shold
| Always be 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 File Stream mode
| --------------------------------------------------------------------------

| These modes are used when 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.