Logo Search packages:      
Sourcecode: nag2 version File versions  Download package

& Nag_Driver::factory ( tasklist = '',
driver = null,
params = null 
) [inherited]

Attempts to return a concrete Nag_Driver instance based on $driver.

string$tasklistThe name of the tasklist to load.
string$driverThe type of concrete Nag_Driver subclass to return. The is based on the storage driver ($driver). The code is dynamically included.
array$params(optional) A hash containing any additional configuration or connection parameters a subclass might need.
mixed The newly created concrete Nag_Driver instance, or false on an error.

Definition at line 231 of file Driver.php.

Referenced by Nag_Driver::singleton().

        if (is_null($driver)) {
            $driver = $GLOBALS['conf']['storage']['driver'];

        $driver = basename($driver);

        if (is_null($params)) {
            $params = Horde::getDriverConfig('storage', $driver);

        require_once dirname(__FILE__) . '/Driver/' . $driver . '.php';
        $class = 'Nag_Driver_' . $driver;
        if (class_exists($class)) {
            return $ret = &new $class($tasklist, $params);
        } else {
            return false;

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index