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

Breadcrumb

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

function Cache::isEnabled

Return value

bool

11 calls to Cache::isEnabled()
Cache::clear in vendor/composer/composer/src/Composer/Cache.php
Cache::copyFrom in vendor/composer/composer/src/Composer/Cache.php
Copy a file into the cache
Cache::copyTo in vendor/composer/composer/src/Composer/Cache.php
Copy a file out of the cache
Cache::gc in vendor/composer/composer/src/Composer/Cache.php
Cache::gcVcsCache in vendor/composer/composer/src/Composer/Cache.php

... See full list

File

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

Class

Cache
Reads/writes to a filesystem cache

Namespace

Composer

Code

public function isEnabled() {
    if ($this->enabled === null) {
        $this->enabled = true;
        if (!$this->readOnly && (!is_dir($this->root) && !Silencer::call('mkdir', $this->root, 0777, true) || !is_writable($this->root))) {
            $this->io
                ->writeError('<warning>Cannot create cache directory ' . $this->root . ', or directory is not writable. Proceeding without cache. See also cache-read-only config if your filesystem is read-only.</warning>');
            $this->enabled = false;
        }
    }
    return $this->enabled;
}

API Navigation

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