From: Andreas Unterkircher Date: Sat, 29 Mar 2008 07:29:53 +0000 (+0100) Subject: check if Smarty engine is available is now done in check_requirements() X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=commitdiff_plain;h=ef48f1930daad7ffc993708ff9e6656135897964;hp=1532cb592eb45670d0d72fe5e9acb1f5b0fb31c9 check if Smarty engine is available is now done in check_requirements() Signed-off-by: Andreas Unterkircher --- diff --git a/phpfspot.class.php b/phpfspot.class.php index a9e3e68..7cc4e19 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -66,7 +66,7 @@ class PHPFSPOT { ); /* Check necessary requirements */ - if(!$this->checkRequirements()) { + if(!$this->check_requirements()) { exit(1); } @@ -129,12 +129,7 @@ class PHPFSPOT { /* Check if some tables need to be created */ $this->check_config_table(); - /* include Smarty template engine */ - if(!$this->check_readable($this->cfg->smarty_path .'/libs/Smarty.class.php')) { - exit(1); - } - require $this->cfg->smarty_path .'/libs/Smarty.class.php'; - /* overload Smarty class if our own template handler */ + /* overload Smarty class with our own template handler */ require_once "phpfspot_tmpl.php"; $this->tmpl = new PHPFSPOT_TMPL($this); @@ -1794,7 +1789,7 @@ class PHPFSPOT { /** * check if all requirements are met */ - private function checkRequirements() + private function check_requirements() { if(!function_exists("imagecreatefromjpeg")) { print "PHP GD library extension is missing
\n"; @@ -1823,6 +1818,11 @@ class PHPFSPOT { print "PEAR Console_Getopt package is missing
\n"; $missing = true; } + @include_once $this->cfg->smarty_path .'/libs/Smarty.class.php'; + if(isset($php_errormsg) && preg_match('/Failed opening.*for inclusion/i', $php_errormsg)) { + print "Smarty template engine can not be found in ". $this->cfg->smarty_path ."/libs/Smarty.class.php
\n"; + $missing = true; + } ini_restore('track_errors'); if(isset($missing)) @@ -1830,7 +1830,7 @@ class PHPFSPOT { return true; - } // checkRequirements() + } // check_requirements() private function _debug($text) {