Location: PHPKode > scripts > PAX > pax/index.php
<?php


/**
 * Page DocBlock definition
 * @package org.zadara.marius.pax
 */


/**
 * PAX example file.

 * @author Marius Zadara <hide@address.com>
 * @category Examples
 * @copyright (C) 2008-2009 Marius Zadara
 * @license Free for non-comercial use
 * @package org.zadara.marius.pax
 * @version 6.0
 * @since 5.0 
 */

// report any errors
error_reporting(E_ALL);

// add the PAX core and configuration
require_once 'core/_addCore.php';
require_once 'config.php';

// catch any exceptions
try 
{
    // instanciate PAX
	$pax = new PAX();
		
	// set all the PAX elements
	$pax->setPrerequisites($Prerequisites);
	$pax->setValidations($Validations);
	$pax->setDirectories($Directories);
	$pax->setFilenames($Filenames);
	$pax->setElements($Elements);
	$pax->setConfig($PAXConfig);
	$pax->setInstructions($Instructions);
	$pax->setVariables($Variables);
	
	// parse the file
	$pax->parseFile("example.xml");
}
catch (PAXException $pe)
{
    // if any PAX exception, 
    // display it
	echo $pe;
}
catch (Exception $e)
{
    // the same for general exception
	echo "Exception occured: " . $e->getMessage();
	$e->getTrace();
}


?>
Return current item: PAX