Bug fixes
This commit is contained in:
@@ -8,6 +8,12 @@ class SihnonFramework_Exception_AlreadyInitialisted extends SihnonFramework_E
|
|||||||
class SihnonFramework_Exception_NotImplemented extends SihnonFramework_Exception {};
|
class SihnonFramework_Exception_NotImplemented extends SihnonFramework_Exception {};
|
||||||
class SihnonFramework_Exception_MissingDefinition extends SihnonFramework_Exception {};
|
class SihnonFramework_Exception_MissingDefinition extends SihnonFramework_Exception {};
|
||||||
|
|
||||||
|
class SihnonFramework_Exception_TemplateException extends SihnonFramework_Exception {};
|
||||||
|
class SihnonFramework_Exception_AbortEntirePage extends SihnonFramework_Exception_TemplateException {};
|
||||||
|
class SihnonFramework_Exception_Unauthorized extends SihnonFramework_Exception_TemplateException {};
|
||||||
|
class SihnonFramework_Exception_FileNotFound extends SihnonFramework_Exception_TemplateException {};
|
||||||
|
class SihnonFramework_Exception_InvalidParameters extends SihnonFramework_Exception_TemplateException {};
|
||||||
|
|
||||||
class SihnonFramework_Exception_DatabaseException extends SihnonFramework_Exception {};
|
class SihnonFramework_Exception_DatabaseException extends SihnonFramework_Exception {};
|
||||||
class SihnonFramework_Exception_DatabaseConfigMissing extends SihnonFramework_Exception_DatabaseException {};
|
class SihnonFramework_Exception_DatabaseConfigMissing extends SihnonFramework_Exception_DatabaseException {};
|
||||||
class SihnonFramework_Exception_DatabaseConnectFailed extends SihnonFramework_Exception_DatabaseException {};
|
class SihnonFramework_Exception_DatabaseConnectFailed extends SihnonFramework_Exception_DatabaseException {};
|
||||||
@@ -24,6 +30,5 @@ class SihnonFramework_Exception_CacheObjectNotFound extends SihnonFramework_E
|
|||||||
|
|
||||||
class SihnonFramework_Exception_InvalidPluginName extends SihnonFramework_Exception {};
|
class SihnonFramework_Exception_InvalidPluginName extends SihnonFramework_Exception {};
|
||||||
|
|
||||||
class SihnonFramework_Exception_FileNotFound extends SihnonFramework_Exception {};
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -116,7 +116,10 @@ class SihnonFramework_Main {
|
|||||||
if (preg_match("/^{$class['base']}_/", $classname)) {
|
if (preg_match("/^{$class['base']}_/", $classname)) {
|
||||||
// Special case: all related exceptions are grouped into a single file
|
// Special case: all related exceptions are grouped into a single file
|
||||||
if (preg_match("/^({$class['base']}_(?:.*?_)?)Exception/", $classname, $matches)) {
|
if (preg_match("/^({$class['base']}_(?:.*?_)?)Exception/", $classname, $matches)) {
|
||||||
require_once($class['base_dir_prefix'] . preg_replace('/_/', '/', $matches[1]) . 'Exceptions.class.php');
|
$exceptions_filename = $class['base_dir_prefix'] . preg_replace('/_/', '/', $matches[1]) . 'Exceptions.class.php';
|
||||||
|
if (file_exists($exceptions_filename)) {
|
||||||
|
require_once($exceptions_filename);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,7 +234,7 @@ class SihnonFramework_Main {
|
|||||||
return $var;
|
return $var;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_string($default) && preg_match('/^Sihnon(Framework)?_Exception/', $default) && class_exists($default) && is_subclass_of($default, SihnonFramework_Exception)) {
|
if (is_string($default) && preg_match('/^Sihnon(Framework)?_Exception/', $default) && class_exists($default) && is_subclass_of($default, 'SihnonFramework_Exception')) {
|
||||||
throw new $default();
|
throw new $default();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ abstract class SihnonFramework_PluginFactory implements Sihnon_IPluginFactory {
|
|||||||
$plugins = array();
|
$plugins = array();
|
||||||
|
|
||||||
if (! is_array($directories)) {
|
if (! is_array($directories)) {
|
||||||
$directories = array(SihnonLib => $directories);
|
$directories = array(Sihnon_Lib => $directories);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($directories as $base_dir => $directory) {
|
foreach ($directories as $base_dir => $directory) {
|
||||||
@@ -87,4 +87,4 @@ abstract class SihnonFramework_PluginFactory implements Sihnon_IPluginFactory {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class SihnonFramework_RequestParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function exists($key) {
|
public function exists($key) {
|
||||||
return isset($this->vars[$key]);
|
return array_key_exists($key, $this->vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get($key, $default = null) {
|
public function get($key, $default = null) {
|
||||||
@@ -81,7 +81,7 @@ class SihnonFramework_RequestParser {
|
|||||||
return $this->vars[$key];
|
return $this->vars[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_string($default) && preg_match('/^[a-zA-Z_]+_Exception/', $default) && class_exists($default) && is_subclass_of($default, SihnonFramework_Exception)) {
|
if (is_string($default) && preg_match('/^[a-zA-Z_]+_Exception/', $default) && class_exists($default) && is_subclass_of($default, 'SihnonFramework_Exception')) {
|
||||||
throw new $default();
|
throw new $default();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user