Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Tells whether the filename is a symbolic link
<?php is_link(string $filename): bool
<?php continue;
}
if (is_link($link)) {
$this->laravel->make('files')->delete($link);
}
<?php protected function isRemovableSymlink(string $link, bool $force): bool
{
return is_link($link) && $force;
}
}
<?php public function handle()
{
foreach ($this->links() as $link => $target) {
if (! file_exists($link) || ! is_link($link)) {
continue;
}
<?php while ($directory = array_shift($directories)) {
$publicPath .= '/'.$directory;
if (is_link($publicPath)) {
return implode('/', $directories);
}
}
<?php protected function gitProcessForPath($path)
{
return is_link($path)
? GitProcess::create($path)->fromParent()
: GitProcess::create($path);
}
<?php $targetDir = $im->getInstallPath($package);
if ($downloader instanceof ChangeReportInterface) {
if (is_link($targetDir)) {
$errors[$targetDir] = $targetDir . ' is a symbolic link.';
}
<?php $this->initializeBinDir();
$link = $this->binDir.'/'.basename($bin);
if (file_exists($link)) {
if (!is_link($link)) {
if ($warnOnOverwrite) {
$this->io->writeError(' Skipped installation of bin '.$bin.' for package '.$package->getName().': name conflicts with an existing file');
}
<?php }
foreach ($binaries as $bin) {
$link = $this->binDir.'/'.basename($bin);
if (is_link($link) || file_exists($link)) { // still checking for symlinks here for legacy support
$this->filesystem->unlink($link);
}
if (is_file($link.'.bat')) {
<?php return true;
}
return (Platform::isWindows() && $this->filesystem->isJunction($installPath)) || is_link($installPath);
}
<?php if ($dh = opendir($dir)) {
while ($file = readdir($dh)) {
if ($file !== '.' && $file !== '..') {
if (is_link($dir.'/'.$file)) {
$array[$dir][$file] = readlink($dir.'/'.$file);
} elseif (is_dir($dir.'/'.$file)) {
if (!count($array)) {
<?php public function emptyDirectory($dir, $ensureDirectoryExists = true)
{
if (is_link($dir) && file_exists($dir)) {
$this->unlink($dir);
}
<?php return $this->removeJunction($directory);
}
if (is_link($directory)) {
return unlink($directory);
}
<?php private function unlinkImplementation($path)
{
if (Platform::isWindows() && is_dir($path) && is_link($path)) {
return rmdir($path);
}
<?php $resolved = $this->resolveSymlinkedDirectorySymlink($directory);
return is_link($resolved);
}
<?php clearstatcache(true, $junction);
if (!is_dir($junction) || is_link($junction)) {
return false;
}