Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Pages: 1
Bonjour.
Je viens tout juste de débuter sous zend et je me suis donc lancé dans le fameux tutoriel de la collection de CD. Le tuto que je suis est disponible à cette adresse : http://akrabat.com/wp-content/uploads/g … rk-162.pdf
Voilà j'ai suivi pas à pas jusqu'à la partie ou l'on utilise un seul fichier phtml plutôt que les 4.
Mais à l'exécution je me retrouve avec l'erreur suivante :
Message: No adapter found for Model_DbTable_Albums
Stack trace:
#0 C:\wamp\www\zf-tutorial\library\Zend\Db\Table\Abstract.php(652): Zend_Db_Table_Abstract->_setupDatabaseAdapter()
#1 C:\wamp\www\zf-tutorial\library\Zend\Db\Table\Abstract.php(286): Zend_Db_Table_Abstract->_setup()
#2 C:\wamp\www\zf-tutorial\application\controllers\IndexController.php(16): Zend_Db_Table_Abstract->__construct()
#3 C:\wamp\www\zf-tutorial\library\Zend\Controller\Action.php(512): IndexController->indexAction()
#4 C:\wamp\www\zf-tutorial\library\Zend\Controller\Dispatcher\Standard.php(288): Zend_Controller_Action->dispatch('indexAction')
#5 C:\wamp\www\zf-tutorial\library\Zend\Controller\Front.php(945): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#6 C:\wamp\www\zf-tutorial\library\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch()
#7 C:\wamp\www\zf-tutorial\library\Zend\Application.php(328): Zend_Application_Bootstrap_Bootstrap->run()
#8 C:\wamp\www\zf-tutorial\public\index.php(26): Zend_Application->run()
#9 {main}
Request Parameters:
array(3) {
["controller"]=>
string(5) "index"
["action"]=>
string(5) "index"
["module"]=>
string(7) "default"
}
En cherchant un peu j'ai pu trouver quelques personnes avec un problème similaire, mais dans un contexte différent à chaque fois...
Bref je suis un peu perdu donc je viens vers vous afin de trouver une piste qui pourrait me permettre de résoudre mon problème.
Merci d'avance.
Dernière modification par slake13 (26-06-2009 10:04:05)
Hors ligne
Hello,
As-tu bien défini la partie base de données :
[production] resources.db.adapter = PDO_MYSQL resources.db.params.host = localhost resources.db.params.username = rob resources.db.params.password = 123456 resources.db.params.dbname = zf-tutorial
A+
Hors ligne
Salut.
Voici mon fichier config.ini :
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
phpSettings.date.timezone = "GMT"
resources.layout.layoutpath = APPLICATION_PATH "/layouts"
[staging : production]
resources.db.adapter = PDO_MYSQL
resources.db.params.host = localhost
resources.db.params.username = x
resources.db.params.password = x
resources.db.params.dbname = zf-tutorial
resources.db.params.port = 3306
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
Donc voilà le nom et le password sont bon ça c'est sûr. Puis-je avoir la possibilité de vérifier si il se connecte correctement à la BDD ?
Hors ligne
Hello,
Ne mets pas tes infos de base en 'staging' si tu initialises un mode 'production' (ou 'test' ou 'developpement') ensuite.
Déplaces tes infos dans la clé production.
A+
Hors ligne
Super merci beaucoup ça marche nickel !
Je vais un peu lire la doc pour comprendre à quoi servent exactement les différentes sections.
Merci encore !
Hors ligne
Hello,
Cela te permet de paramétrer différents environnement et de basculer rapidement de l'un vers l'autre : production, staging (=recette), test, development.
A+
Hors ligne
Pages: 1