3
* Spring Signage Ltd - http://www.springsignage.com
4
* Copyright (C) 2018 Spring Signage Ltd
14
public static $WEBSITE_VERSION_NAME = '1.8.6';
15
public static $WEBSITE_VERSION = 137;
17
public static $VERSION_REQUIRED = '5.5';
18
public static $VERSION_UNSUPPORTED = '8.0';
21
* Check FileSystem Permissions
24
public static function checkFsPermissions()
26
return (is_writable(PROJECT_ROOT . "/web/settings.php") || is_writable(PROJECT_ROOT . "/cache"));
30
* Check PHP version is within the preset parameters
33
public static function checkPHP()
35
return (version_compare(phpversion(), self::$VERSION_REQUIRED) != -1) && (version_compare(phpversion(), self::$VERSION_UNSUPPORTED) != 1);
39
* Check PHP has the PDO module installed (with MySQL driver)
41
public static function checkPDO()
43
return extension_loaded("pdo_mysql");
47
* Check PHP has the GetText module installed
50
public static function checkGettext()
52
return extension_loaded("gettext");
56
* Check PHP has JSON module installed
59
public static function checkJson()
61
return extension_loaded("json");
66
* Check PHP has SOAP module installed
69
public static function checkSoap()
71
return extension_loaded("soap");
75
* Check PHP has GD module installed
78
public static function checkGd()
80
return extension_loaded("gd");
84
* Check PHP has the DOM XML functionality installed
87
public static function checkDomXml()
89
return extension_loaded("dom");
93
* Check PHP has the Mcrypt functionality installed
96
public static function checkMcrypt()
98
return extension_loaded("mcrypt");
102
* Check PHP has the DOM functionality installed
105
public static function checkDom()
107
return class_exists("DOMDocument");
111
* Check PHP has session functionality installed
114
public static function checkSession()
116
return extension_loaded("session");
120
* Check PHP has PCRE functionality installed
123
public static function checkPCRE()
125
return extension_loaded("pcre");
129
* Check PHP has FileInfo functionality installed
132
public static function checkFileInfo()
134
return extension_loaded("fileinfo");
137
public static function checkZip()
139
return extension_loaded('zip');
142
public static function checkIntlDateFormat()
144
return class_exists('IntlDateFormatter');
149
* Check to see if curl is installed
151
public static function checkCurlInstalled()
153
return function_exists('curl_version');
157
* Check PHP is setup for large file uploads
160
public static function checkPHPUploads()
162
# Consider 0 - 128M warning / < 120 seconds
163
# Variables to check:
165
# upload_max_filesize
168
$minSize = ByteFormatter::toBytes('128M');
170
if (ByteFormatter::toBytes(ini_get('post_max_size')) < $minSize)
173
if (ByteFormatter::toBytes(ini_get('upload_max_filesize')) < $minSize)
176
if (ini_get('max_execution_time') < 120)
186
public static function checkZmq()
188
return class_exists('ZMQSocket');
192
public static function getMaxUploadSize()
194
return ini_get('upload_max_filesize');
198
* Check open ssl is available
201
public static function checkOpenSsl()
203
return extension_loaded('openssl');
208
* https://stackoverflow.com/a/45767760
210
public static function getMemoryLimitBytes()
212
return intval(str_replace(array('G', 'M', 'K'), array('000000000', '000000', '000'), ini_get('memory_limit')));
218
public static function checkTimezoneIdentifiers()
220
return function_exists('timezone_identifiers_list');
226
public static function checkAllowUrlFopen()
228
return ini_get('allow_url_fopen');
234
public static function checkSimpleXml()
236
return extension_loaded('simplexml');
b'\\ No newline at end of file'