On Sat, Jul 4, 2009 at 2:38 AM, KimG<kim.gabriel...@get2net.dk> wrote:
>
> hi,
>
> im trying to get my bootstrap working.
>
> from the zend documentation - as far as i unerstand it - it's possible to
> load ressources by defining them in the config file - right? (at least as
> long as they are the predefined type).
>
> i've created a very simple bootstrap file as defined in the quickstart
> tutorial.
>
> i would like to create my session in the boot strap so i conclude from the
> zend doc that i could just do the following in my ini file:
>
> ;Database connection settings
> resources.db.adapter = "PDO_MYSQL"
> resources.db.params.host = "localhost"
> resources.db.params.username = "user"
> resources.db.params.password = "password"
> resources.db.params.dbname = "db1"
> resources.db.isDefaultTableAdapter = "true"
> ;Session stuff
> resources.session.save_path = APPLICATION_PATH "/../data/session"
> resources.session.use_only_cookies = true
> resources.session.remember_me_seconds = 864000
> resources.session.saveHandler.class = "Zend_Session_SaveHandler_DbTable"
> resources.session.saveHandler.options.name = "session"
> resources.session.saveHandler.options.primary.session_id = "session_id"
> resources.session.saveHandler.options.primary.save_path = "save_path"
> resources.session.saveHandler.options.primary.name = "name"
> resources.session.saveHandler.options.primaryAssignment.sessionId =
> "sessionId"
> resources.session.saveHandler.options.primaryAssignment.sessionSavePath =
> "sessionSavePath"
> resources.session.saveHandler.options.primaryAssignment.sessionName =
> "sessionName"
> resources.session.saveHandler.options.modifiedColumn = "modified"
> resources.session.saveHandler.options.dataColumn = "session_data"
> resources.session.saveHandler.options.lifetimeColumn = "lifetime"
>
>
> as far as i'm concerned this should create the database adapter first and
> second the session. right?
>
> but i get the following error message when i test it:
>
> Zend_Db_Table_Exception' with message 'No adapter found for
> Zend_Session_SaveHandler_DbTable' i......
>
> how do i make the connection between the db and the session?
>
> is there a more advanced tutorial available than the quickstart application
> for zend 1.8.x?
>
> kim

You could set a default DB connection for Zend_Db_Table in your bootstrap:

// $db is created
Zend_Db_Table_Abstract::setDefaultAdapter($db);

Otherwise, you could try something like:
resources.session.saveHandler.options.adapter = db;

I'm not sure if this is what it expects, you might need to step
through the code.

Till

Reply via email to