File: 0001-Use-ClassLoader-from-Symfony-instead-of-autoload.patch

package info (click to toggle)
php-doctrine-data-fixtures 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 336 kB
  • ctags: 546
  • sloc: php: 1,621; makefile: 10; sh: 5
file content (33 lines) | stat: -rw-r--r-- 1,080 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Sun, 7 Sep 2014 19:16:51 -0400
Subject: Use ClassLoader from Symfony instead of autoload

Work around the lack of proper autoload.php from composer by using the
ClassLoader element from Symfony.

http://symfony.com/doc/current/components/class_loader/class_loader.html

Forwarded: not-needed
---
 tests/bootstrap.php | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 00ebd58..9795b80 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -18,5 +18,12 @@
  * <http://www.doctrine-project.org>.
  */
 
-$loader = require_once __DIR__ . "/../vendor/autoload.php";
-$loader->add('Doctrine\\Tests\\', __DIR__);
+require_once 'Symfony/Component/ClassLoader/ClassLoader.php';
+use Symfony\Component\ClassLoader\ClassLoader;
+$loader = new ClassLoader();
+$loader->setUseIncludePath(true);
+$loader->register();
+$loader->addPrefixes(array(
+	'Doctrine\\Common\\DataFixtures'	=> __DIR__ . '/../lib/',
+	'Doctrine\\Tests'			=> __DIR__,
+));