class StorageCtools in Configuration Management 7.2
Hierarchy
- class \Drupal\configuration\Storage\Storage
- class \Drupal\configuration\Storage\StoragePhp
- class \Drupal\configuration\Storage\StorageCtools
- class \Drupal\configuration\Storage\StoragePhp
Expanded class hierarchy of StorageCtools
File
- lib/
Drupal/ configuration/ Storage/ StorageCtools.php, line 12 - Definition of Drupal\configuration\Storage\StorageCtools.
Namespace
Drupal\configuration\StorageView source
class StorageCtools extends StoragePHP {
// The class that storages the data of the configuration
protected $table;
public function __construct($table) {
parent::__construct();
$this->table = $table;
}
/**
* Saves the configuration object into the DataStore.
*/
public function getDataToSave() {
$filename = $this->filename;
ctools_include('export');
$export = '$api = ' . $this
->export($this->api_version) . ";\n\n";
$export .= '$data = ' . ctools_export_crud_export($this->table, $this->data) . "\n\n";
$export .= '$dependencies = ' . $this
->export($this->dependencies) . ";\n\n";
$export .= '$optional = ' . $this
->export($this->optional_configurations) . ";\n\n";
$export .= '$modules = ' . $this
->export($this->required_modules) . ";";
$file_contents = "<?php\n/**\n * @file\n * {$filename}\n */\n\n" . $export . "\n";
$this->hash = sha1($file_contents);
return $file_contents;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
public static | function | Returns TRUE if the path is a directory or we can create one in that path. | |
Storage:: |
public static | function | Returns TRUE if the current user has write permissions for a configuration file in the config:// directory. | |
Storage:: |
public | function | ||
Storage:: |
public static | function | Returns TRUE if the file for a configuration exists in the config:// directory. | |
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public static | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | Set an array of keys names to export. If the array is empty, all the keys of the configuration will be exported. | |
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
StorageCtools:: |
protected | property | ||
StorageCtools:: |
public | function |
Saves the configuration object into the DataStore. Overrides StoragePhp:: |
|
StorageCtools:: |
public | function |
Overrides Storage:: |
|
StoragePhp:: |
public static | property |
Overrides Storage:: |
|
StoragePhp:: |
public | function | ||
StoragePhp:: |
public | function |
Adapted from CTools ctools_var_export(). Overrides Storage:: |
|
StoragePhp:: |
public | function |
Overrides Storage:: |
|
StoragePhp:: |
public | function |
Loads the configuration object from the DataStore. Overrides Storage:: |
|
StoragePhp:: |
public | function |
Saves the configuration object into the DataStore. Overrides Storage:: |