Updated install and fixed bugs
Added session messages display Fixed field and validator loading. Updated form validation Updated root config management Muted error reporting in file evaluation Added menu updates Fixed galaxy data access error Fixed config bug Added HTTP request method checks Added Form manager Fixed core bugs Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
parent
c38e53706e
commit
9636b4bb00
69 changed files with 2434 additions and 789 deletions
|
|
@ -197,7 +197,7 @@ class Wootook
|
|||
return self::$_defaultLocale;
|
||||
}
|
||||
|
||||
public function getPreferredLocale($availableLocales = array())
|
||||
public static function getPreferredLocale($availableLocales = array())
|
||||
{
|
||||
if (empty($availableLocales)) {
|
||||
return self::getDefaultLocale();
|
||||
|
|
@ -255,6 +255,9 @@ class Wootook
|
|||
return self::$_now;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Wootook_Core_Controller_Request_Http
|
||||
*/
|
||||
public static function getRequest()
|
||||
{
|
||||
if (self::$_request === null) {
|
||||
|
|
@ -268,6 +271,9 @@ class Wootook
|
|||
self::$_request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Wootook_Core_Controller_Response_Http
|
||||
*/
|
||||
public static function getResponse()
|
||||
{
|
||||
if (self::$_response === null) {
|
||||
|
|
@ -281,11 +287,20 @@ class Wootook
|
|||
self::$_response = $response;
|
||||
}
|
||||
|
||||
public static function getConfig($path = null)
|
||||
private static function _loadConfig()
|
||||
{
|
||||
if (self::$_config === null) {
|
||||
self::$_config = include ROOT_PATH . DIRECTORY_SEPARATOR . 'config.php';
|
||||
|
||||
if (!is_array(self::$_config)) {
|
||||
self::$_config = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function getConfig($path = null)
|
||||
{
|
||||
self::_loadConfig();
|
||||
|
||||
if ($path === null || !is_string($path)) {
|
||||
return self::$_config;
|
||||
|
|
@ -300,6 +315,25 @@ class Wootook
|
|||
return $config;
|
||||
}
|
||||
|
||||
public static function setConfig($path = null, $value)
|
||||
{
|
||||
self::_loadConfig();
|
||||
|
||||
if ($path === null || !is_string($path)) {
|
||||
return self::$_config;
|
||||
}
|
||||
$config = &self::$_config;
|
||||
foreach (explode('/', $path) as $chunk) {
|
||||
if (!isset($config[$chunk])) {
|
||||
$config[$chunk] = array();
|
||||
}
|
||||
$config = &$config[$chunk];
|
||||
}
|
||||
$config = $value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function getBaseUrl()
|
||||
{
|
||||
return self::getConfig('global/web/base_url');
|
||||
|
|
@ -333,10 +367,13 @@ class Wootook
|
|||
return false;
|
||||
}
|
||||
|
||||
Wootook_Core_ErrorProfiler::sleep();
|
||||
if (($fp = @fopen($path, 'r', true)) === false) {
|
||||
Wootook_Core_ErrorProfiler::wakeup();
|
||||
return false;
|
||||
}
|
||||
fclose($fp);
|
||||
Wootook_Core_ErrorProfiler::wakeup();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue