You are here

class Provision_Config_Example in Hosting 7.3

Same name and namespace in other branches
  1. 7.4 example/example_service/drush/Provision/Config/Example.php \Provision_Config_Example

A basic configuration file class.

Just a file containing the value passed to us.

Hierarchy

Expanded class hierarchy of Provision_Config_Example

1 string reference to 'Provision_Config_Example'
Provision_Service_example_basic::init_server in example/example_service/drush/Provision/Service/example/basic.php
Initialize this class, including option handling.

File

example/example_service/drush/Provision/Config/Example.php, line 8

View source
class Provision_Config_Example extends Provision_Config {

  /**
   * Template file to load. In the same directory as this class definition.
   */
  public $template = 'basic.tpl.php';

  /**
   * Where the file generated will end up.
   *
   * It is extremely important that this path is only made up of information
   * relative to this class, and does not use drush_get_option or the d() accessor.
   */
  function filename() {
    return $this->example_config_path . '/example.conf';
  }

  /**
   * Override the write method.
   */
  function write() {
    parent::write();

    // Sync the config to a remote server if necessary.
    $this->data['server']
      ->sync($this
      ->filename());
  }

  /**
   * Override the unlink method.
   */
  function unlink() {
    parent::unlink();

    // Remove the config from a remote server if necessary.
    $this->data['server']
      ->sync($this
      ->filename());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Provision_Config_Example::$template public property Template file to load. In the same directory as this class definition.
Provision_Config_Example::filename function Where the file generated will end up.
Provision_Config_Example::unlink function Override the unlink method.
Provision_Config_Example::write function Override the write method.