public removeEmptyDirectory ( string $directoryPath ) : boolean | ||
$directoryPath | string | |
리턴 | boolean |
public function removeEmptyDirectory($directoryPath)
{
if (is_dir($directoryPath) && $this->isDirEmpty($directoryPath)) {
if (!$this->removeDirectory($directoryPath)) {
// @codeCoverageIgnoreStart
throw new \RuntimeException('Unable to remove the directory : ' . $directoryPath);
// @codeCoverageIgnoreEnd
}
return true;
}
return false;
}
/** * @param PackageInterface $package * * @throws FilesystemException */ protected function removePackageVendorSymlink(PackageInterface $package) { if ($this->config->isSymlinkEnabled() && $this->filesystem->removeSymlink($this->getPackageVendorSymlink($package))) { $this->io->write(array(' - Deleting symlink for <info>' . $package->getPrettyName() . '</info> ' . '(<fg=yellow>' . $package->getPrettyVersion() . '</fg=yellow>)', '')); $symlinkParentDirectory = dirname($this->getPackageVendorSymlink($package)); $this->filesystem->removeEmptyDirectory($symlinkParentDirectory); } }