1.20.x config_file_storage.inc public ConfigFileStorage::delete($name)

Deletes a configuration object from the storage.

Parameters

string $name: The name of a configuration object to delete.

Return value

bool: TRUE on success, FALSE otherwise.

Overrides ConfigStorageInterface::delete

File

drivers/config_file/config_file_storage.inc, line 148

Class

ConfigFileStorage
Defines the file storage controller.

Code

public function delete($name) {
  if (!$this->exists($name)) {
    if (!file_exists($this->directory)) {
      throw new ConfigStorageException($this->directory . '/ not found.');
    }
    return FALSE;
  }
  $file_path = $this->getFilePath($name);
  $status = backdrop_unlink($file_path);
  clearstatcache(FALSE, $file_path);
  return $status;
}