Witam,
Przede wszystkim dzięki za świetną bibliotekę :-)
Przygotowałem projekt i chcę go wdrożyć online. No i chciałem wyłączyć konsolę. Niestety strona nie jest wówczas wyświetlana. Generują się skompilowane kody template'ów.
Chrome:
Error 330 "ERR_CONTENT_DECODING_FAILED"
Firefox:
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
<?php
// Load the libraries core
require('../scripts/libs/opl/Base.php');
spl_autoload_register(array('Opl_Loader', 'OPLautoload'));
$library_opl = array('directory' => '../scripts/libs/opl', 'basePath' => '../scripts/libs/opl');
$library_opt = array('directory' => '../scripts/libs/opt', 'basePath' => '../scripts/libs/opt');
Opl_Loader::addLibrary('Opl', $library_opl);
Opl_Loader::addLibrary('Opt', $library_opt);
Opl_Registry::setState('opl_debug_console', false); // false -> nie dziala; true -> dziala
try
{
$tpl = new Opt_Class;
$tpl->sourceDir = '../scripts/opt_templates/';
$tpl->compileDir = '../scripts/opt_templates_c/';
$tpl->setup();
$view = new Opt_View('layout.tpl');
// Zmienne naglowka strony i usera
require_once("../scripts/app_include/opt-view-variables.inc.php");
// Add a template variable
$viewModule = new Opt_View('main/glowna.tpl');
$viewModule->comment = $comment;
//zlaczenie wydokow
$view->module = $viewModule;
$output = new Opt_Output_Http;
$output->setContentType(Opt_Output_Http::XHTML, 'iso-8859-2');
$output->render($view);
}
catch(Opt_Exception $exception)
{
// Use the standard error handler to display exceptions
$handler = new Opt_ErrorHandler;
$handler->display($exception);
}
<?xml version="1.0" standalone="yes" encoding="iso-8859-2"?>
<opt:root>
<opt:prolog standalone="yes"/>
<opt:dtd template="html4"/>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-2" />
<meta http-equiv="Content-Language" content="pl" />
<meta name="Robots" content="all" />
<meta name="Description" parse:content="$global.Page.Description" />
<meta name="Keywords" parse:content="$global.Page.Keywords" />
<title>{$global.Page.Title}</title>
<script type="text/javascript">
<opt:literal type="comment_cdata">
<![CDATA[
var _gaq = _gaq || [];
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
]]>
</opt:literal>
</script>
</head>
<body>
<div id="c">
<div id="content">
<opt:include view="$module">
<p>Sorry, nie wiem co pokazać :[</p>
</opt:include>
</div>
</div>
</body>
</html>
</opt:root>
Proszę o pomoc, bo już nie wiem co sprawdzać.
Pozdrawiam,
Tomek