Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Busy but happy!

Jan Kiesewetter t3easy

💭
Busy but happy!
View GitHub Profile
@t3easy
t3easy / FileCategoryAspect.php
Created Sep 17, 2020
Categories of files for TYPO3 v8
View FileCategoryAspect.php
<?php
namespace Vendor\Extension\Aspect;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class FileCategoryAspect
{
/**
* Add categories to file metadata
@t3easy
t3easy / .env
Created Jan 13, 2020
Snipe-it docker-compose stack
View .env
SNIPE_IT_VERSION=4.7.8
VHOST=assets.domain.tld
FRONTEND_NETWORK=frontend
@t3easy
t3easy / .gitlab-ci.yml
Last active Jan 15, 2021
TYPO3 Surf in GitLab CI
View .gitlab-ci.yml
cache:
key: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths:
- .cache/
.dedicated-runner:
tags:
- docker
- linux
@t3easy
t3easy / .gitlab-ci.yml
Created Apr 29, 2019
Wraith in GitLab CI
View .gitlab-ci.yml
compare:staging:live:
image:
name: bbcnews/wraith
entrypoint: [""]
tags:
- docker
- linux
stage: compare
only:
- develop
@t3easy
t3easy / .gitlab-ci.yml
Last active Oct 14, 2021
Build and deploy docker containers with GitLab CI
View .gitlab-ci.yml
image: an-image-with-docker-and-docker-compose
variables:
DOCKER_TLS_VERIFY: "1"
DOCKER_CERT_PATH: ".docker"
before_script:
- mkdir -p $DOCKER_CERT_PATH
- echo "$DOCKER_CA" > $DOCKER_CERT_PATH/ca.pem
- echo "$DOCKER_CERT" > $DOCKER_CERT_PATH/cert.pem
@t3easy
t3easy / Readme.md
Created May 4, 2018
Lock composer packages for a specific php version
View Readme.md
composer config platform.php 7.0.30 # Fake PHP 7.0.30
composer update --with-all-dependencies symfony/* # Update symfony to the latest 7.0.30 compatible version
composer config --unset platform.php # Remove the faked PHP (or remove the entire config section if its empty)
composer update --lock # Rewrite the composer.lock to remove the platform-override and recalculate the hash
View FlexFormProcessor.php
<?php
namespace Vendor\Extension\DataProcessing;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
/**
* This data processor can be used for processing data for the content elements which have flexform contents in one field
@t3easy
t3easy / AdditionalConfiguration.php
Created Jul 28, 2017
Deploy TYPO3 (via Surf) to METANET hosting
View AdditionalConfiguration.php
<?php
// The mysql socket is not accessable from the chrooted env. You have to allow TCP connection for the user from 127.0.0.1
// See https://www.metanet.ch/support/713#weitere-hinweise
if (PHP_SAPI === 'cli') {
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['host'] = '127.0.0.1';
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['port'] = 3306;
}
View .gitlab-ci.yml
cache:
# Use a cache for every branch and every stage
key: "$CI_COMMIT_REF_NAME/$CI_JOB_STAGE"
# Cache the path .cache within the project workspace
paths:
- .cache/
variables:
# Tell composer to save and load it's cache within the .cache folder
COMPOSER_CACHE_DIR: "$CI_PROJECT_DIR/.cache/composer"
@t3easy
t3easy / README.md
Last active May 18, 2020
Non composer extension insight composer mode TYPO3
View README.md
  1. Copy your extension to [web/]typo3conf/ext/ of your composer mode TYPO3 (or kickstart one with extension_builder).
  2. Add autoload entry to your root composer.json (that one which requires "typo3/cms")
"autoload": {
	"psr-4": {
		"T3easy\\MyExt\\": "web/typo3conf/ext/my_ext/Classes/"
	}
}
  1. Run composer dump-autoload -a to update the autoloader.