mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-25 00:30:17 +02:00
ADVICE: there is no Backwards Compatibility with custom tasks, those using the _config instance will be broken or those using the getEnvironmentName().
23 lines
676 B
PHP
23 lines
676 B
PHP
<?php
|
|
class Mage_Autoload
|
|
{
|
|
public static function autoload($className)
|
|
{
|
|
$baseDir = dirname(dirname(__FILE__));
|
|
$classFile = $baseDir . '/' . str_replace('_', '/', $className . '.php');
|
|
require_once $classFile;
|
|
}
|
|
|
|
public static function isLoadable($className)
|
|
{
|
|
$baseDir = dirname(dirname(__FILE__));
|
|
$classFile = $baseDir . '/' . str_replace('_', '/', $className . '.php');
|
|
return (file_exists($classFile) && is_readable($classFile));
|
|
}
|
|
|
|
public static function loadUserTask($taskName)
|
|
{
|
|
$classFile = '.mage/tasks/' . ucfirst($taskName) . '.php';
|
|
require_once $classFile;
|
|
}
|
|
} |