示例#1
0
 /**
  * Returns absolute domain path.
  * 
  * @param	array		$removeComponents
  * @return	string
  */
 public static function getPath(array $removeComponents = array())
 {
     if (empty(self::$path)) {
         self::$path = FileUtil::addTrailingSlash(dirname($_SERVER['SCRIPT_NAME']));
     }
     if (!empty($removeComponents)) {
         $path = explode('/', self::$path);
         foreach ($path as $index => $component) {
             if (empty($path[$index])) {
                 unset($path[$index]);
             }
             if (in_array($component, $removeComponents)) {
                 unset($path[$index]);
             }
         }
         return '/' . implode('/', $path) . '/';
     }
     return self::$path;
 }