Horde_Core_Factory_Base::_getDriverName PHP Méthode

_getDriverName() protected méthode

Return the classname of the driver to load.
protected _getDriverName ( string $driver, string $base ) : string
$driver string Driver name.
$base string The base classname.
Résultat string Classname.
    protected function _getDriverName($driver, $base)
    {
        /* Intelligent loading... if we see at least one separator character
         * in the driver name, guess that this is a full classname so try that
         * option first. */
        $search = strpbrk($driver, '\\_') === false ? array('driver', 'class') : array('class', 'driver');
        foreach ($search as $val) {
            switch ($val) {
                case 'class':
                    if (class_exists($driver)) {
                        return $driver;
                    }
                    break;
                case 'driver':
                    $class = $base . '_' . Horde_String::ucfirst($driver);
                    if (class_exists($class)) {
                        return $class;
                    }
                    break;
            }
        }
        throw new Horde_Exception('"' . $driver . '" driver (for ' . $base . ' not found).');
    }
Horde_Core_Factory_Base