function ndebug() { NDebugger::$strictMode = TRUE; NDebugger::enable(NDebugger::DEVELOPMENT); }
/** * @param string error log directory * @param string administrator email * @return void */ public function enableDebugger($logDirectory = NULL, $email = NULL) { NDebugger::$strictMode = TRUE; NDebugger::enable($this->parameters['productionMode'], $logDirectory, $email); }
<?php /** * My Application bootstrap file. */ // Load Nette Framework require LIBS_DIR . '/Nette/loader.php'; // Enable Nette Debugger for error visualisation & logging NDebugger::$logDirectory = dirname(__FILE__) . '/../log'; NDebugger::$strictMode = TRUE; NDebugger::enable(); // Configure application $configurator = new NConfigurator(); $configurator->setTempDirectory(dirname(__FILE__) . '/../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(dirname(__FILE__) . '/config/config.neon'); $container = $configurator->createContainer(); // Opens already started session if ($container->session->exists()) { $container->session->start(); } // Setup router $router = $container->router; $router[] = new NRoute('index.php', 'Dashboard:default', NRoute::ONE_WAY); $router[] = new NRoute('<presenter>/<action>[/<id>]', 'Dashboard:default'); // Configure and run the application! $application = $container->application; //$application->catchExceptions = TRUE; $application->errorPresenter = 'Error';
<?php function set_magic_quotes_runtime() { return false; } // Step 1: Load Nette Framework require LIBS_DIR . '/nette.min.php'; define('_NETTE_MODE', false); NDebugger::$strictMode = TRUE; NDebugger::enable(false, APP_NETTE_DIR . '/log'); //NEnvironment::setVariable ( "tempDir", "%appNetteDir%/temp" ); // 2c) enable RobotLoader - this allows load all classes automatically $loader = new NRobotLoader(); $loader->setCacheStorage(new NFileStorage(TEMP_DIR)); $loader->addDirectory(APP_NETTE_DIR); $loader->addDirectory(LIBS_DIR); $loader->addDirectory(WWW_DIR . '/require_modules'); $loader->addDirectory(WWW_DIR . '/classes'); //$loader->addDirectory ( WWW_DIR.'/app/models' ); //$loader->addDirectory ( WWW_DIR.'/app/components' ); $loader->register(); // 2b) load configuration from config.ini file $config = NEnvironment::loadConfig(APP_NETTE_DIR . '/config/config.neon'); $neon = new NConfigNeonAdapter(); $n = $neon->load(APP_NETTE_DIR . '/config/config.db.neon'); $database = $n['common']['parameters']; foreach ($database as $k => $p) { NEnvironment::setVariable($k, $p); } //var_dump($d);exit;