Skip to content

Commit

Permalink
Modification on autoloading : use composer/composer project
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin RICHARD committed Jan 4, 2012
1 parent a21c322 commit fd001d4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 105 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -2,14 +2,15 @@ language: php

php:
- 5.3
# - 5.4

env:
- SYMFONY_VERSION=v2.0.7
# - SYMFONY_VERSION=origin/2.0
# - SYMFONY_VERSION=origin/master

before_script: php Tests/vendor/vendors.php
before_script:
- wget -nc http://getcomposer.org/composer.phar
- php composer.phar update

script: phpunit

Expand Down
63 changes: 0 additions & 63 deletions Tests/autoload.php.dist

This file was deleted.

24 changes: 14 additions & 10 deletions Tests/bootstrap.php
@@ -1,13 +1,17 @@
<?php

/*
* This file is part of the RebolonPagerBundle package.
*
* It has been freely inspired by FOSUserBundle
*/
$loader = require __DIR__.'/../vendor/.composer/autoload.php';
$loader->register();

if (file_exists($file = __DIR__.'/autoload.php')) {
require_once $file;
} elseif (file_exists($file = __DIR__.'/autoload.php.dist')) {
require_once $file;
}
// @todo : resolve this autoload requirements whereas it should not be !!!
spl_autoload_register(function($class) {
if (0 === strpos($class, 'Rebolon\\PagerBundle\\')) {
$path = __DIR__ . '/../' . implode('/', array_slice(explode('\\', $class), 2)) . '.php';

if (!stream_resolve_include_path($path)) {
return false;
}
require_once $path;
return true;
}
});
28 changes: 0 additions & 28 deletions Tests/vendor/vendors.php

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"symfony/framework-bundle": "2.*",
"twig/twig": "1.*",
"twig/twig": "1.*"
},
"autoload": {
"psr-0": { "Rebolon\\PagerBundle": "" }
Expand Down
3 changes: 2 additions & 1 deletion phpunit.xml.dist
Expand Up @@ -11,7 +11,7 @@
<testsuites>
<testsuite name="Rebolon/PagerBundle test suite">
<directory suffix="Test.php">./Tests</directory>
<exclude>./Tests/vendor</exclude>
<exclude>./vendor</exclude>
<exclude>./Tests/cache</exclude>
<exclude>./Tests/logs</exclude>
<exclude>./Tests/Units</exclude> <!-- Atoum folder -->
Expand All @@ -22,6 +22,7 @@
<whitelist>
<directory>./</directory>
<exclude>
<directory>./vendor</directory>
<directory>./Tests</directory>
</exclude>
</whitelist>
Expand Down

0 comments on commit fd001d4

Please sign in to comment.