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

Breadcrumb

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

function Cache::read

Return value

string|false

File

vendor/composer/composer/src/Composer/Cache.php, line 121

Class

Cache
Reads/writes to a filesystem cache

Namespace

Composer

Code

public function read(string $file) {
    if ($this->isEnabled()) {
        $file = Preg::replace('{[^' . $this->allowlist . ']}i', '-', $file);
        if (file_exists($this->root . $file)) {
            $this->io
                ->writeError('Reading ' . $this->root . $file . ' from cache', true, IOInterface::DEBUG);
            return file_get_contents($this->root . $file);
        }
    }
    return false;
}

API Navigation

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