Project

General

Profile

Actions

Bug #92023

closed

Post update shell hook (skript)

Added by C. Gogolin almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2020-08-16
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
update hook script
Complexity:
easy
Is Regression:
Sprint Focus:

Description

Hi together...

I have a wish for the CoreUpdateService:

I would like a shell script to be executed after the update. For example: If the file PostUpdateHook.sh exists in the directory typo3conf it will be executed after the update.

Background: My provider offers different PHP versions.
In the file: /typo3/sysext/core/bin/typo3 is

#!/usr/bin/env php
<?php
...

For this to work with my provider, the first line must be exchanged:

#!/usr/bin/env php7.4-cli
<?php
...

I think a post update script would be very useful for this. Or is there already such a hook I have not found yet?

Thanks for the help up front...

Translated with www.DeepL.com/Translator (free version)

Actions #1

Updated by Christian Kuhn almost 4 years ago

  • Status changed from New to Needs Feedback

In general, the install tool does not allow much hooking: The install tool is designed to 'always work', even if some broken extension is loaded that has buggy ext_localconf.php or ext_tables.php settings that could lead to a PHP fatal.
Thus, the install tool core updater would basically simply ignore any hooks defined by some extension or LocalConfiguration.php.
Your request is hard to come by for the sake of a stable updater process. You could register dedicated upgrade wizards which can be manually executed after update, though: The API for this is pretty capable and allows registration of various wizards for your needs.

Apart from this, it seems there are alternative solutions to your issue. If your cli shell command to bin/typo3 fails becaus it is using a not appropriate php version, you could probably circumvent this by adding the proper binary to ENV before executing the commmand, so the env call returns/exucutes the one you want.
Additionally, you could probably just do something like "/my/binary/php-7.4 bin/typo3 my:command" to pre-select the interpreter version. Please feedback if that is sufficient to you.

Actions #2

Updated by C. Gogolin almost 4 years ago

Hi Christian,

Thanks for your fast answer. i have changed my cronjob call:

*/10 ... *  /usr/bin/env php7.4-cli /...pathToTypo.../bin/typo scheduler:run

and it works. :) Thanks for your help. I need only support in the issue 91800 ( https://forge.typo3.org/issues/91800 ) and my typo3 works perfect. ;-)

This issue can closed.

Best regards
Clemens

Actions #3

Updated by Riccardo De Contardi almost 4 years ago

  • Status changed from Needs Feedback to Closed

@C. Gogolin thank you for your quick feedback;

I close this issue as per request of the reporter.

If you think that this is the wrong decision or experience the issue again, please reopen it or open a new issue with a reference to this one

Thanks.

Actions

Also available in: Atom PDF