Skip to content

Instantly share code, notes, and snippets.

View h3nn3s's full-sized avatar

Henrik Ziegenhain h3nn3s

View GitHub Profile
@h3nn3s
h3nn3s / DataHandler.php
Created April 3, 2023 04:21
Hook into Tcemain to clear custom cachetags
<?php
namespace Vendor\Extension\Hooks;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheGroupException;
use TYPO3\CMS\Core\Database\ReferenceIndex;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
@h3nn3s
h3nn3s / dump_typo3_without_userdata_caches.sh
Created February 27, 2019 06:55
Dump TYPO3 Database without Caches and Userdata
#!/bin/bash
# This script dumps all neccessary tables for LOCAL Development
# Be aware, that it excludes all userdata, caches and environment
# specific tables!
PASSWORD=
HOST=
USER=
DATABASE=
@h3nn3s
h3nn3s / PznValidator.php
Created January 30, 2018 14:01
TYPO3 Powermail Validator Class
<?php
namespace HenrikZiegenhain\MyExt\Domain\Validator;
/***************************************************************
* Copyright notice
*
* (c) 2018 Henrik Ziegenhain <[email protected]>
*
* All rights reserved
*
@h3nn3s
h3nn3s / ConvertApplicationAreaValuesToBinaryDataProcessor.php
Created January 30, 2018 11:00
TYPO3 powermail DataProcessor: Convert checkbox positions to there decimal represenation
<?php
namespace HenrikZiegenhain\MyExt\DataProcessor;
/***************************************************************
* Copyright notice
*
* (c) 2018 Henrik Ziegenhain <[email protected]>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
@h3nn3s
h3nn3s / FindActiveCheckboxesViewHelper.php
Created January 30, 2018 10:04
TYPO3: Check which checkbox items got checked by bitwise shifting
<?php
namespace HenrikZiegenhain\MyExt\ViewHelpers;
/***************************************************************
* Copyright notice
*
* (c) 2018 Henrik Ziegenhain <[email protected]>
*
* All rights reserved
*
@h3nn3s
h3nn3s / auto_prepend_file.php
Created January 18, 2017 07:28
Small PHP script to set TYPO3_CONTEXT environment variable via php.ini setting for auto_prepend_file. Sets context depending on current subdomain (dev. or www.)
<?php
$host = getenv('SERVER_NAME');
$patternDev = '/^dev\./';
$patternProduction = '/^www\./';
if (preg_match($patternDev, $host)) {
putenv('TYPO3_CONTEXT=Development');
}
if (preg_match($patternProduction, $host)) {
putenv('TYPO3_CONTEXT=Production');
@h3nn3s
h3nn3s / Configuration-TCA-Overrides-tx_kesearch_indexerconfig.php
Last active January 21, 2020 14:44
Custom indexer configuration for TYPO3 Extension ke_search. This Script is made for TYPO3 7 LTS (and above, but untested atm) and respects - besides the "normal" sysfolder - the storagepids_recursive field too.
<?php
// enable "sysfolder" and "startingpoints_recursive" field
$GLOBALS['TCA']['tx_kesearch_indexerconfig']['columns']['sysfolder']['displayCond'] .= ',customindexer';
$GLOBALS['TCA']['tx_kesearch_indexerconfig']['columns']['startingpoints_recursive']['displayCond'] .= ',customindexer';
@h3nn3s
h3nn3s / gist:5071939327876e7328c5711951101066
Last active November 23, 2016 09:49 — forked from gthln/gist:8401080
Install Composer on Managed Hosting at Domainfactory

Install Composer on Managed Hosting at Domainfactory

Step 1:

Log in to your Managed Hosting Server via SSH

Step 2:

Add these two lines to .bashrc:

@h3nn3s
h3nn3s / powermail.ts
Last active November 15, 2016 09:32
Script to fetch post params from TYPO3s powermail Extension and send it to an email address (newsletter subscription for Supermailer). In order to use the BasicAuthProtection powermail needs this pull request to be merged: https://github.com/einpraegsam/powermail/pull/7
plugin.tx_powermail.settings.setup {
marketing {
# Send Form values to CRM like salesforce or eloqua
sendPost {
# Activate sendPost (0/1)
_enable = TEXT
_enable.value = 1
# Target URL for POST values (like http://www.target.com/target.php)
targetUrl = http://www.example.com/scripts/supermailer-powermail-crm.php?debug=1
@h3nn3s
h3nn3s / Unhide Anchor link clicks behind header
Created April 12, 2016 11:35
Find and replace anchor links to not hide Anchor behind fixed Header