Exemplo n.º 1
0
<?php

error_reporting(E_ALL);
set_error_handler('error2exception', E_ALL);
function error2exception($errno, $errmsg)
{
    throw new Exception('This Error Happened ' . $errno . ': ' . $errmsg);
}
try {
    require '../library/Corto/ProxyServer.php';
    $server = new Corto_ProxyServer();
    require '../filters/DemoFilter.php';
    require '../filters/GoogleFilter.php';
    require '../filters/LiveAtEduFilter.php';
    $metadatafile = '../metadata/';
    preg_match("/^([^\\.]+)/", basename(__FILE__), $dollar);
    $instance = $dollar[1];
    $server->setMetadata($metadatafile, $instance, true);
    $server->setTemplatePath(dirname(__FILE__) . '/../templates/');
    /*
    * include standard modules
    */
    require '../library/Corto/Module/Services.php';
    $server->setServicesModule(new Corto_Module_Services($server));
    require '../library/Corto/Module/Bindings.php';
    $server->setBindingsModule(new Corto_Module_Bindings($server));
    require '../library/Corto/Log/Syslog.php';
    $server->setSystemLog(new Corto_Log_Syslog());
    /*
     * Handle requests/responses to Corto
     */
 public function renderTemplate($templateName, $vars = array(), $parentTemplates = array())
 {
     $renderedView = parent::renderTemplate($templateName, $vars, $parentTemplates);
     $layout = $this->layout();
     $layout->content = $renderedView;
     $renderedPage = $layout->render();
     return $renderedPage;
 }