This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
tsmac/application/classes/Config.php
2014-10-09 23:23:02 +11:00

66 lines
1.6 KiB
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class extends the core Kohana class by adding some core application
* specific functions, and configuration.
*
* @package TSM Access Management
* @category Helpers
* @author Deon George
* @copyright (c) 2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Config extends Kohana_Config {
/**
* Some early initialisation
*
* At this point, KH hasnt been fully initialised either, so we cant rely on
* too many KH functions yet.
*
* NOTE: Kohana doesnt provide a parent construct for the Kohana_Config class.
*/
public function __construct() {
}
/**
* Get the singleton instance of Config.
*
* $config = Config::instance();
*
* @return Config
* @compat Restore KH 3.1 functionality
*/
public static function instance() {
if (Config::$_instance === NULL)
// Create a new instance
Config::$_instance = new Config;
return Config::$_instance;
}
public static function Copywrite($html=FALSE) {
return ($html ? '&copy;' : '(c)').' 2014 IBM';
}
public static function version() {
// @todo Work out our versioning
return 'TBA';
}
/**
* See if our emails for the template should be sent to configured admin(s)
*
* @param string template - Template to test for
* @return mixed|array - Email to send test emails to
*/
public static function testmail($template) {
$config = Kohana::$config->load('debug')->email_admin_only;
if (is_null($config) OR ! is_array($config) OR empty($config[$template]))
return FALSE;
else
return $config[$template];
}
}
?>