Giter Site home page Giter Site logo

jcsama / codeigniter-develbar Goto Github PK

View Code? Open in Web Editor NEW
176.0 20.0 58.0 273 KB

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...

License: MIT License

PHP 98.81% HTML 1.19%
developer-toolbar codeigniter profiler-library party-library hmvc

codeigniter-develbar's Introduction

CodeIgniter Developer Toolbar

CodeIgniter Developer Toolbar is a third party library based on Profiler Library with additional functionality for debugging and optimization.

  • Support CI.2 and CI.3
  • Support HMVC.

Screen-shot

Alt text Alt text

Installation

Copy the files to the application/third_party/DevelBar folder.

Copy the file core/MY_Loader.php to the application/core folder.

Copy the file controllers/develbarprofiler.php to the application/controllers folder.

Change permissions for cache folder chmod 777 application/cache

For HMVC

If you are using HMVC third party library, copy MX_Loader.php instead of MY_Loader.php to your core directory, and change the file name to MY_Loader.php instead of MX_Loader.php.

Usage

Open application/config/autoload.php :

$autoload['packages'] = array(APPPATH . 'third_party/DevelBar');

Open application/config/config.php :

$config['enable_hooks'] = TRUE;

Open application/config/hooks.php and add this line :

$hook['display_override'][] = array(
	'class'  	=> 'Develbar',
    'function' 	=> 'debug',
    'filename' 	=> 'Develbar.php',
    'filepath' 	=> 'third_party/DevelBar/hooks'
);

Enable or disable Develbar, open application/third_party/DevelBar/config/config.php :

$config['enable_develbar'] = TRUE;

Additional parameters

If you want to disable some sections within the developer toolbar,

Open application/third_party/DevelBar/config/config.php, and set the sections value to FALSE :

$config['develbar_sections'] = array(
	'Benchmarks' 		=> TRUE,
    'Memory Usage'	   	=> TRUE,
    'Request'   		=> TRUE,
    'Database'			=> TRUE,
    'Hooks'			=> FALSE, // Disable Hooks Section
    'Libraries'			=> TRUE,
    'Helpers' 			=> FALSE, // Disable Helpers Section,
    'Views' 			=> TRUE,
    'Config' 			=> TRUE,
    'Session' 			=> TRUE,
    'Models' 			=> TRUE,
    'Ajax'                      => TRUE,
);

To auto check for available new version of CodeIgniter and DeveloperToolbar, you should set check_update option to TRUE, within application/third_party/DevelBar/config/config.php :

$config['check_update'] = TRUE;

codeigniter-develbar's People

Contributors

cijagani avatar iyongbudiarso avatar jcsama avatar mavisland avatar varunsridharan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codeigniter-develbar's Issues

missing data handle vars parsed to views and/or complete trace files

i cannot see the data boject with all the vars parsed to views?!

		$data['objetousuario1'] = $object1->result();
		$data['objetousuario2'] = $object2->result();
		$this->load->view('header.php',$data);
		$this->load->view('adm_indicadores_verdata.php',$data);
		$this->load->view('footer.php',$data);

develbar does not offers to user two important things:

  1. complete trace of files loaded secuence (see forensics addon) with each time spend
  2. complete vars manage into views also inte session

also db objects are overriting by default object see comments in #7 if i have a default db instance, each other are not handle!

How to find profiler ID?

After installing (copying files), I don't know how to proceed. When I go to develbarprofiler/profil it asks for a profileID, which is not mentioned in the documentation.

I also noticed it does not create files inside the cache folder.

db multi instances are managed or not

i note that CI couln handle multiple instances in the normal profiler, event the forencis profiler addon either.....

this develbar doesn seems to handle either, due i do nto see in the code a search for instances of the DB type class before load and show the querys made.. or i wrong?

echo models loaded

Hello guy, thanks you for your plugin, it's great.

I had installed this, it's works but i have "echo" about my models loaded in top page, do you know how disable it?

Thanks a lot.

Working with PDO gives error.

Hi, I am using PDO driver in Codeigniter 3.x. When I enabled DevelBar, it throws an error:

error: {type: "PDOException", message: "You cannot serialize or unserialize PDO instances",…}
    file: "/system/libraries/Cache/drivers/Cache_file.php"
    line: 104
    message: "You cannot serialize or unserialize PDO instances"
    type: "PDOException"

How can I fix it? Thanks for any help.

CI profiler not visible debug profiler view

Hi,

How to enable profiler view? (https://raw.githubusercontent.com/JCSama/CodeIgniter-develbar/gh-pages/images/Screen-Shot-develbar-profiler.png)

If develbar is enabled not showing profiler.
Welcome controller:

`<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {
public function index()
{
$this->output->enable_profiler(TRUE);

	$this->load->view('welcome_message');
}

}
fireshot capture 5 - welcome to codeigniter - http___localhost_public_welcome

Disabled develbar
fireshot capture 4 - welcome to codeigniter - http___localhost_public_welcome

Thanks for help.
Prepared

`

Error after first setup.

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

AJAX panel not visible

Hi,

I installed it on CodeIgniter 3.1.2, I see the develbar at the bottom, but I cant find a way to open the full AJAX panel.

Also there is a CSS issue with Database section, if too many queries are listed, it overlaps with the develbar, instead of appearing in a scrollbar.

Call to undefined function lang()

I'm getting this error when I try to run it:

ERROR - 2017-03-31 10:57:17 --> Severity: error --> Exception: Call to undefined function lang() /Users/acme/Public/Websites/demo.dev/application/third_party/DevelBar/views/develbar/benchmarks.php 1

Breaking view when adding config data

In my config files, if i add $config['foobar'] = '<li>'; the develbar view is breaking. <li> seems to be the problem. (the green squares are from me)
develbar-bugview

Loads request twice

Hello
Thanks for this great tool

But i am having a problem

When i load a page, it loads the page content twice. that is, the content on the page shows in two, one up and one below it, same content.

An it also do ajax request twice.

Thank you

Reg : Issue in ajax Request.

Hi,

I am using this DevelBar In my CodeIgniter project. but i am having issues in ajax request.

I have no idea on how to setup an ajax request in codeigniter but i created an controller named ajax in my project and using that i do all the actions i need to do via ajax

but i am getting html printed out in each and every ajax request. for most of the ajax request i get json as response which makes it break :(

ajax.js problem on profilerLink

i have detect a problem on profilerLink

i'm getting this error Uncaught (in promise) ReferenceError: profilerLink is not defined

can share with us ajax.js the original file cause this one is minified and variables has been changed

i have solve the problem but add comment to

/*""!=b.profiler&&(profilerLink.textContent="profiler",n.appendChild(n)),*/

waiting for your feedback

B.R

Ajax requests can't work if not default templator used

$output = $this->CI->output->get_output(); //null;
$output = preg_replace('|(.*?)</head>|is', ''.$js.'$1', $output, 1, $count); //so not work

very force hack, but work fine )
$develBarOutput = $this->develbar_output();
// Patch for Pace.js or similar
if (true == $this->default_options['develbar_sections']['Ajax']) {
$js = $this->CI->load->file($this->assets_folder.'js/ajax.js', true);
$js = '<script type="text/javascript">var cidvl_siteurl="'. site_url().'";'.$js.'</script>';
$develBarOutput .= $js;
}
$this->CI->output->_display($develBarOutput);
return;

Autoloading Database in the config.php

  • Expected behavior and actual behavior.
    hello when adding autoloading the database in the config.php, we should expect to see the database setup
    but what happen either no data will return when hover on the database icon or and error will return, here is the attach screenhot
    image

  • Steps to reproduce the problem.
    I just simply autoload the libraty database in the config.php

  • Specifications like the version of the project, operating system, or hardware.
    I use the latest CI 3.1.9 with mysql in windows 10 running in IIS

also for my basic work around, i simply change the object to array return function in views database.php, here is the below
image

Problem in my project

Hi,

In my french project with many librairies, helpers, multilangue system, etc. I immediately get an error page after install library

Unable to load the requested language file: language/french/develbar_lang.php

I change language to english and this time many errors appear

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Home::$hostname

Filename: core/Model.php

Line Number: 77

Backtrace:

File: Q:\www\CodeIgniter3-cedricr\web\application_cicr\third_party\DevelBar\hooks\Develbar.php
Line: 286
Function: __get

File: Q:\www\CodeIgniter3-cedricr\web\application_cicr\third_party\DevelBar\hooks\Develbar.php
Line: 147
Function: call_user_func

File: Q:\www\CodeIgniter3-cedricr\web\index.php
Line: 292
Function: require_once

I can temporaly resolve with this fix in Develbar.php (line 279 & 284):

$db_server[$cobject->hostname] = $cobject->hostname;

to

if(isset($cobject->hostname)) $db_server[$cobject->hostname] = $cobject->hostname;

For the moment i have not enough time to find why errors happen but this is a first approach

Use OOP features

why You not use OOP ?

protected function _ci_load($_ci_data) {
//your code goes here
 return parent::_ci_load($_ci_data);
}

Cannot use object of type Closure as array

I use another hook like pre_system and post_controller_constructor. And an error appears "Cannot use object of type closure as array. I have 2 problem in this

  1. Cannot view hook if value of params is array (Array to string conversation)
  2. Cannot use object of type Closure as array

Check my config hooks.php

screenshot-localhost-8201-2017-10-11-09-32-45-550

My Request Pull #19

Thanks

Italian translation

Just a FYI. in the "Language" folder the "Italian" folder has a capital "I". The file can't be found as CI is checking for 'third_party/DevelBar/language/italian/develbar_lang.php'.

If this is the worst mistake you have then you should be proud! :)

Thanks, Scott

Bug in application\third_party\DevelBar\views\develbar\database.php

On a fresh install of Code Igniter 3.1.10, I received an error:

A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: develbar/database.php
Line Number: 36

This error can be reproduced on any page with no SQL query.

There is indeed a problem in the code. At line 10 && 26, you access $db like an array:

Line 10:
echo '-' . $db['hostname'] . '#' . lang('database') . ' : ' . $db['database'] . '<br/>';

Line 26:
$total_execution_time = array_sum($db['query_times']);

But, line 36, you access it like an object:

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

Because all the lines are part of an if / else structure, there is no valid reason to change the way you access the variable.

Especially, on a fresh CI install, $dbs is an array so it's indeed impossible to access it like an object.

The fix is to edit line 36:

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

Displaying view twice

It loads view twice.
I'm using CI version 3.1.11 with HMVC library, PHP 7.3.9

I debugged it that it is because of using MX_Loader class. If I disable this I cannot see the debugger bar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.