diff options
author | rojaro <> | 2010-09-02 15:55:55 +0000 |
---|---|---|
committer | rojaro <> | 2010-09-02 15:55:55 +0000 |
commit | 30de03241b5efd1c3f533347be12191aeb3e78a4 (patch) | |
tree | 39f8b4d4352c2144bae0a25b3b60bf8b8fff16a3 /framework | |
parent | 3a1a3b8fce61013b277a04e486bd6d75550b04f7 (diff) |
fixed #285
Diffstat (limited to 'framework')
-rw-r--r-- | framework/PradoBase.php | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/framework/PradoBase.php b/framework/PradoBase.php index 95ea7e23..55758bb6 100644 --- a/framework/PradoBase.php +++ b/framework/PradoBase.php @@ -341,21 +341,24 @@ class PradoBase * @param string extension to be appended if the namespace refers to a file * @return string file path corresponding to the namespace, null if namespace is invalid */ - public static function getPathOfNamespace($namespace,$ext='') + public static function getPathOfNamespace($namespace, $ext='') { - if(isset(self::$_usings[$namespace])) - return self::$_usings[$namespace]; - else if(isset(self::$_aliases[$namespace])) - return self::$_aliases[$namespace]; - else + if(self::CLASS_FILE_EXT === $ext || empty($ext)) { - $segs=explode('.',$namespace); - $alias=array_shift($segs); - if(($file=array_pop($segs))!==null && ($root=self::getPathOfAlias($alias))!==null) - return rtrim($root.DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR ,$segs),'/\\').(($file==='*')?'':DIRECTORY_SEPARATOR.$file.$ext); - else - return null; + if($_useBuffer && isset(self::$_usings[$namespace])) + return self::$_usings[$namespace]; + + if($_useBuffer && isset(self::$_aliases[$namespace])) + return self::$_aliases[$namespace]; } + + $segs = explode('.',$namespace); + $alias = array_shift($segs); + + if(null !== ($file = array_pop($segs)) && null !== ($root = self::getPathOfAlias($alias))) + return rtrim($root.DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR ,$segs),'/\\').(($file === '*') ? '' : DIRECTORY_SEPARATOR.$file.$ext); + + return null; } /** |