From 558cea582a29b9caa64d5eadc92c422dc1ef3660 Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Tue, 5 Feb 2013 18:18:09 +0100 Subject: [PATCH 1/6] removed unneeded config --- DependencyInjection/Configuration.php | 2 +- DependencyInjection/FOSTwitterExtension.php | 2 +- README.md | 1 - Resources/config/schema/twitter-1.0.xsd | 1 - Resources/config/twitter.xml | 2 -- Tests/DependencyInjection/FOSTwitterExtensionTest.php | 1 - 6 files changed, 2 insertions(+), 7 deletions(-) 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..4ef2a69 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,6 @@ Installation #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..9af166e 100644 --- a/Resources/config/schema/twitter-1.0.xsd +++ b/Resources/config/schema/twitter-1.0.xsd @@ -9,7 +9,6 @@ - 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..ddf5d0d 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', From a7c7ceddd7f8e69370afc270087d68d1f5fd189b Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Tue, 5 Feb 2013 18:22:03 +0100 Subject: [PATCH 2/6] simplified installation instructions --- README.md | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4ef2a69..f9f11bb 100644 --- a/README.md +++ b/README.md @@ -16,21 +16,13 @@ Installation 1. Add this bundle and Abraham Williams' Twitter library to your project as Git submodules: - $ 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": "*" + } - 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,7 +34,7 @@ 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: From c1cca64ccd91c132d19895df7c97ba470d2c1ca9 Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Tue, 5 Feb 2013 18:24:08 +0100 Subject: [PATCH 3/6] added a branch alias --- README.md | 2 +- composer.json | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f9f11bb..c73778a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Installation "require": { "_some_package": "*", - "friendsofsymfony/twitter-bundle": "*" + "friendsofsymfony/twitter-bundle": "1.1.*" } 2. Add this bundle to your application's kernel: diff --git a/composer.json b/composer.json index d58a404..68c710d 100644 --- a/composer.json +++ b/composer.json @@ -20,5 +20,10 @@ "autoload": { "psr-0": { "FOS\\TwitterBundle": "" } }, - "target-dir": "FOS/TwitterBundle" + "target-dir": "FOS/TwitterBundle", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + } } From ecf8fc994aaa54859a59674049e49ad96b58c29d Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Tue, 12 Feb 2013 10:07:46 +0100 Subject: [PATCH 4/6] fixed composer instruction --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c73778a..6729198 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ 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``` : "require": { "_some_package": "*", From b2b4bd8589ffce89b4dbea05491703e05736ee01 Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Tue, 12 Feb 2013 10:19:58 +0100 Subject: [PATCH 5/6] added a todo note to the file attribute in xml xsd --- Resources/config/schema/twitter-1.0.xsd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Resources/config/schema/twitter-1.0.xsd b/Resources/config/schema/twitter-1.0.xsd index 9af166e..c5bec8d 100644 --- a/Resources/config/schema/twitter-1.0.xsd +++ b/Resources/config/schema/twitter-1.0.xsd @@ -13,6 +13,8 @@ + + From b3a2d53df8950043371a4c6ce52bb951ac9e438b Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Sun, 28 Apr 2013 22:28:53 +0200 Subject: [PATCH 6/6] fixed test suite and updated dependencies --- .gitignore | 4 +-- .travis.yml | 6 +--- .../FOSTwitterExtensionTest.php | 2 +- Tests/autoload.php.dist | 35 ------------------- Tests/bootstrap.php | 16 --------- composer.json | 5 +-- phpunit.xml.dist | 2 +- 7 files changed, 7 insertions(+), 63 deletions(-) delete mode 100644 Tests/autoload.php.dist delete mode 100644 Tests/bootstrap.php 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/Tests/DependencyInjection/FOSTwitterExtensionTest.php b/Tests/DependencyInjection/FOSTwitterExtensionTest.php index ddf5d0d..db32041 100644 --- a/Tests/DependencyInjection/FOSTwitterExtensionTest.php +++ b/Tests/DependencyInjection/FOSTwitterExtensionTest.php @@ -54,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 68c710d..db3aa9d 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,11 @@ ], "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": "" } }, 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 @@ - +