Skip to content

Instantly share code, notes, and snippets.

@caefer
Created September 29, 2011 13:11
Show Gist options
  • Save caefer/1250703 to your computer and use it in GitHub Desktop.
Save caefer/1250703 to your computer and use it in GitHub Desktop.
<?php
namespace Caefer;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Goutte\Client;
class GoutteServiceProvider implements ServiceProviderInterface
{
public function register(Application $app)
{
$app['goutte.client'] = $app->share(function () use ($app) {
return new Client();
});
if (isset($app['goutte.class_path'])) {
$app['autoloader']->registerNamespaces(array(
'Goutte' => $app['goutte.class_path'],
'Zend' => $app['goutte.class_path'].'/../vendor/zend/library',
));
}
}
}
@dmouse
Copy link

dmouse commented Nov 17, 2012

need add
public function boot(Application $app)
{ }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment