Skip to content

Instantly share code, notes, and snippets.

@josefglatz
Last active June 19, 2018 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josefglatz/cd75ce4d48bb06c5f3d4c37442a08dfb to your computer and use it in GitHub Desktop.
Save josefglatz/cd75ce4d48bb06c5f3d4c37442a08dfb to your computer and use it in GitHub Desktop.
TYPO3/surf snippets for TYPO3 CMS deployments
<?php
// ...
/**
* Set custom symlinks (in addition to fileadmin and uploads)
*/
$application->setSymlinks([
'web/typo3conf/l10n' => '../../../../shared/Data/l10n'
]);
// ...
/**
* Define task to generate the shared target folder "l10n"
* and execute the task right after task "TYPO3\\Surf\\Task\\Generic\\CreateSymlinksTask"
*/
$workflow->defineTask('JosefGlatz\\TYPO3\\Distribution\\DefinedTask\\L10nShared', 'TYPO3\\Surf\\Task\\TYPO3\\CMS\\SymlinkDataTask', [
'directories' => [
'l10n'
],
]);
$workflow->afterTask('TYPO3\\Surf\\Task\\Generic\\CreateSymlinksTask', 'JosefGlatz\\TYPO3\\Distribution\\DefinedTask\\L10nShared', $application);
// ...
// If you want, you can add a language:update task for every deployment.
// You can run the language:update task also via scheduler on a regular basis if it takes to much time.
$workflow->defineTask('JosefGlatz\\TYPO3\\Distribution\\DefinedTask\\UpdateLanguages', RunCommandTask::class, [
'command' => 'language:update',
]);
$workflow->afterTask('TYPO3\\Surf\\Task\\TYPO3\\CMS\\FlushCachesTask', 'JosefGlatz\\TYPO3\\Distribution\\DefinedTask\\UpdateLanguages', $application);
@t3easy
Copy link

t3easy commented Jun 19, 2018

The SymlinkDataTask also creates the directory for you and symlinks it, you don't need $application->setSymlinks, but you have to use the full path:
So if you set $application->setOption(\TYPO3\Surf\Task\TYPO3\CMS\SymlinkDataTask::class . '[directories]', ['web/typo3conf/l10n']);
you get a folder shared/Data/web/typo3conf/l10n that is symlinked to web/typo3conf/l10n
See TYPO3/Surf#84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment