Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Helmut Hummel helhum

💭
I may be slow to respond.
Block or report user

Report or block helhum

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CacheWarmingFrontend.php
<?php
declare(strict_types=1);
namespace Helhum\SitePackage\Cache\Frontend;
use TYPO3\CMS\Core\Cache\Backend\BackendInterface;
use TYPO3\CMS\Core\Cache\Frontend\VariableFrontend;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Http\ServerRequestFactory;
class CacheWarmingFrontend extends VariableFrontend
@helhum
helhum / bench.php
Created Sep 13, 2018
Require vs. unserialize PHP Benchmarks
View bench.php
<?php
$data = array(
'AddThis_SharingTool_Block_Share' => 'app/code/community/AddThis/SharingTool/Block/Share.php',
'AddThis_SharingTool_Model_Observer' => 'app/code/community/AddThis/SharingTool/Model/Observer.php',
'Amasty_Base_Model_Feed' => 'app/code/local/Amasty/Base/Model/Feed.php',
'Amasty_Promo_Helper_Data' => 'app/code/local/Amasty/Promo/Helper/Data.php',
'Amasty_Promo_Model_Observer' => 'app/code/local/Amasty/Promo/Model/Observer.php',
'Amasty_Rules_Block_Adminhtml_Promo_Quote_Edit' => 'app/code/local/Amasty/Rules/Block/Adminhtml/Promo/Quote/Edit.php',
'Amasty_Rules_Block_Checkout_Discount' => 'app/code/local/Amasty/Rules/Block/Checkout/Discount.php',
@helhum
helhum / composer.json
Last active Oct 16, 2019
The (currently) ideal TYPO3 composer setup
View composer.json
{
"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",
@helhum
helhum / setup.sh
Created Oct 29, 2017 — forked from sascha-egerer/setup.sh
Install script for my personal tool chain (Mac OS)
View setup.sh
#!/bin/bash
set -e
# insert a line to a file if the line does not already exist
# - first parameter is the file to insert the line
# - second parameter is the line to insert. It'll only be inserted if not already exists
# - third parameter is optional. This will override the search behavior.
# Instead of searching for the line of parameter 2 this term is used.
function insertLineIfNotExists {
FILE=$1
@helhum
helhum / composer.json
Last active Aug 15, 2017
Fix environment variables with `REDIRECT_` prefix
View composer.json
{
"autoload": {
"files": ["res/fix-env.php"]
}
}
@helhum
helhum / composer.json
Last active Feb 15, 2019
TYPO3 Extension composer.json essentials
View composer.json
{
"name": "vendor/ext-key",
"description": "Essential composer.json attributes",
"keywords": ["typo3", "extension", "composer.json"],
"homepage": "http://helhum.io",
"authors": [
{
"name": "Helmut Hummel",
"email": "info@helhum.io"
}
@helhum
helhum / FluidTemplate.html
Last active Jan 25, 2017
Focus area View Helper
View FluidTemplate.html
<a href="#"
class="lazyload fullscreen random-gallery"
id="js-random-image"
data-random-images="{h:homePageTeaserImages(
images: object.images,
breakPointConfiguration: {
300: '{maxWidth: \'300\', maxHeight: \'300\'}',
1000: '{maxWidth: \'1000\', maxHeight: \'1000\'}',
1900: '{maxWidth: \'1900\', maxHeight: \'1900\'}'}
) -> f:format.htmlspecialchars()}"
View deploy-to-target-info.md

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 Sep 5, 2019
Unattended TYPO3 7LTS installation (including introduction package)
View install.sh
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 '*.*'
@helhum
helhum / generateIdeDummyFile.php
Created Nov 3, 2015
Dummy IDE file for class aliases
View generateIdeDummyFile.php
<?php
error_reporting(E_ALL);
$aliasMapFile = '/Migrations/Code/ClassAliasMap.php';
$ideFile = '/Migrations/Code/LegacyClassesForIde.php';
$extensionDir = getcwd() . '/typo3/sysext/';
$map = array();
$iterator = new DirectoryIterator($extensionDir);
foreach ($iterator as $fileinfo) {
/** @var $fileinfo DirectoryIterator */
You can’t perform that action at this time.