Permalink
Browse files

add composer.json and update tests to support it

  • Loading branch information...
1 parent 8173896 commit 9ab47196419ed257885a473df2d879e9cdb5c2c9 @iampersistent iampersistent committed Jun 1, 2012
Showing with 195 additions and 32 deletions.
  1. +2 −0 .gitignore
  2. +32 −0 composer.json
  3. +151 −0 composer.lock
  4. +10 −32 tests/bootstrap.php
View
@@ -1,2 +1,4 @@
*.swp
.DS_Store
+composer.phar
+vendor/*
View
@@ -0,0 +1,32 @@
+{
+ "name": "gpupo/camelspider",
+ "description": "A class to help handle gateways to processing entities.",
+ "authors": [
+ {"name": "Gilmar Pupo", "email": "g@g1mr.com"}
+ ],
+ "keywords": ["Camel Spider", "spider", "crawler"],
+ "require": {
+ "doctrine/common": "2.3.*",
+ "fabpot/goutte": "1.0.*",
+ "pear-horde/Horde_Text_Diff": "*",
+ "php": ">=5.3.2",
+ "Respect/Validation": "0.4.4",
+ "symfony/class-loader": "2.1.*",
+ "zendframework/zend-cache": "2.0.*",
+ "zendframework/zend-date": "2.0.*",
+ "zendframework/zend-http": "2.0.*",
+ "zendframework/zend-uri": "2.0.*",
+ "zendframework/zend-validator": "2.0.*"
+ },
+ "repositories": [
+ {
+ "type": "pear",
+ "url": "http://pear.horde.org"
+ }
+ ],
+ "autoload": {
+ "psr-0": {
+ "CamelSpider": "src/"
+ }
+ }
+}
View
Oops, something went wrong.
View
@@ -2,35 +2,13 @@
date_default_timezone_set('UTC');
-/**
- * Set include path considering that camelSpider is contained in vendors directory
- *
- */
-set_include_path(
- '../../doctrine-common/lib/' . PATH_SEPARATOR
- . '../src' . PATH_SEPARATOR
- . '../../Symfony/src/'. PATH_SEPARATOR
- . '../../Goutte/src/'. PATH_SEPARATOR
- . '../../Respect/Validation/library/'
- . PATH_SEPARATOR . '../../Zend/library/'
- . PATH_SEPARATOR . get_include_path());
-
-/**
- * Autoloader that implements the PSR-0 spec for interoperability between
- * PHP software.
- */
-spl_autoload_register(
- function($className) {
- $fileParts = explode('\\', ltrim($className, '\\'));
-
- if (false !== strpos(end($fileParts), '_'))
- array_splice($fileParts, -1, 1, explode('_', current($fileParts)));
-
- $file = implode(DIRECTORY_SEPARATOR, $fileParts) . '.php';
-
- foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) {
- if (file_exists($path = $path . DIRECTORY_SEPARATOR . $file))
- return require $path;
- }
- }
-);
+$loader = @include __DIR__ . '/../vendor/autoload.php';
+
+if (!$loader) {
+ die(<<<'EOT'
+You must set up the project dependencies, run the following commands:
+wget http://getcomposer.org/composer.phar
+php composer.phar install
+EOT
+ );
+}

0 comments on commit 9ab4719

Please sign in to comment.