function Filesystem::isReadable
Same name in this branch
- 11.1.x vendor/symfony/filesystem/Filesystem.php \Symfony\Component\Filesystem\Filesystem::isReadable()
Cross-platform safe version of is_readable()
This will also check for readability by reading the file as is_readable can not be trusted on network-mounts and \\wsl$ paths. See https://github.com/composer/composer/issues/8231 and https://bugs.php.net/bug.php?id=68926
Return value
bool
16 calls to Filesystem::isReadable()
- Application::doRun in vendor/
composer/ composer/ src/ Composer/ Console/ Application.php - Runs the current application.
- AutoloadGenerator::dump in vendor/
composer/ composer/ src/ Composer/ Autoload/ AutoloadGenerator.php - AutoloadGenerator::parseAutoloadsType in vendor/
composer/ composer/ src/ Composer/ Autoload/ AutoloadGenerator.php - BumpCommand::doBump in vendor/
composer/ composer/ src/ Composer/ Command/ BumpCommand.php - ConfigCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ ConfigCommand.php
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Filesystem.php, line 692
Class
- Filesystem
- @author Jordi Boggiano <j.boggiano@seld.be> @author Johannes M. Schmitt <schmittjoh@gmail.com>
Namespace
Composer\UtilCode
public static function isReadable(string $path) {
if (is_readable($path)) {
return true;
}
if (is_file($path)) {
return false !== Silencer::call('file_get_contents', $path, false, null, 0, 1);
}
if (is_dir($path)) {
return false !== Silencer::call('opendir', $path);
}
// assume false otherwise
return false;
}