Skip to content

Instantly share code, notes, and snippets.

@fchaussin
fchaussin / gist:449d878607f28746d8e8485e74a5dbd0
Last active February 24, 2022 10:47
Debug SQL Queries in TYPO3 Repository (Extbase)
function debug($query){
$doctrineObj = $this->objectManager
->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class)
->convertQueryToDoctrineQueryBuilder($query);
$doctrineSql = $doctrineObj->getSQL();
$params = $doctrineObj->getParameters();
$search = $replace = [];
foreach ($params as $k => $v) {
$search[] = ':' . $k;
$replace[] = '\'' . $v . '\'';
@helhum
helhum / composer.json
Last active February 12, 2024 10:54
The (currently) ideal TYPO3 composer setup
{
"require": {
"typo3-console/composer-auto-setup": "^0.1",
"georgringer/news": "^6.1",
"helhum/typo3-secure-web": "^0.2.5",
"typo3/cms-introduction": "^3.0"
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
@koehnlein
koehnlein / .gitlab-ci.yml
Last active December 1, 2021 15:21
simple deployment based on TYPO3 Surf and Gitlab CI
stages:
- deploy
# use caching
cache:
key: "$CI_BUILD_REF_NAME/$CI_BUILD_STAGE"
paths:
- .caches/
variables:
@peterkraume
peterkraume / Page.ts
Created July 20, 2017 09:51
Backport for TYPO3 8.7: PageLayoutView - Allow to disable copy- / translate- buttons
mod {
web_layout {
// disable translation mode for content elements
// backported feature from TYPO3 9.x. See Xclass PageLayoutView.php for details
localization.enableTranslate = 0
}
}
@spoonerWeb
spoonerWeb / .gitlab-ci.yml
Last active February 12, 2024 10:54
GitLab CI (version >= 9) configuration for testing and TER uploading TYPO3 extensions
cache:
key: "$CI_COMMIT_REF_NAME/$CI_JOB_STAGE"
paths:
- .composer/
before_script:
# Install git on machine
- apk add git --update
stages:
@Sebobo
Sebobo / .gitlab-ci.yml
Last active September 13, 2018 04:02
TYPO3 v8 surf example
stages:
- build
- deploy
variables:
COMPOSER_PROCESS_TIMEOUT: "1200"
NODE_ENV: "production"
cache:
key: "$CI_BUILD_REF_NAME"
@fazzyx
fazzyx / ReferenceViewHelper.php
Last active November 7, 2016 14:16
TYPO3 Fluid ViewHelper for content element "shortcut"
<?php
namespace NAMESPACE\ThemeMgCustom\ViewHelpers;
/*
*
* Copyright notice
*
* (c) 2015 Claus Fassing <cfassing@mediengarage.de>, MEDIENGARAGE
*
* All rights reserved
@helhum
helhum / deploy-to-target-info.md
Last active August 23, 2018 13:30
TYPO3 setup steps

Requirements for deployment

  • ssh (generate key and put on server)
  • rsync must be available on both machines (deployment host and target host)
  • PHP cli binary must be available on both machines (deployment host and target host)
  • composer must be available on deployment host

Needed info for each target system:

  • deploy directory
@helhum
helhum / install.sh
Last active January 10, 2023 15:38
Unattended TYPO3 7LTS installation (including introduction package)
composer create-project typo3/cms-base-distribution='^7.6.0' my-test-typo3 --no-interaction
cd my-test-typo3/
composer require helhum/typo3-console
# This will only work with PHP < 7 as realurl need PHP 5.x
composer require typo3-ter/introduction
cp web/typo3conf/ext/typo3_console/Scripts/typo3cms .
cp web/typo3conf/ext/bootstrap_package/Configuration/Apache/.htaccess web/
chmod +x typo3cms
./typo3cms install:setup --non-interactive --database-user-name="root" --database-user-password="root" --database-host-name="localhost" --database-port="3306" --database-name="t3_my_test" --admin-user-name="admin" --admin-password="password" --site-name="Auto Install"
./typo3cms database:updateschema '*.*'
@oliverthiele
oliverthiele / robots.txt
Last active November 23, 2023 18:18
robots.txt for TYPO3
User-agent: *
# Only allow URLs generated with RealURL
Disallow: /*?id=*
Disallow: /*&id=*
# L=0 is the default language
Disallow: /*?L=0*
Disallow: /*&L=0*