diff options
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r-- | phpfspot.class.php | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index 191e066..907b6dc 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -16,6 +16,11 @@ class PHPFSPOT { public function __construct() { + /* Check necessary requirements */ + if(!$this->checkRequirements()) { + exit(1); + } + $this->cfg = new PHPFSPOT_CFG; $this->db = new PHPFSPOT_DB(&$this, $this->cfg->fspot_db); @@ -798,7 +803,7 @@ class PHPFSPOT { } // get_photo_tags() - function showTextImage($txt, $color=000000, $space=4, $font=4, $w=300) + public function showTextImage($txt, $color=000000, $space=4, $font=4, $w=300) { if (strlen($color) != 6) $color = 000000; @@ -824,6 +829,40 @@ class PHPFSPOT { } // showTextImage() + private function checkRequirements() + { + if(!function_exists("imagecreatefromjpeg")) { + print "PHP GD library extension is missing<br />\n"; + $missing = true; + } + + if(!function_exists("mysql_connect")) { + print "PHP MySQL library extension is missing<br />\n"; + $missing = true; + } + + if(!function_exists("sqlite3_open")) { + print "PHP SQLite3 library extension is missing<br />\n"; + $missing = true; + } + + /* Check for HTML_AJAX PEAR package, lent from Horde project */ + ini_set('track_errors', 1); + @include 'HTML/AJAX/Server.php'; + if(isset($php_errormsg)) { + print "PEAR HTML_AJAX package is missing<br />\n"; + $missing = true; + } + ini_restore('track_errors'); + + if(isset($missing)) + return false; + + return true; + + } // checkRequirements() + + } ?> |