fixing underscored library auto-loading.

Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
Taylor Otwell
2012-02-27 14:08:01 -06:00
parent 2fdde4ad2f
commit ca5dfa4061
2 changed files with 64 additions and 17 deletions

View File

@@ -365,13 +365,14 @@ function str_finish($value, $cap)
* Get the root namespace of a given class.
*
* @param string $class
* @param string $separator
* @return string
*/
function root_namespace($class)
function root_namespace($class, $separator = '\\')
{
if (str_contains($class, '\\'))
if (str_contains($class, $separator))
{
return head(explode('\\', $class));
return head(explode($separator, $class));
}
}