Feature #60056
closedExecute custom scripts in distributions
0%
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
Updated by Philipp Gampe over 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?
Updated by Norbert Sendetzky over 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
Updated by Norbert Sendetzky over 10 years ago
- Status changed from Needs Feedback to New
Updated by Susanne Moog over 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
Updated by Norbert Sendetzky over 10 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
Updated by Norbert Sendetzky about 10 years ago
Hi Alexander
http://typo3blogger.de/signal-slot-pattern/
or
http://docs.typo3.org/flow/TYPO3FlowDocumentation/stable/TheDefinitiveGuide/PartIII/SignalsAndSlots.htmlhelps 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
Updated by Alexander Opitz about 10 years ago
This looks correct. maybe one of the existing distributions uses such things. ;)
Updated by Mathias Schreiber almost 10 years ago
- Target version changed from 7.0 to 7.1 (Cleanup)
Updated by Mathias Schreiber almost 10 years ago
- Target version changed from 7.1 (Cleanup) to 7.3 (Packages)
Updated by Alexander Opitz over 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.