File: 0002-Use-ClassLoader-from-Symfony-instead-of-autoLoader.patch

package info (click to toggle)
php-sabre-vobject-3 3.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,492 kB
  • ctags: 3,416
  • sloc: php: 20,479; xml: 47; makefile: 43
file content (31 lines) | stat: -rw-r--r-- 1,014 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
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Tue, 24 Feb 2015 16:16:15 -0400
Subject: Use ClassLoader from Symfony instead of autoLoader

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/psr4_class_loader.html#usage
---
 tests/bootstrap.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 0abcff3..853d3f1 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -14,7 +14,13 @@ foreach($try as $path) {
     }
 }
 
-$autoLoader->addPsr4('Sabre\\VObject\\',__DIR__ . '/VObject');
+use Symfony\Component\ClassLoader\Psr4ClassLoader;
+
+require_once 'Symfony/Component/ClassLoader/Psr4ClassLoader.php';
+
+$loader = new Psr4ClassLoader();
+$loader->addPrefix('Sabre\\VObject\\',__DIR__ . '/VObject');
+$loader->register();
 
 if (!defined('SABRE_TEMPDIR')) {
   define('SABRE_TEMPDIR', __DIR__ . '/temp/');