Skip to content

Instantly share code, notes, and snippets.

View pschriner's full-sized avatar

Patrick Schriner pschriner

View GitHub Profile
@pschriner
pschriner / gist:26fe7cc5f4effdfd3f4a4146bceb1de0
Created July 13, 2016 10:12
TYPO3 shallow clone instead of download
git clone --branch ${TYPO3_VERSION} --depth 1 https://github.com/TYPO3/TYPO3.CMS.git typo3_src-${TYPO3_VERSION}
@pschriner
pschriner / ext_tables.php
Last active July 26, 2017 10:22
TYPO3 TCA compatibility for renderType inputDateTime (7 + 8)
<?php
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch) < 8006000 &&
\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch) >= 7006000) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1501063451] = array(
'nodeName' => 'inputDateTime',
'priority' => 40,
'class' => \TYPO3\CMS\Backend\Form\Element\InputTextElement::class,
);
}
?>
@pschriner
pschriner / typoscript
Created January 23, 2018 13:37
Typoscript-Cache Menü
lib.mainNav = HMENU
lib.mainNav {
cache.key = lib-mainNav_{TSFE:sys_page|versioningWorkspaceId}_{global:BE_USER|user|uid}
cache.key.insertData = 1
cache.lifetime = 900
cache.tags = typoscript_mainNavigation
### ...
}
/**
* renders a recursive pidList to reference content from a list of pages
*/
public function user_getTreeList()
{
$this->getTSFE()->acquireLock('getTreeList', $this->cObj->data['uid'].'::'.(int)$this->getTSFE()->register['tt_content_shortcut_recursive']);
$pidList = $this->getTSFE()->register['tt_content_shortcut_recursive']
? $this->cObj->getTreeList($this->cObj->data['uid'],
$this->getTSFE()->register['tt_content_shortcut_recursive'])
: '';
@pschriner
pschriner / .gitlab-ci.yml
Last active January 11, 2019 09:34 — forked from spoonerWeb/.gitlab-ci.yml
GitLab CI for building and deploying TYPO3 websites with deployer
cache:
paths:
- /cache/composer
stages:
- composer
- deploy
build:
stage: composer
@pschriner
pschriner / ubuntu-18.04.sh
Created May 14, 2019 10:54 — forked from mourato/ubuntu-18.04.sh
Things to do after install Ubuntu 18.04
#!/bin/bash
#
# Updating system
#
sudo apt-get update # Update resources
sudo apt dist-upgrade -f # Then, a dist upgrade
#
@pschriner
pschriner / realurl.patch
Created June 14, 2019 07:40
Helhum-Realurl patch
diff --git a/Classes/Hooks/UrlRewritingHook.php b/Classes/Hooks/UrlRewritingHook.php
index 2299ec0..cb1a688 100644
--- a/Classes/Hooks/UrlRewritingHook.php
+++ b/Classes/Hooks/UrlRewritingHook.php
@@ -161,6 +161,13 @@ class UrlRewritingHook implements SingletonInterface
*/
protected $rebuildCHash;
+ /**
+ * Flag to have realurl get cache entries greedy
@pschriner
pschriner / RealurlChashCommand.php
Last active July 5, 2019 19:49
Symfony Command for realurl 2.5 to update chashs in tx_realurl_urldata in case they have to be modified - e.g. because an old argument is no excluded from chash generation
<?php
namespace Vendor\Example\Command;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
From 002c27d1d2e9605af0c9a2dcca0052fbdc1d368b Mon Sep 17 00:00:00 2001
From: Patrick Schriner <patrick.schriner@diemedialen.de>
Date: Wed, 13 May 2020 14:46:09 +0200
Subject: [PATCH] [BUGFIX] Fix image size detection
---
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php b/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
@pschriner
pschriner / locallang-xml-to-xliff.php
Last active February 12, 2024 10:54 — forked from tleilax/locallang-xml-to-xliff.php
Typo3: Very very basic locallang.xml to locallang.xlf converter
<?php
function Language2XML($data, $language, $translations = array()) {
$xml = new DOMDocument('1.0', 'UTF-8');
$xliff = $xml->createElement('xliff');
$xliff->setAttribute('version', '1.0');
$file = $xml->createElement('file');
$file->setAttribute('source-language', 'en');
if (func_num_args() > 2) {
$file->setAttribute('target-language', $language);