Merge branch 'maint/7.0'
[ninja.git] / index.php
blobfc1679de05c2d459da3f07203cf5f4120bcebe0f
1 <?php
2 /**
3 * This file acts as the "front controller" to your application. You can
4 * configure your application, modules, and system directories here.
5 * PHP error_reporting level may also be changed.
7 * @see http://kohanaphp.com
8 */
10 /**
11 * Define the website environment status. When this flag is set to TRUE, some
12 * module demonstration controllers will result in 404 errors. For more information
13 * about this option, read the documentation about deploying Kohana.
15 * @see http://docs.kohanaphp.com/installation/deployment
17 define('IN_PRODUCTION', FALSE);
19 /**
20 * Website application directory. This directory should contain your application
21 * configuration, controllers, models, views, and other resources.
23 * This path can be absolute or relative to this file.
25 $kohana_application = 'application';
27 /**
28 * Kohana modules directory. This directory should contain all the modules used
29 * by your application. Modules are enabled and disabled by the application
30 * configuration file.
32 * This path can be absolute or relative to this file.
34 $kohana_modules = 'modules';
36 /**
37 * Kohana system directory. This directory should contain the core/ directory,
38 * and the resources you included in your download of Kohana.
40 * This path can be absolute or relative to this file.
42 $kohana_system = 'system';
44 /**
45 * Set the error reporting level. Unless you have a special need, E_ALL is a
46 * good level for error reporting.
48 #error_reporting(E_ALL & ~E_STRICT);
50 /**
51 * Turning off display_errors will effectively disable Kohana error display
52 * and logging. You can turn off Kohana errors in application/config/config.php
54 ini_set('display_errors', TRUE);
56 /**
57 * If you rename all of your .php files to a different extension, set the new
58 * extension here. This option can left to .php, even if this file has a
59 * different extension.
61 define('EXT', '.php');
64 // DO NOT EDIT BELOW THIS LINE, UNLESS YOU FULLY UNDERSTAND THE IMPLICATIONS.
65 // ----------------------------------------------------------------------------
66 // $Id: index.php 3917 2009-01-21 03:06:22Z zombor $
69 $kohana_pathinfo = pathinfo(__FILE__);
70 // Define the front controller name and docroot
71 define('DOCROOT', $kohana_pathinfo['dirname'].DIRECTORY_SEPARATOR);
72 define('KOHANA', $kohana_pathinfo['basename']);
74 // If the front controller is a symlink, change to the real docroot
75 is_link(KOHANA) and chdir(dirname(realpath(__FILE__)));
77 // If kohana folders are relative paths, make them absolute.
78 $kohana_application = DOCROOT.$kohana_application;
79 $kohana_modules = DOCROOT.$kohana_modules;
80 $kohana_system = DOCROOT.$kohana_system;
82 // Define application and system paths
83 define('APPPATH', str_replace('\\', '/', realpath($kohana_application)).'/');
84 define('MODPATH', str_replace('\\', '/', realpath($kohana_modules)).'/');
85 define('SYSPATH', str_replace('\\', '/', realpath($kohana_system)).'/');
87 // Clean up
88 unset($kohana_application, $kohana_modules, $kohana_system);
90 if (file_exists(DOCROOT.'install'.EXT))
92 // Load the installation tests
93 include DOCROOT.'install'.EXT;
95 else
97 // Initialize Kohana
98 require SYSPATH.'core/Bootstrap'.EXT;