Projekt

Obecné

Profil

Stáhnout (3.49 KB) Statistiky
| Větev: | Tag: | Revize:
<?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;
}
(7-7/8)