Are pibase extensions still working in TYPO3 8?
Asked Answered
K

4

6

I have to migrate TYPO3 6.2 websites to 8.7. Some websites use custom pibase extensions, do I need to redevelop them with Extbase ?

Kalikalian answered 27/12, 2017 at 11:39 Comment(2)
You dont need, they should still work. Class tslib_pibase has changed to \TYPO3\CMS\Frontend\Plugin\AbstractPlugin since TYPO3 v6 and is still availableBerthaberthe
There exists the extension migration_core which helps to do most class replacements automatically for you.Cinelli
C
5

you don't need to redevelop these extensions, but you might need to change the call to core functions.
In 6.2 you still could use the old class names like t3lib.
These class names are available only with compatibility layer (together with a lot of delay).

For the future you need to use namespaces (and the correct new classes). You also should use namespaces for your own classes.

Depending on your used functions you might need to replace some calls with the newer functions as some functions got deprecated meanwhile.

Crossexamine answered 27/12, 2017 at 12:6 Comment(0)
E
17

delete reason: while this answer was upvoted a lot, it is actually off-topic for the question. Because it is the highest votest answer (June 6, 2022) it drowns out other answers. That is why I decided to delete it.

Resources

I found the following ressources helpful for porting:

Update to 6.2+

Update to 7+

Update to 8+

Update to 9+

  • Official "Changelog" for 9
  • Migrating from TYPO3_DB in "TYPO3 Explained" for converting old database functions to QueryBuilder. You can convert to QueryBuilder or Extbase Query. ($GLOBALS['TYPO3_DB'] is no longer available since 9, except if you use the extension typo3db_legacy!)

Also:

In general

The changes, that you need to make, may be trivial. In other cases, significant.

All things considered, I would usually recommend a rewrite using Extbase or Doctrine DBAL (QueryBuilder) and Fluid, Namespaces, TYPO3 9 API (maybe even TYPO3 10 if possible). Your extension will (probably) be better maintainable in the long run.

Tip

  • If you migrate to TYPO3 9 or above, use the extension scanner to detect code that will most likely cause problems. It is incredibly helpful for cleaning up legacy code. (You can also scan uninstalled extensions in a TYPO3 9 installation).
  • Alternatively, the use of rector is often used to automatically make changes to PHP in extensions. Rules are available for TYPO3 via sabbelasichon/typo3-rector

Changes

You may need to change one or more of the following (and this is not a complete list!):

Replace old with new classes

In most cases, I needed to replace a subset of:

  • Tx_Extbase_Utility_Extension : \TYPO3\CMS\Extbase\Utility\ExtensionUtility
  • t3lib_extMgm : \TYPO3\CMS\Core\Utility\ExtensionManagementUtility
  • t3lib_div : \TYPO3\CMS\Core\Utility\GeneralUtility
  • tslib_cObj : \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
  • t3lib_utility_VersionNumber : \TYPO3\CMS\Core\Utility\VersionNumberUtility
  • t3lib_BEfunc : \TYPO3\CMS\Backend\Utility\BackendUtility
  • t3lib_TCEmain : \TYPO3\CMS\Core\DataHandling\DataHandler
  • t3lib_parsehtml_proc : \TYPO3\CMS\Core\Html\RteHtmlParser

See ClassAliasMap.php for a complete list.

TCA

See "Andreas Fernandez: Cleaning the hood" for a very nice description of cleaning up the TCA with real examples.

PageRenderer

  • replace $this->getPageRenderer with \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class);

page.includeJSlibs

"page.includeJSlibs is marked for deprecation and will be removed in TYPO3 CMS 8. Please use page.includeJSLibs (with an uppercase L) instead"

Epistemic answered 12/1, 2018 at 18:3 Comment(0)
W
10

All previous answers have been correct but some words from a TYPO3 core team member: There are no plans to drop the support of "pibase" in the core. It is absolutely ok to use that API even though it does not provide much help to developers.


However I recommend to use at least fluid standalone to be able to create nice templates without all those ### stuff.

Warren answered 28/12, 2017 at 13:32 Comment(5)
Thanks, I will follow your recommendation.Kalikalian
Hi @Georg Ringer, thank you for your clear statement. As your statement is now 1.5 years old, I'd like to ask, are pibased plugins still not deprecated? - And do you know why no one here is recommending the compatibility plugins for pibase extensions?Spier
The API is still not deprecated. The compatibility plugins are not recommended because it just moves the technical debts to the future and it will hit you later. Those extensions are also not maintainedWarren
@GeorgRinger That's maybe a stupid question but: When I am using a pibase extension that is having this ### stuff, can I mix it with Fluid and using the ### markers for the output?Mara
you could of course use a fluid standalone view and use that resultWarren
C
5

you don't need to redevelop these extensions, but you might need to change the call to core functions.
In 6.2 you still could use the old class names like t3lib.
These class names are available only with compatibility layer (together with a lot of delay).

For the future you need to use namespaces (and the correct new classes). You also should use namespaces for your own classes.

Depending on your used functions you might need to replace some calls with the newer functions as some functions got deprecated meanwhile.

Crossexamine answered 27/12, 2017 at 12:6 Comment(0)
V
3

You don't need to redevelop these extensions.

Just you need to change some TYPO3 core function like t3lib_div t3lib_BEfunc t3lib_parsehtml t3lib_extMgm and more..

Please see complete example here : See more details

Vocative answered 27/12, 2017 at 12:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.