Update and improve cache flushing of TYPO3

This commit is contained in:
Daniel Siepmann 2023-11-30 08:22:23 +01:00
parent dc8e02c1df
commit 4bd2bc8332
Signed by: Daniel Siepmann
GPG Key ID: 33D6629915560EF4
1 changed files with 13 additions and 25 deletions

View File

@ -1,36 +1,24 @@
augroup typo3
autocmd!
" Clear some caches depending on files saved. Only works if cwd is document root
autocmd BufWritePost **/sites/**/*.yaml :silent !rm */**/cache/**/sites-configuration.php
autocmd BufWritePost **/local_packages/**/Sites/**/*.yaml :silent !rm */**/cache/**/sites-configuration.php
autocmd BufWritePost **/Configuration/RequestMiddlewares.php :silent !rm */**/cache/**/middlewares_*
autocmd BufWritePost **/Configuration/Backend/Routes.php :silent !rm */**/cache/**/BackendRoutesFromPackages_* */**/cache/**/BackendRoutes_*
autocmd BufWritePost **/Classes/Domain/Model/News.php :silent !rm -rf */**/var/cache/code/news/*
autocmd BufWritePost **/Configuration/Backend/Modules.php :silent !rm */**/cache/**/BackendModules*
autocmd BufWritePost **/Configuration/Icons.php :silent !rm */**/cache/**/Icons_*
autocmd BufWritePost **/Configuration/Services.yaml,**/Configuration/Services/*.yaml,**/Configuration/Services.php :silent !rm */**/cache/**/DependencyInjectionContainer_*
" Extbase
autocmd BufWritePost **/Domain/Model/*.php :silent !rm */**/cache/data/extbase/*
autocmd BufWritePost **/Configuration/Backend/Routes.php :silent !rm */**/cache/**/BackendRoutesFromPackages_* */**/cache/**/BackendRoutes_*
autocmd BufWritePost **/Configuration/Extbase/Persistence/Classes.php :silent !rm */**/cache/data/extbase/*
autocmd BufWritePost **/ext_tables.php :silent !rm */**/cache*/**/ext_tables_*
autocmd BufWritePost **/ext_localconf.php :silent !rm */**/cache*/**/ext_localconf_*
autocmd BufWritePost **/Configuration/Icons.php :silent !rm */**/cache/**/Icons_*
autocmd BufWritePost **/Configuration/RequestMiddlewares.php :silent !rm */**/cache/**/middlewares_*
autocmd BufWritePost **/Configuration/Services.yaml,**/Configuration/Services/*.yaml,**/Configuration/Services.php :silent !rm */**/cache/**/DependencyInjectionContainer_*
autocmd BufWritePost **/Configuration/TCA/** :silent !rm */**/cache*/**/tca_base_*
autocmd BufWritePost **/Domain/Model/*.php :silent !rm */**/cache/data/extbase/*
autocmd BufWritePost **/ext_localconf.php :silent !rm */**/cache*/**/ext_localconf_*
autocmd BufWritePost **/ext_tables.php :silent !rm */**/cache*/**/ext_tables_*
autocmd BufWritePost **/local_packages/**/Sites/**/*.yaml :silent !rm */**/cache/**/sites-configuration.php
autocmd BufWritePost **/sites/**/*.yaml :silent !rm */**/cache/**/sites-configuration.php
autocmd BufWritePost *.typoscript,*.tsconfig :silent !rm -rf */**/cache/**/typoscript/*
autocmd BufWritePost **/*.xlf :silent !rm */**/cache/**/l10n/*
autocmd BufWritePost **/*.yml,**/*.yaml :silent !rm */**/cache/**/yamlsettings_form*
" autocmd BufWritePost *.tsconfig,*.typoscript,*.ts,*/TypoScript/*.ts,*/TypoScript/*.txt :silent !rm -rf */**/var/**/cache_pagesection/*
autocmd BufWritePost *.typoscript :silent !rm -rf */**/cache/**/typoscript/constant*
autocmd BufWritePost *.typoscript :silent !rm -rf */**/cache/**/typoscript/ext-*
autocmd BufWritePost *.typoscript :silent !rm -rf */**/cache/**/typoscript/globals-*
autocmd BufWritePost *.typoscript :silent !rm -rf */**/cache/**/typoscript/setup-*
autocmd BufWritePost *.typoscript :silent !rm -rf */**/cache/**/typoscript/sys-template-*
autocmd BufWritePost *.tsconfig :silent !rm -rf */**/cache/**/typoscript/pagetsconfig-*
" ext:news
autocmd BufWritePost **/Classes/Domain/Model/News.php :silent !rm -rf */**/var/cache/code/news/*
" Also update ftdetect/typoscript.vim for detection of Typoscript
" autocmd BufWritePost *.tsconfig,*.typoscript,*.ts,*/TypoScript/*.ts,*/TypoScript/*.txt :redraw!
autocmd BufEnter,BufRead **/de.*.xlf :setlocal spelllang=de
augroup END