Esempio n. 1
0
 /**
  * @return \Nette\DI\Container
  */
 public static final function create($new = FALSE)
 {
     if ($new || self::$container === NULL) {
         $configurator = new \Nette\Configurator();
         $configurator->onCompile[] = function (\Nette\Configurator $configurator, \Nette\DI\Compiler $compiler) {
             $compiler->addExtension('testbench', new \Testbench\TestbenchExtension());
             self::registerAdditionalExtension($compiler, 'fakeSession', new \Kdyby\FakeSession\DI\FakeSessionExtension());
             if (class_exists('Kdyby\\Console\\DI\\ConsoleExtension')) {
                 self::registerAdditionalExtension($compiler, 'console', new \Kdyby\Console\DI\ConsoleExtension());
             }
         };
         $configurator->setTempDirectory(\Testbench\Bootstrap::$tempDir);
         // shared container for performance purposes
         $configurator->setDebugMode(FALSE);
         if (is_callable(\Testbench\Bootstrap::$onBeforeContainerCreate)) {
             call_user_func_array(\Testbench\Bootstrap::$onBeforeContainerCreate, [$configurator]);
         }
         self::$container = $configurator->createContainer();
     }
     return self::$container;
 }
Esempio n. 2
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode([]);
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
\ShoPHP\ShoPHP::initialize($configurator);
$configurator->addConfig(__DIR__ . '/config/config.neon');
return $configurator->createContainer();
Esempio n. 3
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode(true);
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../vendor/NiftyGrid')->addDirectory(__DIR__ . '/../vendor/joseki/pdf-response')->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 4
0
<?php

require __DIR__ . '/../vendor/autoload.php';
Tester\Environment::setup();
$configurator = new Nette\Configurator();
$configurator->setDebugMode(FALSE);
$configurator->setTempDirectory(__DIR__ . '/temp');
$configurator->addConfig(__DIR__ . '/config/config.neon');
return $configurator->createContainer();
Esempio n. 5
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode(TRUE);
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../errorlog');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . "/../vendor/others")->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 6
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
if (php_sapi_name() === 'cli') {
    $configurator->setDebugMode(TRUE);
} else {
    $configurator->setDebugMode(['127.0.0.1']);
}
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../Libs')->register();
/*
* Optionally, you can comment out RobotLoader and append this to composer.json:

 "autoload": {
   "classmap": [
     "App/",
     "Libs/"
   ]
 },

*
*  as it would bring you more speed thanks to optimized class loader (included in robo install production.
*  Anyways, it is pain as it needs you to run composer dump every time you create new class,
*  which is not needed with RobotLoader...
*/
$configurator->addConfig(__DIR__ . '/Config/config.neon');
$configurator->addConfig(__DIR__ . '/Config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 7
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode('77.78.82.122');
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log');
Nette\Diagnostics\Debugger::$maxDepth = 10;
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon', Nette\Configurator::AUTO);
$container = $configurator->createContainer();
$container->parameters['test_param'] = 'test param';
return $container;
Esempio n. 8
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode('89.103.130.22');
$configurator->setDebugMode('80.251.241.38');
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 9
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode(['192.168.99.230']);
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../vendor/nette-extras')->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
Kdyby\Replicator\Container::register();
return $container;
Esempio n. 10
0
<?php

use Nette\Forms\Container;
setlocale(LC_ALL, 'cs_CZ.UTF-8');
//require LIBS_DIR . '/libs/nette.phar';
require __DIR__ . '/../vendor/autoload.php';
// Configure application
Tracy\Debugger::timer();
Tracy\Debugger::$editor = "pstorm://open/?url=file://%file&line=%line";
/* @var $configurator \Nette\Configurator */
$configurator = new \Nette\Configurator();
// Enable Nette Debugger for error visualisation & logging
$configurator->setDebugMode(array("localhost", "peknyden.soundake.com", "pd-0613.rostiapp.cz"));
$configurator->enableDebugger(__DIR__ . '/../log', "*****@*****.**");
// 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
switch ($_SERVER['SERVER_NAME']) {
    case "pd-0613.rostiapp.cz":
        $environment = "preview";
        break;
    case "peknyden.cz":
    case "www.peknyden.cz":
        $environment = "production";
        break;
    default:
        $environment = "development";
        break;
}
$configurator->addConfig(__DIR__ . '/config/config.neon', $environment);
Esempio n. 11
0
<?php

require __DIR__ . '/shortcuts.php';
require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
if (($debug = getenv('NETTE_DEBUG')) !== FALSE) {
    // https://forum.nette.org/cs/26561-configurator-a-detekce-prostredi-v-dockeru#p176044
    $configurator->setDebugMode($debug === '1');
}
//$configurator->setDebugMode('23.75.345.200'); // enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 12
0
<?php

/**
 * @author Patrick Kusebauch
 * @version 1.01, 26. 10. 2014
 */
// Load Nette Framework or autoloader generated by Composer
setlocale(LC_TIME, 'cs_CZ.utf8');
require __DIR__ . '/../libs/autoload.php';
//Configuration
ini_set("session.gc_probability", 0);
$configurator = new Nette\Configurator();
// Enable Nette Debugger for error visualisation & logging
$configurator->setDebugMode(['94.138.99.8', '10.0.2.2']);
$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__ . '/../libs')->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config-local.neon');
$container = $configurator->createContainer();
//Form extensions
use Nette\Forms\Container;
use Nextras\Forms\Controls;
//Date & Datetime Picker
Container::extensionMethod('addDatePicker', function (Container $container, $name, $label = NULL) {
    return $container[$name] = new Controls\DatePicker($label);
});
Container::extensionMethod('addDateTimePicker', function (Container $container, $name, $label = NULL) {
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode('46.227.171.253');
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
//$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 14
0
<?php

$developers = ['127.0.0.1', '83.240.124.229'];
$tempDir = __DIR__ . '/../temp';
// afterDeploy
$remoteAddr = isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : NULL;
if (in_array($remoteAddr, $developers) && isset($_GET["afterDeploy"])) {
    $deployment = __DIR__ . "/../vendor/adt/deployment/src/Deployment.php";
    if (file_exists($deployment)) {
        include $deployment;
        ADT\Deployment\Deployment::install($tempDir);
    }
}
require __DIR__ . '/../vendor/autoload.php';
include_once __DIR__ . '/../app/shortcuts.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode($developers);
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory($tempDir);
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../vendor/others')->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
Kdyby\Replicator\Container::register();
Vodacek\Forms\Controls\DateInput::register();
return $container;
Esempio n. 15
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
umask(0);
$configurator->setDebugMode('127.0.0.1,10.0.2.2');
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 16
0
<?php

function bd($var, $title = NULL, array $options = NULL)
{
    \Tracy\Debugger::barDump($var, $title, $options);
}
function flg($var)
{
    \Tracy\Debugger::fireLog($var);
}
require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode('94.113.110.220');
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 17
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode(strncmp($_SERVER['REMOTE_ADDR'], '172.20.10.', 10) === 0 || in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']));
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
Tracy\Debugger::setLogger(new Beetle\Tracy\Logger(__DIR__ . '/../log', ['consolePath' => '/srv/http/me/monokl/bugs/bin/console', 'userId' => 2, 'projectId' => 4]));
$container = $configurator->createContainer();
return $container;
Esempio n. 18
0
<?php

$configurator = new Nette\Configurator();
// Uncomment following line to enable dynamic debug mode
// $debugModeConfig = __DIR__ . '/config/debugger.neon';
if (isset($debugModeConfig)) {
    $ips = Nette\Neon\Neon::decode(file_get_contents($debugModeConfig));
    if (!empty($ips)) {
        $configurator->setDebugMode($ips);
    }
}
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
// Uncomment following line to enable workbench support
// $workbenchActive = TRUE;
if (isset($workbenchActive)) {
    $configurator->createRobotLoader()->addDirectory(__DIR__ . '/../workbench')->register();
}
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 19
0
<?php

/**
 * @author    Martin Procházka <*****@*****.**>
 * @package   www.juniwalk.cz
 * @link      https://github.com/juniwalk/www.juniwalk.cz
 * @copyright Martin Procházka (c) 2015
 * @license   MIT License
 */
include __DIR__ . '/../vendor/autoload.php';
$di = new \Nette\Configurator();
$di->addConfig(__DIR__ . '/config/config.neon');
$di->setTempDirectory(__DIR__ . '/../temp');
$di->addParameters(['pkgDir' => __DIR__ . '/../vendor', 'wwwDir' => __DIR__ . '/../www', 'appDir' => __DIR__]);
$di->setDebugMode(include __DIR__ . '/config/config-ipconf.php');
$di->enableDebugger(__DIR__ . '/../log');
$di->createRobotLoader()->addDirectory(__DIR__)->register();
return $di->createContainer();
Esempio n. 20
0
<?php

function dump($var)
{
    Tracy\Dumper::dump($var, [Tracy\Dumper::TRUNCATE => 1024, Tracy\Dumper::COLLAPSE => 30, Tracy\Dumper::COLLAPSE_COUNT => 15, Tracy\Dumper::DEPTH => 6]);
    return $var;
}
function bdump($var)
{
    Tracy\Debugger::barDump($var);
    return $var;
}
require __DIR__ . '/../vendor/autoload.php';
Tracy\Debugger::$maxDepth = 10;
$configurator = new Nette\Configurator();
if (PHP_SAPI === 'cli') {
    $configurator->setDebugMode(!in_array('--production', $_SERVER['argv'], TRUE));
} else {
    $configurator->setDebugMode([]);
}
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../lib')->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
if ($configurator->isDebugMode()) {
    #	Dibi\Bridges\Tracy\Panel::$maxLength = 65535;
    $configurator->addConfig(__DIR__ . '/config/config.debug.neon');
}
$container = $configurator->createContainer();
return $container;
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
//$configurator->setDebugMode('23.75.345.200'); // enable for your remote IP
$configurator->setDebugMode(false);
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 22
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$environment = $configurator->setDebugMode('x.x.x.x');
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$environment = (Nette\Configurator::detectDebugMode('127.0.0.1') or PHP_SAPI == 'cli' && Nette\Utils\Strings::startsWith(getHostByName(getHostName()), "192.168.")) ? 'development' : 'production';
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . "/config/config.{$environment}.neon");
$container = $configurator->createContainer();
$container->getService('application')->errorPresenter = 'Front:Error';
return $container;
Esempio n. 23
0
<?php

require __DIR__ . '/../vendor/autoload.php';
require_once '../vendor/ezyang/htmlpurifier/library/HTMLPurifier.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode(array("0.0.0.0"));
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log');
error_reporting(E_ALL ^ E_NOTICE);
\Tracy\Debugger::$strictMode = FALSE;
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 24
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$tomDebug = getenv('TOM_DEBUG') === 'TRUE' && isset($_COOKIE['tom_api_debug']);
$tomLogDir = getenv('TOM_LOG_DIR') ?: '/var/log/tripomatic-api-skeleton';
$tomTmpDir = getenv('TOM_TMP_DIR') ?: '/var/tmp/tripomatic-api-skeleton';
$tomConfigFile = getenv('TOM_CONFIG_FILE') ?: __DIR__ . '/config.local.neon';
$configurator = new Nette\Configurator();
$configurator->setDebugMode($tomDebug);
$configurator->enableDebugger($tomLogDir);
// fix for HHVM to always correctly render Tracy bluescreen
register_shutdown_function(function () {
    flush();
});
$configurator->setTempDirectory($tomTmpDir);
$configurator->addConfig(__DIR__ . '/config.neon');
if (file_exists($tomConfigFile)) {
    $configurator->addConfig($tomConfigFile);
}
return $configurator->createContainer();
Esempio n. 25
0
<?php

umask(0);
require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode('192.168.10.1');
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 26
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode("127.0.0.1");
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../vendor/jzechy')->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$configurator->addConfig(__DIR__ . '/components/config/config.neon');
$configurator->addConfig(__DIR__ . '/model/config/config.neon');
$container = $configurator->createContainer();
Zet\FileUpload\FileUploadControl::register($container);
Zet\AntiSpam\AntiSpamControl::register($container);
return $container;
Esempio n. 27
0
<?php

require __DIR__ . '/../vendor/autoload.php';
use RadekDostal\NetteComponents\DateTimePicker\DateTimePicker;
use RadekDostal\NetteComponents\DateTimePicker\DatePicker;
$configurator = new Nette\Configurator();
$configurator->setDebugMode('23.75.345.200');
// enable for your remote IP
//$configurator->setDebugMode(array());
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../vendor/custom')->register();
DateTimePicker::register();
DatePicker::register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 28
0
<?php

require __DIR__ . '/../vendor/autoload.php';
\Tracy\Debugger::$showLocation = TRUE;
function barDump($var, $title = NULL, $options = NULL)
{
    \Tracy\Debugger::barDump($var, $title, $options);
}
$configurator = new Nette\Configurator();
$configurator->setDebugMode('194.228.13.179');
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log', '*****@*****.**');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Esempio n. 29
0
require __DIR__ . '/shortcuts.php';
require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$debugMode = FALSE;
$environmentFile = __DIR__ . '/local/environment';
if (file_exists($environmentFile)) {
    $environment = file_get_contents($environmentFile);
    $debugMode = $environment === 'production' ? FALSE : TRUE;
} else {
    $environment = 'production';
}
$environment = Strings::trim(Strings::lower($environment));
$debugSwitchFile = __DIR__ . '/local/debug';
if (file_exists($debugSwitchFile)) {
    $debugMode = Strings::trim(mb_strtolower(file_get_contents($debugSwitchFile))) === 'true' ? TRUE : FALSE;
}
// Enable Nette Debugger for error visualisation & logging
$configurator->setDebugMode($debugMode);
$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__ . '/../libs')->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$localConfig = __DIR__ . '/local/config.local.neon';
if (file_exists($localConfig)) {
    $configurator->addConfig($localConfig);
}
$container = $configurator->createContainer();
return $container;
Esempio n. 30
0
});
Container::extensionMethod('addMultiOptionList', function (Container $container, $name, $label = NULL, array $items = NULL) {
    return $container[$name] = new Controls\MultiOptionList($label, $items);
});
Container::extensionMethod('addDatePicker', function (Container $container, $name, $label = NULL) {
    return $container[$name] = new Controls\DatePicker($label);
});
Container::extensionMethod('addDateTimePicker', function (Container $container, $name, $label = NULL) {
    return $container[$name] = new Controls\DateTimePicker($label);
});
Container::extensionMethod('addTypeahead', function (Container $container, $name, $label = NULL, $callback = NULL) {
    return $container[$name] = new Controls\Typeahead($label, $callback);
});
$configurator = new Nette\Configurator();
if (DEV_MODE === TRUE) {
    $configurator->setDebugMode(TRUE);
} elseif (isset($debugIPs)) {
    $configurator->setDebugMode($debugIPs);
}
$configurator->enableDebugger(DIR_ROOT . '/log', isset($debugMail) ? $debugMail : NULL);
$configurator->setTempDirectory(DIR_ROOT . '/temp');
if (!isset($robotLoaderDirs)) {
    $robotLoaderDirs = [];
}
$robotLoaderDirs[] = DIR_VENDOR . '/cothema/';
$robotLoaderDirs[] = DIR_ROOT . '/app/';
$robotLoader = $configurator->createRobotLoader();
foreach ($robotLoaderDirs as $robotLoaderDirsOne) {
    $robotLoader->addDirectory($robotLoaderDirsOne);
}
$robotLoader->register();