Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created January 15, 2016 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/781dc139f3a72d2d29e2 to your computer and use it in GitHub Desktop.
Save kurozumi/781dc139f3a72d2d29e2 to your computer and use it in GitHub Desktop.
【Silex】TwitterOAuthサービスプロバイダー
<?php
namespace Acme\ServiceProvider;
use Silex\Application;
use Silex\ServiceProviderInterface;
class TwitterOAuthServiceProvider implements ServiceProviderInterface
{
public function boot(Application $app)
{
}
public function register(Application $app)
{
$app['twitter.connection'] = $app->share(function($app){
return new \Abraham\TwitterOAuth\TwitterOAuth(
$app['twitter.consumer_key'],
$app['twitter.consumer_secret'],
$app['twitter.access_token'],
$app['twitter.access_token_secret']
);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment