diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Setup.php | 11 | ||||
-rw-r--r-- | Zotlabs/Update/_1220.php | 47 |
2 files changed, 56 insertions, 2 deletions
diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index a3832d156..50b40834b 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -526,14 +526,21 @@ class Setup extends \Zotlabs\Web\Controller { $ck_funcs[0]['status'] = false; $ck_funcs[0]['help'] = t('Error: libCURL PHP module required but not installed.'); } - if(! function_exists('imagecreatefromjpeg')) { + if((! function_exists('imagecreatefromjpeg')) || (! class_exists('Imagick'))) { $ck_funcs[1]['status'] = false; - $ck_funcs[1]['help'] = t('Error: GD graphics PHP module with JPEG support required but not installed.'); + $ck_funcs[1]['help'] = t('Error: GD PHP module with JPEG support or ImageMagick graphics library required but not installed.'); } if(! function_exists('openssl_public_encrypt')) { $ck_funcs[2]['status'] = false; $ck_funcs[2]['help'] = t('Error: openssl PHP module required but not installed.'); } + if(class_exists('PDO')) { + $x = PDO::getAvailableDrivers(); + if((! in_array('mysql',$x)) && (! in_array('pgsql',$x))) { + $ck_funcs[3]['status'] = false; + $ck_funcs[3]['help'] = t('Error: PDO database PHP module missing a driver for either mysql or pgsql.'); + } + } if(! class_exists('PDO')) { $ck_funcs[3]['status'] = false; $ck_funcs[3]['help'] = t('Error: PDO database PHP module required but not installed.'); diff --git a/Zotlabs/Update/_1220.php b/Zotlabs/Update/_1220.php new file mode 100644 index 000000000..adcb8c9c6 --- /dev/null +++ b/Zotlabs/Update/_1220.php @@ -0,0 +1,47 @@ +<?php + +namespace Zotlabs\Update; + +class _1220 { + + function run() { + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("CREATE TABLE listeners ( + id serial NOT NULL, + target_id text NOT NULL, + portable_id text NOT NULL, + ltype smallint NOT NULL DEFAULT '0', + PRIMARY KEY (id) +)"); + + $r2 = q("create index \"target_id_idx\" on listeners (\"target_id\")"); + $r3 = q("create index \"portable_id_idx\" on listeners (\"portable_id\")"); + $r4 = q("create index \"ltype_idx\" on listeners (\"ltype\")"); + + $r = $r1 && $r2 && $r3 && $r4; + + } + + if(ACTIVE_DBTYPE == DBTYPE_MYSQL) { + $r = q("CREATE TABLE IF NOT EXISTS listeners ( + id int(11) NOT NULL AUTO_INCREMENT, + target_id varchar(191) CHARACTER SET utf8mb4 NOT NULL DEFAULT '', + portable_id varchar(191) CHARACTER SET utf8mb4 NOT NULL DEFAULT '', + ltype int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY target_id (target_id), + KEY portable_id (portable_id), + KEY ltype (ltype) +) ENGINE=InnoDB DEFAULT CHARSET=utf8"); + + } + + if($r) { + return UPDATE_SUCCESS; + } + return UPDATE_FAILED; + + } + +} |