Skip to content

Instantly share code, notes, and snippets.

View immutef's full-sized avatar

immutef

  • SCAYLE GmbH
  • Hamburg, Germany
View GitHub Profile
@immutef
immutef / services.xml
Created May 5, 2010 13:54
Symfony2 DI container for Zend Framework
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://www.symfony-project.org/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="views_dir">%root_dir%/views/default</parameter>
<parameter key="view.suffix">php</parameter>
</parameters>
@immutef
immutef / User.php
Created October 15, 2010 07:45
Reflect the latest changes of Symfony2 and Doctrine2's Annotations (http://bit.ly/cGZbjw)
<?php
namespace Application\MyBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @orm:Entity(repositoryClass="Application\MyBundle\Entity\UserRepository")
* @orm:Table(name="user",
* uniqueConstraints={
@immutef
immutef / LoadGameData.php
Created October 16, 2010 18:50
Latest Symfony2 Fixtures for Doctrine2
<?php // src/Application/GameBundle/DataFixtures/ORM/LoadGameData.php
// cd src/vendor && git clone git://github.com/doctrine/data-fixtures doctrine-data-fixtures
// register the "Doctrine\Common\DataFixtures" namespace in your src/autoload.php file
namespace Application\GameBundle\DataFixtures\ORM;
use Doctrine\ORM\EntityManager,
Doctrine\Common\DataFixtures\FixtureInterface;
@immutef
immutef / symfony2-pull-requests.md
Created October 25, 2010 19:10
HowTo: clean GitHub pull requests for Symfony2
  1. Fork Fabiens repository: http://github.com/fabpot/symfony.git

  2. Clone your fork and install/update vendors (I use my personal fork for now):

    git clone [email protected]:pminnieur/symfony.git symfony

    cd symfony && sh install_vendors.sh && sh update_vendors.sh

    phpunit

  3. Integrate Fabiens repository into your local clone:

@immutef
immutef / SecurityController.php
Created October 27, 2010 09:58
Symfony2 Security Form Login
<?php // src/Application/UserBundle/Controller/SecurityController.php
namespace Application\UserBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller,
Symfony\Component\Security\SecurityContext;
class SecurityController extends Controller
{
public function loginAction()
@immutef
immutef / php_navigation.php_r26001.diff
Created November 3, 2010 10:49
Developers Shame Day
Index: php/navigation.php
===================================================================
--- a/php/navigation.php
+++ b/php/navigation.php
@@ -2001,15 +2001,27 @@
}
-/********************************************************************************************
-* Function: getCountryURL *
-* Action: *
/**
* Generating 1.000.000 solar systems (3 iterations).
* Chances for a 6 star solar system are fairly small.
* Only one solar system with 6 stars out of 3 million.
*
* #1st
* 1 Star : 732724
* 2 Stars: 234559
* 3 Stars: 30955
* 4 Stars: 1728
@immutef
immutef / config.yml
Created November 13, 2010 09:36
REST configuration [DRAFT]
rest.config:
users:
path: /users
provider: users
properties: [id]
methods: [*index, read, *create, update, delete] # methods prefixed with * are property-less
formats: [html, json, xml, yaml]
providers:
users:
@immutef
immutef / response.html
Created November 21, 2010 22:29
REST response formats [DRAFT]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body data-version="1.0">
<section role="errors">
<article data-code="404">
Not found
@immutef
immutef / ConfigureMenuEvent.php
Created April 30, 2011 09:35
MenuBundle EventDispatcher integration
<?php
namespace Turtle\AcpBundle\Event;
use Symfony\Component\EventDispatcher\Event;
use Knplabs\Bundle\MenuBundle\Menu;
class ConfigureMenuEvent extends Event
{