diff --git a/installation/language/en-AU/en-AU.ini b/installation/language/en-AU/en-AU.ini index 2e6e3227668ed..565afcfc490c5 100644 --- a/installation/language/en-AU/en-AU.ini +++ b/installation/language/en-AU/en-AU.ini @@ -266,6 +266,14 @@ INSTL_ZIP_SUPPORT_AVAILABLE="Native ZIP support" INSTL_ZLIB_COMPRESSION_SUPPORT="Zlib Compression Support" INSTL_PROCESS_BUSY="Process is in progress. Please wait..." +;PHP Support Status +INSTL_PHP_MESSAGE_SECURITY_ONLY="Your PHP version, %1$s, is only receiving security fixes at this time. This means your PHP version will soon no longer be supported. We recommend planning to upgrade to a newer PHP version before it reaches end of support on %2$s. Please contact your host for upgrade instructions." +INSTL_PHP_MESSAGE_UNSUPPORTED="Your PHP version, %1$s, is no longer supported by the PHP project. Support for this version of PHP ended on %2$s. We highly recommend upgrading your server to a newer PHP version. Please contact your host for upgrade instructions." +INSTL_PHP_VERSION_SUPPORT="PHP Version Support" + +;Date Format +DATE_FORMAT_LC4="Y-m-d" + ;Global strings JADMINISTRATOR="Administrator" JCHECK_AGAIN="Check Again" diff --git a/installation/language/en-CA/en-CA.ini b/installation/language/en-CA/en-CA.ini index 5fa0a27a697e0..e5fd0b06b9776 100644 --- a/installation/language/en-CA/en-CA.ini +++ b/installation/language/en-CA/en-CA.ini @@ -266,6 +266,14 @@ INSTL_ZIP_SUPPORT_AVAILABLE="Native ZIP support" INSTL_ZLIB_COMPRESSION_SUPPORT="Zlib Compression Support" INSTL_PROCESS_BUSY="Process is in progress. Please wait..." +;PHP Support Status +INSTL_PHP_MESSAGE_SECURITY_ONLY="Your PHP version, %1$s, is only receiving security fixes at this time. This means your PHP version will soon no longer be supported. We recommend planning to upgrade to a newer PHP version before it reaches end of support on %2$s. Please contact your host for upgrade instructions." +INSTL_PHP_MESSAGE_UNSUPPORTED="Your PHP version, %1$s, is no longer supported by the PHP project. Support for this version of PHP ended on %2$s. We highly recommend upgrading your server to a newer PHP version. Please contact your host for upgrade instructions." +INSTL_PHP_VERSION_SUPPORT="PHP Version Support" + +;Date Format +DATE_FORMAT_LC4="Y-m-d" + ;Global strings JADMINISTRATOR="Administrator" JCHECK_AGAIN="Check Again" diff --git a/installation/language/en-GB/en-GB.ini b/installation/language/en-GB/en-GB.ini index 4d0bbcc692a09..d5e163d9d8aa0 100644 --- a/installation/language/en-GB/en-GB.ini +++ b/installation/language/en-GB/en-GB.ini @@ -264,6 +264,14 @@ INSTL_ZIP_SUPPORT_AVAILABLE="Native ZIP support" INSTL_ZLIB_COMPRESSION_SUPPORT="Zlib Compression Support" INSTL_PROCESS_BUSY="Process is in progress. Please wait ..." +;PHP Support Status +INSTL_PHP_MESSAGE_SECURITY_ONLY="Your PHP version, %1$s, is only receiving security fixes at this time. This means your PHP version will soon no longer be supported. We recommend planning to upgrade to a newer PHP version before it reaches end of support on %2$s. Please contact your host for upgrade instructions." +INSTL_PHP_MESSAGE_UNSUPPORTED="Your PHP version, %1$s, is no longer supported by the PHP project. Support for this version of PHP ended on %2$s. We highly recommend upgrading your server to a newer PHP version. Please contact your host for upgrade instructions." +INSTL_PHP_VERSION_SUPPORT="PHP Version Support" + +;Date Format +DATE_FORMAT_LC4="Y-m-d" + ;Global strings JADMINISTRATOR="Administrator" JCHECK_AGAIN="Check Again" diff --git a/installation/language/en-US/en-US.ini b/installation/language/en-US/en-US.ini index 692ad0c86f673..9f43833328149 100644 --- a/installation/language/en-US/en-US.ini +++ b/installation/language/en-US/en-US.ini @@ -266,6 +266,14 @@ INSTL_ZIP_SUPPORT_AVAILABLE="Native ZIP support" INSTL_ZLIB_COMPRESSION_SUPPORT="Zlib Compression Support" INSTL_PROCESS_BUSY="Process is in progress. Please wait..." +;PHP Support Status +INSTL_PHP_MESSAGE_SECURITY_ONLY="Your PHP version, %1$s, is only receiving security fixes at this time. This means your PHP version will soon no longer be supported. We recommend planning to upgrade to a newer PHP version before it reaches end of support on %2$s. Please contact your host for upgrade instructions." +INSTL_PHP_MESSAGE_UNSUPPORTED="Your PHP version, %1$s, is no longer supported by the PHP project. Support for this version of PHP ended on %2$s. We highly recommend upgrading your server to a newer PHP version. Please contact your host for upgrade instructions." +INSTL_PHP_VERSION_SUPPORT="PHP Version Support" + +;Date Format +DATE_FORMAT_LC4="Y-m-d" + ;Global strings JADMINISTRATOR="Administrator" JCHECK_AGAIN="Check Again" diff --git a/installation/model/setup.php b/installation/model/setup.php index 2d38feb68b996..78fc56d13ef52 100644 --- a/installation/model/setup.php +++ b/installation/model/setup.php @@ -16,6 +16,30 @@ */ class InstallationModelSetup extends JModelBase { + /** + * Constant representing the active PHP version being fully supported + * + * @const integer + * @since 3.5 + */ + const PHP_SUPPORTED = 0; + + /** + * Constant representing the active PHP version receiving security support only + * + * @const integer + * @since 3.5 + */ + const PHP_SECURITY_ONLY = 1; + + /** + * Constant representing the active PHP version being unsupported + * + * @const integer + * @since 3.5 + */ + const PHP_UNSUPPORTED = 2; + /** * Get the current setup options from the session. * @@ -407,6 +431,78 @@ public function getPhpSettings() return $settings; } + /** + * Gets PHP support status. + * + * @return array Array of PHP support data + * + * @since 3.5 + */ + public function getPhpSupport() + { + $phpSupportData = array( + '5.3' => array( + 'security' => '2013-07-11', + 'eos' => '2014-08-14', + ), + '5.4' => array( + 'security' => '2014-09-14', + 'eos' => '2015-09-14', + ), + '5.5' => array( + 'security' => '2015-07-10', + 'eos' => '2016-07-10' + ), + '5.6' => array( + 'security' => '2016-08-28', + 'eos' => '2017-08-28' + ), + ); + + // Fill our return array with default values + $supportStatus = array( + 'version' => PHP_VERSION, + 'eos' => null, + 'status' => self::PHP_SUPPORTED, + 'message' => null + ); + + // Check the PHP version's support status using the minor version + $activePhpVersion = PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION; + + // Do we have the PHP version's data? + if (isset($phpSupportData[$activePhpVersion])) + { + // Set the 'eos' date in the return array + $supportStatus['eos'] = $phpSupportData[$activePhpVersion]['eos']; + + // First check if the version has reached end of support + $today = new JDate; + $phpEndOfSupport = new JDate($phpSupportData[$activePhpVersion]['eos']); + + if ($phpNotSupported = $today > $phpEndOfSupport) + { + $supportStatus['status'] = self::PHP_UNSUPPORTED; + $supportStatus['message'] = JText::sprintf( + 'INSTL_PHP_MESSAGE_UNSUPPORTED', PHP_VERSION, $phpEndOfSupport->format(JText::_('DATE_FORMAT_LC4')) + ); + } + + // If the version is still supported, check if it has reached security support only + $phpSecurityOnlyDate = new JDate($phpSupportData[$activePhpVersion]['security']); + + if (!$phpNotSupported && $today > $phpSecurityOnlyDate) + { + $supportStatus['status'] = self::PHP_SECURITY_ONLY; + $supportStatus['message'] = JText::sprintf( + 'INSTL_PHP_MESSAGE_SECURITY_ONLY', PHP_VERSION, $phpEndOfSupport->format(JText::_('DATE_FORMAT_LC4')) + ); + } + } + + return $supportStatus; + } + /** * Method to validate the form data. * diff --git a/installation/view/summary/html.php b/installation/view/summary/html.php index 0d65762e73717..49666ca281908 100644 --- a/installation/view/summary/html.php +++ b/installation/view/summary/html.php @@ -40,6 +40,14 @@ class InstallationViewSummaryHtml extends InstallationViewDefault */ protected $phpsettings; + /** + * The PHP support status checked by the installer + * + * @var array + * @since 3.5 + */ + protected $phpsupport; + /** * Method to render the view. * @@ -52,6 +60,7 @@ public function render() $this->options = $this->model->getOptions(); $this->phpoptions = $this->model->getPhpOptions(); $this->phpsettings = $this->model->getPhpSettings(); + $this->phpsupport = $this->model->getPhpSupport(); return parent::render(); } diff --git a/installation/view/summary/tmpl/default.php b/installation/view/summary/tmpl/default.php index ad4f6a1021cd6..178f5dfd5b993 100644 --- a/installation/view/summary/tmpl/default.php +++ b/installation/view/summary/tmpl/default.php @@ -28,6 +28,13 @@


+ + phpsupport['status'] !== InstallationModelSetup::PHP_SUPPORTED) : ?> +
+

+ phpsupport['message']; ?> +
+
form->getLabel('sample_file'); ?>