\n";
print_r($val);
echo "\n";
}
error_reporting(E_ALL);
require_once 'Savant2.php';
$conf = array(
'template_path' => 'templates',
'resource_path' => 'resources'
);
$savant = new Savant2($conf);
echo "
Paths to begin with
\n";
preprint($savant->getPath('resource'));
preprint($savant->getPath('template'));
echo "Add a path
\n";
$savant->addPath('resource', 'no/such/path');
preprint($savant->getPath('resource'));
echo "Find an existing resource (non-default)
\n";
$file = $savant->findFile('resource', 'Savant2_Plugin_cycle.php');
preprint($file);
echo "Find an existing resource (default)
\n";
$file = $savant->findFile('resource', 'Savant2_Plugin_input.php');
preprint($file);
echo "Find a non-existent template
\n";
$file = $savant->findFile('template', 'no_such_template.tpl.php');
if ($file) {
preprint($file);
} else {
preprint("false or null");
}
?>