File: 0001-Use-homemade-static-autoload-in-examples-and-tests.patch

package info (click to toggle)
php-sql-formatter 1.2.17-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 432 kB
  • ctags: 298
  • sloc: php: 924; sql: 221; makefile: 17
file content (58 lines) | stat: -rw-r--r-- 1,710 bytes parent folder | download | duplicates (2)
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
From: =?utf-8?q?David_Pr=C3=A9vot?= <david@tilapin.org>
Date: Thu, 8 Jan 2015 06:54:11 -0400
Subject: Use homemade static autoload in examples and tests

---
 examples/cli.php           | 2 +-
 examples/examples.php      | 2 +-
 tests/SqlFormatterTest.php | 2 +-
 tests/performance.php      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/examples/cli.php b/examples/cli.php
index 17ee0e1..bfbae21 100644
--- a/examples/cli.php
+++ b/examples/cli.php
@@ -12,6 +12,6 @@ else {
 	$sql = stream_get_contents(fopen("php://stdin", "r"));
 }
 
-require_once(__DIR__.'/../lib/SqlFormatter.php');
+require_once('SqlFormatter/autoload.php');
 
 echo SqlFormatter::format($sql);
diff --git a/examples/examples.php b/examples/examples.php
index f54cfb0..22b0344 100644
--- a/examples/examples.php
+++ b/examples/examples.php
@@ -31,7 +31,7 @@
 <body>
 <?php
 
-require_once(__DIR__.'/../lib/SqlFormatter.php');
+require_once('SqlFormatter/autoload.php');
 
 // Example statements for formatting and highlighting
 $statements = array(
diff --git a/tests/SqlFormatterTest.php b/tests/SqlFormatterTest.php
index ca535cf..ac3a232 100644
--- a/tests/SqlFormatterTest.php
+++ b/tests/SqlFormatterTest.php
@@ -1,5 +1,5 @@
 <?php
-require __DIR__.'/../lib/SqlFormatter.php';
+require 'SqlFormatter/autoload.php';
 
 // Force SqlFormatter to run in non-CLI mode for tests
 SqlFormatter::$cli = false;
diff --git a/tests/performance.php b/tests/performance.php
index 6c9eb97..8e1e3d3 100644
--- a/tests/performance.php
+++ b/tests/performance.php
@@ -1,5 +1,5 @@
 <?php
-require '../lib/SqlFormatter.php';
+require 'SqlFormatter/autoload.php';
 
 //this is the default value
 //set to '0' to disable caching