[Openfirst-cvscommit] base/includes Module.php,1.5,1.6 globals.php,1.11,1.12 xmlModule.php,1.2,1.3
Brought to you by:
xtimg
From: Astronouth7303 <ast...@us...> - 2005-07-18 22:34:42
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31000/includes Modified Files: Module.php globals.php xmlModule.php Log Message: Fixes for installation script Index: xmlModule.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/xmlModule.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xmlModule.php 29 Jun 2005 21:20:41 -0000 1.2 --- xmlModule.php 18 Jul 2005 22:34:33 -0000 1.3 *************** *** 28,32 **** class xmlModule { ! /*private*/ var $mName, $mID, $mVersion, $mAuthor, $mMaintainer; /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mTables; /*private*/ var $mSetupScript, $mRemoveScript, $mUpgradeScript; --- 28,32 ---- class xmlModule { ! /*private*/ var $mName, $mID, $mDir, $mVersion, $mAuthor, $mMaintainer; /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mTables; /*private*/ var $mSetupScript, $mRemoveScript, $mUpgradeScript; *************** *** 38,41 **** --- 38,43 ---- function xmlModule($File) { + $this->mDir = basename(dirname($File)); // Should actually be made into a path relative to $fBasePath + $hXML = false; if (!($fp = @fopen($File, 'r'))) { *************** *** 100,103 **** --- 102,109 ---- } + /*public*/ function getDir() { + return $this->mDir; + } + /*public*/ function getID() { return $this->mID; Index: Module.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/Module.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Module.php 30 Jun 2005 03:27:57 -0000 1.5 --- Module.php 18 Jul 2005 22:34:33 -0000 1.6 *************** *** 28,32 **** ! /** Provides static functions for managing modules. */ class ModuleManager { --- 28,32 ---- ! /** Provides functions for managing modules. */ class ModuleManager { Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/globals.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** globals.php 30 Jun 2005 03:27:57 -0000 1.11 --- globals.php 18 Jul 2005 22:34:33 -0000 1.12 *************** *** 30,34 **** $configdir = dirname(__FILE__); ! if( !file_exists( "$configdir/sitesettings.php" ) ) { $path = "#"; if(file_exists("../config/first.php")) { --- 30,34 ---- $configdir = dirname(__FILE__); ! if( !defined('OPENFIRST_NO_INSTALLATION') && !file_exists( "$configdir/sitesettings.php" ) ) { $path = "#"; if(file_exists("../config/first.php")) { *************** *** 43,46 **** --- 43,54 ---- } + if (defined('OPENFIRST_NO_INSTALLATION')) { + if(is_readable("style/headers.php")) { + $Header = "style/headers.php"; + } else { + $Header = "../style/headers.php"; + } + } + define('osUNIX', 'unix'); define('osWINDOWS', 'windows'); *************** *** 57,61 **** require_once('compatibility.php'); ! require_once('dbase.php'); set_include_path( get_include_path().PATH_SEPARATOR."$configdir/".PATH_SEPARATOR."."); --- 65,70 ---- require_once('compatibility.php'); ! if (!defined('OPENFIRST_NO_INSTALLATION')) ! require_once('dbase.php'); set_include_path( get_include_path().PATH_SEPARATOR."$configdir/".PATH_SEPARATOR."."); *************** *** 63,125 **** require_once('functions.php'); ! require_once('auth.php'); ! require_once('Module.php'); ! require_once('slug.php'); ! require_once('edit.php'); require_once('skin.php'); $sqlTablePrefix = 'ofirst_'; ! require_once('sitesettings.php'); ! $ogDB = new DataBase($DBaseType, $sqlServer, $sqlUser, $sqlPassword); ! $ogDB->selectDB($sqlDatabase); ! InitUser(); // Determine what module the user is viewing ! $curmodule = str_replace($BasePath, '', $_SERVER['SCRIPT_NAME']); ! $curmodule = substr($curmodule, 1, strpos($curmodule, '/', 2) - 1); ! ! // Include the functions using glob(); ! foreach (glob("$fBasePath/includes/functions/*.php") as $filename) { ! include_once($filename); ! } ! ! $headers = ''; ! $ogCurrentModule = null; ! /* This is not going into a function becuase: ! 1. the files should be included in the global scope ! 2. I'd rather iterate through the array once ! */ ! $ogModuleManager = new ModuleManager; ! $res = $ogDB->query('SELECT '.$ogDB->quoteField('dir'). ! ' FROM '.$ogDB->quoteTable('config')); ! if($ogDB->errorNumber() != 0) { ! trigger_error('Error while listing modules!', E_USER_ERROR); ! } ! while($mod =& $ogDB->fetchObject($res)) { ! $dir = $mod->dir; ! $module =& $ogModuleManager->addModuleFromDir($dir); ! if ($module->getActive()) { ! $dir = $module->getDir(); ! $includes = $module->getIncludes(); ! if (is_array($includes) && count($includes) > 0) { ! foreach ($includes as $include) { ! if ($include != '') { ! include_once($include); ! } ! } ! } ! } ! } ! $ogDB->freeResult($res); ! ! if (!preg_match('/\A[a-zA-Z0-9]+\z/',session_id())) { ! session_regenerate_id(); ! } ! session_write_close(); ?> --- 72,151 ---- require_once('functions.php'); ! if (!defined('OPENFIRST_NO_INSTALLATION')) ! require_once('auth.php'); ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) { ! require_once('Module.php'); ! require_once('slug.php'); ! require_once('edit.php'); ! } require_once('skin.php'); $sqlTablePrefix = 'ofirst_'; ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) ! require_once('sitesettings.php'); ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! $ogDB = new DataBase($DBaseType, $sqlServer, $sqlUser, $sqlPassword); ! $ogDB->selectDB($sqlDatabase); ! } ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) ! InitUser(); // Determine what module the user is viewing ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! $curmodule = str_replace($BasePath, '', $_SERVER['SCRIPT_NAME']); ! $curmodule = substr($curmodule, 1, strpos($curmodule, '/', 2) - 1); ! } ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! // Include the functions using glob(); ! foreach (glob("$fBasePath/includes/functions/*.php") as $filename) { ! include_once($filename); ! } ! } ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! $headers = ''; ! ! $ogCurrentModule = null; ! ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) { ! /* This is not going into a function becuase: ! 1. the files should be included in the global scope ! 2. I'd rather iterate through the array once ! */ ! $ogModuleManager = new ModuleManager; ! $res = $ogDB->query('SELECT '.$ogDB->quoteField('dir'). ! ' FROM '.$ogDB->quoteTable('config')); ! if($ogDB->errorNumber() != 0) { ! trigger_error('Error while listing modules!', E_USER_ERROR); ! } ! while($mod =& $ogDB->fetchObject($res)) { ! $dir = $mod->dir; ! $module =& $ogModuleManager->addModuleFromDir($dir); ! if ($module->getActive()) { ! $dir = $module->getDir(); ! $includes = $module->getIncludes(); ! if (is_array($includes) && count($includes) > 0) { ! foreach ($includes as $include) { ! if ($include != '') { ! include_once($include); ! } ! } ! } ! } ! } ! $ogDB->freeResult($res); ! } ! ! ! if (!preg_match('/\A[a-zA-Z0-9]+\z/',session_id())) { ! session_regenerate_id(); ! } ! ! session_write_close(); ! } ?> |