travis tests
[plcapi.git] / demo / client / _bootstrap.php
1 <?php
2 /**
3  * Hackish code used to make the demos both viewable as source, runnable, and viewable as html
4  */
5
6 if (isset($_GET['showSource']) && $_GET['showSource']) {
7     $file = debug_backtrace()[0]['file'];
8     highlight_file($file);
9     die();
10 }
11
12 // Make errors visible
13 ini_set('display_errors', true);
14 error_reporting(E_ALL);
15
16 // Use the custom class autoloader. These two lines not needed when the phpxmlrpc library is installed using Composer
17 include_once __DIR__ . '/../../src/Autoloader.php';
18 PhpXmlRpc\Autoloader::register();
19
20 // Let unit tests run against localhost, 'plain' demos against a known public server
21 if (isset($_SERVER['HTTPSERVER'])) {
22     define('XMLRPCSERVER', 'http://'.$_SERVER['HTTPSERVER'].'/demo/server/server.php');
23 } else {
24     define('XMLRPCSERVER', 'http://phpxmlrpc.sourceforge.net/server.php');
25 }