Horde_Vcs::factory PHP Méthode

factory() public static méthode

Attempts to return a concrete Horde_Vcs instance based on $driver.
public static factory ( mixed $driver, array $params = [] ) : Horde_Vcs
$driver mixed The type of concrete Horde_Vcs subclass to return. The code is dynamically included.
$params array A hash containing any additional configuration or parameters a subclass might need.
Résultat Horde_Vcs The newly created concrete instance.
    public static function factory($driver, $params = array())
    {
        $class = 'Horde_Vcs_' . $driver;
        if (class_exists($class)) {
            return new $class($params);
        }
        throw new Horde_Vcs_Exception($class . ' not found.');
    }

Usage Example

Exemple #1
0
 public function setUp()
 {
     if (!self::$conf) {
         $this->markTestSkipped('No test configuration');
     }
     $this->vcs = Horde_Vcs::factory('Git', array_merge(self::$conf, array('sourceroot' => __DIR__ . '/repos/git')));
 }
All Usage Examples Of Horde_Vcs::factory
Horde_Vcs