Fixed minor bugs
[speedfreak] / Server / index.php
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.
6  *
7  * @see http://kohanaphp.com
8  */
9
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.
14  *
15  * @see http://docs.kohanaphp.com/installation/deployment
16  */
17 define('IN_PRODUCTION', FALSE);
18
19 /**
20  * Website application directory. This directory should contain your application
21  * configuration, controllers, models, views, and other resources.
22  *
23  * This path can be absolute or relative to this file.
24  */
25 $kohana_application = 'application';
26
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.
31  *
32  * This path can be absolute or relative to this file.
33  */
34 $kohana_modules = 'modules';
35
36 /**
37  * Kohana system directory. This directory should contain the core/ directory,
38  * and the resources you included in your download of Kohana.
39  *
40  * This path can be absolute or relative to this file.
41  */
42 $kohana_system = 'system';
43
44 /**
45  * Test to make sure that Kohana is running on PHP 5.2 or newer. Once you are
46  * sure that your environment is compatible with Kohana, you can comment this
47  * line out. When running an application on a new server, uncomment this line
48  * to check the PHP version quickly.
49  */
50 version_compare(PHP_VERSION, '5.2', '<') and exit('Kohana requires PHP 5.2 or newer.');
51
52 /**
53  * Set the error reporting level. Unless you have a special need, E_ALL is a
54  * good level for error reporting.
55  */
56 error_reporting(E_ALL & ~E_STRICT);
57
58 /**
59  * Turning off display_errors will effectively disable Kohana error display
60  * and logging. You can turn off Kohana errors in application/config/config.php
61  */
62 ini_set('display_errors', TRUE);
63
64 /**
65  * If you rename all of your .php files to a different extension, set the new
66  * extension here. This option can left to .php, even if this file has a
67  * different extension.
68  */
69 define('EXT', '.php');
70
71 //
72 // DO NOT EDIT BELOW THIS LINE, UNLESS YOU FULLY UNDERSTAND THE IMPLICATIONS.
73 // ----------------------------------------------------------------------------
74 // $Id: index.php 3915 2009-01-20 20:52:20Z zombor $
75 //
76
77 $kohana_pathinfo = pathinfo(__FILE__);
78 // Define the front controller name and docroot
79 define('DOCROOT', $kohana_pathinfo['dirname'].DIRECTORY_SEPARATOR);
80 define('KOHANA',  $kohana_pathinfo['basename']);
81
82 // If the front controller is a symlink, change to the real docroot
83 is_link(KOHANA) and chdir(dirname(realpath(__FILE__)));
84
85 // If kohana folders are relative paths, make them absolute.
86 $kohana_application = file_exists($kohana_application) ? $kohana_application : DOCROOT.$kohana_application;
87 $kohana_modules = file_exists($kohana_modules) ? $kohana_modules : DOCROOT.$kohana_modules;
88 $kohana_system = file_exists($kohana_system) ? $kohana_system : DOCROOT.$kohana_system;
89
90 // Define application and system paths
91 define('APPPATH', str_replace('\\', '/', realpath($kohana_application)).'/');
92 define('MODPATH', str_replace('\\', '/', realpath($kohana_modules)).'/');
93 define('SYSPATH', str_replace('\\', '/', realpath($kohana_system)).'/');
94
95 // Clean up
96 unset($kohana_application, $kohana_modules, $kohana_system);
97
98 if (file_exists(DOCROOT.'install'.EXT))
99 {
100         // Load the installation tests
101         include DOCROOT.'install'.EXT;
102 }
103 else
104 {
105         // Initialize Kohana
106         require SYSPATH.'core/Bootstrap'.EXT;
107 }