From: Florent Bruneau Date: Tue, 24 Jun 2008 20:50:41 +0000 (+0200) Subject: Fix page()->kill() behaviour for php-cli. X-Git-Tag: core/1.0.0~66 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=36f472dc1d8abe2ac18079b04cf8b6a2e10522be;p=platal.git Fix page()->kill() behaviour for php-cli. Signed-off-by: Florent Bruneau --- diff --git a/classes/plpage.php b/classes/plpage.php index 5c2172b..7a28303 100644 --- a/classes/plpage.php +++ b/classes/plpage.php @@ -223,6 +223,12 @@ abstract class PlPage extends Smarty public function kill($msg) { + // PHP is used on command line... do not run the whole page stuff. + if (php_sapi_name() == 'cli') { + echo $msg . "\n"; + exit; + } + global $platal; $this->assign('platal', $platal);