Commit 8bc128fd authored by Taylor Otwell's avatar Taylor Otwell

cleaning up code.

parent 9ad6fabc
<?php namespace Laravel; defined('DS') or die('No direct script access.');
<?php namespace Laravel;
class Asset {
......
<?php namespace Laravel; defined('DS') or die('No direct script access.');
<?php namespace Laravel;
class Autoloader {
......@@ -52,7 +52,7 @@ class Autoloader {
// called again for the "real" class name to load its file.
if (isset(static::$aliases[$class]))
{
class_alias(static::$aliases[$class], $class);
return class_alias(static::$aliases[$class], $class);
}
// All classes in Laravel are staticly mapped. There is no crazy search
......@@ -76,17 +76,6 @@ class Autoloader {
}
}
// If the class uses PEAR-ish style underscores for indicating its
// directory structure we'll load the class using PSR-0 standards
// standards from that directory, trimming the root.
foreach (static::$underscored as $prefix => $directory)
{
if (starts_with($class, $prefix))
{
return static::load_namespaced($class, $prefix, $directory);
}
}
// If all else fails we will just iterator through the mapped
// PSR-0 directories looking for the class. This is the last
// resort and slowest loading option for the class.
......@@ -177,29 +166,28 @@ class Autoloader {
}
/**
* Register underscored "namespaces" to directory mappings.
* Map namespaces to directories.
*
* @param array $mappings
* @param array $mappings
* @param string $append
* @return void
*/
public static function underscored($mappings)
public static function namespaces($mappings, $append = '\\')
{
$mappings = static::format_mappings($mappings, '_');
$mappings = static::format_mappings($mappings, $append);
static::$underscored = array_merge($mappings, static::$underscored);
static::$namespaces = array_merge($mappings, static::$namespaces);
}
/**
* Map namespaces to directories.
* Register underscored "namespaces" to directory mappings.
*
* @param array $mappings
* @return void
*/
public static function namespaces($mappings)
public static function underscored($mappings)
{
$mappings = static::format_mappings($mappings, '\\');
static::$namespaces = array_merge($mappings, static::$namespaces);
static::namespaces($mappings, '_');
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment