diff options
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r-- | phpfspot.class.php | 18 |
1 files changed, 9 insertions, 9 deletions
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<br />\n"; @@ -1823,6 +1818,11 @@ class PHPFSPOT { print "PEAR Console_Getopt package is missing<br />\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<br />\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) { |