Skip to content

Instantly share code, notes, and snippets.

View tPl0ch's full-sized avatar
💭
I may be slow to respond.

Thomas Ploch tPl0ch

💭
I may be slow to respond.
View GitHub Profile
@tPl0ch
tPl0ch / Configure.php
Created March 11, 2012 12:51
Configure Bootstrap ErrorHandler
<?php
/**
* Initializes configure and runs the bootstrap process.
* Bootstrapping includes the following steps:
*
* - Setup App array in Configure.
* - Include app/Config/core.php.
* - Configure core cache configurations.
* - Load App cache files.
* - Include app/Config/bootstrap.php.
@tPl0ch
tPl0ch / MyServiceTest.php
Created July 22, 2012 14:23
Symfony2 ContainerAware TestCase Base class
<?php
/**
* Symfony2 ContainerAware TestCase Base class example implementation
*
* @author Thomas Ploch
* @copyright 2012 REIZWERK GmbH
* @license The MIT License (MIT)
*/
namespace Reizwerk\ContainerTestBundle\Tests;
@tPl0ch
tPl0ch / FixtureTestCase.php
Created August 9, 2012 15:37
FixtureTestCase
<?php
namespace Reizwerk\TestSuiteBundle\Test;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\Common\DataFixtures\Executor\MongoDBExecutor;
use Doctrine\Common\DataFixtures\Purger\MongoDBPurger;
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/**
@tPl0ch
tPl0ch / LoadArticleData.php
Created September 12, 2012 08:12 — forked from anonymous/gist:3705051
ODMFixtureWithReference
<?php
namespace Schuh\BlogBundle\DataFixtures\ODM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Schuh\BlogBundle\Document\Article;
use Schuh\BlogBundle\Document\Comment;
@tPl0ch
tPl0ch / Vagrantfile
Created October 30, 2012 15:06 — forked from jmather/Vagrantfile
Vagrant setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.provision OnHostProvisioner
end
class OnHostProvisioner < Vagrant::Provisioners::Base
def provision!
env[:vm].channel.execute("/home/vagrant/provision.sh")
end
@tPl0ch
tPl0ch / ODMFixtureTestCase.php
Created November 23, 2012 16:23
A Symfony2 TestCase base class that autoloads ODM Mongo Fixtures
<?php
namespace RC\FixtureAutoLoadBundle\Test;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\Common\DataFixtures\Executor\MongoDBExecutor;
use Doctrine\Common\DataFixtures\Purger\MongoDBPurger;
@tPl0ch
tPl0ch / build.xml
Created December 2, 2012 03:51
Ant build file for PHP projects including Behat build task
<?xml version="1.0" encoding="utf-8"?>
<project name="your-project-name-here" default="build">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdox,phpunit,behat,phpcb"/>
<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
<target name="tools-parallel" description="Run tools in parallel">
<parallel threadCount="2">
@tPl0ch
tPl0ch / ShopCompilerPass.php
Created January 18, 2013 12:19
Using DefinitionDecorator to extend abstract service definition in a CompilerPass.
<?php
/**
* ShopCompilerPass.php
*
* @author Thomas Ploch <[email protected]>
* @since 17.01.13 14:26
* @filesource
*/
namespace Einblick\CoreShopBundle\DependencyInjection\Compiler;
Required packages on host:
cifs-utils
# /etc/samba/smb.conf
...
[www]
comment = www
path = /var/www
public = yes
# Ubuntu: /etc/apt/preferences.d/php | Debian: /etc/apt/preferences
Package: php5 Pin: version 5.2.17* Pin-Priority: 991