Skip to content

Instantly share code, notes, and snippets.

@neufeind
neufeind / typo3_init_fe.php
Last active January 20, 2023 07:31
TYPO3 v10: Init Frontend-environment for use in CLI- or BE-context
protected function initFrontend() {
$siteId = 1;
$pageId = 1219;
$typeNum = 0;
if (!is_object($GLOBALS['TT'])) {
$GLOBALS['TT'] = new \TYPO3\CMS\Core\TimeTracker\TimeTracker;
$GLOBALS['TT']->start();
}
$context = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Context\Context::class);
<?php
namespace SpeedPartner;
class ImageResizeCached extends \Gumlet\ImageResize
{
protected $source_image_filename;
private function loadSourceImage()
{
switch ($this->source_type) {