[xiph-commits] r14666 - in branches/dir.xiph.org: inc templates

balbinus at svn.xiph.org balbinus at svn.xiph.org
Mon Apr 7 12:21:43 PDT 2008


Author: balbinus
Date: 2008-04-07 12:21:43 -0700 (Mon, 07 Apr 2008)
New Revision: 14666

Modified:
   branches/dir.xiph.org/inc/inc.db.php
   branches/dir.xiph.org/inc/prepend.php
   branches/dir.xiph.org/templates/foot.tpl
Log:
Better handling of environments.

Modified: branches/dir.xiph.org/inc/inc.db.php
===================================================================
--- branches/dir.xiph.org/inc/inc.db.php	2008-04-07 19:06:27 UTC (rev 14665)
+++ branches/dir.xiph.org/inc/inc.db.php	2008-04-07 19:21:43 UTC (rev 14666)
@@ -4,10 +4,20 @@
  * Connection parameters for dir.xiph.org
  **/
 
-define('CP_DB_HOST', 'localhost');
-define('CP_DB_USER', 'dir_xiph_org_t');
-define('CP_DB_PASS', '6.NvxjR7B5j3Q');
-define('CP_DB_NAME', 'dir_xiph_org_test');
+if (ENVIRONEMENT == 'preprod')
+{
+	define('CP_DB_HOST', 'localhost');
+	define('CP_DB_USER', 'dir_xiph_org_t');
+	define('CP_DB_PASS', '6.NvxjR7B5j3Q');
+	define('CP_DB_NAME', 'dir_xiph_org_test');
+}
+elseif (ENVIRONMENT == 'prod')
+{
+	define('CP_DB_HOST', 'localhost');
+	define('CP_DB_USER', 'dir_xiph_org');
+	define('CP_DB_PASS', '5wCjLEVmAJnmM');
+	define('CP_DB_NAME', 'dir_xiph_org');
+}
 
 /**
  * Database connection class with semi-hard-coded (?!) login and stuff.

Modified: branches/dir.xiph.org/inc/prepend.php
===================================================================
--- branches/dir.xiph.org/inc/prepend.php	2008-04-07 19:06:27 UTC (rev 14665)
+++ branches/dir.xiph.org/inc/prepend.php	2008-04-07 19:21:43 UTC (rev 14666)
@@ -3,7 +3,19 @@
 class BadIDException extends Exception { }
 class EnvironmentUndefinedException extends Exception { }
 
-define('ENVIRONMENT', 'preprod');
+if ($_SERVER['SERVER_NAME'] == 'directory-test.radiopytagor.net')
+{
+	define('ENVIRONMENT', 'preprod');
+}
+elseif ($_SERVER['SERVER_NAME'] == 'directory.radiopytagor.net'
+		|| $_SERVER['SERVER_NAME'] == 'dir.xiph.org')
+{
+	define('ENVIRONMENT', 'prod');
+}
+else
+{
+	define('ENVIRONEMENT', 'test');
+}
 //define('DEBUG', 'true');
 
 if (ENVIRONMENT != 'prod')

Modified: branches/dir.xiph.org/templates/foot.tpl
===================================================================
--- branches/dir.xiph.org/templates/foot.tpl	2008-04-07 19:06:27 UTC (rev 14665)
+++ branches/dir.xiph.org/templates/foot.tpl	2008-04-07 19:21:43 UTC (rev 14666)
@@ -1,4 +1,5 @@
 			<div id="copyright">
+{if $smarty.const.ENVIRONMENT != 'prod'}
 				<p>Generated in {$generation_time} ms.</p>
 				<p>Executed {$sql_queries} SQL queries.</p>
 {if !empty($sql_debug)}
@@ -18,6 +19,7 @@
 {/foreach}
 				</ul>
 {/if}
+{/if}
 			</div>
 		</div>
 	</body>



More information about the commits mailing list