PHP Class QueryPath\ExtensionRegistry

QueryPath extensions should call the QueryPath::ExtensionRegistry::extend() function to register their extension classes. The QueryPath library then uses this information to determine what QueryPath extensions should be loaded and executed. Extensions are attached to a Query object. To enable an extension (the easy way), use QueryPath::enable(). This class provides lower-level interaction with the extension mechanism.
Afficher le fichier Open project: microweber/microweber Class Usage Examples

Méthodes publiques

Свойство Type Description
$useRegistry Internal flag indicating whether or not the registry should be used for automatic extension loading. If this is false, then implementations should not automatically load extensions.

Protected Properties

Свойство Type Description
$extensionMethodRegistry
$extensionRegistry The extension registry. This should consist of an array of class names.

Méthodes publiques

Méthode Description
autoloadExtensions ( $boolean = true ) Enable or disable automatic extension loading.
extend ( $classname ) Extend a Query with the given extension class.
extensionNames ( )
getExtensions ( querypath\Query $qp ) : array Get extensions for the given Query object.
getMethodClass ( string $name ) : string Get the class that a given method belongs to.
hasExtension ( string $name ) : boolean Check to see if the given extension class is registered.
hasMethod ( string $name ) : boolean Check to see if a method is known.

Method Details

autoloadExtensions() public static méthode

If extension autoloading is disabled, then QueryPath will not automatically load all registred extensions when a new Query object is created using qp().
public static autoloadExtensions ( $boolean = true )

extend() public static méthode

Extend a Query with the given extension class.
public static extend ( $classname )

extensionNames() public static méthode

public static extensionNames ( )

getExtensions() public static méthode

Given a Query object, this will return an associative array of extension names to (new) instances. Generally, this is intended to be used internally.
public static getExtensions ( querypath\Query $qp ) : array
$qp querypath\Query The Query into which the extensions should be registered.
Résultat array An associative array of classnames to instances.

getMethodClass() public static méthode

Given a method name, this will check all registered extension classes to see if any of them has the named method. If so, this will return the classname. Note that if two extensions are registered that contain the same method name, the last one registred will be the only one recognized.
public static getMethodClass ( string $name ) : string
$name string The name of the method.
Résultat string The name of the class.

hasExtension() public static méthode

Given a class name for a QueryPath::Extension class, this will check to see if that class is registered. If so, it will return TRUE.
public static hasExtension ( string $name ) : boolean
$name string The name of the class.
Résultat boolean TRUE if the class is registered, FALSE otherwise.

hasMethod() public static méthode

This checks to see if the given method name belongs to one of the registered extensions. If it does, then this will return TRUE.
public static hasMethod ( string $name ) : boolean
$name string The name of the method to search for.
Résultat boolean TRUE if the method exists, false otherwise.

Property Details

$extensionMethodRegistry protected_oe static_oe property

protected static $extensionMethodRegistry

$extensionRegistry protected_oe static_oe property

The extension registry. This should consist of an array of class names.
protected static $extensionRegistry

$useRegistry public_oe static_oe property

Internal flag indicating whether or not the registry should be used for automatic extension loading. If this is false, then implementations should not automatically load extensions.
public static $useRegistry