class QueryPathExtensionRegistry in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/QueryPathExtension.php \QueryPathExtensionRegistry
- 7.2 QueryPath/QueryPathExtension.php \QueryPathExtensionRegistry
Hierarchy
- class \QueryPathExtensionRegistry
Expanded class hierarchy of QueryPathExtensionRegistry
File
- QueryPath/
QueryPathExtension.php, line 12
View source
class QueryPathExtensionRegistry {
public static $useRegistry = TRUE;
protected static $extensionRegistry = array();
protected static $extensionMethodRegistry = array();
public static function extend($classname) {
self::$extensionRegistry[] = $classname;
$class = new ReflectionClass($classname);
$methods = $class
->getMethods();
foreach ($methods as $method) {
self::$extensionMethodRegistry[$method
->getName()] = $classname;
}
}
public static function hasMethod($name) {
return isset(self::$extensionMethodRegistry[$name]);
}
public static function hasExtension($name) {
return in_array($name, self::$extensionRegistry);
}
public static function getMethodClass($name) {
return self::$extensionMethodRegistry[$name];
}
public static function getExtensions(QueryPath $qp) {
$extInstances = array();
foreach (self::$extensionRegistry as $ext) {
$extInstances[$ext] = new $ext($qp);
}
return $extInstances;
}
public static function autoloadExtensions($boolean = TRUE) {
self::$useRegistry = $boolean;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
QueryPathExtensionRegistry:: |
protected static | property | ||
QueryPathExtensionRegistry:: |
protected static | property | ||
QueryPathExtensionRegistry:: |
public static | property | ||
QueryPathExtensionRegistry:: |
public static | function | ||
QueryPathExtensionRegistry:: |
public static | function | ||
QueryPathExtensionRegistry:: |
public static | function | ||
QueryPathExtensionRegistry:: |
public static | function | ||
QueryPathExtensionRegistry:: |
public static | function | ||
QueryPathExtensionRegistry:: |
public static | function |