Beispiel #1
0
 private function prepareContainer($class, $configFiles)
 {
     $tempDir = __DIR__ . '/../temp';
     foreach (Finder::findFiles('*')->exclude('.gitignore')->from($tempDir . '/cache') as $file) {
         unlink((string) $file);
     }
     $configurator = new \Nette\Config\Configurator();
     $configurator->setTempDirectory($tempDir);
     foreach ($configFiles as $file) {
         $configurator->addConfig($file, FALSE);
     }
     $configurator->addParameters(array('fixturesDir' => __DIR__ . '/../fixtures', 'tempDir' => $tempDir, 'container' => array('class' => $class)));
     $extension = new \WebLoader\Nette\Extension();
     $extension->install($configurator);
     $this->container = $configurator->createContainer();
 }
Beispiel #2
0
 /**
  * @return \TestPresenter
  */
 private function createPresenter()
 {
     $url = new \Nette\Http\UrlScript('http://localhost/');
     $url->setScriptPath('/');
     $configurator = new \Nette\Config\Configurator();
     $configurator->addConfig(__DIR__ . '/config.neon');
     \Nella\Doctrine\Config\Extension::register($configurator);
     $container = $configurator->setTempDirectory(TEMP_DIR)->createContainer();
     $container->removeService('httpRequest');
     $container->addService('httpRequest', new \Nette\Http\Request($url));
     $application = $container->getService('application');
     $application->router[] = new \Nette\Application\Routers\SimpleRouter();
     $presenter = new TestPresenter($container);
     $presenter->invalidLinkMode = $presenter::INVALID_LINK_WARNING;
     $presenter->autoCanonicalize = FALSE;
     return $presenter;
 }
<?php

/**
 * My Application bootstrap file.
 */
use Nette\Application\Routers\Route;
// Load Nette Framework
require LIBS_DIR . '/autoload.php';
// Configure application
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
$configurator->setDebugMode($configurator::AUTO);
$configurator->enableDebugger(__DIR__ . '/../log');
\Nette\Diagnostics\Debugger::$email = 'no-reply@***.cz';
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(APP_DIR)->register();
\Nella\Console\Config\Extension::register($configurator);
\Nella\Doctrine\Config\Extension::register($configurator);
\Nella\Doctrine\Config\MigrationsExtension::register($configurator);
\Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace('JMS\\Serializer\\Annotation', LIBS_DIR . "/jms/serializer/src");
Kdyby\Replicator\Container::register();
if (CLIDatabaseRemoteSync::isCLI() && !CLIDatabaseRemoteSync::syncWithRemoteDatabase()) {
    $configurator->addConfig(__DIR__ . '/config/config.neon', "development");
    $configurator->setProductionMode(FALSE);
    $configurator->setDebugMode(TRUE);
} else {
    $configurator->addConfig(__DIR__ . '/config/config.neon');
}
// Create Dependency Injection container from config.neon file
$container = $configurator->createContainer();
Beispiel #4
0
{
    // kinda shitty logic to avoid a PHP notice (Undefined index: path)
    if (!isset($_GET['path']) && $path == '') {
        return ' class="active"';
    }
    if (!isset($_GET['path']) && $path != '') {
        return false;
    }
    if ($_GET['path'] == $path) {
        return ' class="active"';
    }
    return false;
}
require './lib/nette.min.php';
require './lib/Kdyby/BootstrapFormRenderer/BootstrapRenderer.php';
$configurator = new Nette\Config\Configurator();
$configurator->setTempDirectory(__DIR__ . '/tmp');
$configurator->setDebugMode();
$configurator->enableDebugger(__DIR__ . "/tmp");
require './db.php';
require './func.php';
// nette things
// how to set up sessions the most complicated way
$container = $configurator->createContainer();
$session = $container->session;
$user = $container->user;
$s = $session->getSection('logs-db');
?>
<!DOCTYPE html>
<html lang="en">
  <head>
<?php

/**
 * My Application bootstrap file.
 */
use Nette\Diagnostics\Debugger, Nette\Application\Routers\Route;
// Load Nette Framework
require LIBS_DIR . '/Nette/loader.php';
// Enable Nette Debugger for error visualisation & logging
Debugger::$logDirectory = __DIR__ . '/../log';
Debugger::$strictMode = TRUE;
Debugger::enable();
// Configure application
$configurator = new Nette\Config\Configurator();
$configurator->setTempDirectory(__DIR__ . '/../temp');
// Enable RobotLoader - this will load all classes automatically
$configurator->createRobotLoader()->addDirectory(APP_DIR)->addDirectory(LIBS_DIR)->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();
// Opens already started session
if ($container->session->exists()) {
    $container->session->start();
}
// Setup router
$router = $container->router;
if (MobileDetection::isMobile()) {
    // mobile routing
    $router[] = new Route('index.php', 'Mobile:Homepage:default', Route::ONE_WAY);
    $router[] = new Route('<presenter>/<action>[/<id>]', 'Mobile:Homepage:default');
} else {
Beispiel #6
0
<?php

require WWW_DIR . '/../libs/autoload.php';
$configurator = new Nette\Config\Configurator();
$debugMode = file_exists(__DIR__ . '/dev');
$configurator->setDebugMode($debugMode);
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(APP_DIR)->register();
$webloaderExtension = new \WebLoader\Nette\Extension();
$webloaderExtension->install($configurator);
$configurator->addConfig(__DIR__ . '/config/config.neon', FALSE);
$configurator->addConfig(__DIR__ . '/config/config.local.neon', FALSE);
$container = $configurator->createContainer();
$container->application->errorPresenter = 'Error';
$container->application->catchExceptions = !$debugMode;
if (!defined('CANCEL_START_APP')) {
    $container->application->run();
}
Beispiel #7
0
<?php

/**
 * Nannou
 *
 * Copyright (c) 2008, 2009 Lukáš Hroch (http://soundake.info)
 *
 *
 * @copyright  Copyright (c) 2008, 2009 Lukáš Hroch
 * @category   Nannou
 * @package    Nannou
 * @version    $Id: file.php 49 2009-02-27 14:55:11Z soundake $
 */
require LIBS_DIR . '/Nette/loader.php';
// Configure application
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
$configurator->setProductionMode(false);
$configurator->enableDebugger(__DIR__ . '/../../log', "*****@*****.**");
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../../temp');
$configurator->createRobotLoader()->addDirectory(LIBS_DIR)->addDirectory(APP_DIR)->register();
// Create Dependency Injection container from config.neon file
//$configurator->addConfig(__DIR__ . '/../config/config.neon');
$configurator->addConfig(__DIR__ . '/../config/config.neon', $configurator::DEVELOPMENT);
$container = $configurator->createContainer();
dibi::connect($container->parameters['database']);
$key = (string) $_REQUEST['key'];
$res = dibi::query("SELECT * FROM [file] WHERE [file.code] = %s", $key)->fetch();
$sourcepath = FILESTORAGE_DIR . '/' . $res['filepath'];
$fn = $res['orig_name'];
Beispiel #8
0
<?php

// Load Nette Framework or autoloader generated by Composer
require __DIR__ . '/../vendor/autoload.php';
// Base dirs
$logDir = __DIR__ . "/../log";
$tempDir = __DIR__ . "/../temp";
// Deployment center
$deploy = new DeployCenter\Application($logDir, $tempDir, "123");
# modify password!
$deploy->register("debug")->checkMaintenance();
// Create Nette Configurator
$configurator = new \Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
//$configurator->setDebugMode(TRUE);
if (PHP_SAPI === "cli") {
    $configurator->setDebugMode(TRUE);
    $configurator->addParameters(array("environment" => $configurator::DEVELOPMENT));
}
$configurator->enableDebugger($logDir);
// Specify folder for cache
$configurator->setTempDirectory($tempDir);
// Enable RobotLoader - this will load all classes automatically
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../vendor/others')->addDirectory($tempDir . "/proxies")->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon', $configurator::NONE);
// ModulesInstaller
$modulesInstaller = new \Flame\Modules\ModulesInstaller(new \Flame\Modules\DI\ConfiguratorHelper($configurator));
$modulesInstaller->addConfig(new \Flame\Modules\Config\NeonConfigFile(__DIR__ . "/config/config.neon", $tempDir . "/cache"));
$modulesInstaller->register();
Beispiel #9
0
<?php

/**
 * My Application bootstrap file.
 */
use Nette\Application\Routers\Route;
// Load Nette Framework
require LIBS_DIR . '/Nette/loader.php';
// Configure application
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
$configurator->setProductionMode('78.45.222.206, 90.182.141.34');
$configurator->enableDebugger(__DIR__ . '/../log');
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(APP_DIR)->addDirectory(LIBS_DIR)->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config.neon');
$container = $configurator->createContainer();
// Setup router
$container->router[] = new Route('uvod', 'Samanka:domu', Route::ONE_WAY);
$container->router[] = new Route('<action>', 'Samanka:domu');
// Configure and run the application!
$container->application->run();
Beispiel #10
0
<?php

/**
 * My Application bootstrap file.
 */
use Nette\Application\Routers\Route;
// Load Nette Framework or autoloader generated by Composer
require LIBS_DIR . '/lessc.inc.php';
require LIBS_DIR . '/autoload.php';
// Configure application
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
$configurator->setDebugMode(Nette\Config\Configurator::DEVELOPMENT);
//$configurator->setDebugMode($configurator::NONE);
$configurator->enableDebugger(__DIR__ . '/../log');
//\Nette\Diagnostics\Debugger::enable(\Nette\Diagnostics\Debugger::DEVELOPMENT);
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(APP_DIR)->addDirectory(LIBS_DIR)->register();
$configurator->onCompile[] = function ($configurator, $compiler) {
    $compiler->addExtension('ajax', new VojtechDobes\NetteAjax\Extension());
};
$webloaderExtension = new \WebLoader\Nette\Extension();
$webloaderExtension->install($configurator);
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();
//Vodacek\Forms\Controls\DateInput::register();
Nette\Forms\Container::extensionMethod('addDatePicker', function (Nette\Forms\Container $container, $name, $label = NULL) {
    return $container[$name] = new JanTvrdik\Components\DatePicker($label);
});
Beispiel #11
0
<?php

define('LIBS_DIR', __DIR__ . '/../libs');
define('TMP_DIR', __DIR__ . '/../temp');
require LIBS_DIR . '/autoload.php';
// Configure application
$configurator = new Nette\Config\Configurator();
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(TMP_DIR);
$configurator->createRobotLoader()->addDirectory(__DIR__ . '/../src')->register();
\Nette\Diagnostics\Debugger::enable(false);
\Nette\Diagnostics\Debugger::$strictMode = true;
<?php

/**
 * My Application bootstrap file.
 */
use Nette\Application\Routers\Route;
// Load Nette Framework
define('VENDORS_DIR', __DIR__ . '/../vendor');
require_once VENDORS_DIR . '/nette/nette/Nette/loader.php';
require_once VENDORS_DIR . '/autoload.php';
// Configure application
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
//$configurator->setProductionMode($configurator::AUTO);
$configurator->enableDebugger(__DIR__ . '/../log');
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(APP_DIR)->addDirectory(LIBS_DIR)->register();
$configurator->addParameters(array('libsDir' => LIBS_DIR));
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->onCompile[] = function ($configurator, $compiler) {
    $compiler->addExtension('documentManagerExtension', new \Extensions\DocumentManagerExtension());
    $compiler->addExtension('appCommands', new \Extensions\AppCommandsExtension());
    $compiler->addExtension('doctrineODMCommands', new \Extensions\DoctrineODMCommandsExtension());
    $compiler->addExtension('consoleApp', new \Extensions\ConsoleExtension());
};
$container = $configurator->createContainer();
if (PHP_SAPI === 'cli') {
    $container->console->run();
} else {
<?php

/**
 * My Application bootstrap file.
 */
use Nette\Application\Routers\Route, Nette\Application\Routers\SimpleRouter;
// Load Nette Framework
require LIBS_DIR . '/Nette.min.php';
//require LIBS_DIR . '/Nette/loader.php';
// Configure application
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
//$configurator->setDebugMode($configurator::AUTO);
$configurator->enableDebugger(Nette\Diagnostics\Debugger::PRODUCTION, __DIR__ . '/../log');
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(APP_DIR)->addDirectory(LIBS_DIR)->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();
// Setup router
$container->router = new SimpleRouter('Say:hello');
// Configure and run the application!
$container->application->run();
Beispiel #14
0
<?php

/* version Virgin1 */
use Nette\Diagnostics\Debugger, Nette\Application\Routers\Route, Nette\Application\Routers\RouteList, Nette\Application\Routers\SimpleRouter;
//use MultipleFileUpload;
//ini_set('max_execution_time', 6);
// Load Nette Framework
require LIBS_DIR . '/autoload.php';
// Configure application
$configurator = new Nette\Config\Configurator();
//$configurator->onCompile[] = function ($configurator, $compiler) {
//    $compiler->addExtension('gettextTranslator', new GettextTranslator\DI\Extension);
//};
// Enable Nette Debugger for error visualisation & logging
$configurator->setDebugMode();
$configurator->enableDebugger(__DIR__ . '/../log');
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(APP_DIR)->register();
//Extras\Debug\ComponentTreePanel::register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(CONFIG_DIR . '/config.neon');
//$configurator->addConfig(CONFIG_DIR . '/config2.neon');
$loader = new Nette\Config\Loader();
$serverName = $_SERVER['SERVER_NAME'];
//dump($serverName);
//die();
$selectedModuleNs = NULL;
$selectedHost = NULL;
$selectedProjectPath = NULL;
$selectedFile = NULL;
Beispiel #15
0
<?php

// Load Nette Framework or autoloader generated by Composer
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../libs/extensions.php';
umask(0);
mb_internal_encoding('UTF-8');
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
$configurator->setDebugMode(FALSE);
$configurator->enableDebugger(__DIR__ . '/../log');
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../libs')->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon', 'production');
$container = $configurator->createContainer();
return $container;
<?php

require __DIR__ . '/../libs/autoload.php';
if (!class_exists('Tester\\Assert')) {
    echo "Install Nette Tester using `composer update --dev`\n";
    exit(1);
}
Tester\Environment::setup();
function id($val)
{
    return $val;
}
$configurator = new Nette\Config\Configurator();
$configurator->setDebugMode(FALSE);
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__ . '/../app')->register();
$configurator->addConfig(__DIR__ . '/../app/config/config.neon');
$configurator->addConfig(__DIR__ . '/../app/config/config.local.neon', $configurator::NONE);
// none section
return $configurator->createContainer();
Beispiel #17
0
define('WWW_DIR', __DIR__);
define('FILES_DIR', __DIR__ . '/file');
function sanitizePath($path)
{
    $path = preg_replace('~(\\.\\.)+~', '', $path);
    // This is not necessary
    $path = preg_replace('~/+~', '', $path);
    return $path;
}
// Load libraries
require LIBS_DIR . '/Nette/loader.php';
// Enable Nette Debugger for error visualisation & logging
Debugger::$logDirectory = __DIR__ . '/log';
Debugger::enable();
// Configure application
$configurator = new Nette\Config\Configurator();
$configurator->setTempDirectory(__DIR__ . '/temp');
$container = $configurator->createContainer();
// Setup router
// Homepage and about
$container->router[] = new Route('<page (|about)>', function ($presenter, $page) {
    $page = $page ?: 'default';
    return $presenter->createTemplate()->setFile(__DIR__ . '/app/' . $page . '.latte');
});
$container->router[] = new Route('process', function ($presenter) {
    require __DIR__ . '/app/PngCompressor.php';
    /* Accept input */
    // Never trust user input
    $filename = trim($_SERVER['HTTP_X_FILE_NAME']);
    $filename = sanitizePath($filename);
    $filepath = FILES_DIR . '/' . $filename;
Beispiel #18
0
<?php

/**
 * This file is part of the Taco Library (http://dev.taco-beru.name)
 *
 * Copyright (c) 2004, 2011 Martin Takáč (http://martin.takac.name)
 *
 * For the full copyright and license information, please view
 * the file license.txt that was distributed with this source code.
 *
 * PHP version 5.3
 */
use Nette\Application\Routers\Route, Nette\Application\Routers\SimpleRouter;
// Load Composer
require_once VENDORS_DIR . '/autoload.php';
// Configure application
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
Nette\Diagnostics\Debugger::$maxDepth = 5;
// hloubka zanorení polí
Nette\Diagnostics\Debugger::$maxLen = 1000;
// maximální délka retezce
$configurator->enableDebugger(__DIR__ . '/../../var/logs');
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../../temp');
$configurator->createRobotLoader()->addDirectory(LIBS_DIR)->addDirectory(__DIR__)->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config.neon');
$container = $configurator->createContainer();
// Run the application!
$container->application->run();
Beispiel #19
0
<?php

/**
 * Homepage presenter.
 *
 * @author     Martin Bubik
 * @package    Spektral.cz
 */
use Nette\Application\Routers\Route;
// Load Nette Framework
require LIBS_DIR . '/Nette/loader.php';
setlocale(LC_ALL, "cs_CZ.UTF-8");
// Configure application
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
$configurator->setProductionMode('217.30.64.190, 80.188.94.196');
//$configurator->setProductionMode(true);
$configurator->enableDebugger(__DIR__ . '/../log');
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(APP_DIR)->addDirectory(LIBS_DIR)->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config.neon');
$container = $configurator->createContainer();
// Setup router
$container->router[] = new Route('index.php', 'Web:domu', Route::ONE_WAY);
$container->router[] = new Route('[<action>]', 'Web:domu');
// Configure and run the application!
$container->application->run();
Beispiel #20
0
<?php

use Nette\Application\Routers\Route;
// Load libraries
require __DIR__ . '/app/libs/nette.min.php';
require __DIR__ . '/app/libs/feed.class.php';
require __DIR__ . '/app/libs/twitter.class.php';
require __DIR__ . '/app/libs/texy.min.php';
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
$configurator->enableDebugger(__DIR__ . '/app/log');
// Configure libraries
Twitter::$cacheDir = Feed::$cacheDir = __DIR__ . '/app/temp/cache';
$configurator->setTempDirectory(__DIR__ . '/app/temp');
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/app/config.neon');
$container = $configurator->createContainer();
// Setup routes
// http://davidgrudl.com/[cs|en]
$container->router[] = new Route('[<lang (?-i)cs|en>]', function ($presenter, $lang) use($container) {
    if (!$lang) {
        $lang = $container->httpRequest->detectLanguage(array('en', 'cs')) ?: 'cs';
        return $presenter->redirectUrl($lang);
    }
    // create template
    $template = $presenter->createTemplate()->setFile(__DIR__ . '/app/' . $lang . '.latte');
    // register template helpers like {$foo|date}
    $template->registerHelper('date', function ($date) use($lang) {
        if ($lang === 'en') {
            return date('F j, Y', (int) $date);
        } else {
Beispiel #21
0
<?php

// Load Nette Framework or autoloader generated by Composer
require __DIR__ . '/../libs/autoload.php';
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
//$configurator->setDebugMode(TRUE);
$configurator->enableDebugger(__DIR__ . '/../log');
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../libs')->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon', $configurator::NONE);
// none section
$container = $configurator->createContainer();
return $container;
<?php

require __DIR__ . '/../libs/autoload.php';
if (!class_exists('Tester\\Assert')) {
    echo "Install Nette Tester using `composer update --dev`\n";
    exit(1);
}
Tester\Helpers::setup();
if (extension_loaded('xdebug')) {
    xdebug_disable();
    Tester\CodeCoverage\Collector::start(__DIR__ . '/coverage.dat');
}
function id($val)
{
    return $val;
}
$configurator = new Nette\Config\Configurator();
$configurator->setDebugMode(FALSE);
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__ . '/../EventCalendar')->register();
return $configurator->createContainer();
Beispiel #23
0
<?php

require __DIR__ . '/../../vendor/autoload.php';
// Configure application
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
$configurator->setProductionMode(false);
$configurator->enableDebugger();
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../../temp');
$configurator->createRobotLoader()->addDirectory(APP_DIR)->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/../config/config.neon');
$container = $configurator->createContainer();
$new = $old = array("driver" => "mysql", "host" => "localhost", "username" => "root", "password" => "root", "database" => "peknyden", "charset" => "utf8", "result:objects" => "", "format:date" => "Y-m-d", "format:datetime" => "Y-m-d H:i:s");
$old['database'] = 'peknyden_old';
//dibi::connect(Environment::getConfig('database'));
dibi::connect($new, "new");
dibi::connect($old, "old");
dibi::activate('new');
dibi::query('SET FOREIGN_KEY_CHECKS=0;');
//categories(); // kategorie - aktivity
subjects();
// subjekty - katalog
//files(); // soubory
//subject_files();
//localities(); // lokality
//shire(); // kraje
//events(); // eventy
/**
 * Subjects
Beispiel #24
0
/**
 * My Application bootstrap file.
 */
use Nette\Diagnostics\Debugger, Nette\Application\Routers\Route;
// Load Nette Framework
require LIBS_DIR . '/Nette/loader.php';
// Enable Nette Debugger for error visualisation & logging
Debugger::$logDirectory = __DIR__ . '/../log';
Debugger::$strictMode = TRUE;
Debugger::enable();
// Configure application
$parameters = array();
$parameters['tempDir'] = __DIR__ . '/../temp';
$parameters['cacheDir'] = __DIR__ . '/../temp/cache';
$configurator = new Nette\Config\Configurator();
$configurator->setCacheDirectory($parameters['cacheDir']);
$configurator->addParameters($parameters);
// Enable RobotLoader - this will load all classes automatically
$configurator->createRobotLoader()->addDirectory(APP_DIR)->addDirectory(LIBS_DIR)->register();
// Create Dependency Injection container from config.neon file
$container = $configurator->loadConfig(__DIR__ . '/config/config.neon');
// Opens already started session
if ($container->session->exists()) {
    $container->session->start();
}
// Setup router
$router = $container->router;
$router[] = new Route('index.php', 'Homepage:default', Route::ONE_WAY);
$router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
// Configure and run the application!
Beispiel #25
0
<?php

// Load Nette Framework or autoloader generated by Composer
require __DIR__ . '/../../vendor/autoload.php';
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
$configurator->setDebugMode(true);
$configurator->enableDebugger(__DIR__);
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__);
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../../src')->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
return $configurator->createContainer();
Beispiel #26
0
<?php

require __DIR__ . '/../libs/autoload.php';
$configurator = new Nette\Config\Configurator();
// Enable Nette Debugger for error visualisation & logging
//$configurator->setDebugMode(TRUE);
$configurator->enableDebugger(__DIR__ . '/../log');
// Specify folder for cache
$configurator->setTempDirectory(__DIR__ . '/../temp');
// Enable RobotLoader - this will load all classes automatically
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../app/model')->addDirectory(__DIR__ . '/../app/services')->register();