Skip to content

Instantly share code, notes, and snippets.

@merk
merk / config.yml
Created September 13, 2012 06:35
hwioauth fosuserbundle
hwi_oauth:
connect: ~
firewall_name: main
fosub:
username_iterations: 30
properties:
github: github
google: google
resource_owners:
google:
@merk
merk / JobController.php
Last active October 10, 2015 14:17
Use of a FormType to build a filter for a list of entities
<?php
namespace Ibms\JobBundle\Controller;
class JobController extends BaseJobController
{
/**
* Job list.
*
* @param \Symfony\Component\HttpFoundation\Request $request
@merk
merk / mysql.log
Created September 6, 2012 01:55
Differences in queries logged in symfony and mysql
2 Query INSERT INTO payment_instructions (amount, approved_amount, approving_amount, created_at, credited_amount, crediting_amount, currency, deposited_amount, depositing_amount, extended_data, payment_system_name, reversing_approved_amount, reversing_credited_amount, reversing_deposited_amount, state, updated_at) VALUES ('795.85', '0', '0', '2012-09-06 11:53:34', '0', '0', 'AUD', '0', '0', 'a:5:{s:11:\"expiryMonth\";a:3:{i:0;s:56:\"laYg+WRlzAbOFkEOsjOn5AMoFEVRa0HyONOJDsT77G0LL7qn8TDlUec=\";i:1;b:1;i:2;b:1;}s:10:\"expiryYear\";a:3:{i:0;s:52:\"MWYNfAMqfw3CdHzBkmxxqJvc9Ccg4QXnYxWTDRvOW5kyNmp8gA==\";i:1;b:1;i:2;b:1;}s:14:\"cardHolderName\";a:3:{i:0;s:56:\"03XlAKyOdQogZAOb2aGD4CBftkcZD1NcnedaR2CMRvnFkUbXO/kWVNO+\";i:1;b:1;i:2;b:1;}s:32:\"customer.customerReferenceNumber\";a:3:{i:0;s:68:\"LxeMcU+bcWaJDFbdq6lhxX0jp8GSLO6if2Sb8IHSr0RaHD+vUkYssa6Udn6K+i3XNQO4\";i:1;b:1;i:2;b:1;}s:11:\"censoredPan\";a:3:{i:0;s:76:\"h46otrelevM/ihzNcw3C0kDQRxnggFQ38t4e/wi8Scn4Zvs6BzCX/lf/KB3pOFzSkxvxILZs0IU=\";i:1;b:1;i:2;b:1;}}'
@merk
merk / composer.json
Last active October 10, 2015 02:07
Example project composer.json
{
"autoload": {
"psr-0": {
"": "src/"
}
},
"require": {
"php": "~5.4",
"symfony/assetic-bundle": "2.1.*@dev",
@merk
merk / Customer.php
Created July 12, 2012 12:08
Symfony 2.1 collections with by_reference = false
<?php
namespace Ibms\CustomerBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\MappedSuperclass
{
"name": "friendsofsymfony/comment-bundle",
"type": "symfony-bundle",
"description": "This Bundle provides threaded comment functionality for Symfony2 applications",
"keywords": ["comment", "threads", "forum"],
"homepage": "http://friendsofsymfony.github.com",
"license": "MIT",
"authors": [
{
"name": "Thibault Duplessis",
@merk
merk / AbstractInvoiceLineType.php
Created July 6, 2012 06:07
Symfony2 Form Polycollection for use with objects in an inheritance structure
<?php
// ...
class AbstractInvoiceLineType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
// ...
@merk
merk / Customer.php
Created June 6, 2012 10:41
ResolveTargetEntityListener examples
<?php
// src/Acme/AppBundle/Entity/Customer.php
namespace Acme\AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Acme\CustomerBundle\Entity\Customer as BaseCustomer;
use Acme\InvoiceBundle\Model\InvoiceSubjectInterface;
<?php
namespace Ibms\SearchBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference;
use InvalidArgumentException;
@merk
merk / composer.json
Created May 17, 2012 05:04
An example composer.json in merkland
{
"autoload": {
"psr-0": {
"": "src/"
}
},
"require": {
"php": ">=5.3.2",
"symfony/assetic-bundle": "dev-master",