blob: 8f2d90639aaf2cfc40ba894b12618636f7aec356 (
plain)
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
|
diff -up example/example.php.old example/example.php
--- example/example.php.old 2015-02-17 13:26:45.000000000 +0100
+++ example/example.php 2015-02-17 13:27:34.000000000 +0100
@@ -11,8 +11,8 @@
<hr />
<?php
- // Include the diff class
- require_once dirname(__FILE__).'/../lib/Diff.php';
+ // Include the autoloader
+ require_once 'phpspec/php-diff/autoload.php';
// Include two sample files for comparison
$a = explode("\n", file_get_contents(dirname(__FILE__).'/a.txt'));
@@ -31,8 +31,6 @@
<h2>Side by Side Diff</h2>
<?php
- // Generate a side by side diff
- require_once dirname(__FILE__).'/../lib/Diff/Renderer/Html/SideBySide.php';
$renderer = new Diff_Renderer_Html_SideBySide;
echo $diff->Render($renderer);
@@ -40,8 +38,6 @@
<h2>Inline Diff</h2>
<?php
- // Generate an inline diff
- require_once dirname(__FILE__).'/../lib/Diff/Renderer/Html/Inline.php';
$renderer = new Diff_Renderer_Html_Inline;
echo $diff->render($renderer);
@@ -49,8 +45,6 @@
<h2>Unified Diff</h2>
<pre><?php
- // Generate a unified diff
- require_once dirname(__FILE__).'/../lib/Diff/Renderer/Text/Unified.php';
$renderer = new Diff_Renderer_Text_Unified;
echo htmlspecialchars($diff->render($renderer));
@@ -59,8 +53,6 @@
<h2>Context Diff</h2>
<pre><?php
- // Generate a context diff
- require_once dirname(__FILE__).'/../lib/Diff/Renderer/Text/Context.php';
$renderer = new Diff_Renderer_Text_Context;
echo htmlspecialchars($diff->render($renderer));
?>
|