Minor updatess

This commit is contained in:
Deon George
2013-02-26 14:19:32 +11:00
parent 288d974cfa
commit 2cdd130d1a
16 changed files with 117 additions and 50 deletions

View File

@@ -31,15 +31,6 @@ class Config extends Kohana_Config {
public function __construct() {
if (defined('PHPUNITTEST'))
$_SERVER['SERVER_NAME'] = PHPUNITTEST;
// We need to know our site here, so that we can subsequently load our enabled modules.
if (Kohana::$is_cli) {
if (! $site = Minion_CLI::options('site'))
// @todo Need to figure out how to make this CLI error nicer.
throw new Minion_Exception_InvalidTask(_('Cant figure out the site, use --site= for CLI'));
else
$_SERVER['SERVER_NAME'] = $site;
}
}
/**
@@ -116,9 +107,19 @@ class Config extends Kohana_Config {
public static function modules() {
static $return = array();
if (! count($return))
if (! count($return)) {
// We need to know our site here, so that we can subsequently load our enabled modules.
if (PHP_SAPI === 'cli') {
if (! $site = Minion_CLI::options('site'))
// @todo Need to figure out how to make this CLI error nicer.
throw new Minion_Exception_InvalidTask(_('Cant figure out the site, use --site= for CLI'));
else
$_SERVER['SERVER_NAME'] = $site;
}
foreach (ORM::factory('Module')->list_external() as $mo)
$return[$mo->name] = MODPATH.$mo->name;
}
return $return;
}

View File

@@ -16,6 +16,7 @@ class URL extends Kohana_URL {
'admin'=>'a',
'affiliate'=>'affiliate', // @todo To retire
'reseller'=>'r',
'task'=>'task',
'user'=>'u',
);