<?php
/*
 * created on 11.3.2007
 * project: zend-hello-world
 * author: vlasta
 * version: $
 */
session_start();

set_include_path(get_include_path() . PATH_SEPARATOR . $root . '../library');
set_include_path(get_include_path() . PATH_SEPARATOR . $root . '../app');

require_once 'Zend.php';

// naloadovani konfigurace ze souboru
Zend :: loadClass('Zend_Config_Ini');
$config = new Zend_Config_Ini('../config/zend.ini', 'all');
Zend :: register('config', $config);

// inicializace a nastaveni front controlleru
Zend :: loadClass('Zend_Controller_Front');
$controller = Zend_Controller_Front :: getInstance();
$controller->setControllerDirectory("../app/web/controllers/");
$controller->throwExceptions(true);

// naloadovani cest z konfigurace
Zend :: loadClass('Zend_Controller_Router_Rewrite');
$router = new Zend_Controller_Router_Rewrite();
$router->addConfig($config, 'routes');

$controller->setRouter($router);

// inicializace a konfigurace view
Zend :: loadClass('Zend_View');
$view = new Zend_View();
$view->setScriptPath('../app/view/php/');
Zend :: register('view', $view);

// inicializace testovaciho servisniho objektu
require_once('business/service/ArticleService.php');
$articleService = new ArticleService();
Zend :: register('articleService', $articleService);

// dispatchnuti requestu
$controller->dispatch();
?>