public function FileStorage::save

Implements Drupal\Component\PhpStorage\PhpStorageInterface::save().

Overrides PhpStorageInterface::save

1 method overrides FileStorage::save()

File

drupal/core/lib/Drupal/Component/PhpStorage/FileStorage.php, line 54
Definition of Drupal\Component\PhpStorage\FileStorage.

Class

FileStorage
Stores the code as regular PHP files.

Namespace

Drupal\Component\PhpStorage

Code

public function save($name, $code) {
  $path = $this
    ->getFullPath($name);
  $dir = dirname($path);
  if (!file_exists($dir)) {
    mkdir($dir, 0700, TRUE);
  }
  return (bool) file_put_contents($path, $code);
}