You are here

class PurgeDependModule in Purge 7.2

Checks if a module is enabled.

Hierarchy

Expanded class hierarchy of PurgeDependModule

File

includes/purge.class.inc, line 197
Contains all class and interface definitions for Purge.

View source
class PurgeDependModule extends PurgeDepend {
  public $modules = array();

  /**
   * Constructs a module dependency from an array of module.
   *
   * @param array $modulenames
   *
   */

  // public function __construct($module_names) {
  //  foreach($module_names as $module_name) {
  // @TODO: Check if things change and call reconfigure if needed.
  //    $this->modules[$module_name] = module_exists($module_name);
  //  }
  // }

  /**
   * Checks if the modules are installed and enabled.
   *
   * @param string $module_name
   */
  public function check_depend($module_name = NULL) {
    $pass = 0;
    if (!is_null($module_name)) {
      $modules = array(
        $module_name => 0,
      );
    }
    else {
      $modules = $this->modules;
    }
    foreach ($modules as $module_name => $module_status) {
      if (module_exists($module_name)) {
        $this->module_status[$module_name] = 1;
        $pass = 1;
      }
    }
    return $pass;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Purge::$access public property
Purge::$available public property
Purge::$depend public property
Purge::$description public property
Purge::$enabled public property
Purge::$item public property
Purge::$name public property
Purge::$option public property
Purge::__sleep public function Only serialize the static values. 1
PurgeDepend::validate public function Validates the dependency. Overrides Purge::validate
PurgeDependModule::$modules public property
PurgeDependModule::check_depend public function Checks if the modules are installed and enabled.