summaryrefslogtreecommitdiffstats
path: root/phpfspot.class.php
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2007-06-29 17:46:43 +0000
committerAndreas Unterkircher <unki@netshadow.at>2007-06-29 17:46:43 +0000
commit605439cc3bceba0e1974448a5c669e33303fcc90 (patch)
treeec97627a8a23c5543fb39034d1d6a7b67b7b2760 /phpfspot.class.php
parent938dd660b2d3157380e62a3e73b3c8b0654a97ce (diff)
issue3, first requirement checks
git-svn-id: file:///var/lib/svn/phpfspot/trunk@132 fa6a889d-dae6-447d-9e79-4ba9a3039384
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r--phpfspot.class.php41
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()
+
+
}
?>