Permalink
Browse files

Travis and Composer Integration, some fixes

 - Travis
  - runs against php 5.3 and 5.4
  - installs mongo, memcache, memcached extensions

 - README
  - changed to use composer

 - vendors.sh
   - dropped - knplabs bundle-url wasnt up2date anymore

 - phpunit
  - verbose, to be able to see which tests are skipped

 - Extensions
   - Some classes have changed names in their libs:
     - Predis\ClientOptions -> Predis\Options\ClientOptions
     - Predis\ConnectionException -> Predis\Connection\ConnectionException

 - Tests
   - bootstrap uses autoloading from composer
   - Tests use class_exists to check if a dependency exists
   - MongoDbExtension Test changed since I could get persistent to have a value, even with older commits

 - Ignore
   - Ignoring composer.phar via .gitignore
  • Loading branch information...
1 parent 6c42344 commit 8460e2093e6f06f46096e84deb14849d0fad9572 @robo47 robo47 committed Mar 9, 2012
Showing with 293 additions and 16 deletions.
  1. +1 −0 .gitignore
  2. +8 −0 .travis.yml
  3. +11 −9 README.rst
  4. +21 −0 bin/travis-init.sh
  5. +124 −0 composer.json
  6. +125 −0 composer.lock
  7. +1 −0 phpunit.xml.dist
  8. +1 −1 tests/SilexExtension/Tests/EmbedlyExtensionTest.php
  9. +1 −6 tests/bootstrap.php
View
@@ -2,6 +2,7 @@ functions.php
vendor/
.redcar
silex.phar
+composer.phar
example/odm/Model
example/assetic/output/*
example/assetic/cache/*
View
@@ -0,0 +1,8 @@
+language: php
+
+php:
+ - 5.3
+ - 5.4
+
+before_script:
+ - "sh bin/travis-init.sh"
View
@@ -26,18 +26,20 @@ Extensions with Twig Support
Installation
------------
-Run the following commands inside your Silex directory:
+Create a composer.json in your projects root-directory
- git clone git@github.com:fate/Silex-Extensions.git vendor/silex-extension
-
-To install vendor depedencies, copy vendors.sh in your root directory and run
+ {
+ "require": {
+ "fate/Silex-Extensions": "*"
+ }
+ }
+
+and run
+
+ curl -s http://getcomposer.org/installer | php
+ php composer.phar install
- sh ./vendors.sh
-
-And install all submodules in vendor/mongodb and vendor/mandango
- git submodule update --init
-
Add the library to the Silex autoloader
$app['autoloader']->registerNamespace('SilexExtension', __DIR__ . '/vendor/silex-extension/src');
View
@@ -0,0 +1,21 @@
+# installing memcached extension
+curl -s http://pecl.php.net/get/memcached-2.0.1.tgz > memcached-2.0.1.tgz
+tar -xzf memcached-2.0.1.tgz
+sh -c "cd memcached-2.0.1 && phpize && ./configure && make && sudo make install"
+echo "extension=memcached.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
+
+curl -s http://pecl.php.net/get/memcache-2.2.6.tgz > memcache-2.2.6.tgz
+tar -xzf memcache-2.2.6.tgz
+sh -c "cd memcache-2.2.6 && phpize && ./configure && make && sudo make install"
+echo "extension=memcache.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
+
+# installing mongo extension
+curl -s http://pecl.php.net/get/mongo-1.2.9.tgz > mongo-1.2.9.tgz
+tar -xzf mongo-1.2.9.tgz
+sh -c "cd mongo-1.2.9 && phpize && ./configure && make && sudo make install"
+echo "extension=mongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
+
+wget silex-project.org/get/silex.phar
+
+wget http://getcomposer.org/composer.phar
+php composer.phar install
View
@@ -0,0 +1,124 @@
+{
+ "name": "fate/silex-extensions",
+ "description": "Collection of Extensions for Silex",
+ "keywords": ["silex"],
+ "homepage": "https://github.com/fate/Silex-Extensions",
+ "type": "library",
+ "license": "MIT",
+ "version": "1.0.0",
+ "authors": [
+ {
+ "name": "Sven Eisenschmidt",
+ "email": "sven.eisenschmidt@gmail.com",
+ "homepage": "http://unsicherheitsagent.de/"
+ }
+ ],
+ "repositories": [
+ {
+ "type":"package",
+ "package": {
+ "name":"mandango/mondator",
+ "version":"master",
+ "dist":{
+ "url":"https://github.com/mandango/mondator/zipball/5685054409a76b41c27573e4bc17523f8236551a",
+ "type":"zip"
+ },
+ "source": {
+ "url":"git://github.com/mandango/mondator.git",
+ "type":"git",
+ "reference": "master"
+ },
+ "autoload": {
+ "psr-0": {
+ "Mandango\\Mondator":"src"
+ }
+ }
+ }
+ },
+ {
+ "type":"package",
+ "package": {
+ "name":"mandango/mandango",
+ "version":"master",
+ "dist":{
+ "url":"https://github.com/mandango/mandango/zipball/957d6c6f54c8ed0762ab63b16a057d1e631bc002",
+ "type":"zip"
+ },
+ "source": {
+ "url":"git://github.com/mandango/mandango.git",
+ "type":"git",
+ "reference": "master"
+ },
+ "autoload": {
+ "psr-0": {
+ "Mandango\\Mandango":"src"
+ }
+ },
+ "require": {
+ "symfony/class-loader": ">=2.0.0",
+ "twig/twig": ">=1.2",
+ "mandango/mondator": "*"
+ }
+ }
+ },
+ {
+ "type":"package",
+ "package": {
+ "name":"fate/gravatar-php",
+ "version":"master",
+ "dist":{
+ "url":"https://github.com/fate/Gravatar-php/zipball/957d6c6f54c8ed0762ab63b16a057d1e631bc002",
+ "type":"zip"
+ },
+ "source": {
+ "url":"git://github.com/fate/Gravatar-php.git",
+ "type":"git",
+ "reference": "master"
+ },
+ "autoload": {
+ "psr-0": {
+ "Gravatar":"src"
+ }
+ }
+ }
+ },
+ {
+ "type":"package",
+ "package": {
+ "name":"embedly/embedly-php",
+ "version":"master",
+ "dist":{
+ "url":"https://github.com/embedly/embedly-php/zipball/fc30b795a97fb79af67cf6c23733a439dd94e8d1",
+ "type":"zip"
+ },
+ "source": {
+ "url":"git://github.com/embedly/embedly-php.git",
+ "type":"git",
+ "reference": "master"
+ },
+ "autoload": {
+ "psr-0": {
+ "Embedly":"src"
+ }
+ }
+ }
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0",
+ "kriswallsmith/assetic": ">=1.0",
+ "twig/twig": ">=1.2.0",
+ "doctrine/mongodb": "*",
+ "predis/predis": "*",
+ "mandango/mandango": "*",
+ "knplabs/knp-markdown-bundle": "*",
+ "embedly/embedly-php": "*",
+ "fate/gravatar-php": "*"
+ },
+ "autoload": {
+ "psr-0": {
+ "SilexExtension": "src"
+ }
+ }
+
+}
View
Oops, something went wrong.
View
@@ -9,6 +9,7 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
+ verbose="true"
bootstrap="tests/bootstrap.php"
>
<testsuites>
@@ -14,7 +14,7 @@ class EmbedlyExtensionTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
- if (!is_dir(__DIR__ . '/../../../vendor/embedly-php/src')) {
+ if (!class_exists('Embedly\\Embedly')) {
$this->markTestSkipped('Embedly was not installed.');
}
}
View
@@ -1,9 +1,4 @@
<?php
require_once __DIR__ . '/../silex.phar';
-
-use Symfony\Component\ClassLoader\UniversalClassLoader;
-
-$loader = new UniversalClassLoader();
-$loader->registerNamespace('SilexExtension', __DIR__ . '/../src');
-$loader->register();
+require_once __DIR__ . '/../vendor/.composer/autoload.php';

0 comments on commit 8460e20

Please sign in to comment.