Permalink
Browse files

Added `Respect\Config` dependence.

  • Loading branch information...
1 parent 9bdc73f commit f8150dc5ef9443465a907834ac084bf7e00a1f06 @henriquemoody henriquemoody committed Feb 14, 2012
Showing with 32 additions and 19 deletions.
  1. +3 −0 .gitignore
  2. +12 −3 composer.json
  3. +17 −16 tests/bootstrap.php
View
@@ -0,0 +1,3 @@
+/composer.lock
+/composer.phar
+/vendor
View
@@ -3,11 +3,11 @@
"version": "0.1.1-alpha",
"type": "library",
"description": "Makes your code speak CLI",
- "homepage": "http:\/\/respect.li",
+ "homepage": "http://respect.li",
"repositories": {
"repository": {
"vcs": {
- "url": "http:\/\/github.com\/Respect\/Cli"
+ "url": "http://github.com/Respect/Cli"
}
}
},
@@ -16,10 +16,19 @@
{
"name": "Alexandre Gaigalas",
"email": "alexandre@gaigalas.net"
+ },
+ {
+ "name": "Augusto Pascutti",
+ "email": "augusto@phpsp.org.br"
+ },
+ {
+ "name": "Henrique Moody",
+ "email": "henriquemoody@gmail.com"
}
],
"require": {
- "php": ">=5.3.0"
+ "php": ">=5.3.0",
+ "respect/config": ">=0.3.1-dev"
},
"autoload": {
"psr-0": {
View
@@ -2,27 +2,28 @@
date_default_timezone_set('UTC');
-$pear_path = trim(`pear config-get php_dir`);
-set_include_path('../library'
- . PATH_SEPARATOR . $pear_path
- . 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 (!@include __DIR__.'/../vendor/.composer/autoload.php') {
+ $pear_path = trim(`pear config-get php_dir`);
+ set_include_path('../library'
+ . PATH_SEPARATOR . $pear_path
+ . PATH_SEPARATOR . get_include_path());
+ spl_autoload_register(
+ function($className) {
+ $fileParts = explode('\\', ltrim($className, '\\'));
- if (false !== strpos(end($fileParts), '_'))
- array_splice($fileParts, -1, 1, explode('_', current($fileParts)));
+ if (false !== strpos(end($fileParts), '_'))
+ array_splice($fileParts, -1, 1, explode('_', current($fileParts)));
- $file = implode(DIRECTORY_SEPARATOR, $fileParts) . '.php';
+ $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;
+ foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) {
+ if (file_exists($path = $path . DIRECTORY_SEPARATOR . $file))
+ return require $path;
+ }
}
- }
-);
+ );
+}

0 comments on commit f8150dc

Please sign in to comment.