1<?php 2/** 3 * @PKG_NAME@–@PKG_VERSION@ 4 * This file acts as the "front controller" to your application. You can 5 * configure your application, modules, and system directories here. 6 * PHP error_reporting level may also be changed. 7 * 8 * @see http://kohanaphp.com 9 */ 10 11define('PNP_NAME' , '@PKG_NAME@'); 12define('PNP_VERSION' , '@PKG_VERSION@'); 13define('PNP_REL_DATE' , '@PKG_REL_DATE@'); 14define('PNP_ETC_PATH' , '@sysconfdir@'); 15define('PNP_LOG_PATH' , '@localstatedir@'); 16 17/** 18 * Define the website environment status. When this flag is set to TRUE, some 19 * module demonstration controllers will result in 404 errors. For more information 20 * about this option, read the documentation about deploying Kohana. 21 * 22 * @see http://docs.kohanaphp.com/installation/deployment 23 */ 24define('IN_PRODUCTION', TRUE); 25 26/** 27 * 28 * OMD path detection 29 * 30 */ 31if(substr($_SERVER["SCRIPT_FILENAME"], 0, 4) == '/omd') { 32 define('OMD', TRUE); 33 $site_parts = array_slice(explode('/' ,dirname($_SERVER["SCRIPT_FILENAME"])), 0, -3); 34 define('OMD_SITE_ROOT', join($site_parts, '/')); 35 define('OMD_SITE', $site_parts[count($site_parts)-1]); 36 unset($site_parts); 37}else{ 38 define('OMD', FALSE); 39} 40 41 42/** 43 * 44 * Autodetect base URL 45 * 46 */ 47define('BASE_URL' , dirname($_SERVER["SCRIPT_NAME"])); 48 49/** 50* The current XML Structure Tag for this PNP Version 51*/ 52define('XML_STRUCTURE_VERSION', '@XML_STRUCTURE_VERSION@'); 53 54/** 55 * Website application directory. This directory should contain your application 56 * configuration, controllers, models, views, and other resources. 57 * 58 * This path can be absolute or relative to this file. 59 */ 60$kohana_application = 'application'; 61 62/** 63 * Kohana modules directory. This directory should contain all the modules used 64 * by your application. Modules are enabled and disabled by the application 65 * configuration file. 66 * 67 * This path can be absolute or relative to this file. 68 */ 69$kohana_modules = 'modules'; 70 71/** 72 * Kohana system directory. This directory should contain the core/ directory, 73 * and the resources you included in your download of Kohana. 74 * 75 * This path can be absolute or relative to this file. 76 */ 77$kohana_system = '@KOHANA_SYSTEM@'; 78 79/** 80 * Test to make sure that Kohana is running on PHP 5.2 or newer. Once you are 81 * sure that your environment is compatible with Kohana, you can comment this 82 * line out. When running an application on a new server, uncomment this line 83 * to check the PHP version quickly. 84 */ 85version_compare(PHP_VERSION, '5.1', '<') and exit('Kohana requires PHP 5.1 or newer.'); 86 87/** 88 * Set the error reporting level. Unless you have a special need, E_ALL is a 89 * good level for error reporting. 90 */ 91error_reporting(E_ALL & ~E_STRICT); 92 93/** 94 * Turning off display_errors will effectively disable Kohana error display 95 * and logging. You can turn off Kohana errors in application/config/config.php 96 */ 97ini_set('display_errors', TRUE); 98 99/** 100 * If you rename all of your .php files to a different extension, set the new 101 * extension here. This option can left to .php, even if this file has a 102 * different extension. 103 */ 104define('EXT', '.php'); 105 106// 107// DO NOT EDIT BELOW THIS LINE, UNLESS YOU FULLY UNDERSTAND THE IMPLICATIONS. 108// ---------------------------------------------------------------------------- 109// 110 111// Force default timezone 112if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")){ 113 @date_default_timezone_set(@date_default_timezone_get()); 114} 115 116$kohana_pathinfo = pathinfo(__FILE__); 117// Define the front controller name and docroot 118define('DOCROOT', $kohana_pathinfo['dirname'].DIRECTORY_SEPARATOR); 119define('KOHANA', $kohana_pathinfo['basename']); 120 121// If the front controller is a symlink, change to the real docroot 122is_link(KOHANA) and chdir(dirname(realpath(__FILE__))); 123 124// If kohana folders are relative paths, make them absolute. 125$kohana_application = file_exists($kohana_application) ? $kohana_application : DOCROOT.$kohana_application; 126$kohana_modules = file_exists($kohana_modules) ? $kohana_modules : DOCROOT.$kohana_modules; 127$kohana_system = file_exists($kohana_system) ? $kohana_system : DOCROOT.$kohana_system; 128 129// Define application and system paths 130define('APPPATH', str_replace('\\', '/', realpath($kohana_application)).'/'); 131define('MODPATH', str_replace('\\', '/', realpath($kohana_modules)).'/'); 132define('SYSPATH', str_replace('\\', '/', realpath($kohana_system)).'/'); 133// JSON Wrapper used for PHP 5.1.x 134require('application/lib/jsonwrapper.php'); 135// Clean up 136unset($kohana_application, $kohana_modules, $kohana_system); 137 138if (file_exists(DOCROOT.'install'.EXT) && !file_exists(DOCROOT.'install.ignore')){ 139 // Load the installation tests 140 include DOCROOT.'install'.EXT; 141} 142else 143{ 144 // Initialize Kohana 145 require SYSPATH.'core/Bootstrap'.EXT; 146} 147 148 149