Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
extensions.typo3.org
extensions.typo3.org
Commits
d7f3b1d6
Commit
d7f3b1d6
authored
Jul 14, 2017
by
Tomas Norre Mikkelsen
Browse files
Merge branch 'namespaces-task-for-ter' into 'develop'
Namespaces task for ter See merge request
!107
parents
d79d8298
261218e5
Pipeline
#1554
passed with stages
in 4 minutes
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
composer.json
View file @
d7f3b1d6
...
...
@@ -52,6 +52,7 @@
},
"autoload"
:
{
"psr-4"
:
{
"T3o\\Ter\\"
:
"html/typo3conf/ext/ter/Classes"
,
"T3o\\TerFe2\\"
:
"html/typo3conf/ext/ter_fe2/Classes"
},
"classmap"
:
[
...
...
html/typo3conf/ext/ter/
task/class.tx_ter_u
pdateCurrentVersionListTask.php
→
html/typo3conf/ext/ter/
Classes/Task/U
pdateCurrentVersionListTask.php
View file @
d7f3b1d6
<?php
namespace
T3o\Ter\Task
;
/**
* This file is part of the TYPO3 CMS project.
*
...
...
@@ -16,12 +18,8 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Update json file with information of core versions
*
* @author Jigal van Hemert <jigal.van.hemert@typo3.org>
* @package TYPO3
* @subpackage tx_ter
*/
class
tx_ter_u
pdateCurrentVersionListTask
extends
tx_s
cheduler
_
Task
class
U
pdateCurrentVersionListTask
extends
\
TYPO3\CMS\Extbase\S
cheduler
\
Task
{
/**
...
...
html/typo3conf/ext/ter/ext_localconf.php
View file @
d7f3b1d6
...
...
@@ -5,15 +5,8 @@ if (!defined('TYPO3_MODE')) {
\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::
addPItoST43
(
$_EXTKEY
,
'pi1/class.tx_ter_pi1.php'
,
'_pi1'
,
'list_type'
,
0
);
// Register extension list update task
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SC_OPTIONS'
][
'scheduler'
][
'tasks'
][
'tx_ter_updateExtensionIndexTask'
]
=
[
'extension'
=>
$_EXTKEY
,
'title'
=>
'LLL:EXT:'
.
$_EXTKEY
.
'/locallang.xml:tx_ter_updateExtensionIndexTask.name'
,
'description'
=>
'LLL:EXT:'
.
$_EXTKEY
.
'/locallang.xml:tx_ter_updateExtensionIndexTask.description'
,
'additionalFields'
=>
'tx_ter_updateExtensionIndexTask_additionalFieldProvider'
,
];
// Register core version update task
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SC_OPTIONS'
][
'scheduler'
][
'tasks'
][
'tx_ter_u
pdateCurrentVersionListTask
'
]
=
[
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SC_OPTIONS'
][
'scheduler'
][
'tasks'
][
\
T3o\Ter\Task\U
pdateCurrentVersionListTask
::
class
]
=
[
'extension'
=>
$_EXTKEY
,
'title'
=>
'LLL:EXT:'
.
$_EXTKEY
.
'/locallang.xml:tx_ter_updateCurrentVersionListTask.name'
,
'description'
=>
'LLL:EXT:'
.
$_EXTKEY
.
'/locallang.xml:tx_ter_updateCurrentVersionListTask.description'
,
...
...
html/typo3conf/ext/ter/task/class.tx_ter_updateExtensionIndexTask.php
deleted
100644 → 0
View file @
d79d8298
<?php
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use
TYPO3\CMS\Core\Utility\ExtensionManagementUtility
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
require_once
ExtensionManagementUtility
::
extPath
(
'ter'
)
.
'class.tx_ter_helper.php'
;
/**
* Create xml file to force update of ter_fe tables
*
* @author Kai Vogel <kai.vogel@speedprogs.de>
* @package TYPO3
* @subpackage tx_ter
*/
class
tx_ter_updateExtensionIndexTask
extends
TYPO3\CMS\Scheduler\Task\AbstractTask
{
/**
* @var string
*/
public
$clearCachePages
;
/**
* Public method, usually called by scheduler
*
* @return boolean TRUE on success
*/
public
function
execute
()
{
// Check extension configuration
if
(
empty
(
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'EXT'
][
'extConf'
][
'ter'
]))
{
throw
new
Exception
(
'No extension configuration found in $TYPO3_CONF_VARS'
,
1303220916
);
return
false
;
}
// Check extension repository path
$extensionConfig
=
unserialize
(
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'EXT'
][
'extConf'
][
'ter'
]);
if
(
empty
(
$extensionConfig
[
'repositoryDir'
]))
{
throw
new
Exception
(
'No repository path found in extension configuration'
,
1303220917
);
return
false
;
}
// Write new extensions xml file
$repositoryDir
=
rtrim
(
$extensionConfig
[
'repositoryDir'
],
'/'
)
.
'/'
;
$dummyObject
=
new
stdClass
();
$dummyObject
->
repositoryDir
=
$repositoryDir
;
$terHelper
=
GeneralUtility
::
makeInstance
(
'tx_ter_helper'
,
$dummyObject
);
$terHelper
->
writeExtensionIndexFile
();
// Clear page cache to force reload of the extension list
$pageIds
=
GeneralUtility
::
intExplode
(
','
,
$this
->
clearCachePages
,
true
);
if
(
!
empty
(
$pageIds
))
{
$terHelper
->
loadBackendUser
(
1
,
'_ter_'
,
true
);
$terHelper
->
loadLang
();
$tce
=
GeneralUtility
::
makeInstance
(
\
TYPO3\CMS\Core\DataHandling\DataHandler
::
class
);
$tce
->
admin
=
1
;
$tce
->
start
([],
[]);
foreach
(
$pageIds
as
$pageId
)
{
$tce
->
clear_cacheCmd
(
$pageId
);
}
}
return
true
;
}
}
\ No newline at end of file
html/typo3conf/ext/ter/task/class.tx_ter_updateExtensionIndexTask_additionalFieldProvider.php
deleted
100644 → 0
View file @
d79d8298
<?php
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Additional BE fields for ter extension publish task
*
* Creates an input field to define UIDs of pages to clear their
* cache after successfully running the scheduler task
*
* @author Kai Vogel <kai.vogel@speedprogs.de>
* @package TYPO3
* @subpackage tx_ter
*/
class
tx_ter_updateExtensionIndexTask_additionalFieldProvider
implements
\
TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface
{
/**
* @var string
*/
protected
$fieldName
=
'scheduler_updateExtensionIndexTask_clearCachePages'
;
/**
* @var string
*/
protected
$fieldId
=
'task_updateExtensionIndexTask_clearCachePages'
;
/**
* Add an input field to define UIDs of pages to clear their
* cache after successfully running the scheduler task
*
* @param array Reference to the array containing the info used in the add/edit form
* @param object When editing, reference to the current task object. Null when adding.
* @param tx_scheduler_Module Reference to the calling object (Scheduler's BE module)
* @return array Array containg all the information pertaining to the additional fields
*/
public
function
getAdditionalFields
(
array
&
$taskInfo
,
$task
,
\
TYPO3\CMS\Scheduler\Controller\SchedulerModuleController
$parentObject
)
{
// Initialize selected fields
if
(
empty
(
$taskInfo
[
$this
->
fieldName
]))
{
$taskInfo
[
$this
->
fieldName
]
=
''
;
if
(
$parentObject
->
CMD
===
'edit'
)
{
$taskInfo
[
$this
->
fieldName
]
=
$task
->
clearCachePages
;
}
}
$fieldName
=
'tx_scheduler['
.
$this
->
fieldName
.
']'
;
$fieldValue
=
htmlspecialchars
(
$taskInfo
[
$this
->
fieldName
]);
$fieldHtml
=
'<input type="text" name="'
.
$fieldName
.
'" id="'
.
$this
->
fieldId
.
'" value="'
.
$fieldValue
.
'" size="30" />'
;
$additionalFields
[
$fieldId
]
=
[
'code'
=>
$fieldHtml
,
'label'
=>
'LLL:EXT:ter/locallang.xml:tx_ter_updateExtensionIndexTask.clearCachePages'
,
'cshKey'
=>
'_MOD_tools_txschedulerM1'
,
'cshLabel'
=>
$fieldId
,
];
return
$additionalFields
;
}
/**
* Checks if the given value is valid
*
* @param array Reference to the array containing the data submitted by the user
* @param tx_scheduler_Module 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
,
\
TYPO3\CMS\Scheduler\Controller\SchedulerModuleController
$parentObject
)
{
$value
=
str_replace
([
','
,
' '
],
''
,
$submittedData
[
$this
->
fieldName
]);
return
(
empty
(
$value
)
||
ctype_digit
(
$value
));
}
/**
* Saves given integer value in task object
*
* @param array Contains data submitted by the user
* @param tx_scheduler_Task Reference to the current task object
* @return void
*/
public
function
saveAdditionalFields
(
array
$submittedData
,
\
TYPO3\CMS\Scheduler\Task\AbstractTask
$task
)
{
$task
->
clearCachePages
=
$submittedData
[
$this
->
fieldName
];
}
}
if
(
defined
(
'TYPO3_MODE'
)
&&
isset
(
$GLOBALS
[
'TYPO3_CONF_VARS'
][
TYPO3_MODE
][
'XCLASS'
][
'ext/scheduler/tasks/class.tx_scheduler_recyclergarbagecollection_additionalfieldprovider.php'
])
)
{
include_once
(
$GLOBALS
[
'TYPO3_CONF_VARS'
][
TYPO3_MODE
][
'XCLASS'
][
'ext/scheduler/tasks/class.tx_scheduler_recyclergarbagecollection_additionalfieldprovider.php'
]);
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment