<?php /** * Soubor pro načtení všech souborů PHPUnit testů. Používá se jen pro spouštění * testů v IDE PHPStorm. * * @author Martin Štekl <*****@*****.**> * @since 2012-07-23 */ use Nette\Config\Configurator; define('TEST_DIR', __DIR__); define('LIBS_DIR', TEST_DIR . '/../vendor'); // Composer autoloading 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(TEST_DIR . '/../log', '*****@*****.**'); // Enable RobotLoader - this will load all classes automatically $configurator->setTempDirectory(TEST_DIR . '/../temp'); $configurator->createRobotLoader()->addDirectory(TEST_DIR)->register();
<?php /** * Addons and code snippets for Nette Framework. (unofficial) * * @author Jan Tvrdík * @license MIT */ use Nette\Application\Routers\Route; use Nette\Config\Configurator; use Nette\Forms; require_once LIBS_DIR . '/Nette/loader.php'; $configurator = new Configurator(); $configurator->enableDebugger(); $configurator->setTempDirectory(TEMP_DIR); $configurator->createRobotLoader() ->addDirectory([APP_DIR, LIBS_DIR, APP_DIR . '/../../NetteExtras/Components', APP_DIR . '/../../NetteExtras/Templates']) ->register(); $dic = $configurator->createContainer(); $dic->router[] = new Route('index.php', 'Demo:default', Route::ONE_WAY); $dic->router[] = new Route('<action>', 'Demo:default'); Forms\Container::extensionMethod('addDatePicker', function (Forms\Container $container, $name, $label = NULL) { return $container[$name] = new JanTvrdik\Components\DatePicker($label); }); $dic->application->run();