/** * @return string The path of the file's parent directory */ public function getParentPath() { if ($this->isRoot()) { return $this->path; } $urlParts = $this->getURLComponents(); $urlParts['path'] = AdvancedPathLib::dirname($urlParts['path']); return AdvancedPathLib::buildUrl($urlParts); }
/** * @return string The path of the file's parent directory */ public function getParentPath() { if (preg_match('/^[a-z]{1}:\\/?$/i', AdvancedPathLib::getPhpLocalHackPath($this->path))) { return $this->getAbsolutePath(); //if the path is the root of a Windows drive, return itself } $urlParts = $this->getURLComponents(); $urlParts['path'] = AdvancedPathLib::dirname($urlParts['path']); return AdvancedPathLib::buildUrl($urlParts); }