/
index.php
113 lines (96 loc) · 3.49 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/**
* This file acts as the "front controller" to your application. You can
* configure your application and system directories here, as well as error
* reporting and error display.
*
* @package Core
* @author Kohana Team
* @copyright (c) 2007 Kohana Team
* @license http://kohanaphp.com/license.html
*/
/**
* Kohana website application directory. This directory should contain your
* application configuration, controllers, models, views, and other resources.
*
* This path can be absolute or relative to this file.
*/
$kohana_application = 'application';
/**
* Kohana package files. This directory should contain the core/ directory, and
* the resources you included in your download of Kohana.
*
* This path can be absolute or relative to this file.
*/
$kohana_system = 'system';
/**
* Set the error reporting level. Unless you have a special need, E_ALL is a
* good level for error reporting.
*/
error_reporting(E_ALL & ~E_STRICT);
/**
* Turning off display_errors will effectively disable Kohana error display
* and logging. You can turn off Kohana errors in application/config/config.php
*/
ini_set('display_errors', TRUE);
/**
* If you rename all of your .php files to a different extension, set the new
* extension here. This option can left to .php, even if this file is has a
* different extension.
*/
define('EXT', '.php');
/**
* Test to make sure that Kohana is running on PHP 5.1.3 or newer. Once you are
* sure that your environment is compatible with Kohana, you can disable this.
*/
version_compare(PHP_VERSION, '5.1.3', '<') and exit('Kohana requires PHP 5.1.3 or newer.');
//
// DO NOT EDIT BELOW THIS LINE, UNLESS YOU FULLY UNDERSTAND THE IMPLICATIONS.
// ----------------------------------------------------------------------------
// $Id: index.php 1631 2007-12-28 00:11:38Z Shadowhand $
//
// Tests if system is running in unit testing mode
$unittest = (empty($_SERVER['SERVER_NAME']) && strpos(@$_SERVER['SCRIPT_NAME'], 'phpunit'));
// If unit testing change relative address of system and appplication folders
if ($unittest)
{
$kohana_application = dirname(__FILE__) . '/' . $kohana_application;
$kohana_system = dirname(__FILE__) . '/' . $kohana_system;
// Define the front controller name and docroot
define('DOCROOT', dirname(__FILE__) . '/');
define('KOHANA', substr(__FILE__, strlen(DOCROOT)));
}
else
{
// Define the front controller name and docroot
define('DOCROOT', getcwd().DIRECTORY_SEPARATOR);
define('KOHANA', substr(__FILE__, strlen(DOCROOT)));
}
// Define application and system paths
define('APPPATH', str_replace('\\', '/', realpath($kohana_application)).'/');
define('SYSPATH', str_replace('\\', '/', realpath($kohana_system)).'/');
// Clean up
unset($kohana_application, $kohana_system);
(is_dir(APPPATH)) or die
(
'Your <code>$kohana_application</code> directory does not exist. '.
'Set a valid <code>$kohana_application</code> in <tt>'.KOHANA.'</tt> and refresh the page.'
);
(is_dir(SYSPATH) AND file_exists(SYSPATH.'/core/'.'Bootstrap'.EXT)) or die
(
'Your <code>$kohana_system</code> directory does not exist. '.
'Set a valid <code>$kohana_system</code> in <tt>'.KOHANA.'</tt> and refresh the page.'
);
// Mail to developers
define('DEVELOPER_EMAIL_ADDRESS', 'bugs@freenetis.org');
// URL to AXO documentation web application
define('AXODOC_URL', 'http://axo.doc.freenetis.org/');
// If unit testing just initilize do not execute
if($unittest)
{
require 'tests/BootstrapPHPUnit'.EXT;
}
else
{
require SYSPATH.'core/Bootstrap'.EXT;
}