@@ 88-102 (lines=15) @@ | ||
85 | * |
|
86 | * @return bool true if meets requirements, false if not |
|
87 | */ |
|
88 | public static function checkVerXoops(XoopsModule $module) |
|
89 | { |
|
90 | xoops_loadLanguage('admin', $module->dirname()); |
|
91 | // check for minimum PHP version |
|
92 | $success = true; |
|
93 | $verNum = PHP_VERSION; |
|
94 | $reqVer = $module->getInfo('min_php'); |
|
95 | if ((false !== $reqVer) && ('' !== $reqVer)) { |
|
96 | if (version_compare($verNum, (string)$reqVer, '<')) { |
|
97 | $module->setErrors(sprintf(_AM_XOOPSFAQ_ERROR_BAD_PHP, $reqVer, $verNum)); |
|
98 | $success = false; |
|
99 | } |
|
100 | } |
|
101 | return $success; |
|
102 | } |
|
103 | ||
104 | /** |
|
105 | * |
|
@@ 112-127 (lines=16) @@ | ||
109 | * |
|
110 | * @return bool true if meets requirements, false if not |
|
111 | */ |
|
112 | public static function checkVerPhp(XoopsModule $module) |
|
113 | { |
|
114 | xoops_loadLanguage('admin', $module->dirname()); |
|
115 | // check for minimum PHP version |
|
116 | $success = true; |
|
117 | $verNum = PHP_VERSION; |
|
118 | $reqVer = $module->getInfo('min_php'); |
|
119 | if (false !== $reqVer && '' !== $reqVer) { |
|
120 | if (version_compare($verNum, $reqVer, '<')) { |
|
121 | $module->setErrors(sprintf(_AM_APCAL_ERROR_BAD_PHP, $reqVer, $verNum)); |
|
122 | $success = false; |
|
123 | } |
|
124 | } |
|
125 | ||
126 | return $success; |
|
127 | } |
|
128 | } |
|
129 |