Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update composer dependences.

* Removed duplicated texts on composer.json;
* Update composer autoloader;
* Update .gitignore with documents and folders of composer that
  should be ignored.
  • Loading branch information...
commit 34eaeda9552dcfd70891be746cfa2e24a9c056c5 1 parent 091e3f7
@henriquemoody henriquemoody authored
Showing with 48 additions and 63 deletions.
  1. +19 −22 .gitignore
  2. +4 −22 composer.json
  3. +25 −19 tests/bootstrap.php
View
41 .gitignore
@@ -1,28 +1,25 @@
-.foundation
-*.phar
-.buildpath
-.project
-.settings/
-nbproject
-.foundation-tmp
-tests/reports
-pirum
-library/Respect/Data
+.*
*.7z
-*.jar
-*.rar
-*.zip
-*.gz
*.bzip
-*.xz
-*.lzma
-*.iso
-*.tar
+*.deb
*.dmg
-*.xpi
-*.gem
*.egg
-*.deb
+*.gem
+*.gz
+*.iso
+*.jar
+*.lock
+*.lzma
+*.phar
+*.rar
*.rpm
+*.tar
*.tgz
-
+*.xpi
+*.xz
+*.zip
+/pirum
+/library/Respect/Data
+/nbproject
+/tests/reports
+/vendor
View
26 composer.json
@@ -1,25 +1,13 @@
{
- "name": "Respect\/Relational",
+ "name": "Respect/Relational",
"description": "Fluent Database Toolkit",
"version": "0.4.6",
"type": "library",
"time": "2012-05-05 19:11:23",
- "homepage": "http:\/\/respect.li",
+ "homepage": "http://respect.li",
"license": "BSD Style",
"authors": [
{
- "name": "Alexandre",
- "email": "alexandre@gaigalas.net"
- },
- {
- "name": "Alexandre Gaigalas",
- "email": "alexandre@gaigalas.net"
- },
- {
- "name": "Alexandre Gaigalas",
- "email": "alganet@alganet-workstation.(none)"
- },
- {
"name": "Alexandre Gomes Gaigalas",
"email": "alexandre@gaigalas.net"
},
@@ -49,17 +37,11 @@
}
],
"require": {
- "pear-Respect\/Data": "*"
+ "respect/data": "*"
},
- "repositories": [
- {
- "type": "pear",
- "url": "http:\/\/respect.li\/pear"
- }
- ],
"autoload": {
"psr-0": {
- "Respect\\Relational": "library\/"
+ "Respect\\Relational": "library/"
}
}
}
View
44 tests/bootstrap.php
@@ -1,28 +1,34 @@
<?php
+/* Timezone */
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.
+ * PSR-0 compliant autoloader created by Composer.
+ * If this file does not exist, run `composer.phar install` from
+ * the project root directory to generate it.
*/
-spl_autoload_register(
- function($className) {
- $fileParts = explode('\\', ltrim($className, '\\'));
-
- if (false !== strpos(end($fileParts), '_'))
- array_splice($fileParts, -1, 1, explode('_', current($fileParts)));
+if (!@include __DIR__ . '/../vendor/autoload.php') {
- $file = implode(DIRECTORY_SEPARATOR, $fileParts) . '.php';
+ /* Include path */
+ set_include_path(implode(PATH_SEPARATOR, array(
+ __DIR__ . '/../src',
+ get_include_path(),
+ )));
- foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) {
- if (file_exists($path = $path . DIRECTORY_SEPARATOR . $file))
- return require $path;
+ /* PEAR autoloader */
+ spl_autoload_register(
+ function($className) {
+ $filename = strtr($className, '\\', DIRECTORY_SEPARATOR) . '.php';
+ foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) {
+ $path .= DIRECTORY_SEPARATOR . $filename;
+ if (is_file($path)) {
+ require_once $path;
+ return true;
+ }
+ }
+ return false;
}
- }
-);
+ );
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.