Project

General

Profile

Actions

Feature #60056

closed

Execute custom scripts in distributions

Added by Norbert Sendetzky almost 10 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extension Manager
Target version:
-
Start date:
2014-07-02
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.3
Tags:
Complexity:
Sprint Focus:

Description

Hi all

We've tried to create a new distribution for Arcavias, our web shop and e-commerce system. It uses an installation and update mechanism that is executed by the class.ext_update.php script. Up to now there seems to be no way to execute this script during installation or update of a distribution but that would be necessary for Arcavias and I'm sure it would also be helpful for other distributions.

Thank you

Norbert

Actions #1

Updated by Philipp Gampe almost 10 years ago

  • Status changed from New to Needs Feedback

I doubt that we do that. Keep in mind that distributions are supposed to be installed only once.

Why do you need to run scripts during installation? What do you try to archive?

Actions #2

Updated by Norbert Sendetzky almost 10 years ago

Hi Philipp

It's absolutely OK that distributions are installed only once but during this installation, we need to execute our update script (which is in fact the class.ext_update.php) to get a fully working installation. In our case, we execute the setup tasks of the Arcavias core library.

Other extensions could benefit from this as well. Sphinx is one that comes into my mind as it also needs to install and build additional tools before it can be used.

Best regards,

Norbert

Actions #3

Updated by Norbert Sendetzky almost 10 years ago

  • Status changed from Needs Feedback to New
Actions #4

Updated by Susanne Moog almost 10 years ago

  • Status changed from New to Needs Feedback

Hi Norbert,

the class ext_update has the scope to be executed after an extension upgrade. For your use case it should be possible to listen for the signal "afterExtensionConfigurationWrite" - if that is not enough we should maybe introduce another signal dedicated to distributionInstallation.

Have you read http://wiki.typo3.org/Blueprints/DistributionManagement ?

Tell me if this is enough for you or if you need something else.

Regards,

Susanne

Actions #5

Updated by Norbert Sendetzky over 9 years ago

Hi Susanne

Thank you for your hint!
Do you have further information (examples or code) how I can listen to this signal? I haven't found much on the web regarding this, especially I don't know what I have to use as first parameter for the connect() function call.

Thank you very much and best regards,

Norbert

Actions #7

Updated by Norbert Sendetzky over 9 years ago

Hi Alexander

http://typo3blogger.de/signal-slot-pattern/
or
http://docs.typo3.org/flow/TYPO3FlowDocumentation/stable/TheDefinitiveGuide/PartIII/SignalsAndSlots.html

helps you?

Unfortunatly not completely. I need the name of the class which is emitting the afterExtensionConfigurationWrite signal and which I have to connect to. In the example used on the blog post from the first link:

$this->signalSlotDispatcher->connect(  
     'Tx_Extension_Controller_NameController', 'beforeRenderView', 'Tx_OtherExtension_Controller_NameController', 'addOtherInformation', FALSE  
);

What do I have to replace 'Tx_Extension_Controller_NameController' with? Is it 'TYPO3\CMS\Extensionmanager\Controller\ConfigurationController'. Where do I have to place the code in order to be executed during installation of the distribution? In the ext_localconf.php file?

Is this then the correct code?

$dispatcher = t3lib_div::makeInstance('Tx_Extbase_Object_Manager')->get('TYPO3\CMS\Extbase\SignalSlot\Dispatcher');
$dispatcher->connect(  
    'TYPO3\CMS\Extensionmanager\Controller\ConfigurationController', 'afterExtensionConfigurationWrite',
    'Tx_Arcavias_Myclass', 'myUpdateMethod', FALSE  
);

Documentation around is topic is a little bit meager ;-)

Thanks

Norbert

Actions #8

Updated by Alexander Opitz over 9 years ago

This looks correct. maybe one of the existing distributions uses such things. ;)

Actions #9

Updated by Alexander Opitz over 9 years ago

Did you find a working solution?

Actions #10

Updated by Mathias Schreiber over 9 years ago

  • Target version changed from 7.0 to 7.1 (Cleanup)
Actions #11

Updated by Mathias Schreiber over 9 years ago

  • Target version changed from 7.1 (Cleanup) to 7.3 (Packages)
Actions #12

Updated by Alexander Opitz almost 9 years ago

  • Status changed from Needs Feedback to Closed
  • Target version deleted (7.3 (Packages))

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF