JCSama / CodeIgniter-develbar

CodeIgniter Developer Toolbar is a third party library based on Profiler Library with additional functionality for debugging and optimisation, Database, Models, Helpers, Libraries, Views, Ajax...
MIT License
176 stars 57 forks source link

Error after first setup. #26

Closed harizinside closed 6 years ago

harizinside commented 6 years ago

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: develbar/database.php

Line Number: 36

Backtrace:

File: C:\Xampp\htdocs\myproject\application\third_party\DevelBar\views\develbar\database.php Line: 36 Function: _error_handler

File: C:\Xampp\htdocs\myproject\application\core\MY_Loader.php Line: 133 Function: include

File: C:\Xampp\htdocs\myproject\application\third_party\DevelBar\hooks\Develbar.php Line: 403 Function: view

File: C:\Xampp\htdocs\myproject\application\third_party\DevelBar\hooks\Develbar.php Line: 191 Function: database_section

File: C:\Xampp\htdocs\myproject\index.php Line: 315 Function: require_once A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: develbar/database.php

Line Number: 36

Backtrace:

File: C:\Xampp\htdocs\myproject\application\third_party\DevelBar\views\develbar\database.php Line: 36 Function: _error_handler

File: C:\Xampp\htdocs\myproject\application\core\MY_Loader.php Line: 133 Function: include

File: C:\Xampp\htdocs\myproject\application\third_party\DevelBar\hooks\Develbar.php Line: 403 Function: view

File: C:\Xampp\htdocs\myproject\application\third_party\DevelBar\hooks\Develbar.php Line: 191 Function: database_section

File: C:\Xampp\htdocs\myproject\index.php Line: 315 Function: require_once -#Database : : No queries were run

after extract the zip and copy file into my project the error on db icon. config db done setup but still get this error, any solution?

CodeIgniter 3.1.8 Xampp 3.2.2 php 7.1 mysql 5.7

JCSama commented 6 years ago

Hello @harizinside I just installer the extension with a fresh C.I Package, and did not get this error, with both mysqli and pdo drivers.

harizinside commented 6 years ago

echo '-' . $db->hostname . '#' . lang('database') . ' : ' . $db->database .' : ' . lang('no_queries').'<br/>'; i don't know what i'm wrong, but a bug leads to that code.

JCSama commented 6 years ago

can you post your database config file ?

harizinside commented 6 years ago

sure `$query_builder = TRUE;

$db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'root', 'password' => 'mypassword', 'database' => 'kemarin_db', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => (ENVIRONMENT !== 'production'), 'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );`

JCSama commented 6 years ago

I'm sorry, but it's working just fine for me. did you use the latest package ?

harizinside commented 6 years ago

never mind, my vault. My language is missing.

damiandaud commented 6 years ago

CodeIgniter Version 3.1.8

\third_party\DevelBar\views\develbar\database.php Línea: 36

//echo '-' . $db->hostname . '#' . lang('database') . ' : ' . $db->database .' : ' . lang('no_queries').'<br/>';

if( isset( $db->hostname ) ){
    echo '-' . $db->hostname . '#' . lang('database') . ' : ' . $db->database .' : ' . lang('no_queries').'<br/>';
}elseif ( isset( $db['hostname'] ) ) {
    echo '-' . $db['hostname'] . '#' . lang('database') . ' : ' . $db['database'] .' : ' . lang('no_queries').'<br/>';
}else{
    echo "NO ES POSIBLE ENTREGAR INFORMACIÓN";
}