diff --git a/.gitignore b/.gitignore index 1dbdcb2..3eec762 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ phpunit.xml coverage -vendor/symfony -vendor/twig -vendor/twitteroauth \ No newline at end of file +vendor/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 16bb3e4..f06edb7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,7 @@ php: - 5.3 - 5.4 -env: - - SYMFONY_VERSION=v2.0.7 - - SYMFONY_VERSION=origin/2.0 - -before_script: php vendor/vendors.php +before_script: composer install --dev notifications: email: diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index dd0a884..fd369e6 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -40,7 +40,7 @@ public function getConfigTreeBuilder() }) ->end() ->children() - ->scalarNode('file')->defaultValue('%kernel.root_dir%/../vendor/twitteroauth/twitteroauth/twitteroauth.php')->end() + ->scalarNode('file')->info('DEPRECATED. To be removed.')->end() ->scalarNode('consumer_key')->isRequired()->cannotBeEmpty()->end() ->scalarNode('consumer_secret')->isRequired()->cannotBeEmpty()->end() ->scalarNode('access_token')->defaultNull()->end() diff --git a/DependencyInjection/FOSTwitterExtension.php b/DependencyInjection/FOSTwitterExtension.php index c627485..dd52921 100644 --- a/DependencyInjection/FOSTwitterExtension.php +++ b/DependencyInjection/FOSTwitterExtension.php @@ -38,7 +38,7 @@ public function load(array $configs, ContainerBuilder $container) $container->setAlias($config['alias'], 'fos_twitter.service'); } - foreach (array('file', 'consumer_key', 'consumer_secret', 'callback_url', 'access_token', 'access_token_secret', 'anywhere_version') as $attribute) { + foreach (array('consumer_key', 'consumer_secret', 'callback_url', 'access_token', 'access_token_secret', 'anywhere_version') as $attribute) { if (isset($config[$attribute])) { $container->setParameter('fos_twitter.'.$attribute, $config[$attribute]); } diff --git a/README.md b/README.md index 2ac8c8d..6729198 100644 --- a/README.md +++ b/README.md @@ -14,23 +14,15 @@ 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 to your project's ```composer.json``` : - $ git submodule add git://github.com/FriendsOfSymfony/FOSTwitterBundle.git vendor/bundles/FOS/TwitterBundle - $ git submodule add git://github.com/kertz/twitteroauth.git vendor/twitteroauth + "require": { + "_some_package": "*", ->**Note:** The kertz/twitteroauth is patched to be compatible with FOSTwitterBundle - - 2. Register the namespace `FOS` to your project's autoloader bootstrap script: - - //app/autoload.php - $loader->registerNamespaces(array( - // ... - 'FOS' => __DIR__.'/../vendor/bundles', - // ... - )); + "friendsofsymfony/twitter-bundle": "1.1.*" + } - 3. Add this bundle to your application's kernel: + 2. Add this bundle to your application's kernel: //app/AppKernel.php public function registerBundles() @@ -42,11 +34,10 @@ Installation ); } - 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 consumer_key: xxxxxx consumer_secret: xxxxxx callback_url: http://www.example.com/login_check diff --git a/Resources/config/schema/twitter-1.0.xsd b/Resources/config/schema/twitter-1.0.xsd index 0063ada..c5bec8d 100644 --- a/Resources/config/schema/twitter-1.0.xsd +++ b/Resources/config/schema/twitter-1.0.xsd @@ -9,11 +9,12 @@ - + + diff --git a/Resources/config/twitter.xml b/Resources/config/twitter.xml index 9b23ea5..d49bef1 100644 --- a/Resources/config/twitter.xml +++ b/Resources/config/twitter.xml @@ -5,7 +5,6 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - null null null null @@ -29,7 +28,6 @@ - %fos_twitter.file% %fos_twitter.consumer_key% %fos_twitter.consumer_secret% %fos_twitter.access_token% diff --git a/Tests/DependencyInjection/FOSTwitterExtensionTest.php b/Tests/DependencyInjection/FOSTwitterExtensionTest.php index 691a639..db32041 100644 --- a/Tests/DependencyInjection/FOSTwitterExtensionTest.php +++ b/Tests/DependencyInjection/FOSTwitterExtensionTest.php @@ -35,7 +35,6 @@ public function testLoadSuccess() { $configs = array( array( - 'file' => 'foo', 'callback_url' => 'foo', 'consumer_key' => 'foo', 'consumer_secret' => 'foo', @@ -55,7 +54,7 @@ public function testLoadSuccess() $container ->expects($this->once()) ->method('setAlias') - ->with($alias, 'fos_twitter'); + ->with($alias, 'fos_twitter.service'); $configs[] = array('alias' => $alias); diff --git a/Tests/autoload.php.dist b/Tests/autoload.php.dist deleted file mode 100644 index 39e87d4..0000000 --- a/Tests/autoload.php.dist +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -$vendorDir = __DIR__.'/../vendor'; -require_once $vendorDir.'/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; - -use Symfony\Component\ClassLoader\UniversalClassLoader; - -$loader = new UniversalClassLoader(); -$loader->registerNamespaces(array( - 'Symfony' => array($vendorDir.'/symfony/src'), -)); -$loader->registerPrefixes(array( - 'Twig_' => $vendorDir.'/twig/lib', -)); -$loader->register(); - -spl_autoload_register(function($class) { - if (0 === strpos($class, 'FOS\\TwitterBundle\\')) { - $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php'; - if (!stream_resolve_include_path($path)) { - return false; - } - require_once $path; - return true; - } -}); diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php deleted file mode 100644 index ac3d0fb..0000000 --- a/Tests/bootstrap.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (file_exists($file = __DIR__.'/autoload.php')) { - require_once $file; -} elseif (file_exists($file = __DIR__.'/autoload.php.dist')) { - require_once $file; -} diff --git a/composer.json b/composer.json index d58a404..db3aa9d 100644 --- a/composer.json +++ b/composer.json @@ -13,12 +13,18 @@ ], "require": { "php": ">=5.3.2", - "symfony/framework-bundle": "2.*", - "symfony/security-bundle": ">=2.1,<2.3-dev", + "symfony/framework-bundle": "~2.1", + "symfony/security-bundle": "~2.1", "kertz/twitteroauth": "*" }, + "minimum-stability": "dev", "autoload": { "psr-0": { "FOS\\TwitterBundle": "" } }, - "target-dir": "FOS/TwitterBundle" + "target-dir": "FOS/TwitterBundle", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3d75c83..b1dfd0f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,6 @@ - +