public function getLinkForVhost($vhostName) { $baseDir = $this->globalConfiguration->getVhostsDirectory(); if (!is_dir($baseDir)) { throw new NotADirectoryException($baseDir); } $linkName = $baseDir . '/' . $vhostName; if (!is_link($linkName) && file_exists($linkName)) { throw new NotALinkException($linkName); } return $linkName; }
public function getLink() { $link = new \SplFileInfo($this->globalConfiguration->getVhostsDirectory() . '/' . $this->getName()); OutsideConfiguredRootDirectoryException::assert($link->getPathname(), 'vhosts-dir', $this->globalConfiguration->getVhostsDirectory()); return $link; }