Skip to content

Instantly share code, notes, and snippets.

View romainneutron's full-sized avatar

Romain Neutron romainneutron

View GitHub Profile
[ romain @MacBook : ~/ ] brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 01968160de98684ac95945640569f33ee26f9fa5
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.8.2-x86_64
Xcode: 4.6
CLT: 4.5.0.0.1.1249367152
@romainneutron
romainneutron / composer.json
Created February 26, 2013 13:31
Phraseanet SDK boilerplate
{
"require" : "phraseanet/php-sdk"
}
@romainneutron
romainneutron / gist:4744947
Last active December 12, 2015 08:29
PHP-FFMpeg API update RFC

PHP-FFMpeg has grown and what was a simple H264 encoder is now a bigger library.

what we have :

To sum up here is what we have :

  • FFMpeg\FFMpeg : the main component that opens a file, transcode it to a desired format and can optionnaly extract an image.
  • FFMpeg\FFProbe : a component that extracts Streams and Formats informations about a file.

What we need :

<?php
namespace Silex\Tests;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
[ romain @MacBook : /tmp/test-serializer ] php test.php
PHP Fatal error: Uncaught exception 'RuntimeException' with message 'There is neither a public getProbe method, nor a public isProbe method in class Media. Please specify which public method should be used for retrieving the value of the property probe.' in /private/tmp/test-serializer/vendor/jms/serializer/src/JMS/Serializer/Metadata/PropertyMetadata.php:60
Stack trace:
#0 /private/tmp/test-serializer/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/AnnotationDriver.php(188): JMS\Serializer\Metadata\PropertyMetadata->setAccessor('public_method', NULL, NULL)
#1 /private/tmp/test-serializer/vendor/jms/metadata/src/Metadata/MetadataFactory.php(77): JMS\Serializer\Metadata\Driver\AnnotationDriver->loadMetadataForClass(Object(ReflectionClass))
#2 /private/tmp/test-serializer/vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php(177): Metadata\MetadataFactory->getMetadataForClass('Media')
#3 /private/tmp/test-serializer/vendor/jms/serializer/s
<?php
$i = 0;
$app = function ($request, $response) use (&$i) {
$request->on('end', function() use ($response, &$i) {
$i++;
$text = "This is request number $i.\n";
<?php
use React\EventLoop\Factory;
use React\Socket\Server;
class Server
{
private $loop;
private $socket;
function __construct()
<?php
use Predis\Async\Client as PredisClient;
function save(PredisClient $redis)
{
$deferred = new Deferred();
$saddDeferred = new Deferred();
// let's start a transaction
1) unitTest::testUn
binRuntimeException: Trying to save a session that was not started yet or was already closed
/Users/romain/Documents/workspace/PROUT/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php:101
/Users/romain/Documents/workspace/PROUT/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Session.php:184
/Users/romain/Documents/workspace/PROUT/vendor/silex/silex/src/Silex/Provider/SessionServiceProvider.php:107
/Users/romain/Documents/workspace/PROUT/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:164
/Users/romain/Documents/workspace/PROUT/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:53
/Users/romain/Documents/workspace/PROUT/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:169
/Users/romain/Documents/workspace/PROUT/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151
<?php
use Silex\WebTestCase;
use Silex\Application;
use Silex\Provider\SessionServiceProvider;
class unitTest extends WebTestCase
{
public function testUn()
{