/installer/config/constants.php
PHP | 163 lines | 41 code | 15 blank | 107 comment | 8 complexity | 14eb48f674ba6172f6ed709a35098721 MD5 | raw file
Possible License(s): CC-BY-3.0, BSD-3-Clause, CC0-1.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, MIT
- <?php defined('BASEPATH') OR exit('No direct script access allowed');
- /**
- * CodeIgniter
- *
- * An open source application development framework for PHP 5.2.4 or newer
- *
- * NOTICE OF LICENSE
- *
- * Licensed under the Academic Free License version 3.0
- *
- * This source file is subject to the Academic Free License (AFL 3.0) that is
- * bundled with this package in the files license_afl.txt / license_afl.rst.
- * It is also available through the world wide web at this URL:
- * http://opensource.org/licenses/AFL-3.0
- * If you did not receive a copy of the license and are unable to obtain it
- * through the world wide web, please send an email to
- * licensing@ellislab.com so we can send you a copy immediately.
- *
- * @package CodeIgniter
- * @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/)
- * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
- * @link http://codeigniter.com
- * @since Version 1.0
- * @filesource
- */
- /*
- |--------------------------------------------------------------------------
- | File and Directory Modes
- |--------------------------------------------------------------------------
- |
- | These prefs 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 should
- | 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
- |--------------------------------------------------------------------------
- |
- | 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');
- /*
- |--------------------------------------------------------------------------
- | Display Debug backtrace
- |--------------------------------------------------------------------------
- |
- | If set to TRUE, a backtrace will be displayed along with php errors. If
- | error_reporting is disabled, the backtrace will not display, regardless
- | of this setting
- |
- */
- define('SHOW_DEBUG_BACKTRACE', TRUE);
- /*
- |--------------------------------------------------------------------------
- | Exit Status Codes
- |--------------------------------------------------------------------------
- |
- | Used to indicate the conditions under which the script is exit()ing.
- | While there is no universal standard for error codes, there are some
- | broad conventions. Three such conventions are mentioned below, for
- | those who wish to make use of them. The CodeIgniter defaults were
- | chosen for the least overlap with these conventions, while still
- | leaving room for others to be defined in future versions and user
- | applications.
- |
- | The three main conventions used for determining exit status codes
- | are as follows:
- |
- | Standard C/C++ Library (stdlibc):
- | http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
- | (This link also contains other GNU-specific conventions)
- | BSD sysexits.h:
- | http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
- | Bash scripting:
- | http://tldp.org/LDP/abs/html/exitcodes.html
- |
- */
- define('EXIT_SUCCESS', 0); // no errors
- define('EXIT_ERROR', 1); // generic error
- define('EXIT_CONFIG', 3); // configuration error
- define('EXIT_UNKNOWN_FILE', 4); // file not found
- define('EXIT_UNKNOWN_CLASS', 5); // unknown class
- define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
- define('EXIT_USER_INPUT', 7); // invalid user input
- define('EXIT_DATABASE', 8); // database error
- define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
- define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
- /*
- |--------------------------------------------------------------------------
- | Environment
- |--------------------------------------------------------------------------
- */
- # Deprecated: This feature was rolled into CodeIgniter so we don't need to handle it ourselves anymore.
- define('ENV', ENVIRONMENT);
- /*
- |--------------------------------------------------------------------------
- | Docment root folders
- |--------------------------------------------------------------------------
- |
- | These constants use existing location information to work out web root, etc.
- |
- */
- // Base URL (keeps this crazy sh*t out of the config.php
- if (isset($_SERVER['HTTP_HOST'])) {
- $base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https' : 'http';
- $base_url .= '://'. $_SERVER['HTTP_HOST'];
- $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
- // Base URI (It's different to base URL!)
- $base_uri = parse_url($base_url, PHP_URL_PATH);
- if (substr($base_uri, 0, 1) != '/') $base_uri = '/'.$base_uri;
- if (substr($base_uri, -1, 1) != '/') $base_uri .= '/';
- } else {
- $base_url = 'http://localhost/';
- $base_uri = '/';
- }
- // Define these values to be used later on
- define('BASE_URL', $base_url);
- define('BASE_URI', $base_uri);
- define('APPPATH_URI', BASE_URI.APPPATH);
- // We dont need these variables any more
- unset($base_uri, $base_url);
- /*
- |--------------------------------------------------------------------------
- | PyroCMS Version
- |--------------------------------------------------------------------------
- |
- | Which version of PyroCMS is currently running?
- |
- */
- define('CMS_VERSION', '2.3.0-dev');