Permalink
Browse files

added sample environment.php + config.local.neon - they shouldn't be …

…versioned anymore
  • Loading branch information...
juzna committed Mar 7, 2012
1 parent 079b7f0 commit 2e5cc3ff894d31a31fc0785ca6a415f00be3c114
Showing with 30 additions and 1 deletion.
  1. +2 −0 .gitignore
  2. +7 −1 app/bootstrap.php
  3. +11 −0 app/config/config.local.neon
  4. +10 −0 app/config/environment.php
View
@@ -1,3 +1,5 @@
+/app/config/environment.php
+/app/config/config.local.neon
/doc-*
/repos
Guardfile
View
@@ -17,6 +17,10 @@
// Configure application
$configurator = new Nette\Config\Configurator;
+if(file_exists(__DIR__ . '/config/environment.php')) {
+ require_once __DIR__ . '/config/environment.php';
+}
+
// Enable Nette Debugger for error visualisation & logging
//$configurator->setProductionMode($configurator::AUTO);
$configurator->enableDebugger(__DIR__ . '/../log');
@@ -29,7 +33,9 @@
->register();
// Create Dependency Injection container from config.neon file
-$configurator->addConfig(__DIR__ . '/config/config.neon');
+$configurator
+ ->addConfig(__DIR__ . '/config/config.neon', defined('ENVIRONMENT_NAME') ? ENVIRONMENT_NAME : null)
+ ->addConfig(__DIR__ . '/config/config.local.neon', defined('ENVIRONMENT_NAME') ? ENVIRONMENT_NAME : null);
$container = $configurator->createContainer();
// Setup router
@@ -0,0 +1,11 @@
+common:
+ parameters:
+ database:
+
+production < common:
+ parameters:
+ database:
+
+development < common:
+ parameters:
+ database:
View
@@ -0,0 +1,10 @@
+<?php
+/**
+ * Local config for this machine, not in git
+ */
+
+/** @var Nette\Config\Configurator $configurator */
+
+// define('ENVIRONMENT_NAME', 'development');
+// $configurator->setProductionMode(false);
+

0 comments on commit 2e5cc3f

Please sign in to comment.