Skip to content

Instantly share code, notes, and snippets.

@bmack
bmack / AdditionalConfiguration.php
Last active October 14, 2021 11:53
PrimaryReplicaConnection for TYPO3 Doctrine DBAL
<?php
// Runs through a pool of connections and see which one can connect to
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['wrapperClass'] = \PrimaryReplicaConnection::class;
@bmack
bmack / GenerateUrlWithSites.php
Created June 21, 2019 06:20
TYPO3: Create an absolute URL for a page with Site Handling
/**
* Generates an absolute URL for a page (based on Site Handling)
*
* @param int $pageId
* @param array|null $arguments
* @return UriInterface
* @throws \TYPO3\CMS\Core\Exception\SiteNotFoundException
* @throws \TYPO3\CMS\Core\Routing\InvalidRouteArgumentsException
*/
private function getUrlForPage(int $pageId, array $arguments = null): UriInterface
@bmack
bmack / LocalPageErrorHandler.php
Last active June 4, 2021 12:53
Local Error Handler for TYPO3
<?php
namespace B13\AnyProject\PageErrorHandler;
/*
* This file is part of a b13 extension.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
Verifying that +benjaminmack is my blockchain ID. https://onename.com/benjaminmack