You are here

class StorageCtools in Configuration Management 7.2

Hierarchy

Expanded class hierarchy of StorageCtools

File

lib/Drupal/configuration/Storage/StorageCtools.php, line 12
Definition of Drupal\configuration\Storage\StorageCtools.

Namespace

Drupal\configuration\Storage
View 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

Namesort descending Modifiers Type Description Overrides
Storage::$api_version protected property
Storage::$data protected property
Storage::$dependencies protected property
Storage::$filename protected property
Storage::$hash protected property
Storage::$keys_to_export protected property
Storage::$loaded protected property
Storage::$optional_configurations protected property
Storage::$required_modules protected property
Storage::checkDirectory public static function Returns TRUE if the path is a directory or we can create one in that path.
Storage::checkFilePermissions public static function Returns TRUE if the current user has write permissions for a configuration file in the config:// directory.
Storage::checkForChanges public function
Storage::configFileExists public static function Returns TRUE if the file for a configuration exists in the config:// directory.
Storage::getApiVersion public function
Storage::getData public function
Storage::getDependencies public function
Storage::getFileExtension public static function
Storage::getFileName public function
Storage::getHash public function
Storage::getModules public function
Storage::getOptionalConfigurations public function
Storage::reLoad public function
Storage::reset public function
Storage::setApiVersion public function
Storage::setData public function
Storage::setDependencies public function
Storage::setFileName public function
Storage::setKeysToExport 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::setModules public function
Storage::setOptionalConfigurations public function
Storage::withData public function
StorageCtools::$table protected property
StorageCtools::getDataToSave public function Saves the configuration object into the DataStore. Overrides StoragePhp::getDataToSave
StorageCtools::__construct public function Overrides Storage::__construct
StoragePhp::$file_extension public static property Overrides Storage::$file_extension
StoragePhp::delete public function
StoragePhp::export public function Adapted from CTools ctools_var_export(). Overrides Storage::export
StoragePhp::import public function Overrides Storage::import
StoragePhp::load public function Loads the configuration object from the DataStore. Overrides Storage::load
StoragePhp::save public function Saves the configuration object into the DataStore. Overrides Storage::save