lib/ezdbschema/classes/ezdbschema.php
static function instance( $params = false )
    {
        if ( is_object( $params ) )
        {
            $db = $params;
            $params = array( 'instance' => $db );
        }

        if ( !isset( $params['instance'] ) )
        {
            $db = eZDB::instance();
            $params['instance'] = $db;
        }

        $db = $params['instance'];

        if ( !isset( $params['type'] ) )
            $params['type'] = $db->databaseName();
        if ( !isset( $params['schema'] ) )
            $params['schema'] = false;

        $dbname = $params['type'];

        /* Load the database schema handler INI stuff */
        $ini = eZINI::instance( 'dbschema.ini' );
        $schemaPaths = $ini->variable( 'SchemaSettings', 'SchemaPaths' );
        $schemaHandlerClasses = $ini->variable( 'SchemaSettings', 'SchemaHandlerClasses' );

        /* Check if we have a handler */
        if ( !isset( $schemaPaths[$dbname] ) or !isset( $schemaHandlerClasses[$dbname] ) )
        {
            eZDebug::writeError( "No schema handler for database type: $dbname", __METHOD__ );
            return false;
        }

        /* Include the schema file and instantiate it */
        require_once( $schemaPaths[$dbname] );
        return new $schemaHandlerClasses[$dbname]( $params );
    }
static function instance( $params = false )
    {
        if ( is_object( $params ) )
        {
            $db = $params;
            $params = array( 'instance' => $db );
        }

        if ( !isset( $params['instance'] ) )
        {
            $db = eZDB::instance();
            $params['instance'] = $db;
        }

        $db = $params['instance'];

        if ( !isset( $params['type'] ) )
            $params['type'] = $db->databaseName();
        if ( !isset( $params['schema'] ) )
            $params['schema'] = false;

        $dbname = $params['type'];

        /* Load the database schema handler INI stuff */
        $ini = eZINI::instance( 'dbschema.ini' );
        $schemaPaths = $ini->variable( 'SchemaSettings', 'SchemaPaths' );
        $schemaHandlerClasses = $ini->variable( 'SchemaSettings', 'SchemaHandlerClasses' );

        /* Check if we have a handler */
        if ( !isset( $schemaPaths[$dbname] ) or !isset( $schemaHandlerClasses[$dbname] ) )
        {
            eZDebug::writeError( "No schema handler for database type: $dbname", __METHOD__ );
            return false;
        }

        /* Include the schema file and instantiate it */
        require_once( $schemaPaths[$dbname] );
        return new $schemaHandlerClasses[$dbname]( $params );
    }
static function instance ( $ params = false ) { if ( is_object ( $ params ) ) { $ db = $ params ; $ params = array ( 'instance' => $ db ) ; } if ( ! isset ( $ params [ 'instance' ] ) ) { $ db = eZDB :: instance ( ) ; $ params [ 'instance' ] = $ db ; } $ db = $ params [ 'instance' ] ; if ( ! isset ( $ params [ 'type' ] ) ) $ params [ 'type' ] = $ db -> databaseName ( ) ; if ( ! isset ( $ params [ 'schema' ] ) ) $ params [ 'schema' ] = false ; $ dbname = $ params [ 'type' ] ; /* Load the database schema handler INI stuff */ $ ini = eZINI :: instance ( 'dbschema.ini' ) ; $ schemaPaths = $ ini -> variable ( 'SchemaSettings' , 'SchemaPaths' ) ; $ schemaHandlerClasses = $ ini -> variable ( 'SchemaSettings' , 'SchemaHandlerClasses' ) ; /* Check if we have a handler */ if ( ! isset ( $ schemaPaths [ $ dbname ] ) or ! isset ( $ schemaHandlerClasses [ $ dbname ] ) ) { eZDebug :: writeError ( "No schema handler for database type: $dbname" , __METHOD__ ) ; return false ; } /* Include the schema file and instantiate it */ require_once ( $ schemaPaths [ $ dbname ] ) ; return new $ schemaHandlerClasses [ $ dbname ] ( $ params ) ; }
Returns a shared instance of the eZDBSchemaInterface class.

@param array|eZDBInterface|false $params If array, following key is needed:
- instance: the eZDB instance (optional), if none provided, eZDB::instance() will be used.
@return eZDBSchemaInterface|false
Returns a shared instance of the eZDBSchemaInterface class .