Skip to content

Instantly share code, notes, and snippets.

<?php
public function testGetFirewall()
{
$provider = new Provider();
$provider->setFirewallClass('\mock\FirewallInterface');
$firewall = $provider->getFirewall();
$this
<?php
interface FirewallInterface
{
public function getIp();
public function handle();
// … déclarations des fonctions essentielles pour un firewall
}
class Firewall extends Composant\Firewall implements FirewallInterface
<?php
class Provider
{
protected firewallClass;
public function setFirewallClass($firewallClass)
{
$this->firewallClass = $firewallClass;
}
<?php
class Provider
{
public function getFirewall()
{
$firewall = new Firewall();
$firewall->setDefaultState(false);
@KuiKui
KuiKui / MyClass.php
Created February 27, 2013 16:34
Test PHP 5.2 project with atoum (in PHP 5.3 environment)
<?php
class KuiKui_MyProject_MyClass
{
protected $id;
public function setId($id)
{
$this->id = (int) $id;
@KuiKui
KuiKui / gist:3963086
Created October 27, 2012 05:42
Debian Squeeze 64 LAMP Vagrant box
@KuiKui
KuiKui / gist:3951575
Created October 25, 2012 09:16
Create MySQL database
#! /bin/bash
DB_NAME=$1
DB_USERNAME=$DB_NAME
DB_PASSWORD="$DB_USERNAME++"
if [ $# -ge 2 ]; then
DB_USERNAME=$2
fi;
@KuiKui
KuiKui / gist:3951267
Created October 25, 2012 07:53
Vagrant apache configuration file for Silex projects
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /vagrant/web
DirectoryIndex index.php
<Directory /vagrant/web>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
@KuiKui
KuiKui / gist:3947235
Created October 24, 2012 16:42
Debian Squeeze 64 Vagrant box