Skip to content

Instantly share code, notes, and snippets.

View calien666's full-sized avatar

Markus Hofmann calien666

View GitHub Profile
@calien666
calien666 / .gitlab-ci.yaml
Created May 11, 2022 07:50
TYPO3 debug tester for gitlab CI
production:merge:
stage: test
allow_failure: false
only:
refs:
- merge_requests
script:
- test `grep -r -e "DebuggerUtility::var_dump" -e DatabaseQueryDebugger -e "<f:debug" -e "debug(" packages | grep -v -e .js | wc -l` -eq 0
@calien666
calien666 / newContentElement.php
Created May 6, 2022 07:28
New TYPO3 content element generator with ddev command
<?php
// place as .ddev/scripts/newContentElement.php
/**
* Markus Hofmann
* 07.07.21 15:39
* typo3-default-sitepackage
*/
$classLoader = require __DIR__.'/../../vendor/autoload.php';
@calien666
calien666 / config.yaml
Created February 22, 2022 11:39
Adding tx_solr[q] as speaking URL part to TYPO3
Search:
type: Plugin
namespace: tx_solr
routePath: '/{q}'
limitToPages: [1571]
defaults:
q: ''
requirements:
q: '^.*$'
@calien666
calien666 / PersistedSanitizedPatternMapper.php
Last active November 3, 2021 11:51
Persisted Sanitized Pattern Mapper for TYPO3 >= 9.5, creates santized URLs for PersistedPatternMapper
<?php
declare(strict_types=1);
namespace Vendor\ExtensionName\Routing\Aspect;
use TYPO3\CMS\Core\DataHandling\SlugHelper;
use TYPO3\CMS\Core\Routing\Aspect\PersistedPatternMapper;
use TYPO3\CMS\Core\Site\SiteLanguageAwareInterface;
use TYPO3\CMS\Core\Site\SiteLanguageAwareTrait;
@calien666
calien666 / CustomPageTypeDecorator.php
Last active November 5, 2020 09:48
Allow same file ending on multiple PageType definitions and remove default index.html in TYPO3 Page configuration
<?php
declare(strict_types=1);
namespace VENDOR\Extension\Routing\Enhancer;
use TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator;
use TYPO3\CMS\Core\Routing\RouteCollection;
@calien666
calien666 / locallang.xlf
Last active April 12, 2023 12:34
Local language File and code templates for PHpStorm/WebStorm
<!-- add under settings -> Editor -> File and Code Templates -->
<!-- put into file name: #if ($TARGET!="")$TARGET.#end${NAME} -->
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" target-language="$TARGET" datatype="plaintext" original="messages" date="${YEAR}-${MONTH}-${DAY}T${HOUR}:${MINUTE}:${SECOND}Z">
<header>
<generator>PhpStorm</generator>
</header>
<body>
</body>
@calien666
calien666 / inner_tca.php
Last active April 29, 2020 11:34
PhpStorm TCA File Template
//include this snippet under Settings -> Editor -> Live Templates
// Abbreviation tca
'$TITLE$' => [
'label' => 'LLL:EXT:$TEMPLATE$/Resources/Private/Language/locallang.xlf:$pretitle$.$TITLE$',
'config' => [
'type' => '$TYPE$'$END$
]
],
@calien666
calien666 / preparedStatementinTypo3.php
Created March 1, 2019 11:23
Prepared statements in TYPO3
<?php
$connectionPool = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class);
$productConnection = $connectionPool->getConnectionForTable('tx_myext_domain_model_mytable');
$productDB = $productConnection->createQueryBuilder();
$prepSelect = $productDB->select('*')
->from('tx_myext_domain_model_mytable')
->where(