// Norm
This commit is contained in:
1 parent
f808f43258
commit
2e59d72884
1 file changed
+3
-3
@@ -105,9 +105,7 @@ class Autoload
|
|||||||
{
|
{
|
||||||
// request a non Core Class load the associated Core class if exists
|
// request a non Core Class load the associated Core class if exists
|
||||||
if (isset($this->index[$classname.'Core']))
|
if (isset($this->index[$classname.'Core']))
|
||||||
{
|
|
||||||
require_once($this->root_dir.$this->index[$classname.'Core']);
|
require_once($this->root_dir.$this->index[$classname.'Core']);
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($this->index[$classname]))
|
if (isset($this->index[$classname]))
|
||||||
require_once($this->root_dir.$this->index[$classname]);
|
require_once($this->root_dir.$this->index[$classname]);
|
||||||
@@ -158,7 +156,9 @@ class Autoload
|
|||||||
else if (substr($file, -4) == '.php')
|
else if (substr($file, -4) == '.php')
|
||||||
{
|
{
|
||||||
$content = file_get_contents($this->root_dir.$path.$file);
|
$content = file_get_contents($this->root_dir.$path.$file);
|
||||||
if (preg_match('#\W((abstract\s+)?class|interface)\s+(?P<classname>'.basename($file, '.php').'(Core)?)(\s+(extends|implements)\s+[a-z][a-z0-9_]*)?\s*\{#i', $content, $m))
|
$pattern = '#\W((abstract\s+)?class|interface)\s+(?P<classname>'.basename($file, '.php')
|
||||||
|
.'(Core)?)(\s+(extends|implements)\s+[a-z][a-z0-9_]*)?\s*\{#i';
|
||||||
|
if (preg_match($pattern, $content, $m))
|
||||||
{
|
{
|
||||||
$classes[$m['classname']] = $path.$file;
|
$classes[$m['classname']] = $path.$file;
|
||||||
if (substr($m['classname'], -4) == 'Core')
|
if (substr($m['classname'], -4) == 'Core')
|
||||||
|
|||||||
Reference in new issue
Block a user