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
9d209d12
Commit
9d209d12
authored
Jul 14, 2017
by
Thomas Löffler
Browse files
Integrates task for getting current version data
parent
d79d8298
Changes
3
Hide whitespace changes
Inline
Side-by-side
composer.json
View file @
9d209d12
...
...
@@ -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/Classes/Task/UpdateCurrentVersionListTask.php
0 → 100644
View file @
9d209d12
<?php
namespace
T3o\Ter\Task
;
/**
* 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\GeneralUtility
;
/**
* Update json file with information of core versions
*/
class
UpdateCurrentVersionListTask
extends
\
TYPO3\CMS\Extbase\Scheduler\Task
{
/**
* Public method, usually called by scheduler
*
* @return boolean TRUE on success
*/
public
function
execute
()
{
$resultCoreData
=
$this
->
fetchCurrentCoreData
();
$resultDocsData
=
$this
->
fetchCurrentDocumentationData
();
return
$resultCoreData
&&
$resultDocsData
;
}
/**
* @return boolean
*/
protected
function
fetchCurrentCoreData
()
{
$result
=
false
;
$targetFile
=
PATH_site
.
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'BE'
][
'fileadminDir'
]
.
'currentcoredata.json'
;
$sourceData
=
GeneralUtility
::
getUrl
(
'http://get.typo3.org/json'
);
if
(
json_decode
(
$sourceData
,
true
)
!==
null
)
{
$result
=
GeneralUtility
::
writeFile
(
$targetFile
,
$sourceData
);
}
return
$result
;
}
/**
* @return boolean
*/
protected
function
fetchCurrentDocumentationData
()
{
$result
=
false
;
$targetFile
=
PATH_site
.
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'BE'
][
'fileadminDir'
]
.
'currentdocumentationdata.json'
;
$sourceData
=
GeneralUtility
::
getUrl
(
'https://docs.typo3.org/typo3cms/extensions/manuals.json'
);
if
(
json_decode
(
$sourceData
,
true
)
!==
null
)
{
$result
=
GeneralUtility
::
writeFile
(
$targetFile
,
$sourceData
);
}
return
$result
;
}
}
html/typo3conf/ext/ter/ext_localconf.php
View file @
9d209d12
...
...
@@ -13,7 +13,7 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_ter_updateEx
'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'
,
...
...
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