From 806fd35e27e30a04281a7eae764a7a0dedaf7bd6 Mon Sep 17 00:00:00 2001 From: jarrett Date: Tue, 27 Oct 2009 21:36:44 +0200 Subject: [PATCH] Merge Work/Home --- config/cache-path | 1 - config/config-path | 2 +- config/config.ini | 28 ++++++++++++++-------------- setup/migrate/migrateUtil.php | 36 +++++++++++------------------------- setup/migrate/migrateWizard.php | 18 +++++++----------- setup/migrate/migrater.php | 5 ++--- setup/migrate/step.php | 1 - setup/migrate/stepAction.php | 20 ++++++++++---------- setup/migrate/steps/migrateInstallation.php | 12 ++++++++---- setup/migrate/steps/migrateServices.php | 1 - setup/upgrade/step.php | 2 +- setup/upgrade/steps/upgradeDatabase.php | 4 +++- setup/upgrade/steps/upgradeWelcome.php | 11 ++++------- setup/upgrade/upgradeUtil.php | 13 +------------ setup/wizard/iniUtilities.php | 11 +++++------ setup/wizard/installUtil.php | 10 ++++++---- setup/wizard/step.php | 1 - setup/wizard/steps/complete.php | 22 +++++++++++----------- setup/wizard/steps/configuration.php | 43 ++++++++++++++++++++++--------------------- setup/wizard/steps/database.php | 32 +++++++++++++++----------------- setup/wizard/steps/install.php | 6 +++--- thirdparty/Smarty/internals/core.write_compiled_resource.php | 2 +- var/bin/taskrunner.bat | 3 ++- 23 files changed, 127 insertions(+), 157 deletions(-) diff --git a/config/cache-path b/config/cache-path index 80a084a..e69de29 100644 --- a/config/cache-path +++ b/config/cache-path @@ -1 +0,0 @@ -var/cache diff --git a/config/config-path b/config/config-path index 4bfe59e..2be1a8b 100644 --- a/config/config-path +++ b/config/config-path @@ -1 +1 @@ -config/config.ini +C:\ktdms\config\config.ini \ No newline at end of file diff --git a/config/config.ini b/config/config.ini index 3168122..e97498f 100644 --- a/config/config.ini +++ b/config/config.ini @@ -9,14 +9,14 @@ dbType = mysql ; Database login details -dbHost = localhost -dbName = dms -dbUser = dms -dbPass = djw9281js -dbPort = default +dbHost = localhost +dbName = dms_migrate +dbUser = dmsadmin +dbPass = js9281djw +dbPort = 3306 -dbAdminUser = dmsadmin -dbAdminPass = js9281djw +dbAdminUser = dmsadmin +dbAdminPass = js9281djw [KnowledgeTree] @@ -31,7 +31,7 @@ dbAdminPass = js9281djw ; ; Leave as default to have it automatically detected. ; -fileSystemRoot = default +fileSystemRoot = D:/Program Files/Zend/Apache2/htdocs/knowledgetree ; Webserver name (host name) ; @@ -43,7 +43,7 @@ serverName = default ; ; Leave as default to have it automatically detected. ; -sslEnabled = default +sslEnabled = false ; Path to the web application from the root of the web site. ; If KT is at http://example.org/foo/, then rootUrl should be '/foo' @@ -115,11 +115,11 @@ phpErrorLogFile = false [urls] ; directories -varDirectory = ${fileSystemRoot}/var -logDirectory = ${varDirectory}/log -documentRoot = ${varDirectory}/Documents +varDirectory = C:\Program Files\ktdms\var +logDirectory = C:\Program Files\ktdms\var\log +documentRoot = C:\Program Files\ktdms\var\Documents uiDirectory = ${fileSystemRoot}/presentation/lookAndFeel/knowledgeTree -tmpDirectory = ${varDirectory}/tmp +tmpDirectory = C:\Program Files\ktdms\var\tmp ;dedicated feed url ;dedicatedrsstitle = RSS Feed Title @@ -146,4 +146,4 @@ encoding = default ; cacheEnabled = true cacheDirectory = ${varDirectory}/cache -cachePlugins = true \ No newline at end of file +cachePlugins = true diff --git a/setup/migrate/migrateUtil.php b/setup/migrate/migrateUtil.php index 28fd474..ac07f0f 100644 --- a/setup/migrate/migrateUtil.php +++ b/setup/migrate/migrateUtil.php @@ -63,14 +63,14 @@ class MigrateUtil extends InstallUtil { $template_vars['error'] = $error; $file = "templates/error.tpl"; if (!file_exists($file)) { - return false; + extract($template_vars); // Extract the vars to local namespace + ob_start(); + include($file); + $contents = ob_get_contents(); + ob_end_clean(); + echo $contents; } - extract($template_vars); // Extract the vars to local namespace - ob_start(); - include($file); - $contents = ob_get_contents(); - ob_end_clean(); - echo $contents; + return false; } /** @@ -89,19 +89,10 @@ class MigrateUtil extends InstallUtil { return true; } - - public function loadInstallDBUtil() { - require_once("../wizard/dbUtilities.php"); - return new dbUtilities(); - } - - public function loadInstallUtil() { - require_once("../wizard/steps/services.php"); - return new services(); - } public function loadInstallServices() { - $s = $this->loadInstallUtil(); + require_once("../wizard/steps/services.php"); + $s = new services(); return $s->getServices(); } @@ -112,11 +103,6 @@ class MigrateUtil extends InstallUtil { return new $serviceName(); } - public function loadInstallIni($path) { - require_once("../wizard/iniUtilities.php"); - return new iniUtilities($path); - } - public function getPort($location) { if(WINDOWS_OS) { $myIni = "my.ini"; @@ -125,8 +111,8 @@ class MigrateUtil extends InstallUtil { } $dbConfigPath = $location.DS."mysql".DS."$myIni"; if(file_exists($dbConfigPath)) { - $ini = $this->loadInstallIni($dbConfigPath); - $dbSettings = $ini->getSection('mysqladmin'); + $this->iniUtilities->load($dbConfigPath); + $dbSettings = $this->iniUtilities->getSection('mysqladmin'); return $dbSettings['port']; } diff --git a/setup/migrate/migrateWizard.php b/setup/migrate/migrateWizard.php index 0bb58d0..03c93fe 100644 --- a/setup/migrate/migrateWizard.php +++ b/setup/migrate/migrateWizard.php @@ -52,16 +52,14 @@ function __autoload($class) { // Attempt and autoload classes if ($class == "template") { // Load existing templating classes require_once("../wizard/template.php"); require_once("../wizard/lib/helpers/htmlHelper.php"); - return ; - } - if(file_exists(WIZARD_DIR."$class.php")) { - require_once(WIZARD_DIR."$class.php"); - } elseif (file_exists(STEP_DIR."$class.php")) { - require_once(STEP_DIR."$class.php"); - } elseif (file_exists(WIZARD_LIB."$class.php")) { - require_once(WIZARD_LIB."$class.php"); } else { - return null; + if(file_exists(WIZARD_DIR."$class.php")) { + require_once(WIZARD_DIR."$class.php"); + } elseif (file_exists(STEP_DIR."$class.php")) { + require_once(STEP_DIR."$class.php"); + } elseif (file_exists(WIZARD_LIB."$class.php")) { + require_once(WIZARD_LIB."$class.php"); + } } } @@ -233,8 +231,6 @@ class MigrateWizard { return true; break; } - - return $res; } /** diff --git a/setup/migrate/migrater.php b/setup/migrate/migrater.php index 249fa36..86f78f5 100644 --- a/setup/migrate/migrater.php +++ b/setup/migrate/migrater.php @@ -157,7 +157,7 @@ class Migrater { $this->simpleXmlObj = simplexml_load_file(CONF_DIR.$name); } catch (Exception $e) { $util = new MigrateUtil(); - $util->error("Error reading configuration file: $name"); + $util->error("Error reading configuration file: $e"); exit(); } } @@ -431,8 +431,7 @@ class Migrater { if($class->runMigrate()) { // Check if step needs to be migrated $class->setDataFromSession($className); // Set Session Information $class->setPostConfig(); // Set any posted variables - $response = $class->migrateStep(); // Run migrate step - // TODO : Break on error response + $class->migrateStep(); // Run migrate step } } else { $util = new MigrateUtil(); diff --git a/setup/migrate/step.php b/setup/migrate/step.php index 897b710..315fd53 100644 --- a/setup/migrate/step.php +++ b/setup/migrate/step.php @@ -128,7 +128,6 @@ class Step public function __construct() { $this->util = new MigrateUtil(); - $this->dbhandler = $this->util->loadInstallDBUtil(); } /** diff --git a/setup/migrate/stepAction.php b/setup/migrate/stepAction.php index 30724ed..e804976 100644 --- a/setup/migrate/stepAction.php +++ b/setup/migrate/stepAction.php @@ -224,17 +224,18 @@ class stepAction { if($this->action->storeInSession()) { // Check if class values need to be stored in session $this->_loadStepToSession($this->stepName); // Send class to session } - if ($response == 'error') { - $this->_handleErrors(); // Send Errors to session - } else { - $this->_clearErrors($this->stepName); // Send Errors to session - } - return $response; } else { $this->stepName = 'errors'; $this->action = $this->createStep(); $this->action->error = array('Class File Missing in Step Directory'); + + } + if ($response == 'error') { + $this->_handleErrors(); // Send Errors to session + } else { + $this->_clearErrors($this->stepName); // Send Errors to session } + return $response; } /** @@ -308,7 +309,7 @@ class stepAction { $menu = ''; $active = false; if($this->stepClassNames) { - foreach ($this->stepClassNames as $k=>$step) { + foreach ($this->stepClassNames as $step) { if($this->step_names[$step] != '') { $item = $this->step_names[$step]; } else { @@ -452,7 +453,7 @@ class stepAction { * @access private * @return void */ - private function _loadValueToSession($class, $k, $v, $overwrite = false) { + private function _loadValueToSession($class, $k, $v) { if($this->session != null) { $this->session->setClass($class, $k, $v); } else { @@ -502,8 +503,7 @@ class stepAction { * @access private * @return void */ - private function _loadErrorToSession($class, $k, $v, $overwrite = false) { - $k = "errors"; + private function _loadErrorToSession($class, $k = "errors", $v) { if($this->session != null) { $this->session->setClassError($class, $k, $v); } else { diff --git a/setup/migrate/steps/migrateInstallation.php b/setup/migrate/steps/migrateInstallation.php index 07230bb..e935c72 100644 --- a/setup/migrate/steps/migrateInstallation.php +++ b/setup/migrate/steps/migrateInstallation.php @@ -225,8 +225,10 @@ class migrateInstallation extends step } private function loadConfig($path) { - $ini = $this->util->loadInstallIni($path); - $dbSettings = $ini->getSection('db'); +// $ini = $this->util->loadInstallIni($path); + $this->util->iniUtilities->load($path); +// $dbSettings = $ini->getSection('db'); + $dbSettings = $this->util->iniUtilities->getSection('db'); $this->dbSettings = array('dbHost'=> $dbSettings['dbHost'], 'dbName'=> $dbSettings['dbName'], 'dbUser'=> $dbSettings['dbUser'], @@ -235,14 +237,16 @@ class migrateInstallation extends step 'dbAdminUser'=> $dbSettings['dbAdminUser'], 'dbAdminPass'=> $dbSettings['dbAdminPass'], ); - $ktSettings = $ini->getSection('KnowledgeTree'); + $ktSettings = $this->util->iniUtilities->getSection('KnowledgeTree'); +// $ktSettings = $ini->getSection('KnowledgeTree'); $froot = $ktSettings['fileSystemRoot']; if ($froot == 'default') { $froot = $this->location; } $this->ktSettings = array('fileSystemRoot'=> $froot, ); - $urlPaths = $ini->getSection('urls'); +// $urlPaths = $ini->getSection('urls'); + $urlPaths = $this->util->iniUtilities->getSection('urls'); $varDir = $froot.DS.'var'; $this->urlPaths = array(array('name'=> 'Var Directory', 'path'=> $varDir), array('name'=> 'Log Directory', 'path'=> $varDir.DS.'log'), diff --git a/setup/migrate/steps/migrateServices.php b/setup/migrate/steps/migrateServices.php index b0bc18e..756ec5d 100644 --- a/setup/migrate/steps/migrateServices.php +++ b/setup/migrate/steps/migrateServices.php @@ -127,7 +127,6 @@ class migrateServices extends Step public function doStep() { $this->temp_variables = array("step_name"=>"services", "silent"=>$this->silent); - $this->installServices = $this->util->loadInstallUtil(); // Use installer utility class $this->services = $this->util->loadInstallServices(); // Use installer services class $this->storeSilent(); if(!$this->inStep("services")) { diff --git a/setup/upgrade/step.php b/setup/upgrade/step.php index e762275..6a66986 100644 --- a/setup/upgrade/step.php +++ b/setup/upgrade/step.php @@ -110,7 +110,7 @@ class Step public function __construct() { $this->util = new UpgradeUtil(); - $this->dbhandler = $this->util->loadInstallDBUtil(); + //$this->dbhandler = $this->util->dbUtilities; } /** diff --git a/setup/upgrade/steps/upgradeDatabase.php b/setup/upgrade/steps/upgradeDatabase.php index 8987695..88e8cda 100644 --- a/setup/upgrade/steps/upgradeDatabase.php +++ b/setup/upgrade/steps/upgradeDatabase.php @@ -242,7 +242,9 @@ class upgradeDatabase extends Step } private function readConfig($path) { - $ini = $this->util->loadInstallIni($path); + //$ini = $this->util->loadInstallIni($path); + $ini = $this->util->iniUtilities; + $ini->load($path); $dbSettings = $ini->getSection('db'); $this->dbSettings = array('dbHost'=> $dbSettings['dbHost'], 'dbName'=> $dbSettings['dbName'], diff --git a/setup/upgrade/steps/upgradeWelcome.php b/setup/upgrade/steps/upgradeWelcome.php index c3df258..ae86767 100644 --- a/setup/upgrade/steps/upgradeWelcome.php +++ b/setup/upgrade/steps/upgradeWelcome.php @@ -40,6 +40,9 @@ * @version Version 0.1 */ +//require_once('../../config/dmsDefaults.php'); +//require_once KT_LIB_DIR . '/authentication/authenticationutil.inc.php'; + class upgradeWelcome extends step { protected $silent = false; @@ -91,15 +94,9 @@ class upgradeWelcome extends step { $dconf = $ini->getSection('db'); $this->dbhandler->load($dconf['dbHost'], $dconf['dbUser'], $dconf['dbPass'], $dconf['dbName']); } - $sQuery = "SELECT count(*) AS match_count FROM users WHERE username = '$username' AND password = '".md5($password)."'"; - $res = $this->dbhandler->query($sQuery); - $ass = $this->dbhandler->fetchAssoc($res); - if(isset($ass[0]['match_count'])) { - if($ass[0]['match_count']) - return true; - } $this->error[] = 'Could Not Authenticate User'; return false; + } public function getErrors() { diff --git a/setup/upgrade/upgradeUtil.php b/setup/upgrade/upgradeUtil.php index 1816df1..ad78277 100644 --- a/setup/upgrade/upgradeUtil.php +++ b/setup/upgrade/upgradeUtil.php @@ -40,10 +40,9 @@ * @version Version 0.1 */ -//require_once('../../config/dmsDefaults.php'); require_once("../wizard/installUtil.php"); -class UpgradeUtil extends InstallUtil { +class UpgradeUtil extends InstallUtil { /** * Check if system needs to be upgraded * @@ -75,16 +74,6 @@ class UpgradeUtil extends InstallUtil { echo $contents; } - public function loadInstallIni($path) { - require_once("../wizard/iniUtilities.php"); - return new iniUtilities($path); - } - - public function loadInstallDBUtil() { - require_once("../wizard/dbUtilities.php"); - return new dbUtilities(); - } - /** * Function to send output to the browser prior to normal dynamic loading of a template after code execution * diff --git a/setup/wizard/iniUtilities.php b/setup/wizard/iniUtilities.php index 81c2914..e3488ae 100644 --- a/setup/wizard/iniUtilities.php +++ b/setup/wizard/iniUtilities.php @@ -43,11 +43,8 @@ class iniUtilities { private $lineNum = 0; private $exists = ''; - function iniUtilities() { - $this->iniFile = ''; - } - - function load($iniFile) { + + function load($iniFile) { if($this->iniFile != $iniFile) { $this->cleanArray = array(); $this->lineNum = 0; @@ -56,9 +53,11 @@ class iniUtilities { $this->iniFile = $iniFile; $this->backupIni($iniFile); $this->read($iniFile); - } + function __construct() { + } + /** * Create a backup with the date as an extension in the same location as the original config.ini * diff --git a/setup/wizard/installUtil.php b/setup/wizard/installUtil.php index 47bd88d..935f5c3 100644 --- a/setup/wizard/installUtil.php +++ b/setup/wizard/installUtil.php @@ -40,12 +40,14 @@ * @version Version 0.1 */ +require_once("../wizard/iniUtilities.php"); +require_once("../wizard/dbUtilities.php"); class InstallUtil { private $salt = 'installers'; - public $dbHandler = null; - public $iniHandler = null; + public $dbUtilities = null; + public $iniUtilities = null; /** * Constructs installation object @@ -54,8 +56,8 @@ class InstallUtil { * @access public */ public function __construct() { - $this->dbHandler = new dbUtilities(); - $this->iniHandler = new iniUtilities(); + $this->dbUtilities = new dbUtilities(); + $this->iniUtilities = new iniUtilities(); } /** diff --git a/setup/wizard/step.php b/setup/wizard/step.php index 456ac8f..35edf1a 100644 --- a/setup/wizard/step.php +++ b/setup/wizard/step.php @@ -127,7 +127,6 @@ class Step // public $dbhandler; public function __construct() { -// $this->dbhandler = new dbUtilities(); $this->util = new InstallUtil(); } /** diff --git a/setup/wizard/steps/complete.php b/setup/wizard/steps/complete.php index 3108468..e3b66cf 100644 --- a/setup/wizard/steps/complete.php +++ b/setup/wizard/steps/complete.php @@ -142,8 +142,8 @@ class complete extends Step { // retrieve database information from session $dbconf = $this->getDataFromSession("database"); // make db connection - admin - $this->util->dbHandler->load($dbconf['dhost'], $dbconf['dmsname'], $dbconf['dmspassword'], $dbconf['dname']); - $loaded = $this->util->dbHandler->getDatabaseLink(); + $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dmsname'], $dbconf['dmspassword'], $dbconf['dname']); + $loaded = $this->util->dbUtilities->getDatabaseLink(); if (!$loaded) { $this->temp_variables['dbConnectAdmin'] .= '
' . 'Unable to connect to database (user: ' @@ -157,20 +157,20 @@ class complete extends Step { } // make db connection - user - $this->util->dbHandler->load($dbconf['dhost'], $dbconf['dmsusername'], $dbconf['dmsuserpassword'], $dbconf['dname']); - $loaded = $this->util->dbHandler->getDatabaseLink(); + $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dmsusername'], $dbconf['dmsuserpassword'], $dbconf['dname']); + $loaded = $this->util->dbUtilities->getDatabaseLink(); // if we can log in to the database, check access // TODO check write access? if ($loaded) { $this->temp_variables['dbConnectUser'] .= sprintf($html, 'tick', '', 'Database connectivity successful (user: ' . $dbconf['dmsusername'] . ')'); - $qresult = $this->util->dbHandler->query('SELECT COUNT(id) FROM documents'); + $qresult = $this->util->dbUtilities->query('SELECT COUNT(id) FROM documents'); if (!$qresult) { $this->temp_variables['dbPrivileges'] .= '
' . '' - . 'Unable to do a basic database query. Error: ' . $this->util->dbHandler->getLastError() + . 'Unable to do a basic database query. Error: ' . $this->util->dbUtilities->getLastError() . ''; $this->privileges_check = 'cross'; $this->privileges_check = 'cross'; @@ -183,17 +183,17 @@ class complete extends Step { // check transaction support $sTable = 'system_settings'; - $this->util->dbHandler->startTransaction(); - $this->util->dbHandler->query('INSERT INTO ' . $sTable . ' (name, value) VALUES ("transactionTest", "1")'); - $this->util->dbHandler->rollback(); - $res = $this->util->dbHandler->query("SELECT id FROM $sTable WHERE name = 'transactionTest' LIMIT 1"); + $this->util->dbUtilities->startTransaction(); + $this->util->dbUtilities->query('INSERT INTO ' . $sTable . ' (name, value) VALUES ("transactionTest", "1")'); + $this->util->dbUtilities->rollback(); + $res = $this->util->dbUtilities->query("SELECT id FROM $sTable WHERE name = 'transactionTest' LIMIT 1"); if (!$res) { $this->temp_variables['dbTransaction'] .= sprintf($html, 'cross', 'class="error"', 'Transaction support not available in database'); $this->privileges_check = 'cross'; } else { $this->temp_variables['dbTransaction'] .= sprintf($html, 'tick', '', 'Database has transaction support'); } - $this->util->dbHandler->query('DELETE FROM ' . $sTable . ' WHERE name = "transactionTest"'); + $this->util->dbUtilities->query('DELETE FROM ' . $sTable . ' WHERE name = "transactionTest"'); } else { diff --git a/setup/wizard/steps/configuration.php b/setup/wizard/steps/configuration.php index 197dfa1..83e47cd 100644 --- a/setup/wizard/steps/configuration.php +++ b/setup/wizard/steps/configuration.php @@ -307,7 +307,7 @@ class configuration extends Step { $conf = $this->getDataFromSession("configuration"); // get data from the server $dbconf = $this->getDataFromSession("database"); - $this->util->dbHandler->load($dbconf['dhost'], $dbconf['dmsname'], $dbconf['dmspassword'], $dbconf['dname']); + $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dmsname'], $dbconf['dmspassword'], $dbconf['dname']); $server = $conf['server']; $paths = $conf['paths']; if ($this->util->isMigration()) { // Check if its an upgrade @@ -317,24 +317,24 @@ class configuration extends Step $this->readConfigPath(); // initialise writing to config.ini } $this->getFromConfigPath(); // Sets config Paths - if(file_exists($this->confpaths['configIni'])) { - $this->util->iniHandler->load($this->confpaths['configIni']); + if(file_exists($configPath)) { + $this->util->iniUtilities->load($configPath); } - if(!$this->util->iniHandler === false){ // write out the config.ini file - $this->writeUrlSection(); - $this->writeDBSection($server); - $this->writeDBPathSection($paths); - $this->util->iniHandler->write(); + $this->writeUrlSection(); + $this->writeDBSection($server); + $this->writeDBPathSection($paths); + if(!$this->util->iniUtilities === false){ // write out the config.ini file + $this->util->iniUtilities->write(); } - $this->util->dbHandler->close(); // close the database connection - $this->writeCachePath($this->getCachePath(), $paths['cacheDirectory']['path']); // Write cache path file - $this->writeConfigPath($this->getContentPath(), $this->confpaths['configIni']); // Write config file + $this->util->dbUtilities->close(); // close the database connection + $this->writeCachePath(); // Write cache path file + $this->writeConfigPath($configPath); // Write config file } private function writeUrlSection() { $directories = $this->registerDirs(); foreach($directories as $item) { // write server settings to config_settings table and config.ini - $this->util->iniHandler->updateItem($item['section'], $item['setting'], $item['value']); + $this->util->iniUtilities->updateItem($item['section'], $item['setting'], $item['value']); } } @@ -348,14 +348,14 @@ class configuration extends Step $value = mysql_real_escape_string($item['path']); $setting = mysql_real_escape_string($item['setting']); $sql = "UPDATE {$table} SET value = '{$value}' WHERE item = '{$setting}'"; - $this->util->dbHandler->query($sql); + $this->util->dbUtilities->query($sql); } } } private function writeDBSection($server) { $dbconf = $this->getDataFromSession("database"); // retrieve database information from session - $this->util->dbHandler->load($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); // initialise the db connection + $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); // initialise the db connection $server = $this->registerDBConfig($server, $dbconf); // add db config to server variables $table = 'config_settings'; foreach($server as $item) { // write server settings to config_settings table and config.ini @@ -368,14 +368,14 @@ class configuration extends Step if($value == 'no'){ $value = 'false'; } - $this->util->iniHandler->updateItem($item['section'], $item['setting'], $value); + $this->util->iniUtilities->updateItem($item['section'], $item['setting'], $value); break; case 'db': $value = mysql_real_escape_string($item['value']); $setting = mysql_real_escape_string($item['setting']); $sql = "UPDATE {$table} SET value = '{$value}' WHERE item = '{$setting}'"; - $this->util->dbHandler->query($sql); + $this->util->dbUtilities->query($sql); break; } } @@ -573,12 +573,13 @@ class configuration extends Step public function readConfigPathIni() { if(isset($this->temp_variables['paths']['configFile']['path'])) { - return $this->temp_variables['paths']['configFile']['path']; + if($this->temp_variables['paths']['configFile']['path'] != '') + return $this->temp_variables['paths']['configFile']['path']; } $configPath = $this->getContentPath(); if(!$configPath) return false; - $this->util->iniHandler->load($configPath); - $data = $this->util->iniHandler->getFileByLine(); + $this->util->iniUtilities->load($configPath); + $data = $this->util->iniUtilities->getFileByLine(); $firstline = true; foreach ($data as $k=>$v) { if(preg_match('/config.ini/', $k)) { // Find config.ini @@ -600,8 +601,8 @@ class configuration extends Step private function readConfigPath() { $configPath = $this->getContentPath(); if(!$configPath) return false; - $this->util->iniHandler->load($configPath); - $data = $this->util->iniHandler->getFileByLine(); + $this->util->iniUtilities->load($configPath); + $data = $this->util->iniUtilities->getFileByLine(); $firstline = true; foreach ($data as $k=>$v) { if($firstline) { // First line holds the var directory diff --git a/setup/wizard/steps/database.php b/setup/wizard/steps/database.php index 5abb6a5..922d5d0 100644 --- a/setup/wizard/steps/database.php +++ b/setup/wizard/steps/database.php @@ -320,11 +320,11 @@ class database extends Step return false; } if($this->dport == '') { - $this->util->dbHandler->load($this->dhost, $this->duname, $this->dpassword, $this->dname); + $this->util->dbUtilities->load($this->dhost, $this->duname, $this->dpassword, $this->dname); } else { - $this->util->dbHandler->load($this->dhost.":".$this->dport, $this->duname, $this->dpassword, $this->dname); + $this->util->dbUtilities->load($this->dhost.":".$this->dport, $this->duname, $this->dpassword, $this->dname); } - if (!$this->util->dbHandler->getDatabaseLink()) { + if (!$this->util->dbUtilities->getDatabaseLink()) { $this->error['con'] = "Could not connect to the database, please check username and password"; return false; } else { @@ -339,7 +339,7 @@ class database extends Step } public function dbExists() { - return $this->util->dbHandler->useDb(); + return $this->util->dbUtilities->useDb(); } public function match($str1, $str2) { @@ -500,7 +500,6 @@ class database extends Step * @return object SimpleXmlObject */ public function readXml() { -// echo CONF_DIR."databases.xml"; $simplexml = simplexml_load_file(CONF_DIR."databases.xml"); return $simplexml; @@ -583,7 +582,7 @@ class database extends Step * @return object mysql connection */ private function connectMysql() { - $this->util->dbHandler->load($this->dhost, $this->duname, $this->dpassword, $this->dname); + $this->util->dbUtilities->load($this->dhost, $this->duname, $this->dpassword, $this->dname); } /** @@ -642,7 +641,7 @@ class database extends Step $this->error['con'] = "Could not create database: "; } } - $this->util->dbHandler->clearErrors(); + $this->util->dbUtilities->clearErrors(); if(!$this->createDmsUser()) { // Create dms users $this->error['con'] = "Could not create database users "; } @@ -666,8 +665,7 @@ class database extends Step */ private function create() { $sql = "CREATE DATABASE {$this->dname}"; - if ($this->util->dbHandler->query($sql)) { - + if ($this->util->dbUtilities->query($sql)) { return true; } @@ -683,7 +681,7 @@ class database extends Step * @return boolean */ private function usedb() { - if($this->util->dbHandler->useDb()) { + if($this->util->dbUtilities->useDb()) { return true; } else { $this->error['con'] = "Error using database: {$this->dname}"; @@ -702,7 +700,7 @@ class database extends Step private function dropdb() { if($this->ddrop) { $sql = "DROP DATABASE {$this->dname};"; - if(!$this->util->dbHandler->query($sql)) { + if(!$this->util->dbUtilities->query($sql)) { $this->error['con'] = "Cannot drop database: {$this->dname}"; return false; } @@ -724,7 +722,7 @@ class database extends Step private function createDmsUser() { $user1 = "GRANT SELECT, INSERT, UPDATE, DELETE ON {$this->dname}.* TO {$this->dmsusername}@{$this->dhost} IDENTIFIED BY \"{$this->dmsuserpassword}\";"; $user2 = "GRANT ALL PRIVILEGES ON {$this->dname}.* TO {$this->dmsname}@{$this->dhost} IDENTIFIED BY \"{$this->dmspassword}\";"; - if ($this->util->dbHandler->query($user1) && $this->util->dbHandler->query($user2)) { + if ($this->util->dbUtilities->query($user1) && $this->util->dbUtilities->query($user2)) { return true; } else { $this->error['con'] = "Could not create users for database: {$this->dname}"; @@ -751,7 +749,7 @@ class database extends Step while (!feof($handle)) { $query.= fgets($handle, 4096); if (substr(rtrim($query), -1) == ';') { - $this->util->dbHandler->query($query); + $this->util->dbUtilities->query($query); $query = ''; } } @@ -778,9 +776,9 @@ class database extends Step $sqlFile = $dbMigrate['dumpLocation']; $this->parse_mysql_dump($sqlFile); $dropPluginHelper = "TRUNCATE plugin_helper;"; - $this->util->dbHandler->query($dropPluginHelper); + $this->util->dbUtilities->query($dropPluginHelper); $updateUrls = 'UPDATE config_settings c SET c.value = "default" where c.group_name = "urls";'; - $this->util->dbHandler->query($updateUrls); + $this->util->dbUtilities->query($updateUrls); return true; } /** @@ -793,7 +791,7 @@ class database extends Step */ private function closeMysql() { try { - $this->util->dbHandler->close(); + $this->util->dbUtilities->close(); } catch (Exeption $e) { $this->error['con'] = "Could not close: " . $e; } @@ -844,7 +842,7 @@ class database extends Step $this->dpassword = 'root'; $this->dname = 'dms_install'; $this->dbbinary = 'mysql'; - $this->util->dbHandler->load($this->dhost, $this->duname, $this->dpassword, $this->dname); + $this->util->dbUtilities->load($this->dhost, $this->duname, $this->dpassword, $this->dname); $this->createSchema(); echo 'Schema loaded
'; } diff --git a/setup/wizard/steps/install.php b/setup/wizard/steps/install.php index 6974716..48ba644 100644 --- a/setup/wizard/steps/install.php +++ b/setup/wizard/steps/install.php @@ -107,14 +107,14 @@ class install extends step public function callHome() { $conf = $this->getDataFromSession("install"); // retrieve database information from session $dbconf = $this->getDataFromSession("database"); - $this->util->dbHandler->load($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); // initialise the db connection + $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); // initialise the db connection $complete = 1; if($conf['call_home'] == 'enable'){ $complete = 0; } $query = "UPDATE scheduler_tasks SET is_complete = {$complete} WHERE task = 'Call Home'"; - $this->util->dbHandler->query($query); - $this->util->dbHandler->close(); // close the database connection + $this->util->dbUtilities->query($query); + $this->util->dbUtilities->close(); // close the database connection } } ?> \ No newline at end of file diff --git a/thirdparty/Smarty/internals/core.write_compiled_resource.php b/thirdparty/Smarty/internals/core.write_compiled_resource.php index b902eff..c3c6a3f 100644 --- a/thirdparty/Smarty/internals/core.write_compiled_resource.php +++ b/thirdparty/Smarty/internals/core.write_compiled_resource.php @@ -17,7 +17,7 @@ function smarty_core_write_compiled_resource($params, &$smarty) if(!@is_writable($smarty->compile_dir)) { // compile_dir not writable, see if it exists if(!@is_dir($smarty->compile_dir)) { - $smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR); + $smarty->trigger_error('the '.$compile_dir.' \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR); return false; } $smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR); diff --git a/var/bin/taskrunner.bat b/var/bin/taskrunner.bat index 7002021..d25defc 100644 --- a/var/bin/taskrunner.bat +++ b/var/bin/taskrunner.bat @@ -1 +1,2 @@ -// DO NOT DELETE \ No newline at end of file +@echo off +"D:\Program Files\Zend\ZendServer\bin\php.exe" "D:\Program Files\Zend\Apache2\htdocs\knowledgetree\bin\win32\schedulerService.php" \ No newline at end of file -- libgit2 0.21.4