Skip to content

Instantly share code, notes, and snippets.

View DavidBruchmann's full-sized avatar
💭
It's all about compatibility

David Bruchmann DavidBruchmann

💭
It's all about compatibility
  • Webdevelopment Barlian
  • Bandung, West Java, Indonesia
View GitHub Profile
@DavidBruchmann
DavidBruchmann / combining_composer_git_pear.md
Last active October 13, 2023 17:58
Combining Composer, Git repositories and Pear

Combining composer, git repositories and pear

Problem

Pear is the the old PHP-packagemanager, but most 'packages' are nowadays managed with composer on base of git-repositories.
Adding pear-packages to a composer based installation is a little challenge that shall be explained below.

Solution

Prerequisites

@DavidBruchmann
DavidBruchmann / .gitattributes
Last active January 26, 2022 10:26 — forked from dpalomar/.gitattributes
Fixing CRLF with gitattributes
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto
# Force the following filetypes to have unix eols, so Windows does not break them
*.* text eol=lf
# Windows forced line-endings
/.idea/* text eol=crlf
@DavidBruchmann
DavidBruchmann / info-tca.md
Last active May 3, 2020 15:02
TCA related things
@DavidBruchmann
DavidBruchmann / ConvertApplicationAreaValuesToBinaryDataProcessor.php
Created May 1, 2019 09:31 — forked from h3nn3s/ConvertApplicationAreaValuesToBinaryDataProcessor.php
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
@DavidBruchmann
DavidBruchmann / decode.php
Created March 5, 2019 12:41
decode the blobs in TYPO3-scheduler-tasks
$hex = '';
$result = '';
$encoded = substr($hex, 2);
while(strlen($encoded)) {
$current = substr($encoded, 0, 2);
$encoded = substr($encoded, 2);
$result .= chr(hexDec($current));
}
echo $result;
@DavidBruchmann
DavidBruchmann / myFile.php
Last active April 4, 2025 11:27
TYPO3, DBAL: TRUNCATE table
## THIS IS ONLY TO TRUNCATE A TABLE COMPLETELY
$tablename = 'xyz'
$driver = new \Doctrine\DBAL\Driver\Mysqli\Driver;
$queryBuilder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Database\Query\QueryBuilder::class,
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Database\Connection::class, $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default'], $driver
)
@DavidBruchmann
DavidBruchmann / composer.json
Last active March 5, 2019 12:44
composer-snippet for scripts
"scripts":{
"command": [
"echo \"EVENT: command\\n\"",
"VENDOR\\build\\command::myClassMethod"
],
"pre-command-run": [
"echo \"EVENT: pre-command-run\\n\"",
"VENDOR\\build\\preCommandRun::myClassMethod"
],
@echo off
cd /D %~dp0
echo Diese Eingabeforderung nicht waehrend des Running beenden
echo Bitte erst bei einem gewollten Shutdown schliessen
echo Please close this command only for Shutdown
echo Apache 2 is starting ...
SET OPENSSL_CONF=F:\___XAMPP___\xampp-portable-win32-5.6.31-0-VC11\apache\conf\openssl.cnf
REM IF EXIST F:\___XAMPP___\xampp-portable-win32-5.6.31-0-VC11\apache\bin
SET PATH=%PATH%;F:\___XAMPP___\xampp-portable-win32-5.6.31-0-VC11\apache\bin
@DavidBruchmann
DavidBruchmann / Update_Powermail.sql
Last active January 12, 2019 14:42 — forked from einpraegsam/Update.sql
Update TYPO3 Powermail from 2.x to 5.x or a newer version
# Just copy all tables from plural to singular naming
create table tx_powermail_domain_model_form LIKE tx_powermail_domain_model_forms;
insert tx_powermail_domain_model_form select * from tx_powermail_domain_model_forms;
create table tx_powermail_domain_model_page LIKE tx_powermail_domain_model_pages;
insert tx_powermail_domain_model_page select * from tx_powermail_domain_model_pages;
create table tx_powermail_domain_model_field LIKE tx_powermail_domain_model_fields;
insert tx_powermail_domain_model_field select * from tx_powermail_domain_model_fields;
@DavidBruchmann
DavidBruchmann / debug-sql
Last active January 14, 2022 04:27 — forked from rvollebregt/debug-sql
Debug SQL query in TYPO3 8 Extbase
/** @var ObjectManager $objm */
$dbParser = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class);
$doctrineQueryBuilder = $dbParser->convertQueryToDoctrineQueryBuilder($query);
$sql = $doctrineQueryBuilder->getSQL();
$parameters = $doctrineQueryBuilder->getParameters();
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump(['sql' => $sql, 'parameters' => $parameters], __METHOD__ . ':' . __LINE__);