Skip to content

Commit

Permalink
Start fleshing out improvements to the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jakejackson1 committed Dec 11, 2022
1 parent fe529ed commit 9bb11c4
Show file tree
Hide file tree
Showing 22 changed files with 225 additions and 472 deletions.
3 changes: 2 additions & 1 deletion examples/at_a_glance.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
require '../src/qp.php';
require_once __DIR__ . '/../vendor/autoload.php';

$xml = <<<EOF
<?xml version="1.0"?>
<table>
Expand Down
3 changes: 1 addition & 2 deletions examples/database_import.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/

require_once '../src/QueryPath/QueryPath.php';
require_once '../src/QueryPath/Extension/QPDB.php';
require_once __DIR__ . '/../vendor/autoload.php';

// Set the default database.
QPDB::baseDB('sqlite:../test/db/qpTest.db');
Expand Down
2 changes: 1 addition & 1 deletion examples/dbpedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @see musicbrainz.php
*/

require_once '../src/QueryPath/QueryPath.php';
require_once __DIR__ . '/../vendor/autoload.php';

// The URL to look up (any of these works):
$url = 'http://dbpedia.org/data/The_Beatles.rdf';
Expand Down
2 changes: 1 addition & 1 deletion examples/dirty_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
* @see http://www.urbandictionary.com/
*/
require_once '../src/QueryPath/QueryPath.php';
require_once __DIR__ . '/../vendor/autoload.php';

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

Expand Down
109 changes: 0 additions & 109 deletions examples/doc.html

This file was deleted.

108 changes: 0 additions & 108 deletions examples/doc.php

This file was deleted.

3 changes: 2 additions & 1 deletion examples/docx.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
* @see http://www.urbandictionary.com/
*/
require_once '../src/QueryPath/QueryPath.php';
require_once __DIR__ . '/../vendor/autoload.php';

$path = 'http://eabrand.com/images/test.docx';

//$path = 'docx_document.xml';
Expand Down
2 changes: 1 addition & 1 deletion examples/fetch_rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @author M Butcher <[email protected]>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
require_once '../src/QueryPath/QueryPath.php';
require_once __DIR__ . '/../vendor/autoload.php';

// The URL of the remote RSS feed.
$remote = 'http://querypath.org/aggregator/rss/2/rss.xml';
Expand Down
2 changes: 1 addition & 1 deletion examples/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/

require_once '../src/qp.php';
require_once __DIR__ . '/../vendor/autoload.php';

// Begin with an HTML stub document (XHTML, actually), and navigate to the title.
qp(QueryPath::HTML_STUB, 'title')
Expand Down
2 changes: 1 addition & 1 deletion examples/matching_text_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/** Include QueryPath. */
require_once '../src/QueryPath/QueryPath.php';
require_once __DIR__ . '/../vendor/autoload.php';

/**
* Check if the string 'Release' is in the text content of any matched nodes.
Expand Down
2 changes: 1 addition & 1 deletion examples/musicbrainz.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
* @see http://musicbrainz.org
*/
require_once '../src/QueryPath/QueryPath.php';
require_once __DIR__ . '/../vendor/autoload.php';

$artist_url = 'http://musicbrainz.org/ws/1/artist/?type=xml&name=u2';
$album_url = 'http://musicbrainz.org/ws/1/release/?type=xml&artistid=';
Expand Down
2 changes: 1 addition & 1 deletion examples/odt.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/** Include main QP library. */
require_once '../src/QueryPath/QueryPath.php';
require_once __DIR__ . '/../vendor/autoload.php';

// If you have the Zip lib combiled in:
//$file = 'zip://openoffice.odt#content';
Expand Down
Binary file modified examples/openoffice.odt
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/parse_php.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* @author M Butcher <[email protected]>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/

require_once __DIR__ . '/../vendor/autoload.php';
?>
<html>
<head>
<title>Parse PHP from QueryPath</title>
</head>
<body>
<?php
require '../src/QueryPath/QueryPath.php';

// Parse this file with QueryPath.
print qp(__FILE__, 'title')->text();
?>
Expand Down
Loading

0 comments on commit 9bb11c4

Please sign in to comment.