Skip to content

Instantly share code, notes, and snippets.

View simonschaufi's full-sized avatar
👨‍💻

Simon Schaufelberger simonschaufi

👨‍💻
View GitHub Profile
@xperseguers
xperseguers / README.md
Last active March 23, 2024 18:21
Create composer patch from a pending TYPO3 patch on Gerrit

Following structure is expected for your TYPO3 project (adapt script if it differs):

.
├── composer.json
├── composer.lock
├── patches
│   ├── ...
│   └── ...
└── scripts
@derhansen
derhansen / SwitchableControllerActionsPluginUpdater.php
Created March 20, 2021 11:23
SwitchableControllerActionsPluginUpdater for TYPO3 extension "Plain FAQ"
<?php
declare(strict_types=1);
/*
* This file is part of the Extension "plain_faq" for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/
@marble
marble / gist:b02c753abf19368e0f34678601c157f3
Last active January 6, 2021 01:36
render-typo3-viewhelper-docs-from-php-code-whiptail-menu.sh
#! /bin/bash
# This software is MIT licensed.
# Available from https://gist.github.com/marble/b02c753abf19368e0f34678601c157f3/edit
# Designed for a Linux like system that has the 'whiptail' command installed.
# Copyright <2020> <martin.bless@mbless.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
@einpraegsam
einpraegsam / NotAuthorized.php
Last active May 10, 2023 21:46
Individual 403 and 404 handling in TYPO3 9 and 10. Show a 404 page but keep wrong URL. In case of a missing frontend login, redirect to login page and redirect back after login.
<?php
declare(strict_types=1);
namespace Vendor\Sitepackage\PageHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface;
use TYPO3\CMS\Core\Http\RedirectResponse;
use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Core\Site\Entity\Site;
@mpdude
mpdude / fix-cs-php.yml
Last active October 27, 2022 06:55
GitHub Actions workflow to open PRs for php-cs-fixer changes
# Update this by running
# curl https://gist.githubusercontent.com/mpdude/ca93a185bcbf56eb7e341632ad4f8263/raw/fix-cs-php.yml > .github/workflows/fix-cs-php.yml
on:
push:
branches:
- master
pull_request:
name: Coding Standards
@t3easy
t3easy / .gitlab-ci.yml
Last active October 26, 2023 10:09
TYPO3 Surf in GitLab CI
cache:
key: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths:
- .cache/
.dedicated-runner:
tags:
- docker
- linux
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active April 9, 2024 14:08
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
config.contentObjectExceptionHandler = 0
# Default PAGE object:
page = PAGE
page.10 = FLUIDTEMPLATE
page.10.file = fileadmin/template.html
page.10 {
dataProcessing.10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
dataProcessing.10 {
table = pages
pidInList = 1
@spoonerWeb
spoonerWeb / .gitlab-ci.yml
Last active March 15, 2024 08:15
GitLab CI for building and deploying TYPO3 websites with deployer
cache:
paths:
- /cache/composer
stages:
- composer
- deploy
build:
stage: composer
@julrich
julrich / lib.navSidebar.ts
Last active August 4, 2020 12:51
Fully cached TYPO3 HMENU navigation example with expAll and 'active', 'current' states
#
# Main navigation in Sidebar
#
# General idea: Don't render & cache 'active' and 'current' states in 'expAll' menu, so it becomes cacheable
# over all pages. To regain 'active' and 'current' states, the result of the cached menu is parsed by
# 'stdWrap.replacement', utilizing specific information about the resulting menu item markup to insert them.
# Use COA to decouple the stdWrap ('lib.navSidebar.stdWrap.replacement') needed for RegExp replacement from
# the cached menu ('lib.navSidebar.10'). This way the complete menu can be generically cached without current