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

Merge branch 'develop' into 'master'

Weekly release 05-10-17

See merge request t3o/ter!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,17 +25,19 @@ namespace T3o\TerFe2\Domain\Model;
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
/**
* Extension container
*/
class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* Extension key
*
* @var string
*/
protected $extKey;
protected $extKey = '';
/**
* Link to forge project
......@@ -43,22 +45,18 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @var string
* @validate \T3o\TerFe2\Validation\Validator\UrlValidator
*/
protected $forgeLink;
/**
* Last update
* @var DateTime
*/
protected $lastUpdate;
protected $forgeLink = '';
/**
* Tags
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Tag>
*/
protected $tags;
/**
* Versions
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Version>
* @lazy
*/
......@@ -66,37 +64,43 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Last version
*
* @var \T3o\TerFe2\Domain\Model\Version
*/
protected $lastVersion;
/**
* Frontend user
*
* @var string
*/
protected $frontendUser;
protected $frontendUser = '';
/**
* Sum of all version downloads
* @var integer
*
* @var int
*/
protected $downloads;
protected $downloads = 0;
/**
* Flattr username
*
* @var string
*/
protected $flattrUsername;
protected $flattrUsername = '';
/**
* Flattr data from result
*
* @var string
*/
protected $flattrData;
protected $flattrData = '';
/**
* Creation date
* @var DateTime
*
* @var \DateTime
*/
protected $crdate;
......@@ -106,14 +110,14 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @var string
* @validate \T3o\TerFe2\Validation\Validator\UrlValidator
*/
protected $repositoryUrl;
protected $repositoryUrl = '';
/**
* External repository clone url
*
* @var string
*/
protected $repositoryCloneUrl;
protected $repositoryCloneUrl = '';
/**
* Link to an external manual
......@@ -121,7 +125,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @var string
* @validate \T3o\TerFe2\Validation\Validator\UrlValidator
*/
protected $externalManual;
protected $externalManual = '';
/**
* Link to paypal donation
......@@ -129,7 +133,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @var string
* @validate \T3o\TerFe2\Validation\Validator\UrlValidator
*/
protected $paypalUrl;
protected $paypalUrl = '';
/**
* @var \DateTime
......@@ -142,8 +146,8 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/
public function __construct()
{
$this->tags = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->versions = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->tags = new ObjectStorage();
$this->versions = new ObjectStorage();
}
......@@ -153,7 +157,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $extKey extKey
* @return void
*/
public function setExtKey($extKey)
public function setExtKey(string $extKey)
{
$this->extKey = $extKey;
}
......@@ -164,7 +168,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @return string extKey
*/
public function getExtKey()
public function getExtKey(): string
{
return $this->extKey;
}
......@@ -176,7 +180,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param string $forgeLink forgeLink
* @return void
*/
public function setForgeLink($forgeLink)
public function setForgeLink(string $forgeLink)
{
$this->forgeLink = $forgeLink;
}
......@@ -187,38 +191,18 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @return string forgeLink
*/
public function getForgeLink()
public function getForgeLink(): string
{
return $this->forgeLink;
}
/**
* Sets lastUpdate
*
* @param \DateTime $lastUpdate
*/
public function setLastUpdate($lastUpdate)
{
$this->lastUpdate = $lastUpdate;
}
/**
* Gets lastUpdate
*
* @return \DateTime
*/
public function getLastUpdate()
{
return $this->lastUpdate;
}
/**
* Setter for crdate
*
* @param DateTime $crdate creation date
* @param \DateTime $crdate creation date
* @return void
*/
public function setCrdate(DateTime $crdate)
public function setCrdate(\DateTime $crdate)
{
$this->crdate = $crdate;
}
......@@ -227,43 +211,19 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Getter for crdate
*
* @return DateTime crdate
* @return \DateTime crdate
*/
public function getCrdate()
public function getCrdate(): \DateTime
{
return $this->crdate;
}
/**
* Setter for lastMaintained
*
* @param DateTime $lastMaintained lastMaintained
* @return void
*/
public function setLastMaintained(DateTime $lastMaintained)
{
$this->lastMaintained = $lastMaintained;
}
/**
* Getter for lastMaintained
*
* @return DateTime lastMaintained
*/
public function getLastMaintained()
{
return $this->lastMaintained;
}
/**
* Getter for tags
*
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Tag> Tags
*/
public function getTags()
public function getTags(): ObjectStorage
{
return $this->tags;
}
......@@ -275,7 +235,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param \T3o\TerFe2\Domain\Model\Tag $tag The tag to be added
* @return void
*/
public function addTag(\T3o\TerFe2\Domain\Model\Tag $tag)
public function addTag(Tag $tag)
{
$this->tags->attach($tag);
}
......@@ -287,7 +247,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
* @param \T3o\TerFe2\Domain\Model\Tag $tag The tag to be removed
* @return void
*/
public function removeTag(\T3o\TerFe2\Domain\Model\Tag $tag)
public function removeTag(Tag $tag)
{
$this->tags->detach($tag);
}
......@@ -298,7 +258,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\TerFe2\Domain\Model\Version> Versions
*/
public function getVersions()