Created
January 15, 2016 10:08
-
-
Save kurozumi/781dc139f3a72d2d29e2 to your computer and use it in GitHub Desktop.
【Silex】TwitterOAuthサービスプロバイダー
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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