{"id":814,"date":"2012-06-15T07:50:21","date_gmt":"2012-06-15T07:50:21","guid":{"rendered":"http:\/\/www.websitedesignwebsitedevelopment.com\/?p=814"},"modified":"2014-03-19T09:13:51","modified_gmt":"2014-03-19T09:13:51","slug":"codeigniter-error-reporting-intelligent-fix","status":"publish","type":"post","link":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/","title":{"rendered":"Codeigniter Error Reporting &#8211; Intelligent Fix"},"content":{"rendered":"<h2>Codeigniter Error Reporting &#8211; Intelligent Fix<\/h2>\n<h3>Description:<\/h3>\n<p>This little fix will help you to manage the error reporting automatically that if you ever will go online so error reporting will be disabled and when you will import you database in localhost and development phase will be continued so no headache of changing this ENVIRONMENT constant accordingly. By this automatic setting you can save your time and also prevent the unexpected situation where you can forget changing this constant before going online or again working offline.<\/p>\n<p><strong>\u00a0Target File:<\/strong> index.php (Codeigniter <em>Root Directory<\/em>)<\/p>\n<p>if(in_array($_SERVER[&#8216;HTTP_HOST&#8217;],array(&#8216;localhost&#8217;)))<br \/>\n{<br \/>\ndefine(&#8216;ENVIRONMENT&#8217;, &#8216;development&#8217;); \/\/ 15-06-2012<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\ndefine(&#8216;ENVIRONMENT&#8217;, &#8216;production&#8217;); \/\/ 15-06-2012<br \/>\n}<\/p>\n<p>\/*<br \/>\n*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n* ERROR REPORTING<br \/>\n*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n*<br \/>\n* Different environments will require different levels of error reporting.<br \/>\n* By default development will show errors but testing and live will hide them.<br \/>\n*\/<\/p>\n<p>if (defined(&#8216;ENVIRONMENT&#8217;))<br \/>\n{<br \/>\nswitch (ENVIRONMENT)<br \/>\n{<br \/>\ncase &#8216;development&#8217;:<br \/>\nerror_reporting(E_ALL);<br \/>\nbreak;<\/p>\n<p>case &#8216;testing&#8217;:<br \/>\ncase &#8216;production&#8217;:<br \/>\nerror_reporting(0);<br \/>\nbreak;<\/p>\n<p>default:<br \/>\nexit(&#8216;The application environment is not set correctly.&#8217;);<br \/>\n}<br \/>\n}<br \/>\nThanks,<br \/>\nFahad<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Codeigniter Error Reporting &#8211; Intelligent Fix Description: This little fix will help you to manage the error reporting automatically that if you ever will go online so error reporting will be disabled and when you will import you database in localhost and development phase will be continued so no headache of changing this ENVIRONMENT constant [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-814","post","type-post","status-publish","format-standard","hentry","category-codeigniter"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Codeigniter Error Reporting - Intelligent Fix<\/title>\n<meta name=\"description\" content=\"Codeigniter Error Reporting - Intelligent Fix\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Codeigniter Error Reporting - Intelligent Fix\" \/>\n<meta property=\"og:description\" content=\"Codeigniter Error Reporting - Intelligent Fix\" \/>\n<meta property=\"og:url\" content=\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/\" \/>\n<meta property=\"og:site_name\" content=\"AndroidBubble Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/Website-Design-Website-Development\/172363336135453\" \/>\n<meta property=\"article:published_time\" content=\"2012-06-15T07:50:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-03-19T09:13:51+00:00\" \/>\n<meta name=\"author\" content=\"Fahad\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fahad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/\"},\"author\":{\"name\":\"Fahad\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\"},\"headline\":\"Codeigniter Error Reporting &#8211; Intelligent Fix\",\"datePublished\":\"2012-06-15T07:50:21+00:00\",\"dateModified\":\"2014-03-19T09:13:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/\"},\"wordCount\":173,\"articleSection\":[\"CodeIgniter\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/\",\"url\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/\",\"name\":\"Codeigniter Error Reporting - Intelligent Fix\",\"isPartOf\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/#website\"},\"datePublished\":\"2012-06-15T07:50:21+00:00\",\"dateModified\":\"2014-03-19T09:13:51+00:00\",\"author\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\"},\"description\":\"Codeigniter Error Reporting - Intelligent Fix\",\"breadcrumb\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/androidbubble.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Website Development\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PHP Frameworks\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"CodeIgniter\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/codeigniter\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Codeigniter Error Reporting &#8211; Intelligent Fix\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#website\",\"url\":\"https:\/\/androidbubble.com\/blog\/\",\"name\":\"AndroidBubble Blog\",\"description\":\"Articles &amp; Posts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/androidbubble.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\",\"name\":\"Fahad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g\",\"caption\":\"Fahad\"},\"sameAs\":[\"http:\/\/www.androidbubbles.com\/\",\"https:\/\/x.com\/phpFlex\"],\"url\":\"https:\/\/androidbubble.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Codeigniter Error Reporting - Intelligent Fix","description":"Codeigniter Error Reporting - Intelligent Fix","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/","og_locale":"en_US","og_type":"article","og_title":"Codeigniter Error Reporting - Intelligent Fix","og_description":"Codeigniter Error Reporting - Intelligent Fix","og_url":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/","og_site_name":"AndroidBubble Blog","article_publisher":"https:\/\/www.facebook.com\/pages\/Website-Design-Website-Development\/172363336135453","article_published_time":"2012-06-15T07:50:21+00:00","article_modified_time":"2014-03-19T09:13:51+00:00","author":"Fahad","twitter_misc":{"Written by":"Fahad","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/#article","isPartOf":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/"},"author":{"name":"Fahad","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7"},"headline":"Codeigniter Error Reporting &#8211; Intelligent Fix","datePublished":"2012-06-15T07:50:21+00:00","dateModified":"2014-03-19T09:13:51+00:00","mainEntityOfPage":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/"},"wordCount":173,"articleSection":["CodeIgniter"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/","url":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/","name":"Codeigniter Error Reporting - Intelligent Fix","isPartOf":{"@id":"https:\/\/androidbubble.com\/blog\/#website"},"datePublished":"2012-06-15T07:50:21+00:00","dateModified":"2014-03-19T09:13:51+00:00","author":{"@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7"},"description":"Codeigniter Error Reporting - Intelligent Fix","breadcrumb":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/codeigniter-error-reporting-intelligent-fix\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/androidbubble.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Website Development","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/"},{"@type":"ListItem","position":3,"name":"PHP Frameworks","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/"},{"@type":"ListItem","position":4,"name":"CodeIgniter","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/codeigniter\/"},{"@type":"ListItem","position":5,"name":"Codeigniter Error Reporting &#8211; Intelligent Fix"}]},{"@type":"WebSite","@id":"https:\/\/androidbubble.com\/blog\/#website","url":"https:\/\/androidbubble.com\/blog\/","name":"AndroidBubble Blog","description":"Articles &amp; Posts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/androidbubble.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7","name":"Fahad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g","caption":"Fahad"},"sameAs":["http:\/\/www.androidbubbles.com\/","https:\/\/x.com\/phpFlex"],"url":"https:\/\/androidbubble.com\/blog\/author\/admin\/"}]}},"views":771,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/comments?post=814"}],"version-history":[{"count":3,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/814\/revisions"}],"predecessor-version":[{"id":1623,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/814\/revisions\/1623"}],"wp:attachment":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/media?parent=814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/categories?post=814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/tags?post=814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}