2011-12-29 23:54:54 +00:00
|
|
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class overrides Kohana's Core
|
|
|
|
*
|
|
|
|
* @package OSB/Modifications
|
|
|
|
* @category Classes
|
|
|
|
* @category Helpers
|
|
|
|
* @author Deon George
|
|
|
|
* @copyright (c) 2010 Deon George
|
|
|
|
* @license http://dev.leenooks.net/license.html
|
|
|
|
*/
|
2012-11-09 23:13:57 +00:00
|
|
|
abstract class Kohana extends Kohana_Core {
|
|
|
|
/**
|
|
|
|
* @compat Restore KH 3.1 functionality
|
|
|
|
* @var boolean True if Kohana is running from the command line
|
|
|
|
*/
|
|
|
|
public static $is_cli = FALSE;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @compat Restore KH 3.1 functionality
|
|
|
|
*/
|
|
|
|
public static function init(array $settings = NULL) {
|
|
|
|
parent::init($settings);
|
|
|
|
|
|
|
|
// Determine if we are running in a command line environment
|
|
|
|
Kohana::$is_cli = (PHP_SAPI === 'cli');
|
|
|
|
}
|
|
|
|
|
2011-12-29 23:54:54 +00:00
|
|
|
/**
|
|
|
|
* Override Kohana's shutdown_handler()
|
|
|
|
*
|
|
|
|
* When set up for multi-site, we need to disable Kohana's caching
|
|
|
|
* unless each site has exactly the same modules enabled.
|
|
|
|
* This is because Kohana::$file is cached with the enabled modules
|
|
|
|
* and is not OSB multi-site aware.
|
|
|
|
*/
|
|
|
|
public static function shutdown_handler() {
|
|
|
|
// If caching isnt enabled, we can skip this anyway
|
|
|
|
if (! Kohana::$caching)
|
2012-11-09 23:13:57 +00:00
|
|
|
return parent::shutdown_handler();
|
2011-12-29 23:54:54 +00:00
|
|
|
|
|
|
|
Kohana::$caching = FALSE;
|
|
|
|
$result = parent::shutdown_handler();
|
|
|
|
Kohana::$caching = TRUE;
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
}
|
2013-01-15 06:07:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Work out our Class Name as per Kohana's standards
|
|
|
|
*/
|
|
|
|
public static function classname($name) {
|
|
|
|
return str_replace(' ','_',ucwords(strtolower(str_replace('_',' ',$name))));
|
|
|
|
}
|
2011-12-29 23:54:54 +00:00
|
|
|
}
|
|
|
|
?>
|