compute meta file path
@param string $file
@return mixed
549580
protected function getMetaFilePath($file)
	{
		$parts = pathinfo($file);
		$metaFilename = sprintf($this->metaFileMask, $parts['basename']);
		return str_replace($parts['basename'], $metaFilename, $file);
	}
570876
public static function file( $file )
	{
		$params = array_merge( static::$params, array(
			'time' => time(),
			'fingerprint' => \CCSession::fingerprint(),
			'random' => CCStr::random(),
		));
		
		foreach( $params as $param => $value )
		{
			$file = str_replace( ':'.$param, $value, $file );
		}
		
		return $file;
	}
461977
protected function resolve_file_path($file = null)
    {
        if (is_null($file)) {
            $file = $this->args->file;
        }

        if (file_exists($file)) {
            return $file;
        }

        $dirname  = dirname($file);
        $filename = basename($file);
        $relpath  = $dirname ? "/$dirname" : '';
        $path     = getcwd() . "$relpath/$filename";

        /**
         * realpath will return false if path does not exist
         */
        return realpath($path) ?: str_replace('/./', '/', $path);
    }
616419
public static function get(
        $file
    ) {
        if (is_string($file)) {
            $file = new \SplFileInfo($file);
        }

        $extension = mb_strtolower($file->getExtension());
        if ('' === $extension) {
            return static::MIME_TYPE_IF_UNKNOWN;
        }

        if (array_key_exists($extension, static::$mimeTypes)) {
            return static::$mimeTypes[$extension];
        }

        if (function_exists('finfo_open') && $file->isFile()) {
            $path = $file->getPath();

            $fileInfo = finfo_open(FILEINFO_MIME);
            $mimeType = finfo_file($fileInfo, $path);
            finfo_close($fileInfo);

            return $mimeType;
        }

        return static::MIME_TYPE_IF_UNKNOWN;
    }
484474
public static function compassResolvePath($file)
	{
		if ($file{0}=='/') {
			return $file;
			}
		if (!$path=realpath($file)) {
			$path=\PHPSass\Script\ScriptFunction::$context->node->token->filename;
			$path=substr($path, 0, strrpos($path, '/')).'/';
			$path=$path.$file;
			$last='';
			while ($path!=$last) {
				$last=$path;
				$path=preg_replace('`(^|/)(?!\.\./)([^/]+)/\.\./`', '$1', $path);
				}
			$path=realpath($path);
			}
		if ($path) {
			return $path;
			}

		return FALSE;
	}
533137
public function getDiffFile($file)
    {
        $args = [
            '-r', '-p', '-m', '-M', '--no-commit-id', '--full-index', $this->revision,
            '--', $this->repository->getWikiDir().$file,
        ];

        $diff = Diff::parse($this->repository->run('diff-tree', $args));
        $diff->setRepository($this->repository);

        return $diff;
    }
1337486
protected function parse($file)
    {
        $search = '%%CURRENT_DIRECTORY%%';

        $yaml = file_get_contents($file);

        $yaml = str_replace($search, $this->root, $yaml);

        $result = Yaml::parse($yaml);

        $this->commands = $result['paths']['commands'];

        $this->namespace = $result['namespaces']['commands'];

        $this->templates = $result['paths']['templates'];
    }
1301480
public function realPath($file)
    {
        $result = false;
        $path   = dirname($file);

        // Is the path based on a stream?
        if (strpos($path, '://') === false)
        {
            // Not a stream, so do a realpath() to avoid directory traversal attempts on the local file system.
            $path = realpath($path); // needed for substr() later
            $file = realpath($file);
        }

        // The substr() check added to make sure that the realpath() results in a directory registered so that
        // non-registered directories are not accessible via directory traversal attempts.
        if (file_exists($file) && substr($file, 0, strlen($path)) == $path) {
            $result = $file;
        }

        return $result;
    }
181766
public static function rmfile($file)
    {
        if (is_file($file)) {
            return chmod($file, 0777) && unlink($file);
        } else {
            throw new RuntimeException(sprintf(
                'Invalid file path supplied "%s"', $file
            ));
        }
    }
378687
protected function findMiddlewareFromFile($file)
    {
        $filename = pathinfo($file, PATHINFO_FILENAME);

        foreach ($this->middleware as $alias => $class) {
            if (strpos($class, $filename) !== false) {
                return $alias;
            }
        }
    }
715046
public static function getAbsFile($file)
    {
        // If already absolute
        if (self::is_absolute($file)) {
            return $file;
        }

        // If path is relative to public folder search there first
        if (self::publicDir()) {
            $path = Path::join(self::publicFolder(), $file);
            if (file_exists($path)) {
                return $path;
            }
        }

        // Default to base folder
        return Path::join(self::baseFolder(), $file);
    }
561955
public function getFileClass($file)
    {
        $sections = explode(DIRECTORY_SEPARATOR, $file);
        $fileName = $sections[count($sections) - 1];

        $class = str_replace('.php', '', $fileName);

        return $class;
    }
938879
public final function getRelativePath($file = null) {
        return $file ? MODULE_DIR . DS . $this->dirname . DS . ($file ? $file : '') : $this->path . DS;
    }
1075284
protected function locateFile($file)
    {
        $this->locateFile && $file = call_user_func($this->locateFile, $file);

        return $file;
    }
1142250
public function realPath($file)
    {
        $path = parent::realPath($file);

        if($base = $this->getBasePath())
        {
            if(strpos($file, $base) !== 0) {
                return false;
            }
        }

        return $path;
    }
119324
protected function get_file( $file ) {

		$path_parts = $this->parse_path( $file );

		if ( '' === $path_parts[0] ) {
			$file = $this->root;
			unset( $path_parts[0] );
		} else {
			$file = $this->cwd;
		}

		foreach ( $path_parts as $part ) {

			if ( '' === $part ) {
				continue;
			}

			if ( 'dir' !== $file->type || false === isset( $file->contents->$part ) ) {
				return false;
			}

			$file = $file->contents->$part;
		}

		return $file;
	}
1263531
public static function getRelativeFilepath($file)
    {
        $storageDir = self::convertSlashes(config('filer.path.absolute'));
        $absolutePath = self::convertSlashes($file->getRealPath());
        return dirname(str_replace($storageDir, '', $absolutePath));
    }