The method described in this article tries not to affect codeigniter'sCodeIn other words, codeigniter upgrade will not be affected by the firephp plug-in the future.
The procedure is as follows:
1. Download related plug-ins
- Firefox browser
- Firebug Extension
- Firephp Extension
Open Firefox and check that the network panel is enabled.
2. Download The firephp core library file
: Http://www.firephp.org/DownloadRelease/FirePHPLibrary-FirePHPCore-0.3.2 (or updated version)
Decompress the package, copy the file firephp. Class. php to the/application/libraries/directory, and change the file name to firephp. php.
3. Set autoload
Modify the file/application/config/autoload. php to enable the firephp library to automatically load the file:
$ Autoload ['libraries'] = array ('firephp ');
4. Modify the firephp. php file
Before the class declaration in the firephp. php file (line 60 or so), add the following code to enable and disable firephp using the settings in config.
$ CI = & get_instance (); if ($ ci-> config-> item ('Enable _ firephp') define ('Enable _ in_config ', true ); elsedefine ('Enable _ in_config ', false );
Search for filesProtected $ enabled = true, Replace itProtected $ enabled = enable_in_config.
5. Configure the config file
Find config. php In the application/config/directory and add the following line:
$ Config ['Enable _ firephp'] = true;
6. start using it.
Common usage:
$ This-> firephp-> log ($ myvariable)
: Print the variable in the firephp Console
$ This-> firephp-> warn ($ myvariable)
: Print the variables in the firephp console and classify them as warning.
$ This-> firephp-> error ($ myvariable)
: Print the variables in the firephp console and classify them as error.
You can also use group:
$ This-> firephp-> group ('test group'); $ this-> firephp-> log ('Hello World '); $ this-> firephp-> groupend ();
For more instructions, see firephp project website.