[Cs-content-commits] SF.net SVN: cs-content:[464] trunk/1.0/contentSystem.class.php
PHP Templating & Includes System
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-09-23 14:46:27
|
Revision: 464 http://cs-content.svn.sourceforge.net/cs-content/?rev=464&view=rev Author: crazedsanity Date: 2009-09-23 14:46:10 +0000 (Wed, 23 Sep 2009) Log Message: ----------- Die gracefully on CLI too... /contentSystem.class.php: * die_gracefully(): -- only spit out HTML if it is NOT on the command line interface (CLI) -- remove TODO that was already done. Modified Paths: -------------- trunk/1.0/contentSystem.class.php Modified: trunk/1.0/contentSystem.class.php =================================================================== --- trunk/1.0/contentSystem.class.php 2009-09-21 14:38:05 UTC (rev 463) +++ trunk/1.0/contentSystem.class.php 2009-09-23 14:46:10 UTC (rev 464) @@ -731,8 +731,8 @@ * Called when something is broken. */ private function die_gracefully($details=NULL) { - header('HTTP/1.0 404 Not Found'); - if($this->templateObj->template_file_exists('system/404.shared.tmpl')) { + if(isset($_SERVER['SERVER_PROTOCOL']) && $this->templateObj->template_file_exists('system/404.shared.tmpl')) { + header('HTTP/1.0 404 Not Found'); //Simple "Page Not Found" error... show 'em. $this->templateObj->add_template_var('main', $this->templateObj->file_to_string('system/404.shared.tmpl')); @@ -748,7 +748,6 @@ exit; } else { - //TODO: make it *actually* die gracefully... the way it works now looks more like puke than grace. throw new exception(__METHOD__ .": Couldn't find 404 template, plus additional error... \nDETAILS::: $details" . "\nREASON::: ". $this->reason); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |