[TYPO3-dev] Package Loading Order - Define an Extension to be loaded before another

Caspar Stuebs caspar at gosign.de
Thu Jul 31 16:37:15 CEST 2014


Hi Stephan,

thanks for your answer.

I am triyng to write an extension that catches old links from 'before a
relauch' and redirect it to the configured pages 'after the relaunch'. This
has to work with different domains, means three old domains are moved into
one new domain.
Due to that I need to be sure, that my hook to find the id is processed
before the one of realurl. If not, realurl will run into the page not found
handling.

I think the solution to use array_unshift() is good for that. Thanks for
your help.

Kind regards.
Caspar



2014-07-31 13:35 GMT+02:00 Stephan Schuler <Stephan.Schuler at netlogix.de>:

> Hey Caspar.
>
>
> I don't know about a way to adjust the loading order of extensions in the
> way you want it, but I did never need that, so I haven't searched much.
>
>
> http://docs.typo3.org/typo3cms/CoreApiReference/ExtensionArchitecture/DeclarationFile/Index.html
> Although nothing states about loading orders, the "contraints" are
> currently the only way I know to influence loading orders.
>
> Could you please explain what you're trying to do? If you need to e.g.
> register a hook to be executed before another one (because you want to
> precede e.g. realURL, or surround it), then you could do it the other way
> around. Make your extension depend on that other one to ensure you are
> loaded *after* the first one. When registering that hook, don't just
> "array_push" your class/method call to that hook array but rebuild that
> particular hook array entirely. This way you can make sure to have your
> class/method call placed wherever you want.
>
> I just provided some dirty example. This one wraps two methods as close to
> realUrl as possible.
> http://pastebin.com/VSPiQTWK
>
> Or if you don't care "how far away" you go. Registers one hook at the
> beginning of the execution order and another one at the end.
> http://pastebin.com/6rdEmzDx
>
>
> Of course there can be other extensions being loaded after yours that can
> register themselves even earlier in the execution queue, or even later. So
> you can never rely on being the very first one or the very last one. So you
> should either double check your setup or just create code that doesn't care.
>
>
> Regards,
>
>
> Stephan Schuler
> Web-Entwickler
>
> Telefon: +49 (911) 539909 - 0
> E-Mail: Stephan.Schuler at netlogix.de
> Website: media.netlogix.de
>
>
>
> ----------------------------
> netlogix IT-Training Sommerspecial 2014
> Buchen Sie eines unserer Aktionsseminare und Sie erhalten ein Apple iPad
> oder Dell Tablet.
> Eine Übersicht finden Sie unter
> http://it-training.netlogix.de/angebote/training-specials/netlogix-sommerspecial-2014
> ----------------------------
>
>
>
> --
> netlogix GmbH & Co. KG
> IT-Services | IT-Training | Media
> Neuwieder Straße 10 | 90411 Nürnberg
> Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
> E-Mail: info at netlogix.de | Internet: http://www.netlogix.de
>
> netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
> Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
> Umsatzsteuer-Identifikationsnummer: DE 233472254
> Geschäftsführer: Stefan Buchta, Matthias Schmidt
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: typo3-dev-bounces at lists.typo3.org [mailto:
> typo3-dev-bounces at lists.typo3.org] Im Auftrag von Caspar Stuebs
> Gesendet: Donnerstag, 31. Juli 2014 12:56
> An: List for Core-/Extension development
> Betreff: Re: [TYPO3-dev] Package Loading Order - Define an Extension to be
> loaded before another
>
> Yes, that is clear.
>
> But I want to define it the other way.
> Extension ONE should be loaded before Extension TWO - and that has to be
> declared in Extension ONE, because Extension TWO is a third party
> Extension. If I change Extension TWO, it will be remove, when it is updated.
>
>
>
>
> 2014-07-31 12:37 GMT+02:00 Frans Saris <franssaris at gmail.com>:
>
> > If you set the second extension as dependency in tour extension it is
> > loaded before yours.
> >
> > Gr. Frans
> > Op 31 jul. 2014 12:05 schreef "Caspar Stuebs" <caspar at gosign.de>:
> >
> > > Hi Folks,
> > >
> > > is there any possibility to define in an extension, that is has to
> > > be loaded before another extension?
> > >
> > > I know, that I could define it the other way, that the second has to
> > > be loaded after the first. But the second extension is a third party
> > extension
> > > and I do not like to change the ext_emconf.php of that.
> > >
> > > Does anybody know, if this is possible?
> > >
> > > Kind Regards.
> > > Caspar
> > >
> > > --
> > > --
> > >
> > > Gosign media. GmbH | We web ideas.
> > > Langenfelder Damm 67 Gewerbehof | 22525 Hamburg Telefon 040-609 40
> > > 79-0
> > >
> > > Handelsregister AG HH HRB 112197 | Geschäftsführung Bert Gogolin
> > > Greenpeace energy: Gosign läuft mit ehrlichem Strom und Gas.
> > > GLS Bank: Gosign wirtschaftet mit Gewissen.
> > > _______________________________________________
> > > TYPO3-dev mailing list
> > > TYPO3-dev at lists.typo3.org
> > > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
> > _______________________________________________
> > TYPO3-dev mailing list
> > TYPO3-dev at lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
> >
>
> --
> --
>
> Gosign media. GmbH | We web ideas.
> Langenfelder Damm 67 Gewerbehof | 22525 Hamburg Telefon 040-609 40 79-0
>
> Handelsregister AG HH HRB 112197 | Geschäftsführung Bert Gogolin
> Greenpeace energy: Gosign läuft mit ehrlichem Strom und Gas.
> GLS Bank: Gosign wirtschaftet mit Gewissen.
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>

-- 
-- 

Gosign media. GmbH | We web ideas.
Langenfelder Damm 67 Gewerbehof | 22525 Hamburg
Telefon 040-609 40 79-0

Handelsregister AG HH HRB 112197 | Geschäftsführung Bert Gogolin
Greenpeace energy: Gosign läuft mit ehrlichem Strom und Gas.
GLS Bank: Gosign wirtschaftet mit Gewissen. 



More information about the TYPO3-dev mailing list