Skip to content

Instantly share code, notes, and snippets.

View stefanheimes's full-sized avatar

Stefan Heimes stefanheimes

  • MEN AT WORK
  • Lage
View GitHub Profile
@stefanheimes
stefanheimes / gist:7694188
Last active December 29, 2015 15:59
Replace filepath with dbfas id
<?php
$objResult = Database::getInstance()->prepare('SELECT * FROM XXXX') ->execute();
while($objResult->next())
{
$objTlFiles = Database::getInstance()
->prepare('SELECT * FROM tl_files WHERE path=?')
->execute($objResult->image);
@stefanheimes
stefanheimes / gist:7578782
Last active July 19, 2016 12:20
wf_extendedBreadcrumb - Add missing items like MetaModels/Isotope etc.
<?php
// MM
use MetaModels\Filter\Rules\SearchAttribute as MetaModelFilterRuleSearchAttribute;
use MetaModels\Filter\Setting\Factory as MetaModelFilterSettingsFactory;
// Isotope
use Isotope\Model\Product;
/**
* PHP version 5
@stefanheimes
stefanheimes / gist:7533853
Last active December 28, 2015 17:09
Test recipient for a valid email. Use avisot.
<?php
$objResult = Database::getInstance()
->prepare('SELECT id, email FROM orm_avisota_recipient')
->execute();
$objTester = new Swift_Mime_Grammar();
while($objResult->next())
{
@stefanheimes
stefanheimes / gist:7119030
Created October 23, 2013 13:43
Search the initialize.php . Special feature for symlinks.
<?php
/**
* Initialize the system
*/
$dir = dirname(isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : __FILE__);
while ($dir && $dir != '.' && $dir != '/' && !is_file($dir . '/system/initialize.php')) {
$dir = dirname($dir);
}
@stefanheimes
stefanheimes / gist:7118746
Created October 23, 2013 13:27
Example for mapping MM elements to the wf_extendedBreadcrumb.
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
class XBreadCrumb extends Frontend
{
/**
* Constructor
*/
public function __construct()
{