Skip to content

Commit 9bb11c4

Browse files
committed
Start fleshing out improvements to the examples
1 parent fe529ed commit 9bb11c4

22 files changed

+225
-472
lines changed

examples/at_a_glance.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
2-
require '../src/qp.php';
2+
require_once __DIR__ . '/../vendor/autoload.php';
3+
34
$xml = <<<EOF
45
<?xml version="1.0"?>
56
<table>

examples/database_import.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
88
*/
99

10-
require_once '../src/QueryPath/QueryPath.php';
11-
require_once '../src/QueryPath/Extension/QPDB.php';
10+
require_once __DIR__ . '/../vendor/autoload.php';
1211

1312
// Set the default database.
1413
QPDB::baseDB('sqlite:../test/db/qpTest.db');

examples/dbpedia.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* @see musicbrainz.php
2626
*/
2727

28-
require_once '../src/QueryPath/QueryPath.php';
28+
require_once __DIR__ . '/../vendor/autoload.php';
2929

3030
// The URL to look up (any of these works):
3131
$url = 'http://dbpedia.org/data/The_Beatles.rdf';

examples/dirty_html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
88
* @see http://www.urbandictionary.com/
99
*/
10-
require_once '../src/QueryPath/QueryPath.php';
10+
require_once __DIR__ . '/../vendor/autoload.php';
1111

1212
print '<h3>Urban Dictionary Random Word Generator</h3>';
1313

examples/doc.html

Lines changed: 0 additions & 109 deletions
This file was deleted.

examples/doc.php

Lines changed: 0 additions & 108 deletions
This file was deleted.

examples/docx.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
1010
* @see http://www.urbandictionary.com/
1111
*/
12-
require_once '../src/QueryPath/QueryPath.php';
12+
require_once __DIR__ . '/../vendor/autoload.php';
13+
1314
$path = 'http://eabrand.com/images/test.docx';
1415

1516
//$path = 'docx_document.xml';

examples/fetch_rss.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @author M Butcher <[email protected]>
1616
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
1717
*/
18-
require_once '../src/QueryPath/QueryPath.php';
18+
require_once __DIR__ . '/../vendor/autoload.php';
1919

2020
// The URL of the remote RSS feed.
2121
$remote = 'http://querypath.org/aggregator/rss/2/rss.xml';

examples/html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
1717
*/
1818

19-
require_once '../src/qp.php';
19+
require_once __DIR__ . '/../vendor/autoload.php';
2020

2121
// Begin with an HTML stub document (XHTML, actually), and navigate to the title.
2222
qp(QueryPath::HTML_STUB, 'title')

examples/matching_text_content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/** Include QueryPath. */
21-
require_once '../src/QueryPath/QueryPath.php';
21+
require_once __DIR__ . '/../vendor/autoload.php';
2222

2323
/**
2424
* Check if the string 'Release' is in the text content of any matched nodes.

examples/musicbrainz.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
1616
* @see http://musicbrainz.org
1717
*/
18-
require_once '../src/QueryPath/QueryPath.php';
18+
require_once __DIR__ . '/../vendor/autoload.php';
1919

2020
$artist_url = 'http://musicbrainz.org/ws/1/artist/?type=xml&name=u2';
2121
$album_url = 'http://musicbrainz.org/ws/1/release/?type=xml&artistid=';

examples/odt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/** Include main QP library. */
21-
require_once '../src/QueryPath/QueryPath.php';
21+
require_once __DIR__ . '/../vendor/autoload.php';
2222

2323
// If you have the Zip lib combiled in:
2424
//$file = 'zip://openoffice.odt#content';

examples/openoffice.odt

-9.79 KB
Binary file not shown.

examples/parse_php.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
* @author M Butcher <[email protected]>
1515
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
1616
*/
17+
18+
require_once __DIR__ . '/../vendor/autoload.php';
1719
?>
1820
<html>
1921
<head>
2022
<title>Parse PHP from QueryPath</title>
2123
</head>
2224
<body>
2325
<?php
24-
require '../src/QueryPath/QueryPath.php';
25-
2626
// Parse this file with QueryPath.
2727
print qp(__FILE__, 'title')->text();
2828
?>

0 commit comments

Comments
 (0)