summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2008-03-29 08:29:53 +0100
committerAndreas Unterkircher <unki@netshadow.at>2008-03-29 08:34:01 +0100
commitef48f1930daad7ffc993708ff9e6656135897964 (patch)
treee0e61db48ee15215a14112b2f8d825675442b681
parent1532cb592eb45670d0d72fe5e9acb1f5b0fb31c9 (diff)
check if Smarty engine is available is now done in check_requirements()
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
-rw-r--r--phpfspot.class.php18
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)
{