PHPStorm refactoring.

This commit is contained in:
Andrés Montañez
2014-08-06 14:01:39 -03:00
parent 4c584b2634
commit fddeebe59a
48 changed files with 2011 additions and 1996 deletions
+7 -8
View File
@@ -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;