Adding compatibility patch for Enano dev servers to common.php
authordan@scribus.fuhry.local.fuhry.local
Wed, 13 Jun 2007 16:32:27 -0400
changeset 2 0931d60f5bdb
parent 1 fe660c52c48f
child 3 2b2084ca1e60
Adding compatibility patch for Enano dev servers to common.php
includes/common.php
--- a/includes/common.php	Wed Jun 13 16:07:17 2007 -0400
+++ b/includes/common.php	Wed Jun 13 16:32:27 2007 -0400
@@ -36,8 +36,18 @@
 
 error_reporting(E_ALL);
 
+// Determine directory (special case for development servers)
+if ( strpos(__FILE__, '/enano-clean/') && file_exists('.enanodev') )
+{
+  $filename = str_replace('/enano-clean', '', __FILE__);
+}
+else
+{
+  $filename = __FILE__;
+}
+
 if(!defined('ENANO_ROOT')) // ENANO_ROOT is sometimes defined by plugins like AjIM that need the constant before the Enano API is initialized
-  define('ENANO_ROOT', dirname(dirname(__FILE__)));
+  define('ENANO_ROOT', dirname(dirname($filename)));
 
 if(defined('ENANO_DEBUG') && version_compare(PHP_VERSION, '5.0.0') < 0)
 {