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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
From: =?utf-8?q?David_Pr=C3=A9vot?= <david@tilapin.org>
Date: Mon, 1 Feb 2016 14:50:42 -0400
Subject: Adapt autoload path in examples
Forwarded: not-needed
---
docs/examples/01-interpreting-a-simple-docblock.php | 7 ++++++-
docs/examples/02-interpreting-tags.php | 7 ++++++-
docs/examples/03-reconstituting-a-docblock.php | 6 +++++-
docs/examples/04-adding-your-own-tag.php | 6 +++++-
docs/examples/playing-with-descriptions/02-escaping.php | 6 +++++-
5 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/docs/examples/01-interpreting-a-simple-docblock.php b/docs/examples/01-interpreting-a-simple-docblock.php
index d95d455..0041f5f 100644
--- a/docs/examples/01-interpreting-a-simple-docblock.php
+++ b/docs/examples/01-interpreting-a-simple-docblock.php
@@ -1,5 +1,10 @@
<?php
-require_once(__DIR__ . '/../../vendor/autoload.php');
+
+if (stream_resolve_include_path(__DIR__ . '/../../src/DocBlock/autoload.php')) {
+ include_once __DIR__ . '/../../src/DocBlock/autoload.php';
+} elseif (stream_resolve_include_path(__DIR__ . '/../../../phpDocumentor/Reflection/DocBlock/autoload.php')) {
+ include_once('/../../../phpDocumentor/Reflection/DocBlock/autoload.php');
+}
use phpDocumentor\Reflection\DocBlockFactory;
diff --git a/docs/examples/02-interpreting-tags.php b/docs/examples/02-interpreting-tags.php
index ba0ca40..e460bc8 100644
--- a/docs/examples/02-interpreting-tags.php
+++ b/docs/examples/02-interpreting-tags.php
@@ -1,5 +1,10 @@
<?php
-require_once(__DIR__ . '/../../vendor/autoload.php');
+
+if (stream_resolve_include_path(__DIR__ . '/../../src/DocBlock/autoload.php')) {
+ include_once __DIR__ . '/../../src/DocBlock/autoload.php';
+} elseif (stream_resolve_include_path(__DIR__ . '/../../../phpDocumentor/Reflection/DocBlock/autoload.php')) {
+ include_once('/../../../phpDocumentor/Reflection/DocBlock/autoload.php');
+}
use phpDocumentor\Reflection\DocBlockFactory;
diff --git a/docs/examples/03-reconstituting-a-docblock.php b/docs/examples/03-reconstituting-a-docblock.php
index d0b042d..e3e7e2b 100644
--- a/docs/examples/03-reconstituting-a-docblock.php
+++ b/docs/examples/03-reconstituting-a-docblock.php
@@ -1,6 +1,10 @@
<?php
-require_once(__DIR__ . '/../../vendor/autoload.php');
+if (stream_resolve_include_path(__DIR__ . '/../../src/DocBlock/autoload.php')) {
+ include_once __DIR__ . '/../../src/DocBlock/autoload.php';
+} elseif (stream_resolve_include_path(__DIR__ . '/../../../phpDocumentor/Reflection/DocBlock/autoload.php')) {
+ include_once('/../../../phpDocumentor/Reflection/DocBlock/autoload.php');
+}
use phpDocumentor\Reflection\DocBlock\Serializer;
use phpDocumentor\Reflection\DocBlockFactory;
diff --git a/docs/examples/04-adding-your-own-tag.php b/docs/examples/04-adding-your-own-tag.php
index 2e7ff75..2f4516b 100644
--- a/docs/examples/04-adding-your-own-tag.php
+++ b/docs/examples/04-adding-your-own-tag.php
@@ -3,7 +3,11 @@
* In this example we demonstrate how you can add your own Tag using a Static Factory method in your Tag class.
*/
-require_once(__DIR__ . '/../../vendor/autoload.php');
+if (stream_resolve_include_path(__DIR__ . '/../../src/DocBlock/autoload.php')) {
+ include_once __DIR__ . '/../../src/DocBlock/autoload.php';
+} elseif (stream_resolve_include_path(__DIR__ . '/../../../phpDocumentor/Reflection/DocBlock/autoload.php')) {
+ include_once('/../../../phpDocumentor/Reflection/DocBlock/autoload.php');
+}
use phpDocumentor\Reflection\DocBlock\Serializer;
use phpDocumentor\Reflection\DocBlock\Tag;
diff --git a/docs/examples/playing-with-descriptions/02-escaping.php b/docs/examples/playing-with-descriptions/02-escaping.php
index a215303..fe34adc 100644
--- a/docs/examples/playing-with-descriptions/02-escaping.php
+++ b/docs/examples/playing-with-descriptions/02-escaping.php
@@ -1,6 +1,10 @@
<?php
-require_once(__DIR__ . '/../../../vendor/autoload.php');
+if (stream_resolve_include_path(__DIR__ . '/../../src/DocBlock/autoload.php')) {
+ include_once __DIR__ . '/../../src/DocBlock/autoload.php';
+} elseif (stream_resolve_include_path(__DIR__ . '/../../../phpDocumentor/Reflection/DocBlock/autoload.php')) {
+ include_once('/../../../phpDocumentor/Reflection/DocBlock/autoload.php');
+}
use phpDocumentor\Reflection\DocBlockFactory;
|