Merge pull request #343 from sparksp/patch-4
Consolidate Bundle::path and Bundle::location
This commit is contained in:
@@ -169,19 +169,6 @@ class Bundle {
|
||||
return $bundle == DEFAULT_BUNDLE or in_array(strtolower($bundle), static::names());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the full path location of a given bundle.
|
||||
*
|
||||
* @param string $bundle
|
||||
* @return string
|
||||
*/
|
||||
public static function location($bundle)
|
||||
{
|
||||
$location = array_get(static::$bundles, $bundle.'.location');
|
||||
|
||||
return path('bundle').str_finish($location, DS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a given bundle has been started for the request.
|
||||
*
|
||||
@@ -242,9 +229,14 @@ class Bundle {
|
||||
*/
|
||||
public static function path($bundle)
|
||||
{
|
||||
if (is_null($bundle)) return static::path(DEFAULT_BUNDLE);
|
||||
|
||||
return ($bundle == DEFAULT_BUNDLE) ? path('app') : static::location($bundle);
|
||||
if (is_null($bundle) or $bundle === DEFAULT_BUNDLE)
|
||||
{
|
||||
return path('app');
|
||||
}
|
||||
else if ($location = array_get(static::$bundles, $bundle.'.location'))
|
||||
{
|
||||
return str_finish(path('bundle').$location, DS);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user