Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
extensions.typo3.org
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
60
Issues
60
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
8
Merge Requests
8
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
services
extensions.typo3.org
extensions.typo3.org
Commits
8d562a17
Commit
8d562a17
authored
Nov 04, 2019
by
Thomas Löffler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'task/update-to-v9' into TYPO3V9/ter_fe2
parents
41f5c4b9
52c68d46
Changes
18
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
458 additions
and
6673 deletions
+458
-6673
.ddev/.gitignore
.ddev/.gitignore
+9
-0
.ddev/config.yaml
.ddev/config.yaml
+20
-12
.ddev/docker-compose.environment.yaml
.ddev/docker-compose.environment.yaml
+1
-3
composer.lock
composer.lock
+0
-6557
extensions/ter/class.tx_ter_helper.php
extensions/ter/class.tx_ter_helper.php
+18
-1
extensions/ter_fe2/Classes/Domain/Model/Extension.php
extensions/ter_fe2/Classes/Domain/Model/Extension.php
+10
-0
extensions/ter_fe2/Classes/Domain/Model/Version.php
extensions/ter_fe2/Classes/Domain/Model/Version.php
+46
-16
extensions/ter_fe2/Classes/Service/DocumentationService.php
extensions/ter_fe2/Classes/Service/DocumentationService.php
+25
-4
extensions/ter_fe2/Classes/Service/LTSVersionService.php
extensions/ter_fe2/Classes/Service/LTSVersionService.php
+93
-13
extensions/ter_fe2/Classes/Solr/IndexQueue/TerIndexer.php
extensions/ter_fe2/Classes/Solr/IndexQueue/TerIndexer.php
+25
-15
extensions/ter_fe2/Classes/Utility/VersionUtility.php
extensions/ter_fe2/Classes/Utility/VersionUtility.php
+1
-1
extensions/ter_fe2/Resources/Private/Partials/VersionSupportForTypo3.html
...e2/Resources/Private/Partials/VersionSupportForTypo3.html
+6
-7
extensions/ter_fe2/Resources/Private/Templates/Extension/Show.html
...s/ter_fe2/Resources/Private/Templates/Extension/Show.html
+7
-9
extensions/ter_fe2/Tests/Unit/Service/LTSVersionServiceTest.php
...ions/ter_fe2/Tests/Unit/Service/LTSVersionServiceTest.php
+122
-9
extensions/ter_layout/Configuration/TypoScript/Ext/Solr.typoscript
...s/ter_layout/Configuration/TypoScript/Ext/Solr.typoscript
+16
-2
extensions/ter_layout/Resources/Private/Partials/Solr/Facets/OptionsComposer.html
...sources/Private/Partials/Solr/Facets/OptionsComposer.html
+22
-0
extensions/ter_layout/Resources/Private/Partials/Solr/Result/Document.html
...yout/Resources/Private/Partials/Solr/Result/Document.html
+29
-24
private/typo3conf/LocalConfiguration.php
private/typo3conf/LocalConfiguration.php
+8
-0
No files found.
.ddev/.gitignore
View file @
8d562a17
#ddev-generated: Automatically generated ddev .gitignore.
# You can remove the above line if you want to edit and maintain this file yourself.
/commands/*/*.example
/commands/*/README.txt
/commands/db/mysql
/homeadditions/*.example
/homeadditions/README.txt
/import.yaml
/docker-compose.yaml
/db_snapshots
...
...
@@ -8,6 +13,10 @@
/import-db
/.bgsync*
/config.*.y*ml
/.webimageBuild
/.dbimageBuild
/.bgsyncimageBuild
/.sshimageBuild
/.webimageExtra
/.dbimageExtra
/*-build/Dockerfile.example
.ddev/config.yaml
View file @
8d562a17
APIVersion
:
v1.
9.1
APIVersion
:
v1.
11.2
name
:
ter
type
:
typo3
docroot
:
public
...
...
@@ -25,11 +25,11 @@ use_dns_when_possible: true
timezone
:
Europe/Berlin
# This config.yaml was created with ddev version v1.
9.1
# webimage: drud/ddev-webserver:v1.
9
.0
# dbimage: drud/ddev-dbserver:v1.
9
.0-10.2
# dbaimage: drud/phpmyadmin:v1.
9
.0
# bgsyncimage: drud/ddev-bgsync:v1.
9
.0
# This config.yaml was created with ddev version v1.
11.2
# webimage: drud/ddev-webserver:v1.
11
.0
# dbimage: drud/ddev-dbserver:v1.
11
.0-10.2
# dbaimage: drud/phpmyadmin:v1.
11
.0
# bgsyncimage: drud/ddev-bgsync:v1.
11
.0
# However we do not recommend explicitly wiring these images into the
# config.yaml as they may break future versions of ddev.
# You can update this config.yaml using 'ddev config'.
...
...
@@ -43,7 +43,7 @@ timezone: Europe/Berlin
# docroot: <relative_path> # Relative path to the directory containing index.php.
# php_version: "7.
1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3
"
# php_version: "7.
2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4
"
# You can explicitly specify the webimage, dbimage, dbaimage lines but this
# is not recommended, as the images are often closely tied to ddev's' behavior,
...
...
@@ -58,9 +58,18 @@ timezone: Europe/Berlin
# router_https_port: <port> # Port for https (defaults to 443)
# xdebug_enabled: false # Set to true to enable xdebug and "ddev start" or "ddev restart"
# Note that for most people the commands
# "ddev exec enable_xdebug" and "ddev exec disable_xdebug" work better,
# as leaving xdebug enabled all the time is a big performance hit.
# webserver_type: nginx-fpm # Can be set to apache-fpm or apache-cgi as well
# timezone: Europe/Berlin
# This is the timezone used in the containers and by PHP;
# it can be set to any valid timezone,
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# For example Europe/Dublin or MST7MDT
# additional_hostnames:
# - somename
# - someothername
...
...
@@ -121,11 +130,9 @@ timezone: Europe/Berlin
# webimage_extra_packages: [php-yaml, php7.3-ldap]
# Extra Debian packages that are needed in the webimage can be added here
# This is ignored if a free-form .ddev/web-build/Dockerfile is provided
# dbimage_extra_packages: [telnet,netcat]
# Extra Debian packages that are needed in the dbimage can be added here
# This is ignored if a free-form .ddev/db-build/Dockerfile is provided
# use_dns_when_possible: true
# If the host has internet access and the domain configured can
...
...
@@ -136,9 +143,10 @@ timezone: Europe/Berlin
# project_tld: ddev.site
# The top-level domain used for project URLs
# The default "ddev.site" allows DNS lookup via a wildcard
# For backward compatibility this can be changed to "ddev.local"
# If you prefer you can change this to "ddev.local" to preserve
# pre-v1.9 behavior.
# ngrok_args: --subdomain mysite --auth
"user:pass"
# ngrok_args: --subdomain mysite --auth
username:pass
# Provide extra flags to the "ngrok http" command, see
# https://ngrok.com/docs#http or run "ngrok http -h"
...
...
.ddev/docker-compose.environment.yaml
View file @
8d562a17
...
...
@@ -4,5 +4,3 @@ services:
web
:
environment
:
-
TYPO3_CONTEXT=Development
\ No newline at end of file
-
PHP_IDE_CONFIG="serverName=ter.ddev.local"
-
DEBIAN_FRONTEND=noninteractive
\ No newline at end of file
composer.lock
deleted
100644 → 0
View file @
41f5c4b9
This diff is collapsed.
Click to expand it.
extensions/ter/class.tx_ter_helper.php
View file @
8d562a17
...
...
@@ -362,7 +362,7 @@ class tx_ter_helper
// Check if update of files requested
$updateRequestedFile
=
$this
->
pluginObj
->
repositoryDir
.
'extensions.xml.gz.needsupdate'
;
if
(
@
filemtime
(
$updateRequestedFile
)
<=
@
filemtime
(
$this
->
pluginObj
->
repositoryDir
.
'extensions.xml.gz'
))
{
if
(
file_exists
(
$updateRequestedFile
)
&&
@
filemtime
(
$updateRequestedFile
)
<=
@
filemtime
(
$this
->
pluginObj
->
repositoryDir
.
'extensions.xml.gz'
))
{
return
;
}
...
...
@@ -401,6 +401,7 @@ class tx_ter_helper
$dom
=
new
DOMDocument
(
'1.0'
,
'utf-8'
);
$dom
->
formatOutput
=
true
;
$extensionsObj
=
$dom
->
appendChild
(
new
DOMElement
(
'extensions'
));
$documentationService
=
GeneralUtility
::
makeInstance
(
\
T3o\TerFe2\Service\DocumentationService
::
class
);
// Create the nested XML structure:
foreach
(
$extensionsAndVersionsArr
as
$extensionKey
=>
$extensionVersionsArr
)
{
...
...
@@ -412,6 +413,16 @@ class tx_ter_helper
$this
->
xmlentities
(
$extensionsTotalDownloadsArr
[
$extensionKey
])
)
);
$extensionRecord
=
GeneralUtility
::
makeInstance
(
\
TYPO3\CMS\Core\Database\ConnectionPool
::
class
)
->
getConnectionForTable
(
'tx_terfe2_domain_model_extension'
)
->
select
(
[
'uid'
,
'external_manual'
],
'tx_terfe2_domain_model_extension'
,
[
'ext_key'
=>
$extensionKey
]
)
->
fetch
();
foreach
(
$extensionVersionsArr
[
'versions'
]
as
$versionNumber
=>
$extensionVersionArr
)
{
$versionObj
=
$extensionObj
->
appendChild
(
new
DOMElement
(
'version'
));
...
...
@@ -463,6 +474,12 @@ class tx_ter_helper
)
);
$versionObj
->
appendChild
(
new
DOMElement
(
't3xfilemd5'
,
$extensionVersionArr
[
't3xfilemd5'
]));
$documentationLink
=
''
;
try
{
$documentationLink
=
$documentationService
->
getDocumentationLink
(
$extensionKey
,
$versionNumber
,
true
);
}
catch
(
Exception
$e
)
{
}
$versionObj
->
appendChild
(
new
DOMElement
(
'documentation_link'
,
$extensionRecord
[
'external_manual'
]
?:
$documentationLink
));
}
}
...
...
extensions/ter_fe2/Classes/Domain/Model/Extension.php
View file @
8d562a17
...
...
@@ -615,4 +615,14 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
$this
->
notifications
=
$notifications
;
}
public
function
getMatrixOfSupportedTypo3Versions
():
array
{
$supportedTypo3Versions
=
[];
foreach
(
$this
->
versions
as
$version
)
{
$version
->
getMatrixOfSupportedTypo3Versions
(
$supportedTypo3Versions
);
}
return
$supportedTypo3Versions
;
}
}
extensions/ter_fe2/Classes/Domain/Model/Version.php
View file @
8d562a17
...
...
@@ -21,6 +21,8 @@ use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
*/
class
Version
extends
\
TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
const
VERSION_IS_INSECURE
=
-
1
;
const
VERSION_IS_OUTDATED
=
-
2
;
/**
* Title of the extension
...
...
@@ -1134,7 +1136,7 @@ class Version extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
}
/**
* @return \T3o\TerFe2\Domain\Model\Relation
* @return \T3o\TerFe2\Domain\Model\Relation
|null
*/
public
function
getTypo3Dependency
()
{
...
...
@@ -1151,31 +1153,59 @@ class Version extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
}
/**
* @param array $supportedTypo3Versions
* @return array
*/
public
function
getMatrixOfSupportedTypo3Versions
():
array
public
function
getMatrixOfSupportedTypo3Versions
(
array
$supportedTypo3Versions
=
[]
):
array
{
// @todo: Get these versions automatically
$typo3Versions
=
[
'7 LTS'
=>
7006000
,
'8 LTS'
=>
8007000
,
'9 LTS'
=>
9005000
];
$supportedTypo3Versions
=
[];
$ltsVersionService
=
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
makeInstance
(
\
T3o\TerFe2\Service\LTSVersionService
::
class
);
$oldLTSVersions
=
$ltsVersionService
->
getOldLTSVersions
();
$this
->
getSupportedTypo3Versions
(
$supportedTypo3Versions
,
$oldLTSVersions
,
'warning'
);
$currentStableVersions
=
$ltsVersionService
->
getCurrentStableVersions
(
true
);
$this
->
getSupportedTypo3Versions
(
$supportedTypo3Versions
,
$currentStableVersions
,
'success'
);
foreach
(
$typo3Versions
as
$label
=>
$mainVersion
)
{
$supportedTypo3Versions
[
$label
]
=
\
T3o\TerFe2\Utility\VersionUtility
::
doesExtensionSupportTypo3Version
(
$this
->
getExtension
(),
$mainVersion
);
if
(
$this
->
doesSupportTypo3Version
(
$ltsVersionService
->
getLatestDevelopmentVersion
(
true
)))
{
$supportedTypo3Versions
[
$ltsVersionService
->
getVersionLabelOfRelease
(
$ltsVersionService
->
getLatestDevelopmentVersion
(
true
))]
=
[
'label'
=>
$ltsVersionService
->
getVersionLabelOfRelease
(
$ltsVersionService
->
getLatestDevelopmentVersion
(
true
))
.
'-dev'
,
'badgeClass'
=>
'info'
];
}
return
$supportedTypo3Versions
;
}
/**
* @return bool
*/
public
function
hasTypo3Dependency
()
public
function
doesSupportTypo3Version
(
int
$versionNumber
):
bool
{
if
(
$this
->
getTypo3Dependency
()
===
null
||
$this
->
getReviewState
()
===
\
T3o\TerFe2\Domain\Model\Version
::
VERSION_IS_INSECURE
)
{
return
false
;
}
// reset from e.g. 7.6.21 to 7.6.0 for valid check
$resetMinimumVersion
=
(
int
)(
$this
->
getTypo3Dependency
()
->
getMinimumVersion
()
/
\
T3o\TerFe2\Service\LTSVersionService
::
FACTOR_MINOR_VERSION
)
*
\
T3o\TerFe2\Service\LTSVersionService
::
FACTOR_MINOR_VERSION
;
$supportsTypo3Version
=
$resetMinimumVersion
<=
$versionNumber
&&
$this
->
getTypo3Dependency
()
->
getMaximumVersion
()
>=
$versionNumber
;
if
(
$supportsTypo3Version
)
{
return
true
;
}
return
false
;
}
private
function
getSupportedTypo3Versions
(
array
&
$supportedTypo3Versions
,
array
$versions
,
string
$badgeClass
)
{
return
$this
->
getTypo3Dependency
()
!==
null
;
$ltsVersionService
=
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
makeInstance
(
\
T3o\TerFe2\Service\LTSVersionService
::
class
);
foreach
(
$versions
as
$versionNumber
)
{
$mainVersion
=
floor
(
$versionNumber
/
$ltsVersionService
::
FACTOR_MINOR_VERSION
*
$ltsVersionService
::
FACTOR_MINOR_VERSION
);
$label
=
$ltsVersionService
->
getVersionLabelOfRelease
(
$versionNumber
)
.
' LTS'
;
if
(
$this
->
doesSupportTypo3Version
(
$mainVersion
))
{
$supportedTypo3Versions
[
$ltsVersionService
->
getVersionLabelOfRelease
(
$versionNumber
)]
=
[
'label'
=>
$label
,
'badgeClass'
=>
$badgeClass
];
}
}
}
/**
...
...
extensions/ter_fe2/Classes/Service/DocumentationService.php
View file @
8d562a17
...
...
@@ -64,10 +64,14 @@ class DocumentationService implements \TYPO3\CMS\Core\SingletonInterface
$documentationLink
=
''
;
$oldManualsInformation
=
json_decode
(
@
file_get_contents
(
PATH_site
.
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'BE'
][
'fileadminDir'
]
.
'oldmanuals.json'
),
true
);
if
(
isset
(
$this
->
docsInformation
[
$extensionKey
][
'docs'
][
$versionString
]))
{
// link to extension to get the latest manual
$url
=
$this
->
docsInformation
[
$extensionKey
][
'docs'
][
$versionString
][
'url'
];
}
elseif
(
isset
(
$oldManualsInformation
[
$extensionKey
]))
{
foreach
(
$this
->
getPossibleVersionStrings
(
$versionString
)
as
$possibleVersionString
)
{
if
(
isset
(
$this
->
docsInformation
[
$extensionKey
][
'docs'
][
$possibleVersionString
]))
{
$url
=
$this
->
docsInformation
[
$extensionKey
][
'docs'
][
$possibleVersionString
][
'url'
];
break
;
}
}
if
(
$url
===
''
&&
isset
(
$oldManualsInformation
[
$extensionKey
]))
{
$baseUrl
=
'https://docs.typo3.org/typo3cms/extensions/'
;
$url
=
$baseUrl
.
$extensionKey
.
'/'
;
}
...
...
@@ -78,4 +82,21 @@ class DocumentationService implements \TYPO3\CMS\Core\SingletonInterface
return
$returnUrlOnly
?
$url
:
$documentationLink
;
}
private
function
getPossibleVersionStrings
(
string
$defaultVersion
):
array
{
$possibleVersionStrings
=
[
$defaultVersion
,
// just 2 points without v
];
$versionParts
=
explode
(
'.'
,
$defaultVersion
);
if
(
count
(
$versionParts
)
===
3
)
{
$possibleVersionStrings
[]
=
implode
(
'.'
,
array_slice
(
$versionParts
,
0
,
2
));
}
$possibleVersionStrings
[]
=
ltrim
(
$defaultVersion
,
'v'
);
$possibleVersionStrings
[]
=
ltrim
(
implode
(
'.'
,
array_slice
(
$versionParts
,
0
,
2
)),
'v'
);
return
$possibleVersionStrings
;
}
}
extensions/ter_fe2/Classes/Service/LTSVersionService.php
View file @
8d562a17
...
...
@@ -21,11 +21,20 @@ use TYPO3\CMS\Core\Utility\VersionNumberUtility;
*/
class
LTSVersionService
{
const
FACTOR_MAIN_VERSION
=
1000000
;
const
FACTOR_MINOR_VERSION
=
1000
;
const
FIRST_LTS_VERSION_WITH_MAIN_VERSION_NUMBER
=
7
;
/**
* @var array
*/
public
$coreData
=
''
;
public
$ltsVersionsWithMinorVersions
=
[
'4.5'
,
'6.2'
];
public
function
__construct
()
{
// Will be automatically update with UpdateCurrentVersionListTask see T3o\Ter\Task\UpdateCurrentVersionListTask
...
...
@@ -37,28 +46,72 @@ class LTSVersionService
/**
* Get the current stable versions
*
* @param bool $fullVersionNumber
* @return array
*/
public
function
getCurrentStableVersions
(
)
public
function
getCurrentStableVersions
(
$fullVersionNumber
=
false
):
array
{
return
[
$this
->
getLatestOldLTS
(),
$this
->
getLatestLTS
()
$this
->
getLatestOldLTS
(
$fullVersionNumber
),
$this
->
getLatestLTS
(
$fullVersionNumber
)
];
}
/**
* Returns all maintained versions.
*
* @param bool $fullVersionNumber
* @return array
*/
public
function
getAllMaintainedVersions
(
)
public
function
getAllMaintainedVersions
(
$fullVersionNumber
=
false
):
array
{
$versions
=
$this
->
getCurrentStableVersions
();
array_push
(
$versions
,
$this
->
getLatestDevelopmentVersion
());
$versions
=
$this
->
getCurrentStableVersions
(
$fullVersionNumber
);
array_push
(
$versions
,
$this
->
getLatestDevelopmentVersion
(
$fullVersionNumber
));
return
$versions
;
}
/**
* Get all LTS versions ever
*
* @return array
*/
public
function
getAllLTSVersions
():
array
{
$ltsVersions
=
[];
foreach
(
$this
->
coreData
as
$releaseVersion
=>
$releaseData
)
{
if
(
in_array
(
$releaseVersion
,
$this
->
ltsVersionsWithMinorVersions
)
||
$releaseVersion
>=
self
::
FIRST_LTS_VERSION_WITH_MAIN_VERSION_NUMBER
)
{
$latestVersionParts
=
explode
(
'.'
,
$releaseData
[
'latest'
]);
if
((
int
)
$latestVersionParts
[
1
]
===
0
)
{
continue
;
}
$minimumVersion
=
$latestVersionParts
[
0
]
.
'.'
.
$latestVersionParts
[
1
]
.
'.0'
;
$ltsVersions
[]
=
VersionNumberUtility
::
convertVersionNumberToInteger
(
$minimumVersion
);
}
}
sort
(
$ltsVersions
);
return
$ltsVersions
;
}
/**
* Get all LTS versions but current maintained
*
* @return array
*/
public
function
getOldLTSVersions
():
array
{
$oldLTSVersions
=
$this
->
getAllLTSVersions
();
foreach
(
$oldLTSVersions
as
$key
=>
$version
)
{
$mainVersion
=
floor
(
$version
/
self
::
FACTOR_MAIN_VERSION
);
if
(
in_array
(
$mainVersion
,
$this
->
getCurrentStableVersions
()))
{
unset
(
$oldLTSVersions
[
$key
]);
}
}
return
$oldLTSVersions
;
}
/**
* Get latest version within a specific release
*
...
...
@@ -78,30 +131,57 @@ class LTSVersionService
/**
* Get latest development version
*
* @return string
* @param bool $fullVersionNumber
* @return int
*/
public
function
getLatestDevelopmentVersion
(
)
public
function
getLatestDevelopmentVersion
(
$fullVersionNumber
=
false
):
int
{
return
substr
(
$this
->
coreData
[
'latest_stable'
],
0
,
3
);
if
(
$fullVersionNumber
)
{
return
VersionNumberUtility
::
convertVersionNumberToInteger
(
$this
->
coreData
[
'latest_stable'
]);
}
return
floor
(
VersionNumberUtility
::
convertVersionNumberToInteger
(
$this
->
coreData
[
'latest_stable'
])
/
self
::
FACTOR_MAIN_VERSION
);
}
public
function
getVersionLabelOfRelease
(
int
$release
):
string
{
if
(
$release
>=
(
self
::
FIRST_LTS_VERSION_WITH_MAIN_VERSION_NUMBER
*
self
::
FACTOR_MAIN_VERSION
))
{
$versionLabel
=
(
string
)
floor
(
$release
/
self
::
FACTOR_MAIN_VERSION
);
}
else
{
$fullVersionLabelParts
=
explode
(
'.'
,
VersionNumberUtility
::
convertIntegerToVersionNumber
(
$release
));
$versionLabel
=
$fullVersionLabelParts
[
0
]
.
'.'
.
$fullVersionLabelParts
[
1
];
}
return
$versionLabel
;
}
/**
* Get latest LTS Version
*
* @param bool $fullVersionNumber
* @return int
*/
p
rivate
function
getLatestLTS
()
p
ublic
function
getLatestLTS
(
$fullVersionNumber
=
false
):
int
{
return
(
int
)
substr
(
$this
->
coreData
[
'latest_lts'
],
0
,
1
);
if
(
$fullVersionNumber
)
{
return
VersionNumberUtility
::
convertVersionNumberToInteger
(
$this
->
coreData
[
'latest_lts'
]);
}
return
floor
(
VersionNumberUtility
::
convertVersionNumberToInteger
(
$this
->
coreData
[
'latest_lts'
])
/
self
::
FACTOR_MAIN_VERSION
);
}
/**
* Get latest "old" LTS Version
*
* @param bool $fullVersionNumber
* @return int
*/
p
rivate
function
getLatestOldLTS
()
p
ublic
function
getLatestOldLTS
(
$fullVersionNumber
=
false
):
int
{
return
(
int
)
substr
(
$this
->
coreData
[
'latest_old_lts'
],
0
,
1
);
if
(
$fullVersionNumber
)
{
return
VersionNumberUtility
::
convertVersionNumberToInteger
(
$this
->
coreData
[
'latest_old_lts'
]);
}
return
floor
(
VersionNumberUtility
::
convertVersionNumberToInteger
(
$this
->
coreData
[
'latest_old_lts'
])
/
self
::
FACTOR_MAIN_VERSION
);
}
}
extensions/ter_fe2/Classes/Solr/IndexQueue/TerIndexer.php
View file @
8d562a17
...
...
@@ -109,24 +109,34 @@ class TerIndexer extends \ApacheSolrForTypo3\Solr\IndexQueue\Indexer
}
// does this extension supports different versions?
// @todo: use JSON with all versions to get them
$document
->
setField
(
'supports7_boolS'
,
false
);
$document
->
setField
(
'supports8_boolS'
,
false
);
$document
->
setField
(
'supports9_boolS'
,
false
);
$typo3Support
=
[];
if
(
VersionUtility
::
doesExtensionSupportTypo3Version
(
$extension
,
7006000
))
{
$typo3Support
[]
=
'7 LTS'
;
$document
->
setField
(
'supports7_boolS'
,
true
);
}
if
(
VersionUtility
::
doesExtensionSupportTypo3Version
(
$extension
,
8007000
))
{
$typo3Support
[]
=
'8 LTS'
;
$document
->
setField
(
'supports8_boolS'
,
true
);
}
if
(
VersionUtility
::
doesExtensionSupportTypo3Version
(
$extension
,
9005000
))
{
$typo3Support
[]
=
'9 LTS'
;
$document
->
setField
(
'supports9_boolS'
,
true
);
}
$document
->
setField
(
'typo3support_stringM'
,
$typo3Support
);
$supportMaintainedVersions
=
[];
$supportDevVersion
=
''
;
$supportOlderVersions
=
[];
$ltsVersionService
=
GeneralUtility
::
makeInstance
(
\
T3o\TerFe2\Service\LTSVersionService
::
class
);
foreach
(
$ltsVersionService
->
getCurrentStableVersions
(
true
)
as
$versionNumber
)
{
if
(
VersionUtility
::
doesExtensionSupportTypo3Version
(
$extension
,
$versionNumber
))
{
$supportMaintainedVersions
[]
=
$ltsVersionService
->
getVersionLabelOfRelease
(
$versionNumber
)
.
' LTS'
;
}
}
if
(
$ltsVersionService
->
getLatestDevelopmentVersion
()
!==
$ltsVersionService
->
getLatestLTS
()
&&
VersionUtility
::
doesExtensionSupportTypo3Version
(
$extension
,
$ltsVersionService
->
getLatestDevelopmentVersion
(
true
)))
{
$supportDevVersion
=
$ltsVersionService
->
getLatestDevelopmentVersion
()
.
'-dev'
;
}
foreach
(
$ltsVersionService
->
getOldLTSVersions
()
as
$versionNumber
)
{
if
(
VersionUtility
::
doesExtensionSupportTypo3Version
(
$extension
,
$versionNumber
))
{
$supportOlderVersions
[]
=
$ltsVersionService
->
getVersionLabelOfRelease
(
$versionNumber
)
.
' LTS'
;
}
}
$document
->
setField
(
'typo3support_stringM'
,
$supportMaintainedVersions
);
$facetVersions
=
$supportMaintainedVersions
;
if
(
$supportDevVersion
)
{
$facetVersions
=
array_merge
(
$supportMaintainedVersions
,
[
$supportDevVersion
]);
}
$document
->
setField
(
'typo3supportfacets_stringM'
,
$facetVersions
);
$document
->
setField
(
'typo3supportdev_stringS'
,
$supportDevVersion
);
$document
->
setField
(
'typo3supportold_stringM'
,
$supportOlderVersions
);
$extensionIcon
=
$this
->
getExtensionIcon
(
$itemRecord
[
'ext_key'
],
$extension
->
getLastVersion
()
->
getVersionString
());
$document
->
setField
(
'extensionIcon_stringS'
,
$extensionIcon
);
...
...
extensions/ter_fe2/Classes/Utility/VersionUtility.php
View file @
8d562a17
...
...
@@ -49,7 +49,7 @@ class VersionUtility
public
static
function
doesExtensionSupportTypo3Version
(
\
T3o\TerFe2\Domain\Model\Extension
$extension
,
int
$mainVersion
)
:
bool
{
foreach
(
$extension
->
getVersions
()
as
$version
)
{
if
(
$version
->
hasTypo3Dependency
()
===
false
||
$version
->
isLive
()
===
false
)
{
if
(
$version
->
getTypo3Dependency
()
===
null
||
$version
->
getReviewState
()
===
\
T3o\TerFe2\Domain\Model\Version
::
VERSION_IS_INSECURE
)
{
continue
;
}
...
...
extensions/ter_fe2/Resources/Private/Partials/VersionSupportForTypo3.html
View file @
8d562a17
<html
xmlns:f=
"http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid=
"true"
>
<f:if
condition=
"{version.matrixOfSupportedTypo3Versions}"
>
<ul
class=
"list-inline"
>
<f:for
each=
"{version.matrixOfSupportedTypo3Versions}"
key=
"label"
as=
"supported"
>
<f:if
condition=
"{supported}"
>
<li
class=
"list-inline-item badge badge-success"
>
{label}
</li>
</f:if>
<f:if
condition=
"{version.typo3Dependency}"
>
<h4>
This version supports TYPO3
</h4>
<p>
<f:for
each=
"{version.matrixOfSupportedTypo3Versions}"
as=
"version"
>
<button
class=
"btn btn-{version.badgeClass} btn-sm mr-2"
disabled
>
{version.label}
</button>
</f:for>
</
ul
>
</
p
>
</f:if>
</html>
extensions/ter_fe2/Resources/Private/Templates/Extension/Show.html
View file @
8d562a17
...
...
@@ -90,17 +90,15 @@
<div
class=
"row mb-3"
>
<div
class=
"col-md-8"
>
<p
itemprop=
"description"
>
{extension.lastVersion.description}
</p>
<h3>
<f:render
partial=
"VersionSupportForTypo3"
arguments=
"{version: extension.lastVersion}"
/>
</h3>
<f:if
condition=
"{extension.composerName}"
>
<p
class=
"mb-3"
>
<h
3>
Composer support
</h3
>
<h
4>
Composer support
</h4
>
<f:render
partial=
"ComposerNameWithClipboard"
arguments=
"{composerName: extension.composerName}"
/>
</p>
</f:if>
<f:if
condition=
"{extension.tags}"
>
<h
3>
Tags
</h3
>
<h
4>
Tags
</h4
>
<p
class=
"tags"
>
<f:for
each=
"{extension.tags}"
as=
"tag"
>
<f:link.page
class=
"btn btn-outline-info mb-1"
pageUid=
"{settings.pages.searchResultsPid}"
additionalParams=
"{tx_solr: {filter: {0: 'tags:{tag.title}'}}}"
>
...
...
@@ -116,16 +114,16 @@
</f:for>
</div>
</f:if>
<h
3
>
<h
4
>
<f:translate
key=
"last_upload_comment"
/>
</h
3
>
</h
4
>
<p
itemprop=
"releaseNotes"
>
<f:format.nl2br>
{extension.lastVersion.uploadComment}
</f:format.nl2br>
</p>
<f:if
condition=
"{versionHistory->f:count()} >= 1}"
>
<h
3
>
<h
4
>
<f:translate
key=
"downloads_by_version"
/>
</h
3
>
</h
4
>
<script
type=
"text/javascript"
>
var
versionChartData
=
{
extension
.
downloadsByVersionsAsJson
->
f
:
format
.
raw
()};
</script>
...
...
extensions/ter_fe2/Tests/Unit/Service/LTSVersionServiceTest.php
View file @
8d562a17
...
...
@@ -40,7 +40,15 @@ class LTSVersionServiceTest extends UnitTestCase
*/
public
function
getCurrentStableVersions
()
{
$this
->
assertSame
([
7
,
8
],
$this
->
subject
->
getCurrentStableVersions
());
self
::
assertSame
([
8
,
9
],
$this
->
subject
->
getCurrentStableVersions
());
}
/**
* @test
*/
public
function
getCurrentStableVersionsAsFullVersionNumber
()
{
self
::
assertSame
([
8007009
,
9005005
],
$this
->
subject
->
getCurrentStableVersions
(
true
));
}
/**
...
...
@@ -48,7 +56,15 @@ class LTSVersionServiceTest extends UnitTestCase
*/
public
function
getAllMaintainedVersions
()
{
$this
->
assertSame
([
7
,
8
,
'9.0'
],
$this
->
subject
->
getAllMaintainedVersions
());
self
::
assertSame
([
8
,
9
,
10
],
$this
->
subject
->
getAllMaintainedVersions
());
}
/**
* @test
*/
public
function
getAllMaintainedVersionsAsFullVersionNumber
()
{