Commit 3f3601c6 authored by Thomas Löffler's avatar Thomas Löffler

Merge branch 'develop' into 'master'

Weekly release 05-10-17

See merge request !243
parents 3e054b8c dc4b4219
Pipeline #2430 passed with stages
in 2 minutes and 45 seconds
......@@ -47,15 +47,18 @@ layout:
.deploy-template: &deploy_template
stage: deploy
image:
name: "torvitas/deployer:4.0.0-alpine"
entrypoint: [""]
before_script:
- apk add openssh-client bash --no-cache
- mkdir -p /root/.ssh/
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY_STAGE" | ssh-add -
- echo "$SSH_PRIVATE_KEY_PRODUCTION" | ssh-add -
- ssh-keyscan -p 22191 extensions-stage.typo3.org >> /root/.ssh/known_hosts
- ssh-keyscan -p 22179 extensions.typo3.org >> /root/.ssh/known_hosts
script:
- VERSION=4.0.0-alpine ./.gitlab-ci/scripts/deployer.sh -f/src/.gitlab-ci/deployer/deploy.php deploy ${CI_BUILD_REF_NAME}
- dep -f./.gitlab-ci/deployer/deploy.php deploy ${CI_BUILD_REF_NAME}
dependencies:
- layout
except:
......
......@@ -48,9 +48,9 @@ set('rsync', [
'options' => ['delete'],
'timeout' => 300
]);
set('rsync_src', '/src/');
set('rsync_src', './');
set('keep_releases', 10);
serverList('/src/.gitlab-ci/deployer/servers.yml');
serverList('./.gitlab-ci/deployer/servers.yml');
task('typo3', function() {
run('cd {{release_path}} && /opt/php/php70/bin/php bin/typo3cms install:generatepackagestates 0 1');
......
......@@ -26,6 +26,10 @@ namespace T3o\TerFe2\Controller;
* This copyright notice MUST APPEAR in all copies of the script!
* **************************************************************** */
use ApacheSolrForTypo3\Solr\IndexQueue\Queue;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Controller for the extension key registration
*/
......@@ -276,6 +280,11 @@ class RegisterkeyController extends \T3o\TerFe2\Controller\AbstractTerBasedContr
$this->versionRepository->remove($version);
if (empty($version->getExtension()->getVersions())) {
$redirectToIndexAction = true;
// remove from index queue
if (ExtensionManagementUtility::isLoaded('solr')) {
$indexQueue = GeneralUtility::makeInstance(Queue::class);
$indexQueue->deleteItem('tx_terfe2_domain_model_extension', $version->getExtension()->getUid());
}
}
$this->addFlashMessage(
'',
......@@ -322,6 +331,26 @@ class RegisterkeyController extends \T3o\TerFe2\Controller\AbstractTerBasedContr
}
}
/**
* @param \T3o\TerFe2\Domain\Model\Extension $extension
* @param \T3o\TerFe2\Domain\Model\Version $version
* @return void
*/
public function setAsLastVersionAction(\T3o\TerFe2\Domain\Model\Extension $extension, \T3o\TerFe2\Domain\Model\Version $version)
{
$extension->setLastVersion($version);
$this->extensionRepository->update($extension);
$this->redirectWithMessage(
'Version ' . $version->getVersionString() . ' set as latest version!',
'admin',
'New last version',
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
null,
null,
['extensionKey' => $extension->getExtKey()]
);
}
/**
* resolve the error key and get the corresponding translation
*
......
......@@ -25,45 +25,53 @@ namespace T3o\TerFe2\Domain\Model;
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
use TYPO3\CMS\Extbase\Domain\Model\FrontendUser;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
/**
* Author of an extension
*/
class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* Name of the author
*
* @var string
* @validate NotEmpty
*/
protected $name;
protected $name = '';
/**
* Email address
*
* @var string
*/
protected $email;
protected $email = '';
/**
* Company name
*
* @var string
*/
protected $company;
protected $company = '';
/**
* Link to forge profile
*
* @var string
*/
protected $forgeLink;
protected $forgeLink = '';
/**
* Owner username
*
* @var string
*/
protected $username;
protected $username = '';
/**
* versions
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Version>
* @lazy
*/
......@@ -71,9 +79,10 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Frontend user
* @var \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*
* @var string
*/
protected $frontendUser;
protected $frontendUser = '';
/**
* Author type
......@@ -83,7 +92,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* 2 = Developer
* 3 = Support
*
* @var integer
* @var int
*/
protected $authorType;
......@@ -92,17 +101,16 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/
public function __construct()
{
$this->versions = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->versions = new ObjectStorage();
}
/**
* Setter for name
*
* @param string $name Name of the author
* @return void
*/
public function setName($name)
public function setName(string $name)
{
$this->name = $name;
}
......@@ -113,7 +121,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @return string Name of the author
*/
public function getName()
public function getName(): string
{
return $this->name;
}
......@@ -125,7 +133,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $email Email address
* @return void
*/
public function setEmail($email)
public function setEmail(string $email)
{
$this->email = $email;
}
......@@ -136,7 +144,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @return string Email address
*/
public function getEmail()
public function getEmail(): string
{
return $this->email;
}
......@@ -148,7 +156,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $company Company name
* @return void
*/
public function setCompany($company)
public function setCompany(string $company)
{
$this->company = $company;
}
......@@ -159,7 +167,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @return string Company name
*/
public function getCompany()
public function getCompany(): string
{
return $this->company;
}
......@@ -171,7 +179,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $forgeLink Link to forge profile
* @return void
*/
public function setForgeLink($forgeLink)
public function setForgeLink(string $forgeLink)
{
$this->forgeLink = $forgeLink;
}
......@@ -182,7 +190,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @return string Link to forge profile
*/
public function getForgeLink()
public function getForgeLink(): string
{
return $this->forgeLink;
}
......@@ -194,7 +202,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $username Owner username
* @return void
*/
public function setUsername($username)
public function setUsername(string $username)
{
$this->username = $username;
}
......@@ -205,7 +213,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @return string Owner username
*/
public function getUsername()
public function getUsername(): string
{
return $this->username;
}
......@@ -214,9 +222,9 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Getter for versions
*
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Version> versions
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
*/
public function getVersions()
public function getVersions(): ObjectStorage
{
return $this->versions;
}
......@@ -228,7 +236,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param \T3o\TerFe2\Domain\Model\Version $version The Version to be added
* @return void
*/
public function addVersion(\T3o\TerFe2\Domain\Model\Version $version)
public function addVersion(Version $version)
{
$this->versions->attach($version);
}
......@@ -240,7 +248,7 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param \T3o\TerFe2\Domain\Model\Version $version The Version to be removed
* @return void
*/
public function removeVersion(\T3o\TerFe2\Domain\Model\Version $version)
public function removeVersion(Version $version)
{
$this->versions->detach($version);
}
......@@ -248,9 +256,9 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Getter for frontendUser
*
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
* @return string
*/
public function getFrontendUser()
public function getFrontendUser(): string
{
return $this->frontendUser;
}
......@@ -258,9 +266,9 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Setter for frontendUser
*
* @param \TYPO3\CMS\Extbase\Domain\Model\FrontendUser $frontendUser
* @param string $frontendUser
*/
public function setFrontendUser($frontendUser)
public function setFrontendUser(string $frontendUser = '')
{
$this->frontendUser = $frontendUser;
}
......@@ -268,10 +276,10 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Setter for authorType
*
* @param integer $authorType Type of the author
* @param int $type Type of the author
* @return void
*/
public function setAuthorType($type)
public function setAuthorType(int $type)
{
$this->authorType = $type;
}
......@@ -280,9 +288,9 @@ class Author extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Getter for authorType
*
* @return integer Type of the author
* @return int Type of the author
*/
public function getAuthorType()
public function getAuthorType(): int
{
return $this->authorType;
}
......
......@@ -25,10 +25,12 @@ namespace T3o\TerFe2\Domain\Model;
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
/**
* Extension manager cache entry
*/
class ExtensionManagerCacheEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
class ExtensionManagerCacheEntry extends AbstractEntity
{
// No attributes, getters and setters. Only required to get RAW result from respository
}
<?php
namespace T3o\TerFe2\Domain\Model;
/*******************************************************************
......@@ -25,191 +26,186 @@ namespace T3o\TerFe2\Domain\Model;
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
use T3o\TerFe2\Utility\Version;
/**
* Any type of relation of an extension
*/
class Relation extends \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject
{
/**
* Dependancy, conflict or suggest
*
* @var string
* @validate NotEmpty
*/
protected $relationType;
protected $relationType = '';
/**
* Extension key, php, mysql or something else
*
* @var string
* @validate NotEmpty
*/
protected $relationKey;
protected $relationKey = '';
/**
* Minimum required version for this Relation
* @var integer
*
* @var int
*/
protected $minimumVersion;
protected $minimumVersion = 0;
/**
* Maximum allowed version for this Relation
* @var integer
*
* @var int
*/
protected $maximumVersion;
protected $maximumVersion = 0;
/**
* Related extension if in TER
*
* @lazy
* @var \T3o\TerFe2\Domain\Model\Extension $relatedExtension
*/
protected $relatedExtension;
/**
* Setter for relationType
*
* @param string $relationType Dependancy, conflict or suggest
* @return void
*/
public function setRelationType($relationType)
public function setRelationType(string $relationType)
{
$this->relationType = $relationType;
}
/**
* Getter for relationType
*
* @return string Dependancy, conflict or suggest
*/
public function getRelationType()
public function getRelationType(): string
{
return $this->relationType;
}
/**
* Setter for relationKey
*
* @param string $relationKey extension key, php, mysql or something else
* @return void
*/
public function setRelationKey($relationKey)
public function setRelationKey(string $relationKey)
{
$this->relationKey = $relationKey;
}
/**
* Getter for relationKey
*
* @return string extension key, php, mysql or something else
*/
public function getRelationKey()
public function getRelationKey(): string
{
if (empty($this->relationKey)) {
return '';
}
return strtolower(trim($this->relationKey));
}
/**
* Setter for minimumVersion
*
* @param integer $minimumVersion Minimum required version
* @param int $minimumVersion Minimum required version
* @return void
*/
public function setMinimumVersion($minimumVersion)
public function setMinimumVersion(int $minimumVersion)
{
$this->minimumVersion = $minimumVersion;
}
/**
* Getter for minimumVersion
*
* @return integer Minimum required version
* @return int Minimum required version
*/
public function getMinimumVersion()
public function getMinimumVersion(): int
{
return (int)$this->minimumVersion;
return $this->minimumVersion;
}
/**
* Setter for maximumVersion
*
* @param integer $maximumVersion Maximum allowed version
* @param int $maximumVersion Maximum allowed version
* @return void
*/
public function setMaximumVersion($maximumVersion)
public function setMaximumVersion(int $maximumVersion)
{
$this->maximumVersion = $maximumVersion;
}
/**
* Getter for maximumVersion
*
* @return integer Maximum allowed version
* @return int Maximum allowed version
*/
public function getMaximumVersion()
public function getMaximumVersion(): int
{
return (int)$this->maximumVersion;
return $this->maximumVersion;
}
/**
* Setter for relatedExtension
*
* @param \T3o\TerFe2\Domain\Model\Extension $relatedExtension
* @return void
*/
public function setRelatedExtension($relatedExtension)
public function setRelatedExtension(Extension $relatedExtension = null)
{
$this->relatedExtension = $relatedExtension;
}
/**
* Getter for relatedExtension
*
* @return \T3o\TerFe2\Domain\Model\Extension
*/
public function getRelatedExtension()
public function getRelatedExtension(): Extension
{
return $this->relatedExtension;
}
/**
* Returns minumum and maximum version as string
*
* @return string Version
*/
public function getVersionString()
public function getVersionString(): string
{
$version = array();
$version = [];
if (!empty($this->minimumVersion)) {
$version[] = \T3o\TerFe2\Utility\Version::versionFromInteger($this->minimumVersion);
$version[] = Version::versionFromInteger($this->minimumVersion);
}
if (!empty($this->maximumVersion)) {
$version[] = \T3o\TerFe2\Utility\Version::versionFromInteger($this->maximumVersion);
$version[] = Version::versionFromInteger($this->maximumVersion);
}
return (!empty($version) ? implode(' - ', $version) : '');
}
/**
* Get software type
*
* @return string core, system or extension
*/
public function getType()
public function getType(): string
{
$key = $this->getRelationKey();
......@@ -228,36 +224,33 @@ class Relation extends \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject
return 'extension';
}
/**
* Is core relation
*
* @return boolean TRUE if related to core
* @return bool TRUE if related to core
*/
public function getIsCore()
public function getIsCore(): bool
{
return ($this->getType() == 'core');
return ($this->getType() === 'core');
}
/**
* Is system relation
*
* @return boolean TRUE if related to system
* @return bool TRUE if related to system
*/
public function getIsSystem()
public function getIsSystem(): bool
{
return ($this->getType() == 'system');
return ($this->getType() === 'system');
}
/**
* Is extension relation
*
* @return boolean TRUE if related to an extension
* @return bool TRUE if related to an extension
*/
public function getIsExtension()
public function getIsExtension(): bool
{
return ($this->getType() == 'extension');
return ($this->getType() === 'extension');
}
}
......@@ -33,11 +33,19 @@ class Tag extends \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject
/**
* Title of the tag
*
* @var string