mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-29 01:59:19 +01:00
232252475f
Patch is mostly created by script in egroupware/doc/fix_depricated.php in separate commit. I do NOT advice to apply this patch to a production system (it's commited to trunk!), as the automatic modified regular expressions have a good change to break something ...
52 lines
1.0 KiB
PHP
Executable File
52 lines
1.0 KiB
PHP
Executable File
<?php
|
|
|
|
/**
|
|
*
|
|
* Tests multiple-path directory searches
|
|
*
|
|
* @version $Id$
|
|
*
|
|
*/
|
|
|
|
function preprint($val)
|
|
{
|
|
echo "<pre>\n";
|
|
print_r($val);
|
|
echo "</pre>\n";
|
|
}
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
require_once 'Savant2.php';
|
|
|
|
$conf = array(
|
|
'template_path' => 'templates',
|
|
'resource_path' => 'resources'
|
|
);
|
|
|
|
$savant = new Savant2($conf);
|
|
|
|
echo "<h1>Paths to begin with</h1>\n";
|
|
preprint($savant->getPath('resource'));
|
|
preprint($savant->getPath('template'));
|
|
|
|
echo "<h1>Add a path</h1>\n";
|
|
$savant->addPath('resource', 'no/such/path');
|
|
preprint($savant->getPath('resource'));
|
|
|
|
echo "<h1>Find an existing resource (non-default)</h1>\n";
|
|
$file = $savant->findFile('resource', 'Savant2_Plugin_cycle.php');
|
|
preprint($file);
|
|
|
|
echo "<h1>Find an existing resource (default)</h1>\n";
|
|
$file = $savant->findFile('resource', 'Savant2_Plugin_input.php');
|
|
preprint($file);
|
|
|
|
echo "<h1>Find a non-existent template</h1>\n";
|
|
$file = $savant->findFile('template', 'no_such_template.tpl.php');
|
|
if ($file) {
|
|
preprint($file);
|
|
} else {
|
|
preprint("false or null");
|
|
}
|
|
?>
|