refactoring various classes.

This commit is contained in:
Taylor Otwell
2011-11-22 18:00:17 -06:00
parent 246434f4c7
commit 5f348b2c6e
14 changed files with 373 additions and 210 deletions

View File

@@ -63,9 +63,12 @@ class Config {
return ($default instanceof Closure) ? call_user_func($default) : $default;
}
if (is_null($key)) return static::$items[$file];
$items = static::$items[$file];
return Arr::get(static::$items[$file], $key, $default);
// If a specific configuration item was not requested, the key will be null,
// meaning we need to return the entire array of configuration item from the
// requested configuration file. Otherwise we can return the item.
return (is_null($key)) ? $items : Arr::get($items, $key, $default);
}
/**
@@ -152,15 +155,4 @@ class Config {
return isset(static::$items[$file]);
}
/**
* Add a directory to the configuration manager's search paths.
*
* @param string $path
* @return void
*/
public static function glance($path)
{
static::$paths[] = $path;
}
}