PhpThumb::registerPlugin PHP Method

registerPlugin() public method

Adds a plugin to the registry if it isn't already loaded, and if the provided implementation is valid. Note that you can pass the following special keywords for implementation: - all - Requires that all implementations be available - n/a - Doesn't require any implementation When a plugin is added to the registry, it's added as a key on $this->_registry with the value being an array containing the following keys: - loaded - whether or not the plugin has been "loaded" into the core class - implementation - what implementation this plugin is valid for
public registerPlugin ( string $pluginName, string $implementation ) : boolean
$pluginName string
$implementation string
return boolean
    public function registerPlugin($pluginName, $implementation)
    {
        if (!array_key_exists($pluginName, $this->_registry) && $this->isValidImplementation($implementation)) {
            $this->_registry[$pluginName] = array('loaded' => false, 'implementation' => $implementation);
            return true;
        }
        return false;
    }