Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Yokihito Oki
/
kanoya-univercity-prod
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
114d3f39
authored
2020-09-18 09:16:58 +0900
by
Yokihito Oki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
phpのバージョン警告を非表示
1 parent
1eadd7fa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
42 deletions
plugins/quickicon/phpversioncheck/phpversioncheck.php
plugins/quickicon/phpversioncheck/phpversioncheck.php
View file @
114d3f3
...
...
@@ -159,48 +159,48 @@ class PlgQuickiconPhpVersionCheck extends JPlugin
$today
=
new
JDate
;
$phpEndOfSupport
=
new
JDate
(
$phpSupportData
[
$activePhpVersion
][
'eos'
]);
if
(
$phpNotSupported
=
$today
>
$phpEndOfSupport
)
{
/*
* Find the oldest PHP version still supported that is newer than the current version,
* this is our recommendation for users on unsupported platforms
*/
foreach
(
$phpSupportData
as
$version
=>
$versionData
)
{
$versionEndOfSupport
=
new
JDate
(
$versionData
[
'eos'
]);
if
(
version_compare
(
$version
,
$activePhpVersion
,
'ge'
)
&&
(
$today
<
$versionEndOfSupport
))
{
$supportStatus
[
'status'
]
=
self
::
PHP_UNSUPPORTED
;
$supportStatus
[
'message'
]
=
JText
::
sprintf
(
'PLG_QUICKICON_PHPVERSIONCHECK_UNSUPPORTED'
,
PHP_VERSION
,
$version
,
$versionEndOfSupport
->
format
(
JText
::
_
(
'DATE_FORMAT_LC4'
))
);
return
$supportStatus
;
}
}
// PHP version is not supported and we don't know of any supported versions.
$supportStatus
[
'status'
]
=
self
::
PHP_UNSUPPORTED
;
$supportStatus
[
'message'
]
=
JText
::
sprintf
(
'PLG_QUICKICON_PHPVERSIONCHECK_UNSUPPORTED_JOOMLA_OUTDATED'
,
PHP_VERSION
);
return
$supportStatus
;
}
// If the version is still supported, check if it has reached eol minus 3 month
$securityWarningDate
=
clone
$phpEndOfSupport
;
$securityWarningDate
->
sub
(
new
DateInterval
(
'P3M'
));
if
(
!
$phpNotSupported
&&
$today
>
$securityWarningDate
)
{
$supportStatus
[
'status'
]
=
self
::
PHP_SECURITY_ONLY
;
$supportStatus
[
'message'
]
=
JText
::
sprintf
(
'PLG_QUICKICON_PHPVERSIONCHECK_SECURITY_ONLY'
,
PHP_VERSION
,
$phpEndOfSupport
->
format
(
JText
::
_
(
'DATE_FORMAT_LC4'
))
);
}
//
if ($phpNotSupported = $today > $phpEndOfSupport)
//
{
//
/*
//
* Find the oldest PHP version still supported that is newer than the current version,
//
* this is our recommendation for users on unsupported platforms
//
*/
//
foreach ($phpSupportData as $version => $versionData)
//
{
//
$versionEndOfSupport = new JDate($versionData['eos']);
//
if (version_compare($version, $activePhpVersion, 'ge') && ($today < $versionEndOfSupport))
//
{
//
$supportStatus['status'] = self::PHP_UNSUPPORTED;
//
$supportStatus['message'] = JText::sprintf(
//
'PLG_QUICKICON_PHPVERSIONCHECK_UNSUPPORTED',
//
PHP_VERSION,
//
$version,
//
$versionEndOfSupport->format(JText::_('DATE_FORMAT_LC4'))
//
);
//
return $supportStatus;
//
}
//
}
//
// PHP version is not supported and we don't know of any supported versions.
//
$supportStatus['status'] = self::PHP_UNSUPPORTED;
//
$supportStatus['message'] = JText::sprintf('PLG_QUICKICON_PHPVERSIONCHECK_UNSUPPORTED_JOOMLA_OUTDATED', PHP_VERSION);
//
return $supportStatus;
//
}
//
//
If the version is still supported, check if it has reached eol minus 3 month
//
$securityWarningDate = clone $phpEndOfSupport;
//
$securityWarningDate->sub(new DateInterval('P3M'));
//
if (!$phpNotSupported && $today > $securityWarningDate)
//
{
//
$supportStatus['status'] = self::PHP_SECURITY_ONLY;
//
$supportStatus['message'] = JText::sprintf(
//
'PLG_QUICKICON_PHPVERSIONCHECK_SECURITY_ONLY', PHP_VERSION, $phpEndOfSupport->format(JText::_('DATE_FORMAT_LC4'))
//
);
//
}
}
return
$supportStatus
;
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment