Skip to content

Commit e9a04c3

Browse files
committed
Start fleshing out improvements to the examples
1 parent 4e7099c commit e9a04c3

22 files changed

Lines changed: 225 additions & 472 deletions

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 <matt@aleph-null.tv>
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.

0 commit comments

Comments
 (0)