[TYPO3-core] Backporting Hooks
Kay Strobach
typo3 at kay-strobach.de
Mon Feb 18 15:56:50 CET 2013
Hi Again,
after the discussion, what is the result?
Is it possible to a hook to replace an xclass like the following
backported to 4.5, 4.6, 4.7, 6.0, ...?
Is it worth a try or should i stay at the xclass currently?
> <?php
>
> class ux_t3lib_TSparser_TSconfig extends t3lib_TSparser_TSconfig{
>
> /**
> * Parses the passed TS-Config using conditions and caching
> *
> * @param string $TStext: The TSConfig being parsed
> * @param string $type: The type of TSConfig (either "userTS" or "PAGES")
> * @param integer $id: The uid of the page being handled
> * @param array $rootLine: The rootline of the page being handled
> * @return array Array containing the parsed TSConfig and a flag wheter the content was retrieved from cache
> * @see t3lib_TSparser
> */
> public function parseTSconfig($TStext, $type, $id = 0, array $rootLine = array()) {
> // @todo add caching here!
> /**
> * @var Tx_Skinselector_Domain_Repository_SkinRepository
> */
> $skinRepository = t3lib_div::makeInstance('Tx_Skinselector_Domain_Repository_SkinRepository');
> $skin = $skinRepository->findByPageOrRootline($id);
> if($skin !== NULL) {
> $buffer = $skin->getTSConfig() . "\n\n[GLOBAL]\n\n" . $TStext;
> return parent::parseTSconfig($buffer, $type, $id, $rootLine);
> } else {
> return parent::parseTSconfig($TStext, $type, $id, $rootLine);
> }
> }
> }
Thanks in advice
Kay
Am 09.02.13 10:50, schrieb Kay Strobach:
> Hello Guys,
>
> from the discussions above and some problems in the past i want to
> gently ask, if we can add an exception to the non backporting policy.
>
> As Tolleiv mentioned in the "Review System woes" sometimes Hooks are
> missing in the core. So my question is, if hooks may be backported in
> the future.
>
> Reasons:
> - Having hooks backported reduces the use of XClasses
> (which should be denied in my opinion)
> - Having Hooks instead of XClasses reduces headaches between version
> switches
> - Hooks usually do not break anything, but offer more possibilities :D
> - Having Hooks backported atleast one version / LTS makes it easier to
> make futureproof extensions
>
> Thanks in advance
> Kay
>
--
http://www.kay-strobach.de - Open Source Rocks
TYPO3 .... inspiring people to share!
Get involved: http://typo3.org
Answer was useful - feel free to donate:
-
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KPM9NAV73VDF2
- https://flattr.com/profile/kaystrobach
More information about the TYPO3-team-core
mailing list