function Common::isReadable
Checks if a file is readable.
Addresses PHP bug related to reading files from network drives on Windows. e.g. when using WSL2.
Parameters
string $path The path to the file.:
Return value
boolean
3 calls to Common::isReadable()
- Config::getAllConfigData in vendor/
squizlabs/ php_codesniffer/ src/ Config.php - Get all config data.
- Config::__construct in vendor/
squizlabs/ php_codesniffer/ src/ Config.php - Creates a Config object and populates it with command line values.
- LocalFile::__construct in vendor/
squizlabs/ php_codesniffer/ src/ Files/ LocalFile.php - Creates a LocalFile object and sets the content.
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Util/ Common.php, line 64
Class
Namespace
PHP_CodeSniffer\UtilCode
public static function isReadable($path) {
if (@is_readable($path) === true) {
return true;
}
if (@file_exists($path) === true && @is_file($path) === true) {
$f = @fopen($path, 'rb');
if (fclose($f) === true) {
return true;
}
}
return false;
}