{"id":1191,"date":"2012-12-20T10:14:51","date_gmt":"2012-12-20T10:14:51","guid":{"rendered":"http:\/\/brain.payzip.co.kr\/?p=1191"},"modified":"2012-12-20T10:14:51","modified_gmt":"2012-12-20T10:14:51","slug":"php%eb%94%94%eb%b2%84%ea%b9%85-%ec%bd%94%eb%93%9c%ec%9d%b4%ea%b7%b8%ec%9d%b4%ed%84%b0-debugging-a-codeigniter-application-with-firephp-firebug-firephp","status":"publish","type":"post","link":"https:\/\/blog.goorigo.com\/?p=1191","title":{"rendered":"PHP\ub514\ubc84\uae45 &#8211; \ucf54\ub4dc\uc774\uadf8\uc774\ud130 (Debugging a CodeIgniter application with FirePHP), Firebug, FirePHP"},"content":{"rendered":"<p>http:\/\/speedtech.it\/blog\/2009\/05\/10\/debugging-a-codeigniter-application-with-firephp\/<\/p>\n<p>\uc624 \uce5c\uc808\ud558\uac8c \uc124\uba85\uc774 \uc798\ub418\uc5b4\uc788\uad6c\ub9cc&#8230; 2009\ub144\ub3c4 \uae00\uc774\ub124 -_-;<\/p>\n<h1>Debugging a CodeIgniter application with FirePHP<\/h1>\n<div>by\u00a0<a title=\"Posts by Roberto\" href=\"http:\/\/speedtech.it\/blog\/author\/admin\/\" rel=\"author\">Roberto<\/a>\u00a0on\u00a0<abbr title=\"2009-05-10T09:24:19+0000\">May 10, 2009<\/abbr>\u00a0in\u00a0<a title=\"View all posts in General\" href=\"http:\/\/speedtech.it\/blog\/category\/general\/\">General<\/a><\/div>\n<div>\n<p><a href=\"http:\/\/firephp.org\/\">FirePHP<\/a>\u00a0is an addon for\u00a0<a href=\"http:\/\/getfirebug.com\/\">FireBug<\/a>\u00a0extension for\u00a0<a href=\"http:\/\/www.mozilla.com\/en-US\/firefox\/\">Firefox browser<\/a>.<\/p>\n<p>FirePHP extends FireBug functionalities to show log or error messages coming from your PHP application. These messages won\u2019t be printed on the application interface but instead on the FireBug console.<\/p>\n<p>What do you need to integrate this debugging feature in your application :<\/p>\n<ol>\n<li><a href=\"http:\/\/www.mozilla.com\/en-US\/firefox\/\">Firefox<\/a>\u00a0browser<\/li>\n<li><a href=\"http:\/\/getfirebug.com\/\">FireBug<\/a>\u00a0extension<\/li>\n<li><a href=\"http:\/\/firephp.org\/\">FirePHP<\/a>\u00a0extension<\/li>\n<\/ol>\n<p>The next step is to open Firefox and visit the url where your application is located and activate the\u00a0<code>Net panel<\/code>\u00a0in FireBug, clicking the bottom right Firebug icon in Firefox window.<\/p>\n<p><img loading=\"lazy\" title=\"FireBug Net Panel\" src=\"http:\/\/speedtech.it\/wp-content\/uploads\/2009\/05\/firebug-net-panel.png\" alt=\"FireBug Net Panel\" width=\"500\" height=\"137\" \/><\/p>\n<p>The client (the browser), is now ready to accept the debugging messages, we have now to integrate the FirePHP library with the CodeIgniter application on server side :<\/p>\n<ul>\n<li>dowload the FirePHP Core Library from\u00a0<a href=\"http:\/\/www.firephp.org\/DownloadRelease\/FirePHPLibrary-FirePHPCore-0.2.1\">here<\/a><\/li>\n<li>extract the\u00a0<code>FirePHP.class.php<\/code>\u00a0from the archive, rename it to\u00a0<code>firephp.php<\/code>\u00a0and copy in the<code>system\/application\/libraries<\/code>\u00a0directory of your CodeIgniter application<\/li>\n<\/ul>\n<p>Now you can use FirePHP to debug your code :<\/p>\n<ul>\n<li>load the library :\u00a0<code>$this-&gt;load-&gt;library('firephp')<\/code><\/li>\n<li>send debug messages to the FireBug console :\u00a0<code>$this-&gt;firephp-&gt;log($myvariable)<\/code>\u00a0or<code>$this-&gt;firephp-&gt;error('Error at this line')<\/code><\/li>\n<\/ul>\n<p>Detailed instructions to use FirePHP are available on\u00a0<a href=\"http:\/\/www.firephp.org\/HQ\/Use.htm\">FirePHP project website<\/a>. The most useful method for me are :<\/p>\n<ul>\n<li><code>$this-&gt;firephp-&gt;log($myvariable)<\/code>\u00a0: send a dump of the variable\u00a0<code>$myvariable<\/code>\u00a0on the FireBug console<\/li>\n<li><code>$this-&gt;firephp-&gt;warn($myvariable)<\/code>\u00a0: send a dump of the variable\u00a0<code>$myvariable<\/code>\u00a0on the FireBug console classified as a warning<\/li>\n<li><code>$this-&gt;firephp-&gt;error($myvariable)<\/code>\u00a0: send a dump of the variable\u00a0<code>$myvariable<\/code>\u00a0on the FireBug console classified as an error<\/li>\n<\/ul>\n<p>Here there is a little example on how you can use FirePHP with CodeIgniter :<\/p>\n<div>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>And this is the output on the Firefox\u2019s FirePHP console :<br \/>\n<img loading=\"lazy\" title=\"FirePHP console\" src=\"http:\/\/speedtech.it\/wp-content\/uploads\/2009\/05\/firephp_console.png\" alt=\"FirePHP console\" width=\"596\" height=\"193\" \/><\/p>\n<p>The debug messages can be disabled with the method :\u00a0<code>$this-&gt;firephp-&gt;setEnabled(FALSE)<\/code>.<br \/>\nIt is also possible to make the messages appear only for specific ip addresses :<\/p>\n<div>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Suggested books<\/p>\n<p><a href=\"http:\/\/www.packtpub.com\/codeigniter-php-application-development-mvc\/mid\/170909yjl0bm?utm_source=Speedtech.it&amp;utm_medium=affiliate&amp;utm_content=other&amp;utm_campaign=mdb_000683\"><img loading=\"lazy\" title=\"CodeIgniter for rapid PHP application development\" src=\"http:\/\/speedtech.it\/wp-content\/uploads\/2009\/09\/codeigniter-for-rapid-php-application-development.png\" alt=\"CodeIgniter for rapid PHP application development\" width=\"97\" height=\"123\" \/><\/a><a href=\"http:\/\/www.packtpub.com\/codeigniter-1-7-professional-development\/book\/mid\/060510fsf1ym?utm_source=speedtech.it&amp;utm_medium=affiliate&amp;utm_content=authorsite&amp;utm_campaign=mdb_003241\"><img loading=\"lazy\" title=\"CodeIgniter 1.7 Professional Development\" src=\"http:\/\/speedtech.it\/wp-content\/uploads\/2010\/05\/book_codeigniter_1.7_professional_development.jpg\" alt=\"CodeIgniter 1.7 Professional Development\" width=\"97\" height=\"123\" \/><\/a><\/p>\n<div>\n<div id=\"related-posts-MRP_all\">\n<h2>Related Posts<\/h2>\n<ul>\n<li><a href=\"http:\/\/speedtech.it\/blog\/2010\/07\/18\/book-codeigniter-1-7-professional-development\/\">Book : CodeIgniter 1.7 Professional Development<\/a><\/li>\n<li><a href=\"http:\/\/speedtech.it\/blog\/2010\/05\/26\/book-codeigniter-1-7\/\">Book : CodeIgniter 1.7<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/speedtech.it\/blog\/2009\/05\/10\/debugging-a-codeigniter-application-with-firephp\/ \uc624 \uce5c\uc808\ud558\uac8c \uc124\uba85\uc774 \uc798\ub418\uc5b4\uc788\uad6c\ub9cc&#8230; 2009\ub144\ub3c4 \uae00\uc774\ub124 -_-; Debugging a CodeIgniter application with FirePHP by\u00a0Roberto\u00a0on\u00a0May 10, 2009\u00a0in\u00a0General FirePHP\u00a0is an addon for\u00a0FireBug\u00a0extension for\u00a0Firefox browser. FirePHP extends FireBug functionalities to show log&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts\/1191"}],"collection":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1191"}],"version-history":[{"count":0,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts\/1191\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}