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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
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
T
t3o sites
extensions.typo3.org
extensions.typo3.org
Commits
21d993e4
Commit
21d993e4
authored
Jun 10, 2017
by
Jens Jacobsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove tasks which where already removed in develop (see...
Remove tasks which where already removed in develop (see
01c279c9
and
0f8869ac
)
parent
99daf3ee
Pipeline
#962
passed with stages
in 2 minutes and 17 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
0 additions
and
1344 deletions
+0
-1344
html/typo3conf/ext/ter_fe2/Classes/Task/AbstractAdditionalFieldProvider.php
.../ter_fe2/Classes/Task/AbstractAdditionalFieldProvider.php
+0
-250
html/typo3conf/ext/ter_fe2/Classes/Task/AbstractTask.php
html/typo3conf/ext/ter_fe2/Classes/Task/AbstractTask.php
+0
-196
html/typo3conf/ext/ter_fe2/Classes/Task/CreateExtensionFilesTask.php
...onf/ext/ter_fe2/Classes/Task/CreateExtensionFilesTask.php
+0
-210
html/typo3conf/ext/ter_fe2/Classes/Task/CreateExtensionFilesTaskAdditionalFieldProvider.php
.../Task/CreateExtensionFilesTaskAdditionalFieldProvider.php
+0
-56
html/typo3conf/ext/ter_fe2/Classes/Task/DownloadCounterTask.php
...ypo3conf/ext/ter_fe2/Classes/Task/DownloadCounterTask.php
+0
-129
html/typo3conf/ext/ter_fe2/Classes/Task/UpdateDetailsTask.php
.../typo3conf/ext/ter_fe2/Classes/Task/UpdateDetailsTask.php
+0
-113
html/typo3conf/ext/ter_fe2/Classes/Task/UpdateDetailsTaskAdditionalFieldProvider.php
...Classes/Task/UpdateDetailsTaskAdditionalFieldProvider.php
+0
-56
html/typo3conf/ext/ter_fe2/Classes/Task/UpdateExtensionListTask.php
...conf/ext/ter_fe2/Classes/Task/UpdateExtensionListTask.php
+0
-271
html/typo3conf/ext/ter_fe2/Classes/Task/UpdateExtensionListTaskAdditionalFieldProvider.php
...s/Task/UpdateExtensionListTaskAdditionalFieldProvider.php
+0
-63
No files found.
html/typo3conf/ext/ter_fe2/Classes/Task/AbstractAdditionalFieldProvider.php
deleted
100755 → 0
View file @
99daf3ee
<?php
namespace
T3o\TerFe2\Task
;
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/**
* Abstract additional field provider
*/
abstract
class
AbstractAdditionalFieldProvider
implements
tx_scheduler_AdditionalFieldProvider
{
/**
* @var array
*/
protected
$values
=
array
();
/**
* @var boolean
*/
protected
$editMode
=
FALSE
;
/**
* @var array
*/
protected
$structure
=
array
();
/**
* @var string
*/
protected
$languageFile
=
'EXT:ter_fe2/Resources/Private/Language/locallang_db.xml'
;
/**
* @var string
*/
protected
$labelPrefix
=
'tx_terfe2_task_'
;
/**
* Add some input fields to configure the task
*
* @param array $taskInfo Reference to the array containing the info used in the add/edit form
* @param object $task When editing, reference to the current task object. Null when adding.
* @param tx_scheduler_Module $parentObject Reference to the calling object (Scheduler's BE module)
* @return array Array containing all the information pertaining to the additional fields
*/
public
function
getAdditionalFields
(
array
&
$taskInfo
,
$task
,
tx_scheduler_Module
$parentObject
)
{
if
(
!
empty
(
$task
))
{
$this
->
values
=
get_object_vars
(
$task
);
}
if
(
!
empty
(
$parentObject
->
CMD
))
{
$this
->
editMode
=
(
$parentObject
->
CMD
===
'edit'
);
}
$this
->
addInputField
(
'elementsPerRun'
,
10
);
$this
->
addInputField
(
'clearCachePages'
,
0
);
$this
->
addDateField
(
'forceLastRun'
,
''
);
$this
->
addInputField
(
'forceOffset'
,
''
);
$this
->
addInputField
(
'ignoreEmptyUntil'
,
''
);
$this
->
addAdditionalFields
();
return
$this
->
structure
;
}
/**
* Add some input fields to configure the task
*
* @return void
*/
abstract
protected
function
addAdditionalFields
();
/**
* Saves given values into task object
*
* @param array $submittedData Contains data submitted by the user
* @param \TYPO3\CMS\Extbase\Scheduler\Task $task Reference to the current task object
* @return void
*/
public
function
saveAdditionalFields
(
array
$submittedData
,
\
TYPO3\CMS\Extbase\Scheduler\Task
$task
)
{
if
(
!
empty
(
$task
))
{
$attributes
=
get_object_vars
(
$task
);
foreach
(
$attributes
as
$key
=>
$value
)
{
if
(
isset
(
$submittedData
[
$key
]))
{
$task
->
$key
=
$submittedData
[
$key
];
}
}
}
}
/**
* Checks the given values
*
* @param array $submittedData Reference to the array containing the data submitted by the user
* @param tx_scheduler_Module $parentObject Reference to the calling object (Scheduler's BE module)
* @return boolean TRUE if validation was ok (or selected class is not relevant), FALSE otherwise
*/
public
function
validateAdditionalFields
(
array
&
$submittedData
,
tx_scheduler_Module
$parentObject
)
{
if
(
!
$this
->
checkAdditionalFields
(
$submittedData
))
{
return
FALSE
;
}
if
(
empty
(
$submittedData
[
'elementsPerRun'
])
||
!
is_numeric
(
$submittedData
[
'elementsPerRun'
]))
{
return
FALSE
;
}
if
(
!
empty
(
$submittedData
[
'forceLastRun'
])
&&
!
is_string
(
$submittedData
[
'forceLastRun'
]))
{
return
FALSE
;
}
if
(
!
empty
(
$submittedData
[
'forceOffset'
])
&&
!
is_numeric
(
$submittedData
[
'forceOffset'
]))
{
return
FALSE
;
}
return
TRUE
;
}
/**
* Checks the given values
*
* @param array $submittedData Submitted user data
* @return boolean TRUE if validation was ok
*/
protected
function
checkAdditionalFields
(
array
$submittedData
)
{
return
TRUE
;
}
/**
* Adds the structure of an input field
*
* @param string $fieldName Name of the field
* @param mixed $defaultValue Default value of the field
* @return void
*/
protected
function
addInputField
(
$fieldName
,
$defaultValue
=
''
)
{
if
(
$this
->
editMode
&&
isset
(
$this
->
values
[
$fieldName
]))
{
$defaultValue
=
$this
->
values
[
$fieldName
];
}
$this
->
structure
[
$fieldName
]
=
array
(
'code'
=>
'<input type="text" name="tx_scheduler['
.
$fieldName
.
']" value="'
.
htmlspecialchars
(
$defaultValue
)
.
'" />'
,
'label'
=>
'LLL:'
.
$this
->
languageFile
.
':'
.
$this
->
labelPrefix
.
$fieldName
,
);
}
/**
* Adds the structure of a select field
*
* @param string $fieldName Name of the field
* @param array $options Select options
* @param mixed $defaultValue Default value of the field
* @return void
*/
protected
function
addSelectField
(
$fieldName
,
array
$options
,
$defaultValue
=
''
)
{
if
(
$this
->
editMode
&&
isset
(
$this
->
values
[
$fieldName
]))
{
$defaultValue
=
$this
->
values
[
$fieldName
];
}
$html
=
array
(
'<option></option>'
);
foreach
(
$options
as
$key
=>
$option
)
{
$selected
=
(
$key
===
$defaultValue
?
' selected="selected"'
:
''
);
if
(
$key
!==
$option
)
{
$option
=
\
TYPO3\CMS\Extbase\Utility\LocalizationUtility
::
translate
(
$option
,
''
);
}
$html
[]
=
'<option value="'
.
htmlspecialchars
(
$key
)
.
'"'
.
$selected
.
'>'
.
htmlspecialchars
(
$option
)
.
'</option>'
;
}
$this
->
structure
[
$fieldName
]
=
array
(
'code'
=>
'<select name="tx_scheduler['
.
$fieldName
.
']">'
.
implode
(
PHP_EOL
,
$html
)
.
'</select>'
,
'label'
=>
'LLL:'
.
$this
->
languageFile
.
':'
.
$this
->
labelPrefix
.
$fieldName
,
);
}
/**
* Adds the structure of a checkbox field
*
* @param string $fieldName Name of the field
* @param mixed $defaultValue Default value of the field
* @return void
*/
protected
function
addCheckboxField
(
$fieldName
,
$defaultValue
=
FALSE
)
{
if
(
$this
->
editMode
&&
isset
(
$this
->
values
[
$fieldName
]))
{
$defaultValue
=
(
bool
)
$this
->
values
[
$fieldName
];
}
$this
->
structure
[
$fieldName
]
=
array
(
'code'
=>
'<input type="checkbox" name="tx_scheduler['
.
$fieldName
.
']"'
.
(
$defaultValue
?
' checked="checked"'
:
''
)
.
' />'
,
'label'
=>
'LLL:'
.
$this
->
languageFile
.
':'
.
$this
->
labelPrefix
.
$fieldName
,
);
}
/**
* Adds the structure of a date field
*
* @param string $fieldName Name of the field
* @param mixed $defaultValue Default value of the field
* @return void
*/
protected
function
addDateField
(
$fieldName
,
$defaultValue
=
''
)
{
if
(
$this
->
editMode
&&
isset
(
$this
->
values
[
$fieldName
]))
{
$defaultValue
=
$this
->
values
[
$fieldName
];
}
$icon
=
\
TYPO3\CMS\Backend\Utility\IconUtility
::
getSpriteIcon
(
'actions-edit-pick-date'
,
array
(
'style'
=>
'cursor:pointer;'
,
'id'
=>
'picker-tceforms-datetimefield-'
.
$fieldName
,
)
);
$this
->
structure
[
$fieldName
]
=
array
(
'code'
=>
'<input type="text" name="tx_scheduler['
.
$fieldName
.
']" id="tceforms-datetimefield-'
.
$fieldName
.
'" value="'
.
htmlspecialchars
(
$defaultValue
)
.
'" />'
.
$icon
,
'label'
=>
'LLL:'
.
$this
->
languageFile
.
':'
.
$this
->
labelPrefix
.
$fieldName
,
);
}
}
html/typo3conf/ext/ter_fe2/Classes/Task/AbstractTask.php
deleted
100644 → 0
View file @
99daf3ee
<?php
namespace
T3o\TerFe2\Task
;
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/**
* Abstract task
*/
abstract
class
AbstractTask
extends
\
TYPO3\CMS\Extbase\Scheduler\Task
{
/**
* @var integer
*/
public
$elementsPerRun
=
100
;
/**
* @var string
*/
public
$clearCachePages
=
0
;
/**
* @var string
*/
public
$forceLastRun
=
''
;
/**
* @var integer
*/
public
$forceOffset
=
NULL
;
/**
* @var integer
*/
public
$ignoreEmptyUntil
=
NULL
;
/**
* @var array
*/
protected
$setup
;
/**
* @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManager
*/
protected
$configurationManager
;
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManager
*/
protected
$objectManager
;
/**
* @var \T3o\TerFe2\Persistence\Registry
*/
protected
$registry
;
/**
* Public method, usually called by scheduler
*
* @return boolean TRUE on success
*/
public
function
execute
()
{
// Load object manager
$this
->
objectManager
=
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
makeInstance
(
\
TYPO3\CMS\Extbase\Object\ObjectManager
::
class
);
// Configuration is required to be loaded in object manager for persistence mapping
$this
->
setup
=
\
T3o\TerFe2\Utility\TypoScript
::
getSetup
(
'plugin.tx_terfe2'
);
$this
->
configurationManager
=
$this
->
objectManager
->
get
(
\
TYPO3\CMS\Extbase\Configuration\ConfigurationManager
::
class
);
$this
->
configurationManager
->
setConfiguration
(
$this
->
setup
);
// Load registry
$this
->
registry
=
$this
->
objectManager
->
get
(
\
T3o\TerFe2\Persistence\Registry
::
class
);
$this
->
registry
->
setName
(
get_class
(
$this
));
// Initialize task
$this
->
initializeTask
();
// Get process information
// temporary fix to get a consitent state on preview.typo3.org
$lastRun
=
0
;
//(int) $this->registry->get('lastRun');
$offset
=
(
int
)
$this
->
registry
->
get
(
'offset'
);
$count
=
(
int
)
$this
->
elementsPerRun
;
// Force values
if
(
!
empty
(
$this
->
forceLastRun
))
{
$lastRun
=
\
T3o\TerFe2\Utility\Datetime
::
getTimestampFromDate
(
$this
->
forceLastRun
);
}
if
(
is_numeric
(
$this
->
forceOffset
))
{
$offset
=
(
int
)
$this
->
forceOffset
;
}
// Run task
$result
=
$this
->
executeTask
(
$lastRun
,
$offset
,
$count
);
// Add new values to registry
if
(
!
empty
(
$result
)
||
(
!
empty
(
$this
->
ignoreEmptyUntil
)
&&
$offset
<
(
int
)
$this
->
ignoreEmptyUntil
))
{
$offset
+=
$count
;
}
else
{
$offset
=
0
;
}
$this
->
registry
->
add
(
'lastRun'
,
$GLOBALS
[
'EXEC_TIME'
]);
$this
->
registry
->
add
(
'offset'
,
$offset
);
// Clear page cache
if
(
!
empty
(
$result
)
&&
!
empty
(
$this
->
clearCachePages
))
{
$this
->
clearPageCache
(
$this
->
clearCachePages
);
}
return
TRUE
;
}
/**
* Initialize task, override in concrete task
*
* @return void
*/
public
function
initializeTask
()
{
}
/**
* Execute the task, implement in concrete task
*
* @param integer $lastRun Timestamp of the last run
* @param integer $offset Starting point
* @param integer $count Element count to process at once
* @return boolean TRUE on success
*/
abstract
protected
function
executeTask
(
$lastRun
,
$offset
,
$count
);
/**
* Clear cache of given pages
*
* @param string $pages List of page ids
* @return void
*/
protected
function
clearPageCache
(
$pages
)
{
if
(
!
empty
(
$pages
))
{
$pages
=
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
intExplode
(
','
,
$pages
,
TRUE
);
/** @var \TYPO3\CMS\Extbase\Service\CacheService $cacheService */
$cacheService
=
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
makeInstance
(
\
TYPO3\CMS\Extbase\Service\CacheService
::
class
);
$cacheService
->
clearPageCache
(
$pages
);
}
}
/**
* Returns additional information
*
* @return string
*/
public
function
getAdditionalInformation
()
{
// Load registry
$objectManager
=
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
makeInstance
(
\
TYPO3\CMS\Extbase\Object\ObjectManager
::
class
);
$registry
=
$objectManager
->
get
(
\
T3o\TerFe2\Persistence\Registry
::
class
);
$registry
->
setName
(
get_class
(
$this
));
// Get process information
$lastRun
=
(
int
)
$registry
->
get
(
'lastRun'
);
$offset
=
(
int
)
$registry
->
get
(
'offset'
);
return
'Offset: '
.
$offset
.
' '
;
}
}
html/typo3conf/ext/ter_fe2/Classes/Task/CreateExtensionFilesTask.php
deleted
100755 → 0
View file @
99daf3ee
<?php
namespace
T3o\TerFe2\Task
;
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/**
* Create zip archives from t3x files and generate images
*/
class
CreateExtensionFilesTask
extends
\
T3o\TerFe2\Task\AbstractTask
{
/**
* @var \T3o\TerFe2\Domain\Repository\VersionRepository
*/
protected
$versionRepository
;
/**
* @var \T3o\TerFe2\Provider\ProviderManager
*/
protected
$providerManager
;
/**
* @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
*/
protected
$persistenceManager
;
/**
* @var string
*/
protected
$mediaRootPath
=
''
;
/**
* @var array
*/
protected
$imageSizes
=
array
(
'small'
,
'large'
);
/**
* Initialize task
*
* @return void
*/
public
function
initializeTask
()
{
$this
->
versionRepository
=
$this
->
objectManager
->
get
(
\
T3o\TerFe2\Domain\Repository\VersionRepository
::
class
);
$this
->
providerManager
=
$this
->
objectManager
->
get
(
\
T3o\TerFe2\Provider\ProviderManager
::
class
);
$this
->
persistenceManager
=
$this
->
objectManager
->
get
(
\
TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
::
class
);
if
(
empty
(
$this
->
setup
[
'settings.'
][
'mediaRootPath'
]))
{
throw
new
\
Exception
(
'Please configure "plugin.tx_terfe2.settings.mediaRootPath" in TypoScript setup'
);
}
$this
->
mediaRootPath
=
$this
->
setup
[
'settings.'
][
'mediaRootPath'
];
}
/**
* Execute the task
*
* @param integer $lastRun Timestamp of the last run
* @param integer $offset Starting point
* @param integer $count Element count to process at once
* @return boolean TRUE on success
*/
protected
function
executeTask
(
$lastRun
,
$offset
,
$count
)
{
// Get all unprocessed versions
$versions
=
$this
->
versionRepository
->
findForMediaCreation
(
$offset
,
$count
);
if
(
$versions
->
count
()
===
0
)
{
return
FALSE
;
}
// Simulate working directory "htdocs", required for file_exists check
// in \TYPO3\CMS\Core\Imaging\GraphicalFunctions::getImageDimensions
$currentDir
=
getcwd
();
chdir
(
PATH_site
);
// Create ZIP file only for last version
$lastVersionOnly
=
!
empty
(
$this
->
setup
[
'settings.'
][
'onlyLatestVersionZip'
]);
foreach
(
$versions
as
$version
)
{
// Get media path for the extension
$extKey
=
$version
->
getExtension
()
->
getExtKey
();
$lastVersion
=
$version
->
getExtension
()
->
getLastVersion
();
$extensionMediaPath
=
\
T3o\TerFe2\Utility\File
::
getAbsoluteDirectory
(
$this
->
mediaRootPath
.
$extKey
);
// Create zip file
if
(
!
$lastVersionOnly
||
(
$lastVersion
===
$version
))
{
$zipFile
=
$this
->
createZipFile
(
$version
,
$extensionMediaPath
);
if
(
!
empty
(
$zipFile
))
{
$version
->
setZipFileSize
(
filesize
(
$zipFile
));
$version
->
setHasZipFile
(
TRUE
);
}
}
// Create images
if
(
$this
->
createImages
(
$version
,
$extensionMediaPath
))
{
$version
->
setHasImages
(
TRUE
);
}
$this
->
persistenceManager
->
persistAll
();
}
// Revert working directory
chdir
(
$currentDir
);
return
TRUE
;
}
/**
* Create a zip file for given version
*
* @param \T3o\TerFe2\Domain\Model\Version $version Path to t3x file
* @param string $extensionMediaPath Path to media files
* @return string Name of the zip file
*/
protected
function
createZipFile
(
\
T3o\TerFe2\Domain\Model\Version
$version
,
$extensionMediaPath
)
{
if
(
empty
(
$extensionMediaPath
))
{
return
''
;