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

Breadcrumb

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

function Filesystem::isReadable

Same name in this branch
  1. 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

... See full list

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\Util

Code

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

API Navigation

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