<?php
/** * @author Jakub Kuritka <jakub.kuritka@outlook.com> * @copyright (c) 2012, Jakub Kuritka * @license LGPL */
define("JUI_DIR", dirname(__FILE__)); define("JUI_RESOURCES_FILE", dirname(dirname(__FILE__)) . "/Resources/resources.yaml");
/* * Set it true while developing, otherwise set false, * because autoloader will generate class map everytime you run your appliaction */ define("JUI_REGENERATE_CLASS_MAP", true);
/* * If you have your own autoloader, comment this line */ require_once JUI_DIR . "/Autoloader/OPLAutoloader.php";
/* * Create parser and Serializer * Visit JUI/Engine/Serializers dir for more serializers */ $serializer = new \JUI\Engine\Serializers\Yaml();
$parser = new \JUI\Engine\Parser(); $parser->setSerializer($serializer);
/* * Create resources */ $resources = new \JUI\Resources(); $resources->setParser($parser); //for components parsing $resources->setSerializer($serializer); //for reading resources file $resources->setFile(JUI_RESOURCES_FILE);//it will set file and automatically parse, so you have to set parser before calling this method.
/* * Every component can acess resources calling $this->resources() method */ \JUI\Components\Component::setResources($resources);
?>
|