Skip to content

Instantly share code, notes, and snippets.

@psrpinto
psrpinto / LocalSpread.php
Created July 7, 2015 02:14
Support local filesystems with a large number of directories or files (using Flysystem)
<?php
namespace Acme\Adapter;
use League\Flysystem\Adapter\Local;
/**
* A local adapter that works around filesystems' limit of subdirectories in a
* directory.
*
@psrpinto
psrpinto / IPN Handler.md
Last active December 1, 2016 08:47
A plug-and-play handler for Paypal's Instant Payment Notification (IPN) system to be used with JMSPaymentCoreBundle and JMSPaymentPaypalBundle.

IPN handler

A plug-and-play handler for Paypal's Instant Payment Notification system to be used with JMSPaymentCoreBundle and JMSPaymentPaypalBundle. Includes support for Refunds. It's assumed that you are using the JMSPayment bundles to handle the checkout workflow as described here.

It's as simple as:

<?php namespace Acme\SomeBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller
at ErrorHandler ->handle ('2', 'Invalid argument supplied for foreach()', '/myapp/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php', '145', array('id' => 'translation.loader.php', 'aliases' => 'php'))
in /myapp/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php at line 145
at Translator ->initialize ()
in /myapp/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php at line 94
at Translator ->loadCatalogue ('pt')
in /myapp/vendor/symfony/symfony/src/Symfony/Component/Translation/Translator.php at line 125
at Translator ->trans ('home.welcome', array(), 'pages')