Skip to content

Instantly share code, notes, and snippets.

View pschriner's full-sized avatar

Patrick Schriner pschriner

View GitHub Profile
@pschriner
pschriner / Indexer-Xclass.php
Created February 26, 2025 13:58
Indexed Search News
<?php
namespace XXX\YYY\Xclass;
use GeorgRinger\News\Domain\Model\NewsDefault;
use GeorgRinger\News\Domain\Repository\NewsRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
/**
* Indexer
<?php
/**
* Assigns flexform FAL files to fluid template
*
* @param string $flexformFieldname
* @param string $fluidVarName
*/
public function assignFlexFormFal($flexformFieldname, $fluidVarName): void
{
@pschriner
pschriner / DuplicateMethod.php
Created January 27, 2023 17:48
Duplicate spamshield method for powermail
<?php
namespace Vendor\Extension\Domain\Validator\SpamShield;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Database\ConnectionPool;
use In2code\Powermail\Domain\Model\Answer;
use In2code\Powermail\Domain\Validator\SpamShield\AbstractMethod;
/**
@pschriner
pschriner / docker-run.sh
Last active November 14, 2022 18:14
run npm install build in docker
#!/usr/bin/env bash
set -eu
IMAGE=node:16
function nodeRun() {
docker run -i --user $(id -u):$(id -g) --rm -v $(pwd):/app -w /app "$IMAGE" ${*}
}
function pullNewImage() {
IMAGE=$1
@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);
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 / 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;
@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 / 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 / .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