Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Common.php

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

Common

Namespace

PHP_CodeSniffer\Util

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal