[+] Classes: Add PHP exceptions support + handler

This commit is contained in:
rMalie
2011-09-27 12:10:47 +00:00
parent d490598642
commit 473f26bd13
21 changed files with 410 additions and 50 deletions
+4 -2
View File
@@ -78,7 +78,10 @@ class Autoload
public function load($classname)
{
// regenerate the class index if the requested class is not found in the index or if the requested file doesn't exists
if (!isset($this->index[$classname]) || ($this->index[$classname] && !file_exists($this->root_dir.$this->index[$classname])))
if (!isset($this->index[$classname])
|| ($this->index[$classname] && !is_file($this->root_dir.$this->index[$classname]))
|| (isset($this->index[$classname.'Core']) && $this->index[$classname.'Core'] && !is_file($this->root_dir.$this->index[$classname]))
)
$this->generateIndex();
// If $classname has not core suffix (E.g. Shop, Product)
@@ -87,7 +90,6 @@ class Autoload
// If requested class does not exist, load associated core class
if (isset($this->index[$classname]) && !$this->index[$classname])
{
require_once($this->root_dir.$this->index[$classname.'Core']);
if (file_exists($this->root_dir.'override/'.$this->index[$classname.'Core']))
{