Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- application.ini
- [production]
- resources.view[] =
- resources.db.adapter = PDO_MYSQL
- resources.db.params.host = localhost
- resources.db.params.username = xxxx
- resources.db.params.password = xxxx
- resources.db.params.dbname = mydb
- resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
- ; following line added
- resources.db.params.profiler.enabled = "true"
- resources.db.params.profiler.class = "Zend_Db_Profiler_Firebug"
- <?php
- class LoginController extends Zend_Controller_Action
- {
- public function indexAction()
- {
- // Database connection
- $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', 'production');
- // we already told in our application ini else
- //$profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
- //$profiler->setEnabled(true);
- $db = Zend_Db::factory($config->resources->db);
- $this->db = $db;
- // this query will be showing in profiler
- $db->query("select *from clients");
- /**
- Zend_Db_Profiler_Firebug (2 @ 0.000180 sec)
- Time Event Parameters
- ==== ===== ===========
- 0.00061 connect NULL
- 0.00057 select *from clients NULL
- */
- }
- }
Add Comment
Please, Sign In to add comment