src/Nymph.php
public static function configure($config = []) {
    $defaults = include dirname(__DIR__).'/conf/defaults.php';
    self::$config = array_replace_recursive($defaults, $config);

    if (isset(self::$driver)) {
      if (self::$driver->connected) {
        self::$driver->disconnect();
      }
      self::$driver = null;
    }

    $class = '\\Nymph\\Drivers\\'.self::$config['driver'].'Driver';

    $Nymph = new $class(self::$config);
    if (class_exists('\\SciActive\\Hook')) {
      \SciActive\Hook::hookObject($Nymph, 'Nymph->');
    }
    if (self::$config['pubsub']) {
      \Nymph\PubSub\HookMethods::setup();
    }
    self::$driver = $Nymph;
  }
public static function configure($config = []) {
    $defaults = include dirname(__DIR__).'/conf/defaults.php';
    self::$config = array_replace_recursive($defaults, $config);

    if (isset(self::$driver)) {
      if (self::$driver->connected) {
        self::$driver->disconnect();
      }
      self::$driver = null;
    }

    $class = '\\Nymph\\Drivers\\'.self::$config['driver'].'Driver';

    $Nymph = new $class(self::$config);
    if (class_exists('\\SciActive\\Hook')) {
      \SciActive\Hook::hookObject($Nymph, 'Nymph->');
    }
    if (self::$config['pubsub']) {
      \Nymph\PubSub\HookMethods::setup();
    }
    self::$driver = $Nymph;
  }
public static function configure ( $ config = [ ] ) { $ defaults = include dirname ( __DIR__ ) . '/conf/defaults.php' ; self :: $ config = array_replace_recursive ( $ defaults , $ config ) ; if ( isset ( self :: $ driver ) ) { if ( self :: $ driver -> connected ) { self :: $ driver -> disconnect ( ) ; } self :: $ driver = null ; } $ class = '\\Nymph\\Drivers\\' . self :: $ config [ 'driver' ] . 'Driver' ; $ Nymph = new $ class ( self :: $ config ) ; if ( class_exists ( '\\SciActive\\Hook' ) ) { \ SciActive \ Hook :: hookObject ( $ Nymph , 'Nymph->' ) ; } if ( self :: $ config [ 'pubsub' ] ) { \ Nymph \ PubSub \ HookMethods :: setup ( ) ; } self :: $ driver = $ Nymph ; }
Apply configuration to Nymph.

$config should be an associative array of Nymph configuration. Use the
following form:

[
'driver' => 'MySQL',
'pubsub' => true,
'MySql' => [
'host' => '127.0.0.1'
]
]

@param array $config An associative array of Nymph's configuration.
Apply configuration to Nymph .