Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Changes the current umask
<?php umask(?int $mask = null): int
<?php if (! is_null($mode)) {
chmod($tempPath, $mode);
} else {
chmod($tempPath, 0777 - umask());
}
file_put_contents($tempPath, $content);
<?php $umask = 0131;
$originalUmask = umask($umask);
$filesystem = new Filesystem;
<?php $this->assertStringEqualsFile($tempFile, 'Yet Something Else Again');
$this->assertEquals($umask, 0777 - $this->getFilePermissions($tempFile));
umask($originalUmask);
chmod($symlinkDir, 0777 - $originalUmask);
<?php foreach ($package->getBinaries() as $bin) {
if (file_exists($path . '/' . $bin) && !is_executable($path . '/' . $bin)) {
Silencer::call('chmod', $path . '/' . $bin, 0777 & ~umask());
}
}
}
<?php } else {
$this->installUnixyProxyBinaries($binPath, $link);
}
Silencer::call('chmod', $binPath, 0777 & ~umask());
}
}
<?php }
if (!file_exists($link)) {
file_put_contents($link, $this->generateWindowsProxyCode($binPath, $link));
Silencer::call('chmod', $link, 0777 & ~umask());
}
}
<?php protected function installUnixyProxyBinaries($binPath, $link)
{
file_put_contents($link, $this->generateUnixyProxyCode($binPath, $link));
Silencer::call('chmod', $link, 0777 & ~umask());
}
<?php throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename);
}
@chmod($tmpFile, file_exists($filename) ? fileperms($filename) : 0666 & ~umask());
$this->rename($tmpFile, $filename, true);
} finally {