Invenzzia »

Pages: [1]   Go Down
  Print  
Author Topic: OPTv2: Problem po wyłączeniu konsoli  (Read 484 times)
0 Members and 2 Guests are viewing this topic.
chordspl
User

Offline Offline

Posts: 2


View Profile
« on: June 15, 2011, 16:34:43 »

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:
Quote
Error 330 "ERR_CONTENT_DECODING_FAILED"

Firefox:
Quote
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

Code:
<?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);
}


Code:
<?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
« Last Edit: June 15, 2011, 16:38:21 by chordspl » Logged
megaweb
Invenzzia
User
*****
Offline Offline

Posts: 80


View Profile
« Reply #1 on: July 06, 2011, 13:20:23 »

Witaj!

Na początku - wybacz za bardzo długą odpowiedź. Dalej - domyślnie w OPT konsola debugowa jest wyłączona, spróbuj zakomentować kod dotyczący ustawiania konsoli debugowej.

Jak znajdę nieco więcej czasu to rzucę okiem do kodu (OPT 2.0?) i ew. dam znać co się dowiedziałem :)
Logged
chordspl
User

Offline Offline

Posts: 2


View Profile
« Reply #2 on: July 06, 2011, 13:31:08 »

Witam,

Sprawa jest już wyjaśniona. Przepraszam, bo mogłem wcześniej o tym napisać.

Przede wszystkim skorzystałem z najnowszej wersji 2.0.6 a po drugie zmieniłem ustawienia w kodzie

Code:
<?php 


// Load the libraries core and settings
require('../scripts/libs/Opl/Base.php'); 
Opl_Loader::setDirectory('../scripts/libs/');
Opl_Loader::register(); 
Opl_Registry::setState('opl_debug_console'DEBUG_CONSOLE);  // stala DEBUG_CONSOLE=false


try
{
// .....
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Subject Started by Replies Views Last post
OPTv2: OPT 2.0.0 « 1 2 3 » Zyx 42 8401 Last post March 25, 2009, 21:31:09
by Zyx
abercrombie and fitch, galardef 0 64 Last post March 28, 2012, 12:03:29
by galardef
abercrombie italia, and held several meetings galardef 0 18 Last post April 18, 2012, 04:46:59
by galardef
abercrombie sito ufficiale, on the one hand galardef 0 12 Last post April 18, 2012, 04:45:57
by galardef
OPTv2: Własne biblioteki znaczników deallas 1 484 Last post March 11, 2010, 12:13:59
by Zyx