返回系统所在的文件夹相对于根目录的路径

<pre>
Example:
请求: http://www.windwork.org/demo/index.php?app=xx
返回: /demo/
</pre>

@return string
540133
public function getBasePath() 
    {
        $basePath = str_replace($this->getScript(), '', $this->getScriptUrl());
        $basePath = '/' . ltrim($basePath, '/');
        return $basePath;
    }
669383
public function getPath()
    {
        if (isset($this->_options[self::OPTION_SCROLL_ID])) {
            return '_search/scroll';
        }

        $indices = $this->getIndices();

        $path = '';
        $types = $this->getTypes();

        if (empty($indices)) {
            if (!empty($types)) {
                $path .= '_all';
            }
        } else {
            $path .= \implode(',', $indices);
        }

        if (!empty($types)) {
            $path .= '/'.\implode(',', $types);
        }

        // Add full path based on indices and types -> could be all
        return $path.'/_search';
    }
320147
private function getApplicationPathFiles(){

		$this->setPathURI(explode('/', preg_replace('/^[\/]*(.*?)[\/]*$/', '\\1', $_SERVER['REQUEST_URI'])));
		$a=$this->getPathURI();


		if($this->getEnvironmentStatus()=='development'){
			$nun_level=explode("/", $this->getAddressUri());

			for ($i=0; $i < count($nun_level)-2; $i++) {
				array_shift($a);
			}
			$this->setPathURI($a);
		}
		foreach ($a as $key => $value) {
			if($this->getNameApplication()==$value){
				unset($a[$key]);
			}
		}

		if(reset($a)=='helpers'){
			array_shift($a);
			$helpers=true;
		}else{
			$helpers=false;
		}
		$this->setPathURI($a);

		foreach ($a as $key => $value) {
			$this->posURL[]=$value;
		}


		$url_array=$this->getPathURI();

		$directory_action=$directory_ctrl=$directory_view='';

		if($helpers==true){

			$directory_action = $this->getPathApplication().'helpers';

			do{
				if( in_array(current($url_array), scandir($directory_action))){
					$directory_action.='/'.current($url_array);
					next($url_array);
					$dir = false;
					if(isset($url_array[key($url_array)+1])){
						$this->setMethodsURI($url_array[key($url_array)+1]);
					}
				}else if( in_array(current($url_array).'.php', scandir($directory_action))){
					$directory_action.='/'.current($url_array).'.php';
					next($url_array);
					$dir = true;
				}else{
					$directory_action.='/index.php';
					$dir = true;
				}
			}while(!$dir);
		}else{
			$directory_ctrl = $this->getPathApplication().'controllers';
			$directory_view = $this->getPathApplication().'views/pages';
			$this->urlCompletePath = substr($this->getPathBaseHref(),0,-1);
			do{
				if( (file_exists($directory_view) && in_array(current($url_array), scandir($directory_view))) || (file_exists($directory_ctrl) && in_array(current($url_array), scandir($directory_ctrl))) ){
					$directory_ctrl.='/'.current($url_array);
					$directory_view.='/'.current($url_array);
					$this->urlCompletePath.='/'.(current($url_array)!='index'?current($url_array):'');
					next($url_array);
					$dir = false;
					if(isset($url_array[key($url_array)])){
						$this->setMethodsURI($url_array[key($url_array)]);
					}
				}else if( (file_exists($directory_view) && in_array(current($url_array).'.php', scandir($directory_view))) || (file_exists($directory_ctrl) && in_array(current($url_array).'.php', scandir($directory_ctrl))) ){
					$directory_ctrl.='/'.current($url_array).'.php';
					$directory_view.='/'.current($url_array).'.php';
					$this->urlCompletePath.='/'.(current($url_array)!='index'?current($url_array):'');
					next($url_array);
					if(isset($url_array[key($url_array)])){
						$this->setMethodsURI($url_array[key($url_array)]);
					}
					$dir = true;
				}else{
					if(isset($url_array[key($url_array)])){
						$this->setMethodsURI($url_array[key($url_array)]);
					}

					if((count($url_array)==0 || is_int(key($url_array)) == false) || (isset($url_array) && $url_array[0]=='')){
						$directory_ctrl.='/index.php';
						$directory_view.='/index.php';
						$this->urlCompletePath.='/';
					}
					$dir = true;
				}

			}while(!$dir);
		}

		//verifica se existe a view
		if($helpers==true && file_exists($directory_action) && is_file($directory_action) ){
			// inicia actoin
			$this->setPageAction($directory_action);
			$this->instanceTemplate($this->getPageAction());
			if (strpos($_SERVER['HTTP_ACCEPT'], 'htm') === false) {
			}else{
				$helpers=false;
				$this->setPageView($this->getPathApplication('views/error/','404.php'));
			}
		}else if((file_exists($directory_ctrl) && is_file($directory_ctrl)) || (file_exists($directory_view) && is_file($directory_view))){
			// inicia controller
			$this->setPageCtrl($directory_ctrl);
			$this->setPageView($directory_view);
		}
		if(!file_exists($directory_ctrl) || !is_file($directory_ctrl)){
			$this->setPageCtrl($this->getPathApplication('controllers/error/','404.php'));
		}
		if(!file_exists($directory_view) || !is_file($directory_view)){
			$this->setPageView($this->getPathApplication('views/error/','404.php'));
		}

		if($helpers==false){
			$this->instanceTemplate($this->getPathApplication('views/layout/','template.php'));
		}

	}
1358254
public function getViewPath()
    {
        $module = $this->module;
        
        if (substr($module, 0, 1) !== '@') {
            $module = '@'.$module;
        }
        
        return implode(DIRECTORY_SEPARATOR, [Yii::getAlias($module), 'views', 'aws', $this->getViewFolderName()]);
    }
773481
public function getPath()
    {
        $sname = '';
        $gname = '';
        $vname = $this->getName();
        if ( $this->getConfigGroup() ) {
            if ( $this->getConfigGroup()->getConfigSection() ) {
                $sname = $this->getConfigGroup()->getConfigSection()->getName();
            }
            $gname = $this->getConfigGroup()->getName();
        }

        return sprintf(
            '%s:%s:%s',
            $sname,
            $gname,
            $vname
        );
    }
15185
public function _pathinfo() {

        if(isset($this->server['PATH_INFO'])) {
            return $this->server['PATH_INFO'];
        }

        return str_replace(
            '/index.php',
            '',
            explode('?',$this->uri)[0]
        );


        $inputEncoding = NULL;
        $outputEncoding = NULL;
        //参考Zend Framework对pahtinfo的处理, 更好的兼容性
        $pathInfo = NULL;

        //处理requestUri
        $requestUri   = $this->uri;
        $finalBaseUrl = $this->baseurl;

        // Remove the query string from REQUEST_URI
        if ($pos = strpos($requestUri, '?')) {
            $requestUri = substr($requestUri, 0, $pos);
        }

        if ((NULL !== $finalBaseUrl) && (false === ($pathInfo = substr($requestUri, strlen($finalBaseUrl))))  ) {
            // If substr() returns false then PATH_INFO is set to an empty string
            $pathInfo = '/';
        }
        elseif (NULL === $finalBaseUrl) {
            $pathInfo = $requestUri;
        }

        if ($pathInfo) {
            //针对iis的utf8编码做强制转换
            //参考http://docs.moodle.org/ja/%E5%A4%9A%E8%A8%80%E8%AA%9E%E5%AF%BE%E5%BF%9C%EF%BC%9A%E3%82%B5%E3%83%BC%E3%83%90%E3%81%AE%E8%A8%AD%E5%AE%9A
            if (!empty($inputEncoding) && !empty($outputEncoding) && (stripos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false || stripos($_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer') !== false) ) {
                if (function_exists('mb_convert_encoding')) {
                    $pathInfo = mb_convert_encoding($pathInfo, $outputEncoding, $inputEncoding);
                }
                else if (function_exists('iconv')) {
                    $pathInfo = iconv($inputEncoding, $outputEncoding, $pathInfo);
                }
            }
        }
        else {
            $pathInfo = '/';
        }

        return '/' . ltrim(urldecode($pathInfo), '/');
    }
985569
private function getFilePath()
    {
        $fullname = $this->fullName;
        $rootPath = $_SERVER['DOCUMENT_ROOT'];

        if (substr($fullname, 0, 1) != '/') {
            $fullname = '/' . $fullname;
        }

        return $rootPath . $fullname;
    }
809641
protected function getAppFile()
    {
        $app_path = $this->getPlainPath();
        $root_path = trim(dirname($this->getPlainPath()), '/');
        return str_replace($root_path, '', $app_path) . DIRECTORY_SEPARATOR . 'App.php';
    }
140972
public static function getWebPath()
    {
        static $path;
        if (empty($path)) {
            
            // 当前文件路径
            $file = Request::instance()->server('SCRIPT_NAME');
            
            // 去除文件名
            $arr = explode('/', $file);
            array_pop($arr);
            
            // 当前文件夹路径
            if (count($arr) == 0) {
                $path = '/';
            } else {
                $path = implode('/', $arr) . '/';
            }
        }
        return $path;
    }
876958
public function getWpRootFolder()
    {
        if (empty($this->wpRootFolder)) {
            // allow me not to bother with trailing slashes
            $wpRootFolder = Utils::untrailslashit($this->config['wpRootFolder']) . DIRECTORY_SEPARATOR;

            // maybe the user is using the `~` symbol for home?
            $this->wpRootFolder = Utils::homeify($wpRootFolder);

            // remove `\ ` spaces in folder paths
            $this->wpRootFolder = str_replace('\ ', ' ', $this->wpRootFolder);
        }

        return $this->wpRootFolder;
    }
1243127
public function getPath(): string
    {
        if (!$this->path) {
            if (\defined('PATH_APPLICATION')) {
                $this->path = PATH_APPLICATION;
            } else {
                $reflection = new \ReflectionClass($this);
                // 3 level up
                $this->path = \dirname($reflection->getFileName(), 3);
            }
        }
        return $this->path;
    }
1284204
protected function _getFileLocation()
    {
        $this->_sRelativeFilePath = '';
        $sFileHash = $this->oxfiles__oxstorehash->value;
        $sFileName = $this->oxfiles__oxfilename->value;

        //security check for demo shops
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->isDemoShop()) {
            $sFileName = basename($sFileName);
        }

        if ($this->isUploaded()) {
            $this->_sRelativeFilePath = $this->_getHashedFileDir($sFileHash);
            $this->_sRelativeFilePath .= DIRECTORY_SEPARATOR . $sFileHash;
        } else {
            $this->_sRelativeFilePath = DIRECTORY_SEPARATOR . $this->_sManualUploadDir . DIRECTORY_SEPARATOR . $sFileName;
        }

        return $this->_sRelativeFilePath;
    }
150255
public function getFilepath()
    {
        if (isset($this->dirPath)) {
            $filepath = $this->dirPath .'/'.$this->filename;
        } else {
            $fileSystem = $this->createNew(FileSystem::class);
            $filepath   = $fileSystem->getCurrentWorkingDirectory() .'/'.$this->filename;    
        }
        return $filepath;        
    }
1317303
public function path()
    {
        $dirname = $this->dirname();

        if ($this->parent instanceof Root) { //at root

            return $dirname.$this->basename();
        }

        return sprintf('%s/%s', $dirname, $this->basename());

    }
1231586
public function path()
    {
        if (is_null($this->path)) {
            $suffix   = $this->config->get('core.url_html_suffix');
            $pathinfo = $this->baseUrl();
            if (false === $suffix) {
                // 禁止伪静态访问
                $this->path = $pathinfo;
            } elseif ($suffix) {
                // 去除正常的URL后缀
                $this->path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo);
            } else {
                // 允许任何后缀访问
                $this->path = preg_replace('/\.' . $this->ext() . '$/i', '', $pathinfo);
            }
        }
        return $this->path;
    }
1150603
public function getFileInfo() {
    // Create a build list tag from the filename.
    $filename_pieces = explode('.', $this->component_data['filename']);
    if ($filename_pieces[0] == '%module') {
      // Take off the module name from the front.
      array_shift($filename_pieces);
    }
    if (in_array(end($filename_pieces), ['php', 'inc'])) {
      // Take off a file extenstion.
      array_pop($filename_pieces);
    }
    // Implode whatever's left.
    $file_key_tag = implode('.', $filename_pieces);

    return array(
      'path' => '', // Means base folder.
      'filename' => $this->component_data['filename'],
      'body' => $this->fileContents(),
      'build_list_tags' => ['code', $file_key_tag],
    );
  }
1209822
public function getThumbUrl() {

		if( $this->changed ) {

			return Yii::$app->fileManager->uploadUrl . '/' . CoreProperties::DIR_TEMP . $this->directory . "/" . $this->name . "-thumb." . $this->extension;
		}
		else if( $this->id > 0 ) {

			return Yii::$app->fileManager->uploadUrl . '/' . $this->thumb;
		}

		return "";
	}