mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-05 00:48:57 +02:00
PHPStorm refactoring.
This commit is contained in:
+7
-8
@@ -17,21 +17,20 @@ namespace Mage;
|
||||
*/
|
||||
class Autoload
|
||||
{
|
||||
/**
|
||||
* Autoload a Class by it's Class Name
|
||||
* @param string $className
|
||||
/**
|
||||
* Autoload a Class by it's Class Name
|
||||
* @param string $className
|
||||
* @return boolean
|
||||
*/
|
||||
*/
|
||||
public function autoLoad($className)
|
||||
{
|
||||
$className = ltrim($className, '/');
|
||||
$postfix = '/' . str_replace(array('_', '\\'), '/', $className . '.php');
|
||||
$postfix = '/' . str_replace(array('_', '\\'), '/', $className . '.php');
|
||||
|
||||
//Try to load a normal Mage class (or Task). Think that Mage component is compiled to .phar
|
||||
$baseDir = dirname(dirname(__FILE__));
|
||||
$classFileWithinPhar = $baseDir . $postfix;
|
||||
if($this->isReadable($classFileWithinPhar))
|
||||
{
|
||||
if ($this->isReadable($classFileWithinPhar)) {
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
require_once $classFileWithinPhar;
|
||||
return true;
|
||||
@@ -39,7 +38,7 @@ class Autoload
|
||||
|
||||
//Try to load a custom Task or Class. Notice that the path is absolute to CWD
|
||||
$classFileOutsidePhar = getcwd() . '/.mage/tasks' . $postfix;
|
||||
if($this->isReadable($classFileOutsidePhar)){
|
||||
if ($this->isReadable($classFileOutsidePhar)) {
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
require_once $classFileOutsidePhar;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user