Commit c5032fe3 authored by Sebastian Diez's avatar Sebastian Diez
Browse files

Merge branch 'develop' into 75-use-namespaces-and-new-class-names-in-the-tasks

parents 4e3337df fa2cdee5
Pipeline #873 passed with stages
in 3 minutes and 19 seconds
......@@ -3,9 +3,10 @@ variables:
GIT_SSL_NO_VERIFY: "true"
before_script:
- apk add bash --update
- apk add bash --no-cache
stages:
- dump
- build
- layout
- deploy
......@@ -23,7 +24,8 @@ build:
paths:
- ./
expire_in: '1h'
environment: ${CI_BUILD_REF_NAME}
except:
- assets
layout:
stage: layout
......@@ -40,17 +42,22 @@ layout:
environment: ${CI_BUILD_REF_NAME}
dependencies:
- build
except:
- assets
.deploy-template: &deploy_template
stage: deploy
script:
- apk add openssh-client
before_script:
- apk add openssh-client bash --no-cache
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | ssh-add -
script:
- ./.gitlab-ci/scripts/deployer.sh -f/src/.gitlab-ci/deployer/deploy.php deploy ${CI_BUILD_REF_NAME}
when: manual
dependencies:
- layout
except:
- assets
deploy-master:
<<: *deploy_template
......@@ -67,3 +74,21 @@ deploy-develop:
url: https://extensions-dev.typo3.org/
only:
- develop
dump-assets:
<<: *deploy_template
stage: dump
image: alpine:3.5
artifacts:
paths:
- ./assets/
expire_in: '3d'
script:
- apk add rsync --no-cache
- rsync -ah -e "ssh -p 22179" extensionsdev@extensions-dev.typo3.org:ci/shared/ ./assets/
- ssh -p22179 extensionsdev@extensions-dev.typo3.org "mysqldump -u${DEV_DATABASE_USER} -p${DEV_DATABASE_PASSWORD} -h127.0.0.1 extensionsdev | gzip -9 -c" > ./assets/db.sql.gz
dependencies:
when:
only:
- assets
except:
......@@ -35,10 +35,10 @@
},
"scripts": {
"post-install-cmd": [
"./bin/typo3cms install:generatepackagestates 0 1"
"typo3cms install:generatepackagestates 0 1"
],
"post-update-cmd": [
"./bin/typo3cms install:generatepackagestates 0 1"
"typo3cms install:generatepackagestates 0 1"
]
},
"extra": {
......
This diff is collapsed.
......@@ -169,7 +169,7 @@ class tx_ter_api
);
}
if (($typo3DependencyCheck = $this->checkExtensionDependencyOnSupportedTypo3Version($extensionInfoData)) !== true) {
if (($typo3DependencyCheck = $this->checkExtensionDependencyOnSupportedTypo3Version($extensionInfoData)) !== true && $uploadUserRecordArr['admin'] !== true) {
switch ($typo3DependencyCheck) {
case TX_TER_ERROR_UPLOADEXTENSION_TYPO3DEPENDENCYINCORRECT:
$message = 'Extension does not have a dependency for a supported version of TYPO3. See http://typo3.org/news/article/announcing-ter-cleanup-process/ for how to fix this.';
......
......@@ -468,7 +468,7 @@ function versionConv($input, $rev = false)
$result = intval(substr($int, 0, -6)) . '.' . intval(substr($int, -6, -3)) . '.' . intval(substr($int, -3)) . $suffix;
}
} else { // From string to double
$result = \TYPO3\CMS\Core\Utility\GeneralUtility::int_from_ver($input);
$result = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($input);
if (preg_match('/(dev|a|b|rc)([0-9]*)$/', strtolower($input), $reg)) {
$dec = intval($subDecIndex[$reg[1]]) . $reg[2];
$result = (double)(($result - 1) . '.' . $dec);
......@@ -586,4 +586,4 @@ function xmlentities($string)
return str_replace(['&', '"', "'", '<', '>'], ['&amp;', '&quot;', '&apos;', '&lt;', '&gt;'], $string);
}
?>
\ No newline at end of file
?>
......@@ -173,15 +173,14 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
$this->view->assign('extensions', $extensions);
}
/**
* Action that displays a single extension
*
* @param \T3o\TerFe2\Domain\Model\Extension $extension The extension to display
* @param string $extensionKey Extension key
* @return void
* @dontvalidate $extension
* @dontvalidate $extensionKey
*
* @ignorevalidation $extension
*/
public function showAction(\T3o\TerFe2\Domain\Model\Extension $extension = NULL, $extensionKey = NULL)
{
......
......@@ -148,8 +148,8 @@ abstract class AbstractProvider implements \T3o\TerFe2\Provider\ProviderInterfac
protected function getVersionByRange($version)
{
$version = \TYPO3\CMS\Extbase\Utility\ArrayUtility::trimExplode('-', $version);
$minimum = (!empty($version[0]) ? \TYPO3\CMS\Core\Utility\GeneralUtility::int_from_ver($version[0]) : 0);
$maximum = (!empty($version[1]) ? \TYPO3\CMS\Core\Utility\GeneralUtility::int_from_ver($version[1]) : 0);
$minimum = (!empty($version[0]) ? \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($version[0]) : 0);
$maximum = (!empty($version[1]) ? \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($version[1]) : 0);
return array($minimum, $maximum);
}
......
......@@ -210,7 +210,7 @@ class ImportAllExtensionsTask extends \TYPO3\CMS\Extbase\Scheduler\Task
'title' => $extData['title'],
'description' => $extData['description'],
'author' => $this->createAuthor($extData),
'version_number' => \TYPO3\CMS\Core\Utility\GeneralUtility::int_from_ver($extData['version']),
'version_number' => \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($extData['version']),
'version_string' => $extData['version'],
'upload_date' => $extData['lastuploaddate'],
'upload_comment' => $extData['uploadcomment'],
......@@ -404,8 +404,8 @@ class ImportAllExtensionsTask extends \TYPO3\CMS\Extbase\Scheduler\Task
protected function getVersionByRange($version)
{
$version = \TYPO3\CMS\Extbase\Utility\ArrayUtility::trimExplode('-', $version);
$minimum = (!empty($version[0]) ? \TYPO3\CMS\Core\Utility\GeneralUtility::int_from_ver($version[0]) : 0);
$maximum = (!empty($version[1]) ? \TYPO3\CMS\Core\Utility\GeneralUtility::int_from_ver($version[1]) : 0);
$minimum = (!empty($version[0]) ? \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($version[0]) : 0);
$maximum = (!empty($version[1]) ? \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($version[1]) : 0);
return array($minimum, $maximum);
}
......
......@@ -78,7 +78,7 @@ class ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractT
}
if (empty($imageUrl) || !file_exists(\T3o\TerFe2\Utility\File::getAbsolutePathFromUrl($imageUrl))) {
$imageUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl('typo3/clear.gif');
return '';
}
$this->tag->addAttribute('src', $imageUrl);
......
{namespace terfe2=T3o\TerFe2\ViewHelpers}
<dl class="row">
<dt class="col-sm-3"><f:translate key="version" /></dt>
<dd class="col-sm-9">{extension.lastVersion.versionString}</dd>
<dt class="col-sm-3"><f:translate key="last_updated" /></dt>
<dd class="col-sm-9"><terfe2:dateTime format="{settings.dateFormat}">{extension.lastVersion.uploadDate}</terfe2:dateTime></dd>
<dt class="col-sm-3"><f:translate key="first_upload" /></dt>
<dd class="col-sm-9"><terfe2:dateTime format="{settings.dateFormat}">{extension.crdate}</terfe2:dateTime></dd>
<dt class="col-sm-3"><f:translate key="downloads" /></dt>
<dd class="col-sm-9"><f:format.number decimals="0" thousandsSeparator="," decimalSeparator=".">{extension.downloads}</f:format.number></dd>
<dt class="col-sm-4"><f:translate key="version" /></dt>
<dd class="col-sm-8">{extension.lastVersion.versionString}</dd>
<dt class="col-sm-4">Last update</dt>
<dd class="col-sm-8"><f:format.date format="%d. %b %Y">@{extension.lastVersion.uploadDate}</f:format.date></dd>
<dt class="col-sm-4"><f:translate key="first_upload" /></dt>
<dd class="col-sm-8"><f:format.date format="%d. %b %Y">{extension.crdate}</f:format.date></dd>
<dt class="col-sm-4"><f:translate key="downloads" /></dt>
<dd class="col-sm-8"><f:format.number decimals="0" thousandsSeparator="," decimalSeparator=".">{extension.downloads}</f:format.number></dd>
<f:security.ifHasRole role="{settings.reviewerGroupUid}">
<dt class="col-sm-3">Owner:</dt>
<dd class="col-sm-9">Name: {owner.name}<br />Email: {owner.email}<br />Username: {owner.username}</dd>
<dt class="col-sm-4">Owner:</dt>
<dd class="col-sm-8">Name: {owner.name}<br />Email: {owner.email}<br />Username: {owner.username}</dd>
</f:security.ifHasRole>
<dt class="col-sm-3"><f:translate key="category" /></dt>
<dd class="col-sm-9">
<dt class="col-sm-4"><f:translate key="category" /></dt>
<dd class="col-sm-8">
<f:if condition="{extension.lastVersion.emCategory}">
<f:then>
<f:translate key="category_{extension.lastVersion.emCategory}" />
......@@ -24,12 +24,12 @@
</f:else>
</f:if>
</dd>
<dt class="col-sm-3"><f:translate key="dependencies" /></dt>
<dd class="col-sm-9"><f:render partial="InlineRelationList" arguments="{relations: extension.lastVersion.dependencies}" /></dd>
<dt class="col-sm-3"><f:translate key="conflicts" /></dt>
<dd class="col-sm-9"><f:render partial="InlineRelationList" arguments="{relations: extension.lastVersion.conflicts}" /></dd>
<dt class="col-sm-3"><f:translate key="manual" /></dt>
<dd class="col-sm-9">
<dt class="col-sm-4"><f:translate key="dependencies" /></dt>
<dd class="col-sm-8"><f:render partial="InlineRelationList" arguments="{relations: extension.lastVersion.dependencies}" /></dd>
<dt class="col-sm-4"><f:translate key="conflicts" /></dt>
<dd class="col-sm-8"><f:render partial="InlineRelationList" arguments="{relations: extension.lastVersion.conflicts}" /></dd>
<dt class="col-sm-4"><f:translate key="manual" /></dt>
<dd class="col-sm-8">
<f:if condition="{documentationLink}">
<f:then>
<terfe2:raw>{documentationLink}</terfe2:raw>
......@@ -55,45 +55,47 @@
</f:if>
</dd>
<f:if condition="{extension.forgeLink}">
<dt class="col-sm-3">
<dt class="col-sm-4">
<f:translate key="bugtracker" />
</dt>
<dd class="col-sm-9">
<dd class="col-sm-8">
<f:link.external rel="nofollow" uri="{extension.forgeLink}" target="_blank">
<f:translate key="found_a_bug" />
</f:link.external>
</dd>
</f:if>
<f:if condition="{extension.repositoryUrl}">
<dt class="col-sm-3">
<dt class="col-sm-4">
<f:translate key="repository_url" />
</dt>
<dd class="col-sm-9">
<dd class="col-sm-8">
<f:link.external rel="nofollow" uri="{extension.repositoryUrl}" target="_blank">
<f:translate key="repository_url_value" />
</f:link.external>
</dd>
</f:if>
<f:if condition="{flattrUrl}">
<dt class="col-sm-3">
<dt class="col-sm-4">
<f:translate key="donate" />
</dt>
<dd class="col-sm-9">
<dd class="col-sm-8">
<f:link.external uri="{flattrUrl}" target="_blank"><img
src="https://api.flattr.com/button/flattr-badge-large.png"
alt="{f:translate(key:'donate')}" /></f:link.external>
</dd>
</f:if>
<f:if condition="{extension.paypalUrl}">
<dt class="col-sm-3">
<dt class="col-sm-4">
<f:translate key="like_it" />
</dt>
<dd class="col-sm-9">
<dd class="col-sm-8">
<f:link.external rel="nofollow" uri="{extension.paypalUrl}" target="_blank">
<f:translate key="donate_url" />
</f:link.external>
</dd>
</f:if>
<dt class="col-sm-3"><f:translate key="author" /></dt>
<dd class="col-sm-9">{owner.name}</dd>
<f:if condition="{extension.lastVersion.author}">
<dt class="col-sm-4"><f:translate key="author" /></dt>
<dd class="col-sm-8">{extension.lastVersion.author.name}</dd>
</f:if>
</dl>
......@@ -16,7 +16,7 @@
<f:if condition="{version.reviewState} == -1">class="table-danger"</f:if>
>
<td>
<strong>{version.versionString}</strong>
<strong>{version.versionString}</strong> / <span class="ter-ext-state-{extension.lastVersion.state}">{extension.lastVersion.state}</span>
<br />
<small>
<f:format.date format="F d, Y">{version.uploadDate}</f:format.date>
......
<h3>Installation</h3>
<div class="mb-3" id="accordion" role="tablist" aria-multiselectable="true">
<div class="card bgWhite">
<div class="card-header" role="tab" id="headingOne">
<h5 class="mb-0">
<a data-toggle="collapse" data-parent="#accordion" href="#install-zip" aria-expanded="true" aria-controls="collapseOne">
Install extension via ZIP file
</a>
</h5>
</div>
<div id="install-zip" class="collapse show" role="tabpanel" aria-labelledby="headingOne">
<div class="card-block">
<ol>
<li>
<f:link.action controller="Extension" action="download" arguments="{extension : extension, versionString : extension.lastVersion.versionString, format : 'zip'}">
Download ZIP file
</f:link.action>
</li>
<li>
Log into your TYPO3 backend
</li>
<li>
Go to Extension Manager module
</li>
<li>
Press the upload button on the top bar
</li>
<li>
Select the ZIP file and upload it. If you want to overwrite an existing extension installation, activate the
checkbox.
</li>
</ol>
</div>
</div>
</div>
<f:if condition="{extension.composerPackageName}">
<div class="card bgWhite">
<div class="card-header" role="tab" id="headingTwo">
<h5 class="mb-0">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#install-composer" aria-expanded="false" aria-controls="collapseTwo">
Install extension via composer command
</a>
</h5>
</div>
<div id="install-composer" class="collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="card-block">
<ol>
<li>
Go to your folder where the root composer.json file is located
</li>
<li>
Type: <code>composer require {extension.composerPackageName}</code> to get the latest version that runs on
your TYPO3 version.
</li>
</ol>
</div>
</div>
</div>
</f:if>
<div class="card bgWhite">
<div class="card-header" role="tab" id="headingThree">
<h5 class="mb-0">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#install-t3x" aria-expanded="false" aria-controls="collapseThree">
Install extension with T3X file
</a>
</h5>
</div>
<div id="install-t3x" class="collapse" role="tabpanel" aria-labelledby="headingThree">
<div class="card-block">
<ol>
<li>
<f:link.action controller="Extension" action="download" arguments="{extension : extension, versionString : extension.lastVersion.versionString, format : 't3x'}">
Download T3X file
</f:link.action>
</li>
<li>
Log into your TYPO3 backend
</li>
<li>
Go to Extension Manager module
</li>
<li>
Press the upload button on the top bar
</li>
<li>
Select the T3X file and upload it. If you want to overwrite an existing extension installation, activate the checkbox.
</li>
</ol>
</div>
</div>
</div>
</div>
......@@ -3,163 +3,86 @@
<f:layout name="Default" />
<f:section name="main">
<f:if condition="{extension}">
<f:then>
<header class="mt-3">
<terfe2:extensionIcon version="{extension.lastVersion}" alt="{extension.lastVersion.title}" class="ter-ext-icon" />
<h1>
{extension.lastVersion.title}
<small class="text-muted">{extension.extKey} / <span class="ter-ext-state-{extension.lastVersion.state}">{extension.lastVersion.state}</span>
</small>
</h1>
</header>
<f:if condition="{extension.lastVersion.reviewState} == -2">
<div class="alert alert-warning" role="alert">
<div class="alert alert-warning mt-3 mb-3" role="alert">
<h4 class="alert-header">
<span class="ter-ext-state-beta"><i class="fa fa-exclamation-triangle"></i></span>
Outdated extension
<small class="text-muted">This extension supports none of the currently supported TYPO3 core version</small>
</h4>
<p>
This extension supports none of the currently supported TYPO3 core versions or was
uploaded before the release of the oldest TYPO3 core version.<br />
It may no longer be maintained or supported by the extension owner.<br />
Please be careful using this extension for your up-to-date TYPO3 instance.<br /><br />
</p>
<p>
If you are sure this extension is flagged as outdated by mistake, please contact the
<f:link.page pageUid="90">t3o team</f:link.page>
</p>
</div>
</f:if>
<div class="row mb-3">
<div class="col-md-8">
<p>{extension.lastVersion.description}</p>
<div class="row mt-3">
<div class="col-md-9">
<header>
<terfe2:extensionIcon version="{extension.lastVersion}" alt="{extension.lastVersion.title}" class="ter-ext-icon" />
<h1>
{extension.lastVersion.title}
<small class="text-muted">{extension.extKey} /
<span class="ter-ext-state-{extension.lastVersion.state}">{extension.lastVersion.state}</span>
</small>
</h1>
</header>
</div>
<div class="col-md-4">
<div class="col-md-3">
<f:if condition="{extension.lastVersion.reviewState} != -1">
<div class="btn-group mb-3">
<button type="button" class="btn btn-primary pull-right dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Install {extension.extKey} via
</button>
<div class="dropdown-menu">
<a class="dropdown-item" data-parent="#collapse-container" data-toggle="collapse" data-target="#install-zip">ZIP file</a>
<a class="dropdown-item" data-parent="#collapse-container" data-toggle="collapse" data-target="#install-composer">composer</a>
<a class="dropdown-item" data-parent="#collapse-container" data-toggle="collapse" data-target="#install-t3x">T3X file</a>
</div>
</div>
<f:link.action class="btn btn-primary pull-right" controller="Extension" action="download" arguments="{extension : extension, versionString : extension.lastVersion.versionString, format : 'zip'}">
Download {extension.lastVersion.versionString}
</f:link.action>
</f:if>
</div>
</div>
<div class="row mb-3 justify-content-center">
<div id="collapse-container">
<div class="collapse" id="install-zip">
<div class="card card-block bgWhite">
<h4>Install {extension.extKey} via ZIP file</h4>
<ol>
<li>
<f:link.action class="" controller="Extension" action="download"
arguments="{extension : extension, versionString : extension.lastVersion.versionString, format : 'zip'}">
Download ZIP file
</f:link.action>
</li>
<li>
Log into your TYPO3 backend
</li>
<li>
Go to Extension Manager module
</li>
<li>
Press the upload button on the top bar
</li>
<li>
Select the ZIP file and upload it. If you want to overwrite an existing extension installation, activate the
checkbox.
</li>
</ol>
</div>
</div>
<div class="collapse" id="install-composer">
<div class="card card-block bgWhite">
<h4>Install {extension.extKey} via composer command</h4>
<ol>
<li>
Go to your folder where the root composer.json file is located
</li>
<li>
Type: <code>composer require {extension.composerPackageName}</code> to get the latest version that runs on
your TYPO3 version.
</li>
</ol>
</div>
</div>
<div class="collapse" id="install-t3x">
<div class="card card-block bgWhite">
<h4>Install {extension.extKey} via T3X file</h4>
<ol>
<li>
<f:link.action class="" controller="Extension" action="download" arguments="{extension : extension, versionString : extension.lastVersion.versionString, format : 't3x'}">
Download T3X file
</f:link.action>
</li>
<li>
Log into your TYPO3 backend
</li>
<li>
Go to Extension Manager module
</li>
<li>
Press the upload button on the top bar
</li>
<li>
Select the T3X file and upload it. If you want to overwrite an existing extension installation, activate the checkbox.
</li>
</ol>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>TYPO3 version support</h3>
<div class="alert alert-info">
This version works for <strong>TYPO3 {extension.lastVersion.typo3Dependency.versionString}</strong><br />
If you look for other TYPO3 versions, go to the "Download" area to get a history of all extension versions.
</div>
</div>
<f:if condition="{extension.tags}">
<div class="col-md-6">
<h3>Tags</h3>
<p class="tags">
<f:for each="{extension.tags}" as="tag">
<f:link.page class="btn btn-info mb-1" additionalParams="{q: '{tag.title}'}">{tag.title}</f:link.page>
</f:for>
</p>
</div>
<div class="mb-3">
<p>{extension.lastVersion.description}</p>
<f:if condition="{extension.lastVersion.typo3Dependency}">
<p>
<strong>
This version works for TYPO3 {extension.lastVersion.typo3Dependency.versionString}
</strong>
</p>
</f:if>
</div>
<f:if condition="{extension.tags}">
<h3>Tags</h3>
<p class="tags">
<f:for each="{extension.tags}" as="tag">
<f:link.page class="btn btn-info mb-1" additionalParams="{q: '{tag.title}'}">#{tag.title}</f:link.page>
</f:for>
</p>
</f:if>
<div class="row mb-3">
<div class="col-md-6">
<div class="col-md-8">
<h3>
<f:translate key="last_upload_comment" />
</h3>
<p>
<f:format.nl2br>{extension.lastVersion.uploadComment}</f:format.nl2br>
</p>
<h3>
<f:translate key="downloads_by_version" />
</h3>
<f:format.raw>
<terfe2:chart object="{extension}" method="downloadsByVersion" height="220" width="375" pointCount="{settings.defaultPointCount}" renderOnLoad="1" />
</f:format.raw>
<f:if condition="{versionHistory->f:count()} >= 1}">
<h3>
<f:translate key="downloads_by_version" />
</h3>
<f:format.raw>