# HG changeset patch # User Dan # Date 1202122332 18000 # Node ID 7eef739a5b81bcf1ebaed0992e1d7e2bc471776c # Parent a3a9e463c62f3320a8d5df2050829d06812d9325 A few hacks to make the 1.1 demo plugin work diff -r a3a9e463c62f -r 7eef739a5b81 install/includes/common.php --- a/install/includes/common.php Mon Feb 04 05:19:20 2008 -0500 +++ b/install/includes/common.php Mon Feb 04 05:52:12 2008 -0500 @@ -41,18 +41,21 @@ // Determine Enano root directory -$enano_root = dirname(dirname(dirname(__FILE__))); -if ( preg_match('#/repo$#', $enano_root) && file_exists("$enano_root/../.enanodev") ) +if ( !defined('ENANO_ROOT') ) { - $enano_root = preg_replace('#/repo$#', '', $enano_root); + $enano_root = dirname(dirname(dirname(__FILE__))); + if ( preg_match('#/repo$#', $enano_root) && file_exists("$enano_root/../.enanodev") ) + { + $enano_root = preg_replace('#/repo$#', '', $enano_root); + } + + define('ENANO_ROOT', $enano_root); } -define('ENANO_ROOT', $enano_root); - chdir(ENANO_ROOT); // Determine our scriptPath -if ( isset($_SERVER['REQUEST_URI']) ) +if ( isset($_SERVER['REQUEST_URI']) && !defined('scriptPath') ) { // Use reverse-matching to determine where the REQUEST_URI overlaps the Enano root. $requri = $_SERVER['REQUEST_URI']; @@ -86,23 +89,27 @@ exit(); } -function microtime_float() +if ( !function_exists('microtime_float') ) { - list($usec, $sec) = explode(" ", microtime()); - return ((float)$usec + (float)$sec); + function microtime_float() + { + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); + } } define('IN_ENANO_INSTALL', 1); -require(ENANO_ROOT . '/install/includes/ui.php'); -require(ENANO_ROOT . '/includes/functions.php'); -require(ENANO_ROOT . '/includes/json.php'); -require(ENANO_ROOT . '/includes/constants.php'); -require(ENANO_ROOT . '/includes/rijndael.php'); +require_once(ENANO_ROOT . '/install/includes/ui.php'); +require_once(ENANO_ROOT . '/includes/functions.php'); +require_once(ENANO_ROOT . '/includes/json.php'); +require_once(ENANO_ROOT . '/includes/constants.php'); +require_once(ENANO_ROOT . '/includes/rijndael.php'); + // If we have at least PHP 5, load json2 if ( version_compare(PHP_VERSION, '5.0.0', '>=') ) { - require(ENANO_ROOT . '/includes/json2.php'); + require_once(ENANO_ROOT . '/includes/json2.php'); } strip_magic_quotes_gpc(); diff -r a3a9e463c62f -r 7eef739a5b81 install/includes/sql_parse.php --- a/install/includes/sql_parse.php Mon Feb 04 05:19:20 2008 -0500 +++ b/install/includes/sql_parse.php Mon Feb 04 05:52:12 2008 -0500 @@ -54,7 +54,7 @@ public function __construct($sql) { - if ( strpos("\n", $sql) ) + if ( strpos($sql, "\n") ) { $this->sql_string = $sql; } diff -r a3a9e463c62f -r 7eef739a5b81 plugins/admin/LangManager.php --- a/plugins/admin/LangManager.php Mon Feb 04 05:19:20 2008 -0500 +++ b/plugins/admin/LangManager.php Mon Feb 04 05:52:12 2008 -0500 @@ -95,12 +95,6 @@ break; case 'modify_language': - if ( defined('ENANO_DEMO_MODE') ) - { - echo '