Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Tells whether a file exists and is readable
<?php is_readable(string $filename): bool
<?php public function isReadable($path)
{
return is_readable($path);
}
<?php exit(1);
}
if (! is_readable($configFile)) {
echo 'Configuration file [' . $configFile . '] does not have read permission.' . PHP_EOL;
exit(1);
<?php $process = Process::fromShellCommandline($command, null, null, null, null);
if ('\\' !== DIRECTORY_SEPARATOR && file_exists('/dev/tty') && is_readable('/dev/tty')) {
try {
$process->setTty(true);
} catch (RuntimeException $e) {
<?php public function read(): array
{
$state = is_readable($this->path)
? json_decode(file_get_contents($this->path), true)
: [];
<?php public function read(): array
{
$state = is_readable($this->path)
? json_decode(file_get_contents($this->path), true)
: [];
<?php public static function isReadable($path)
{
if (is_readable($path)) {
return true;
}
<?php if (
!ini_get('open_basedir')
&& is_readable('/proc/version')
&& false !== stripos(Silencer::call('file_get_contents', '/proc/version'), 'microsoft')
&& !file_exists('/.dockerenv') // docker running inside WSL should not be seen as WSL
) {
<?php throw new IOException(sprintf('Could not check if file is readable because path length exceeds %d characters.', $maxPathLength), 0, null, $filename);
}
return is_readable($filename);
}