Exemple #1
0
<?php

/**
 * GE3 Installer 
 * 
 * @author  Michal Mikoláš
 * @version 0.0.1   
 **/
// Nette
require_once '../Nette/loader.php';
NDebug::enable(NDebug::DEVELOPMENT);
define('APP_DIR', '../Nette');
require_once '../Nette/dibi.php';
// Config
if (file_exists("../config.php/default.conf.php")) {
    include "../config.php/default.conf.php";
}
$CONF =& $GLOBALS["config"];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  
  <link rel="stylesheet" type="text/css" media="screen" href="style.css" />
  <link rel="stylesheet" type="text/css" href="nifty.css">
  <script type="text/javascript" src="nifty2.js"></script>   
  
  <title>GE3 Installer</title>
</head>
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<h1>Nette\Debug & Variables | dibi</h1>

<p>Dibi can dump variables via Nette\Debug, part of Nette Framework.</p>

<ul>
	<li>Nette Framework: http://nette.org
</ul>

<?php 
require_once 'Nette/Debug.php';
require_once '../dibi/dibi.php';
// enable NDebug
NDebug::enable();
dibi::connect(array('driver' => 'sqlite', 'database' => 'data/sample.sdb', 'profiler' => array('run' => TRUE)));
NDebug::barDump(dibi::fetchAll('SELECT * FROM customers WHERE customer_id < %i', 38), '[customers]');
Exemple #3
0
<?php

/**
 * My NApplication bootstrap file.
 *
 * @copyright  Copyright (c) 2010 John Doe
 * @package    MyApplication
 */
// Step 1: Load Nette Framework
// this allows load Nette Framework classes automatically so that
// you don't have to litter your code with 'require' statements
require LIBS_DIR . '/Nette/loader.php';
// Step 2: Configure environment
// 2a) enable NDebug for better exception and error visualisation
NDebug::enable(NDebug::DETECT, APP_DIR . '/log/php_error.log', '*****@*****.**');
NEnvironment::getHttpResponse()->enableCompression();
// Load dibi
dibi::connect(NEnvironment::getConfig('database'));
dibi::addSubst('graweb', 'gw2010__');
// Step 3: Configure application
NEnvironment::setVariable("sizes", array(0 => array(880, 330), 1 => array(263, 174), 2 => array(600, 510)));
// 3a) get and setup a front controller
$application = NEnvironment::getApplication();
$application->errorPresenter = 'Front:Error';
$application->catchExceptions = TRUE;
// Step 4: Setup application router
$router = $application->getRouter();
$router[] = new NRoute('index.php', array('module' => 'Front', 'presenter' => 'Default'), NRoute::ONE_WAY);
$router[] = new NRoute('', array('module' => 'Front', 'presenter' => 'Default', 'action' => 'default'));
// Presmerovani starych URL
$router[] = new NRoute('internet/<? ceny|postup|sluzby|vyroba>', array('module' => 'Front', 'presenter' => 'Page', 'action' => 'webdesign'), NRoute::ONE_WAY);