forked from ThinkUpLLC/ThinkUp
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't require developers to switch to the tests database manually
Use an environment variable, and for integration tests, a $_SESSION variable, to get the config file to use test database values automatically Closes ThinkUpLLC#463
- Loading branch information
1 parent
908473c
commit 8363336
Showing
6 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* | ||
* ThinkUp/webapp/install/setmode.php | ||
* | ||
* Copyright (c) 2011 Gina Trapani | ||
* | ||
* LICENSE: | ||
* | ||
* This file is part of ThinkUp (http://thinkupapp.com). | ||
* | ||
* ThinkUp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public | ||
* License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any | ||
* later version. | ||
* | ||
* ThinkUp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with ThinkUp. If not, see | ||
* <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* @author Gina Trapani <ginatrapani[at]gmail[dot]com> | ||
* @license http://www.gnu.org/licenses/gpl.html | ||
* @copyright 2011 Gina Trapani | ||
*/ | ||
session_start(); | ||
if (strtolower($_GET['m']) == "tests") { | ||
putenv("MODE=TESTS"); | ||
$_SESSION["MODE"] = "TESTS"; | ||
echo "Set to tests mode"; | ||
} elseif (strtolower($_GET['m']) == "prod") { | ||
putenv("MODE=PROD"); | ||
$_SESSION["MODE"] = "PROD"; | ||
echo "Set to prod mode"; | ||
} else { | ||
echo "Currently in "; | ||
if (isset($_SESSION["MODE"])) { | ||
echo strtolower($_SESSION["MODE"]); | ||
} else { | ||
echo " prod "; | ||
} | ||
echo " mode"; | ||
} |