Example #1
0
<?php

// Load Nette Framework or autoloader generated by Composer
require dirname(__FILE__) . '/../libs/autoload.php';
ini_set('error_reporting', 1);
$configurator = new NConfigurator();
// Enable Nette Debugger for error visualisation & logging
//if ($_SERVER['HTTP_HOST'] == 'gis.drino.net' || $_SERVER['HTTP_HOST']=='gymfed.drino.net') {
$configurator->setDebugMode(TRUE);
$configurator->addParameters(array("environment" => 'development'));
//}
$configurator->enableDebugger(dirname(__FILE__) . '/../log');
// Specify folder for cache
$configurator->setTempDirectory(dirname(__FILE__) . '/../temp');
// Enable RobotLoader - this will load all classes automatically
$configurator->createRobotLoader()->addDirectory(dirname(__FILE__))->addDirectory(dirname(__FILE__) . '/../libs')->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(dirname(__FILE__) . '/config/config.neon');
$configurator->addConfig(dirname(__FILE__) . '/config/config.local.neon', NConfigurator::NONE);
// none section
$container = $configurator->createContainer();
//////////////////
function dd($var, $name = null)
{
    return NDebugger::barDump($var, $name);
}
/////////////////
// Nastavi priznak NRoute::SECURED, pokud prichazime pres HTTPS
//NRoute::$defaultFlags |= ($container->getService('httpRequest')->isSecured() ? NRoute::SECURED : 0);
//    if(preg_match('~.*\.drino\.net~', $_SERVER['HTTP_HOST'])) $domena = "gymfed.drino.net";
//    else $domena = "www.gymfed.cz";
Example #2
0
// absolute filesystem path to the web root
define('WWW_DIR', dirname(__FILE__) . '/');
// absolute filesystem path to the application root
define('APP_DIR', WWW_DIR . '../app');
// absolute filesystem path to the libraries
define('LIBS_DIR', WWW_DIR . '../vendor');
// absolute filesystem path to the temporary files
define('TEMP_DIR', APP_DIR . '/temp');
// absolute filesystem path to the temporary files
define('LOG_DIR', APP_DIR . '/log');
require LIBS_DIR . '/nette.min.php';
require LIBS_DIR . '/shortcuts.php';
// Configure application
$configurator = new NConfigurator();
$configurator->setProductionMode(false);
$configurator->enableDebugger(LOG_DIR);
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(TEMP_DIR);
$configurator->createRobotLoader()->addDirectory(LIBS_DIR)->addDirectory(APP_DIR)->register();
// Create Dependency Injection container from config.neon file
//$configurator->addConfig(APP_DIR . '/config/config.neon');
$configurator->addConfig(APP_DIR . '/config/config.db.neon');
$container = $configurator->createContainer();
function adminer_object()
{
    class AdminerSoftware extends Adminer
    {
        private $container;
        private $user;
        function __construct(SystemContainer $container)
        {