more additions.

This commit is contained in:
Taylor Otwell
2011-08-19 21:39:38 -05:00
parent 9d2a76b26f
commit fb1acc31d2
3 changed files with 39 additions and 13 deletions

View File

@@ -33,7 +33,7 @@ class Loader {
{
static::$aliases = Config::get('aliases');
foreach ($paths as $path) { static::register($path); }
foreach ($paths as $path) { static::register_path($path); }
}
/**
@@ -113,15 +113,38 @@ class Loader {
}
/**
* Register a path with the auto-loader. After registering the path, it will be
* checked similarly to the models and libraries directories.
* Register a path with the auto-loader.
*
* After registering the path, it will be checked similarly to the models and libraries directories.
*
* @param string $path
* @return void
*/
public static function register($path)
public static function register_path($path)
{
static::$paths[] = rtrim($path, '/').'/';
}
/**
* Register an alias with the auto-loader.
*
* @param array $alias
* @return void
*/
public static function register_alias($alias)
{
static::$aliases = array_merge(static::$aliases, $alias);
}
/**
* Remove an alias from the auto-loader's list of aliases.
*
* @param string $alias
* @return void
*/
public static function forget_alias($alias)
{
unset(static::$aliases[$alias]);
}
}