The $objConfiguration comes from the index.php, look:

#
# Checking modules integrity.
#

/**
 * Check the existence of a class.
 *
 * @param string $strClass Class name.
 * @return void.
 */
function __autoload( $strClass )
{
    Zend_Loader::loadClass( $strClass );
}

#
# Load configuration.
#

// Look wich type of configuration we need.
$strConfigurationNode = "development";

// Load configuration file.
$objConfiguration = new Zend_Config_Xml( '../config.xml', $strConfigurationNode 
);

// Register configuration object.
Zend_Registry::set( 'objConfiguration', $objConfiguration );

And then:


// Load db.
require_once( "index_db.php" );

So the $objConfiguration is on the index.php so after loading it I include the 
"index_db.php". The value of $objConfiguration->database->type is: "pdo_pgsql".

Thx for any help :).

----- Original Message -----
From: "Matthew Weier O'Phinney" <[EMAIL PROTECTED]>
To: [email protected]
Sent: miƩrcoles 26 de septiembre de 2007 11H56 (GMT-0500) America/Bogota
Subject: Re: [fw-general] Zend_Loader issue on ZFW 1.0.2

-- Juan Felipe Alavarez Saldarriaga <[EMAIL PROTECTED]> wrote
(on Wednesday, 26 September 2007, 04:25 PM +0000):
> This is my index.php code:
> 
> #
> # Checking modules integrity.
> #
> 
> /**
>  * Check the existence of a class.
>  *
>  * @param string $strClass Class name.
>  * @return void.
>  */
> function __autoload( $strClass )
> {
>     Zend_Loader::loadClass( $strClass );
> }

Try using:

    Zend_Loader::registerAutoload();

instead of the above; it uses spl_autoload, and will allow you to
register additional autoload routines in the future.

> // Load db.
> require_once( "index_db.php" );
> 
> And this is my index_db.php script code:
> 
> // Load DB info
> $arrDbConfig = array( 
>                               'host'     => $objConfiguration->database->host,

Where does $objConfiguration come from?

>                                 'username' => 
> $objConfiguration->database->username,
>                               'password' => 
> $objConfiguration->database->password,
>                               'dbname'   => $objConfiguration->database->name,
>                               'profiler' => 
> $objConfiguration->database->profiler
>                       );
> 
> // Set connection to the database.
> $objDb = Zend_Db::factory( $objConfiguration->database->type, $arrDbConfig );

What is the value of $ojbConfiguration->database->type? I'm guessing
that the error comes into play here, as that value is used to determine
which Zend_Db_Adapter to load.

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to