// replace !is_core by substr($classname, -4) != 'Core'

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7947 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
fBrignoli
2011-08-08 15:52:23 +00:00
parent f0ee603966
commit 58769824ce
+10 -9
View File
@@ -36,7 +36,7 @@ class Autoload
* @var Autoload * @var Autoload
*/ */
protected static $instance; protected static $instance;
/** /**
* @var string Root directory * @var string Root directory
*/ */
@@ -56,7 +56,7 @@ class Autoload
/** /**
* Get instance of autoload (singleton) * Get instance of autoload (singleton)
* *
* @return Autoload * @return Autoload
*/ */
public static function getInstance() public static function getInstance()
@@ -66,10 +66,10 @@ class Autoload
return Autoload::$instance; return Autoload::$instance;
} }
/** /**
* Retrive informations about a class in classes index and load it * Retrieve informations about a class in classes index and load it
* *
* @param string $classname * @param string $classname
*/ */
public function load($classname) public function load($classname)
@@ -78,7 +78,7 @@ class Autoload
$this->generateIndex(); $this->generateIndex();
// If $classname has not core suffix (E.g. Shop, Product) // If $classname has not core suffix (E.g. Shop, Product)
if (substr($classname, -4) == 'Core') if (substr($classname, -4) != 'Core')
{ {
// If requested class does not exist, load associated core class // If requested class does not exist, load associated core class
if (isset($this->index[$classname]) && !$this->index[$classname]) if (isset($this->index[$classname]) && !$this->index[$classname])
@@ -135,9 +135,9 @@ class Autoload
} }
/** /**
* Retrive recursively all classes in a directory and its subdirectories * Retrieve recursively all classes in a directory and its subdirectories
* *
* @param unknown_type $path Relativ path from root to the directory * @param string $path Relativ path from root to the directory
* @return array * @return array
*/ */
protected function getClassesFromDir($path) protected function getClassesFromDir($path)
@@ -166,3 +166,4 @@ class Autoload
return $classes; return $classes;
} }
} }