You are here

public function CSSCompression_Control::access in Advanced CSS/JS Aggregation 6

Same name and namespace in other branches
  1. 7 advagg_css_compress/css-compressor-3.x/src/lib/Control.inc \CSSCompression_Control::access()

Backdoor access to subclasses ONLY FOR DEVELOPMENT/TESTING.

Parameters

(string) class: Name of the focus class:

(array) config: Contains name reference and test arguments:

File

advagg_css_compress/css-compressor-3.x/src/lib/Control.inc, line 216

Class

CSSCompression_Control
CSS Compressor [VERSION] [DATE] Corey Hart @ http://www.codenothing.com

Code

public function access($class, $method, $args) {
  if ($class == 'Control') {
    return call_user_func_array(array(
      $class,
      $method,
    ), $args);
  }
  else {
    if (strpos($class, '.') !== false) {
      $parts = explode('.', $class);
      $class = $parts[0];
      $subclass = $parts[1];
      return $this->{$class}
        ->access($subclass, $method, $args);
    }
    else {
      if (in_array($class, $this->subclasses)) {
        return $this->{$class}
          ->access($method, $args);
      }
      else {
        throw new CSSCompression_Exception("Unknown Class Access - " . $class);
      }
    }
  }
}