| @@ -241,9 +241,9 @@ | ||
| 241 | 241 | * @return boolean True if Joomla is 1.5 or 1.6, otherwise false. |
| 242 | 242 | */ |
| 243 | 243 | public static function isJoomla15() |
| 244 | 244 | { |
| 245 | - return self::getID() == self::J15; | |
| 245 | + return self::isJoomla() && self::getID() == self::J15; | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | /** |
| 249 | 249 | * Checks if the installed Joomla is 2.5. |
| @@ -251,9 +251,9 @@ | ||
| 251 | 251 | * @return boolean True if Joomla is 2.5, otherwise false. |
| 252 | 252 | */ |
| 253 | 253 | public static function isJoomla25() |
| 254 | 254 | { |
| 255 | - return self::getID() == self::J25; | |
| 255 | + return self::isJoomla() && self::getID() == self::J25; | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
| 259 | 259 | * Checks if the installed Joomla is 3.x. |
| @@ -273,9 +273,9 @@ | ||
| 273 | 273 | * @return boolean True if Joomla is between 3.0 and 3.4, otherwise false. |
| 274 | 274 | */ |
| 275 | 275 | public static function isJoomla30() |
| 276 | 276 | { |
| 277 | - return self::getID() == self::J30; | |
| 277 | + return self::isJoomla() && self::getID() == self::J30; | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | /** |
| 281 | 281 | * Checks if the installed Joomla is between 3.5 and 4.0 (excluded). |
| @@ -283,9 +283,9 @@ | ||
| 283 | 283 | * @return boolean True if Joomla is between 3.0 and 4.0 (excluded), otherwise false. |
| 284 | 284 | */ |
| 285 | 285 | public static function isJoomla35() |
| 286 | 286 | { |
| 287 | - return self::getID() == self::J35; | |
| 287 | + return self::isJoomla() && self::getID() == self::J35; | |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | /** |
| 291 | 291 | * Checks if the installed Joomla is 3.7 or higher. |
| @@ -293,18 +293,24 @@ | ||
| 293 | 293 | * @return boolean True if Joomla is 3.7 or higher, otherwise false. |
| 294 | 294 | */ |
| 295 | 295 | public static function isJoomla37() |
| 296 | 296 | { |
| 297 | - return self::getID() == self::J37; | |
| 297 | + return self::isJoomla() && self::getID() == self::J37; | |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | /** |
| 301 | - * Checks if the installed Joomla is 4.x. | |
| 301 | + * Checks if the installed Joomla is 4.0 or higher. | |
| 302 | 302 | * |
| 303 | - * @return boolean True if Joomla is between 4.0 and 5.0 (excluded), otherwise false. | |
| 304 | - * | |
| 305 | - * @since 1.8.3 | |
| 303 | + * @return boolean True if Joomla is 4.0 or higher, otherwise false. | |
| 306 | 304 | */ |
| 305 | + public static function isJoomla40() | |
| 306 | + { | |
| 307 | + return self::isJoomla() && self::getID() == self::J40; | |
| 308 | + } | |
| 309 | + | |
| 310 | + /** | |
| 311 | + * Alias for `isJoomla40`. | |
| 312 | + */ | |
| 307 | 313 | public static function isJoomla4x() |
| 308 | 314 | { |
| 309 | 315 | return self::isJoomla40(); |
| 310 | 316 | } |
| @@ -309,25 +315,25 @@ | ||
| 309 | 315 | return self::isJoomla40(); |
| 310 | 316 | } |
| 311 | 317 | |
| 312 | 318 | /** |
| 313 | - * Checks if the installed Joomla is 4.0 or higher. | |
| 319 | + * Checks if the installed Joomla is 5.0 or higher. | |
| 314 | 320 | * |
| 315 | - * @return boolean True if Joomla is 4.0 or higher, otherwise false. | |
| 321 | + * @return boolean True if Joomla is 5.0 or higher, otherwise false. | |
| 316 | 322 | */ |
| 317 | - public static function isJoomla40() | |
| 323 | + public static function isJoomla50() | |
| 318 | 324 | { |
| 319 | - return self::getID() == self::J40; | |
| 325 | + return self::isJoomla() && version_compare(static::getVersion(), '5.0', '>='); | |
| 320 | 326 | } |
| 321 | 327 | |
| 322 | 328 | /** |
| 323 | - * Checks if the installed Joomla is 5.0 or higher. | |
| 329 | + * Checks if the installed Joomla is 6.0 or higher. | |
| 324 | 330 | * |
| 325 | - * @return boolean True if Joomla is 5.0 or higher, otherwise false. | |
| 331 | + * @return boolean True if Joomla is 6.0 or higher, otherwise false. | |
| 326 | 332 | */ |
| 327 | - public static function isJoomla50() | |
| 333 | + public static function isJoomla60() | |
| 328 | 334 | { |
| 329 | - return false; | |
| 335 | + return self::isJoomla() && version_compare(static::getVersion(), '6.0', '>='); | |
| 330 | 336 | } |
| 331 | 337 | |
| 332 | 338 | /** |
| 333 | 339 | * Checks if the installed Wordpress is 4.0 or higher. |
| @@ -335,9 +341,9 @@ | ||
| 335 | 341 | * @return boolean True if Wordpress is 4.0 or higher, otherwise false. |
| 336 | 342 | */ |
| 337 | 343 | public static function isWordpress4() |
| 338 | 344 | { |
| 339 | - return self::getID() == self::WP4; | |
| 345 | + return self::isWordpress() && self::getID() == self::WP4; | |
| 340 | 346 | } |
| 341 | 347 | |
| 342 | 348 | /** |
| 343 | 349 | * Checks if the installed Wordpress is 5.0 or higher. |
| @@ -345,9 +351,9 @@ | ||
| 345 | 351 | * @return boolean True if Wordpress is 5.0 or higher, otherwise false. |
| 346 | 352 | */ |
| 347 | 353 | public static function isWordpress5() |
| 348 | 354 | { |
| 349 | - return self::getID() == self::WP5; | |
| 355 | + return self::isWordpress() && self::getID() == self::WP5; | |
| 350 | 356 | } |
| 351 | 357 | |
| 352 | 358 | /** |
| 353 | 359 | * Checks if the installed Joomla is supported. |