src/Norm/Norm.php
public static function init($config, $collectionConfig = array())
    {
        $first = null;

        static::$collectionConfig = $collectionConfig;

        if (empty($config)) {
            return;
        }

        foreach ($config as $key => $value) {
            $value['name'] = $key;

            if (!isset($value['driver'])) {
                throw new Exception(
                    '[Norm] Cannot instantiate connection "'.$key.
                    '", Driver "'.@$value['driver'].'" not found!'
                );
            }

            $Driver = $value['driver'];

            static::$connections[$key] = new $Driver($value);

            if (!static::$connections[$key] instanceof Connection) {
                throw new Exception('Norm connection ['.$key.'] should be instance of Connection');
            }

            if (!$first) {
                $first = $key;
            }
        }

        if (!static::$defaultConnection) {
            static::$defaultConnection = $first;
        }
    }
public static function init($config, $collectionConfig = array())
    {
        $first = null;

        static::$collectionConfig = $collectionConfig;

        if (empty($config)) {
            return;
        }

        foreach ($config as $key => $value) {
            $value['name'] = $key;

            if (!isset($value['driver'])) {
                throw new Exception(
                    '[Norm] Cannot instantiate connection "'.$key.
                    '", Driver "'.@$value['driver'].'" not found!'
                );
            }

            $Driver = $value['driver'];

            static::$connections[$key] = new $Driver($value);

            if (!static::$connections[$key] instanceof Connection) {
                throw new Exception('Norm connection ['.$key.'] should be instance of Connection');
            }

            if (!$first) {
                $first = $key;
            }
        }

        if (!static::$defaultConnection) {
            static::$defaultConnection = $first;
        }
    }
public static function init ( $ config , $ collectionConfig = array ( ) ) { $ first = null ; static :: $ collectionConfig = $ collectionConfig ; if ( empty ( $ config ) ) { return ; } foreach ( $ config as $ key => $ value ) { $ value [ 'name' ] = $ key ; if ( ! isset ( $ value [ 'driver' ] ) ) { throw new Exception ( '[Norm] Cannot instantiate connection "' . $ key . '", Driver "' . @ $ value [ 'driver' ] . '" not found!' ) ; } $ Driver = $ value [ 'driver' ] ; static :: $ connections [ $ key ] = new $ Driver ( $ value ) ; if ( ! static :: $ connections [ $ key ] instanceof Connection ) { throw new Exception ( 'Norm connection [' . $ key . '] should be instance of Connection' ) ; } if ( ! $ first ) { $ first = $ key ; } } if ( ! static :: $ defaultConnection ) { static :: $ defaultConnection = $ first ; } }
Initialize framework from configuration. First connection registered from config will be the default connection.

@param array $config
@param array $collectionConfig

@return void
Initialize framework from configuration . First connection registered from config will be the default connection .