jdesrosiers / silex-cors-provider

A silex service provider that adds CORS services to silex
MIT License
78 stars 25 forks source link

Silex 1.2-stable compatility? #10

Closed EdwardIII closed 9 years ago

EdwardIII commented 9 years ago

I'm interested in using this but would rather not upgrade to silex 2.0-dev.

I tried just switching to stable deps (https://github.com/EdwardIII/silex-cors-provider) but this does break the package:

PHP Fatal error:  Interface 'Pimple\ServiceProviderInterface' not found in /private/tmp/silex-cors-provider/src/CorsServiceProvider.php on line 16
PHP Stack trace:
PHP   1. {main}() /usr/local/Cellar/phpunit/4.3.4/libexec/phpunit-4.3.4.phar:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/local/Cellar/phpunit/4.3.4/libexec/phpunit-4.3.4.phar:605
PHP   3. PHPUnit_TextUI_Command->run() phar:///usr/local/Cellar/phpunit/4.3.4/libexec/phpunit-4.3.4.phar/phpunit/TextUI/Command.php:138
PHP   4. PHPUnit_TextUI_TestRunner->doRun() phar:///usr/local/Cellar/phpunit/4.3.4/libexec/phpunit-4.3.4.phar/phpunit/TextUI/Command.php:186
PHP   5. PHPUnit_Framework_TestSuite->run() phar:///usr/local/Cellar/phpunit/4.3.4/libexec/phpunit-4.3.4.phar/phpunit/TextUI/TestRunner.php:423
PHP   6. PHPUnit_Framework_TestCase->run() /private/tmp/silex-cors-provider/vendor/phpunit/phpunit/src/Framework/TestSuite.php:716
PHP   7. PHPUnit_Framework_TestResult->run() /private/tmp/silex-cors-provider/vendor/phpunit/phpunit/src/Framework/TestCase.php:687
PHP   8. PHPUnit_Framework_TestCase->runBare() /private/tmp/silex-cors-provider/vendor/phpunit/phpunit/src/Framework/TestResult.php:609
PHP   9. JDesrosiers\Tests\Silex\Provider\CorsServiceProviderTest->setUp() /private/tmp/silex-cors-provider/vendor/phpunit/phpunit/src/Framework/TestCase.php:727
PHP  10. spl_autoload_call() /private/tmp/silex-cors-provider/vendor/phpunit/phpunit/src/Framework/TestCase.php:19
PHP  11. Composer\Autoload\ClassLoader->loadClass() /private/tmp/silex-cors-provider/vendor/phpunit/phpunit/src/Framework/TestCase.php:0
PHP  12. Composer\Autoload\includeFile() /private/tmp/silex-cors-provider/vendor/composer/ClassLoader.php:278
PHP  13. include() /private/tmp/silex-cors-provider/vendor/composer/ClassLoader.php:386

Any pointers on how I could make this Silex 1.2 compatible?

EdwardIII commented 9 years ago

So I made a couple more changes (https://github.com/EdwardIII/silex-cors-provider/compare/jdesrosiers:master...master) and it seems to pass all unit tests with only prod deps. I'm going to test it in a real app now. This may not align with your goals, but if you're interested, let me know and I'll lodge a pull request.

jdesrosiers commented 9 years ago

Hi @EdwardIII,

All tagged releases are compatible with Silex 1.x. I suggest using ~0.1 as the version constraint in composer.

I chose to push the master branch to Silex 2.0 and maintain the Silex 1.x compatible code in the v0 branch. I won't tag the Silex 2.0 compatible code until Silex 2.0 is officially released. I will probably use version 1.0.0 when the time comes.

EdwardIII commented 9 years ago

Ah OK thanks for the feedback! Might be worth popping something in the readme for the 2.x branch to let others know? Thanks for putting the module together, works great.