Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Dynamic callback URL + updated description #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 12 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,27 @@ database based solution provided by FOSUserBundle.
Installation
============

1. Add this bundle and Abraham Williams' Twitter library to your project as Git submodules:
1. Add this bundle and Abraham Williams' Twitter library to your project as composer references:

$ git submodule add git://github.com/FriendsOfSymfony/FOSTwitterBundle.git vendor/bundles/FOS/TwitterBundle
$ git submodule add git://github.com/kertz/twitteroauth.git vendor/twitteroauth
"kertz/twitteroauth": "dev-master",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed

"friendsofsymfony/twitter-bundle": "dev-master"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should put a proper constraint instead of dev-master


>**Note:** The kertz/twitteroauth is patched to be compatible with FOSTwitterBundle

2. Register the namespace `FOS` to your project's autoloader bootstrap script:
2. Add this bundle to your application's kernel:

//app/autoload.php
$loader->registerNamespaces(array(
// ...
'FOS' => __DIR__.'/../vendor/bundles',
// ...
));

3. Add this bundle to your application's kernel:
$bundles = array(
...
new FOS\TwitterBundle\FOSTwitterBundle(),
...
);

//app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new FOS\TwitterBundle\FOSTwitterBundle(),
// ...
);
}

4. Configure the `twitter` service in your YAML configuration:
3. Configure the `twitter` service in your YAML configuration:

#app/config/config.yml
fos_twitter:
file: %kernel.root_dir%/../vendor/twitteroauth/twitteroauth/twitteroauth.php
file: %kernel.root_dir%/../vendor/kertz/twitteroauth/twitteroauth/twitteroauth.php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply remove this line entirely. It is not needed when the class can be autoloaded, which should be the case when installing the lmibrary through Composer (otherwise, it should be fixed in their composer.json)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stof : #45 ;)

consumer_key: xxxxxx
consumer_secret: xxxxxx
callback_url: http://www.example.com/login_check
Expand Down Expand Up @@ -74,6 +62,7 @@ Using Twitter @Anywhere
-----------------------

>**Note:** If you want the Security Component to work with Twitter @Anywhere, you need to send a request to the configured check path upon successful client authentication (see https://gist.github.com/1021384 for a sample configuration).
>**Note:** Note that using twitter @Anywhere is deprecated.

A templating helper is included for using Twitter @Anywhere. To use it, first
call the `->setup()` method toward the top of your DOM:
Expand Down
5 changes: 5 additions & 0 deletions Services/Twitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public function __construct(TwitterOAuth $twitter, Session $session, $callbackUR
$this->callbackURL = $callbackURL;
}

public function setCallBackURL($callbackURL)
{
$this->callbackURL = $callbackURL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong indentation

}

public function setCallbackRoute(RouterInterface $router, $routeName)
{
$this->router = $router;
Expand Down