magallanes/Mage/Autoload.php
Andrés Montañez 811c83e13a Major overhauling and refactoring of Magallanes Command and Tasks modulairty and workflow.
ADVICE: there is no Backwards Compatibility with custom tasks, those
using the _config instance will be broken or those using the
getEnvironmentName().
2012-09-21 00:23:07 -03:00

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;
}
}