Commit 806fd35e27e30a04281a7eae764a7a0dedaf7bd6
1 parent
05ae1784
Merge Work/Home
Commited By: Jarrett Jordaan Reviewed By: Megan Watson
Showing
23 changed files
with
127 additions
and
157 deletions
config/cache-path
| 1 | -var/cache |
config/config-path
config/config.ini
| ... | ... | @@ -9,14 +9,14 @@ |
| 9 | 9 | dbType = mysql |
| 10 | 10 | |
| 11 | 11 | ; Database login details |
| 12 | -dbHost = localhost | |
| 13 | -dbName = dms | |
| 14 | -dbUser = dms | |
| 15 | -dbPass = djw9281js | |
| 16 | -dbPort = default | |
| 12 | +dbHost = localhost | |
| 13 | +dbName = dms_migrate | |
| 14 | +dbUser = dmsadmin | |
| 15 | +dbPass = js9281djw | |
| 16 | +dbPort = 3306 | |
| 17 | 17 | |
| 18 | -dbAdminUser = dmsadmin | |
| 19 | -dbAdminPass = js9281djw | |
| 18 | +dbAdminUser = dmsadmin | |
| 19 | +dbAdminPass = js9281djw | |
| 20 | 20 | |
| 21 | 21 | [KnowledgeTree] |
| 22 | 22 | |
| ... | ... | @@ -31,7 +31,7 @@ dbAdminPass = js9281djw |
| 31 | 31 | ; |
| 32 | 32 | ; Leave as default to have it automatically detected. |
| 33 | 33 | ; |
| 34 | -fileSystemRoot = default | |
| 34 | +fileSystemRoot = D:/Program Files/Zend/Apache2/htdocs/knowledgetree | |
| 35 | 35 | |
| 36 | 36 | ; Webserver name (host name) |
| 37 | 37 | ; |
| ... | ... | @@ -43,7 +43,7 @@ serverName = default |
| 43 | 43 | ; |
| 44 | 44 | ; Leave as default to have it automatically detected. |
| 45 | 45 | ; |
| 46 | -sslEnabled = default | |
| 46 | +sslEnabled = false | |
| 47 | 47 | |
| 48 | 48 | ; Path to the web application from the root of the web site. |
| 49 | 49 | ; If KT is at http://example.org/foo/, then rootUrl should be '/foo' |
| ... | ... | @@ -115,11 +115,11 @@ phpErrorLogFile = false |
| 115 | 115 | |
| 116 | 116 | [urls] |
| 117 | 117 | ; directories |
| 118 | -varDirectory = ${fileSystemRoot}/var | |
| 119 | -logDirectory = ${varDirectory}/log | |
| 120 | -documentRoot = ${varDirectory}/Documents | |
| 118 | +varDirectory = C:\Program Files\ktdms\var | |
| 119 | +logDirectory = C:\Program Files\ktdms\var\log | |
| 120 | +documentRoot = C:\Program Files\ktdms\var\Documents | |
| 121 | 121 | uiDirectory = ${fileSystemRoot}/presentation/lookAndFeel/knowledgeTree |
| 122 | -tmpDirectory = ${varDirectory}/tmp | |
| 122 | +tmpDirectory = C:\Program Files\ktdms\var\tmp | |
| 123 | 123 | |
| 124 | 124 | ;dedicated feed url |
| 125 | 125 | ;dedicatedrsstitle = RSS Feed Title |
| ... | ... | @@ -146,4 +146,4 @@ encoding = default |
| 146 | 146 | ; |
| 147 | 147 | cacheEnabled = true |
| 148 | 148 | cacheDirectory = ${varDirectory}/cache |
| 149 | -cachePlugins = true | |
| 150 | 149 | \ No newline at end of file |
| 150 | +cachePlugins = true | ... | ... |
setup/migrate/migrateUtil.php
| ... | ... | @@ -63,14 +63,14 @@ class MigrateUtil extends InstallUtil { |
| 63 | 63 | $template_vars['error'] = $error; |
| 64 | 64 | $file = "templates/error.tpl"; |
| 65 | 65 | if (!file_exists($file)) { |
| 66 | - return false; | |
| 66 | + extract($template_vars); // Extract the vars to local namespace | |
| 67 | + ob_start(); | |
| 68 | + include($file); | |
| 69 | + $contents = ob_get_contents(); | |
| 70 | + ob_end_clean(); | |
| 71 | + echo $contents; | |
| 67 | 72 | } |
| 68 | - extract($template_vars); // Extract the vars to local namespace | |
| 69 | - ob_start(); | |
| 70 | - include($file); | |
| 71 | - $contents = ob_get_contents(); | |
| 72 | - ob_end_clean(); | |
| 73 | - echo $contents; | |
| 73 | + return false; | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
| ... | ... | @@ -89,19 +89,10 @@ class MigrateUtil extends InstallUtil { |
| 89 | 89 | |
| 90 | 90 | return true; |
| 91 | 91 | } |
| 92 | - | |
| 93 | - public function loadInstallDBUtil() { | |
| 94 | - require_once("../wizard/dbUtilities.php"); | |
| 95 | - return new dbUtilities(); | |
| 96 | - } | |
| 97 | - | |
| 98 | - public function loadInstallUtil() { | |
| 99 | - require_once("../wizard/steps/services.php"); | |
| 100 | - return new services(); | |
| 101 | - } | |
| 102 | 92 | |
| 103 | 93 | public function loadInstallServices() { |
| 104 | - $s = $this->loadInstallUtil(); | |
| 94 | + require_once("../wizard/steps/services.php"); | |
| 95 | + $s = new services(); | |
| 105 | 96 | return $s->getServices(); |
| 106 | 97 | } |
| 107 | 98 | |
| ... | ... | @@ -112,11 +103,6 @@ class MigrateUtil extends InstallUtil { |
| 112 | 103 | return new $serviceName(); |
| 113 | 104 | } |
| 114 | 105 | |
| 115 | - public function loadInstallIni($path) { | |
| 116 | - require_once("../wizard/iniUtilities.php"); | |
| 117 | - return new iniUtilities($path); | |
| 118 | - } | |
| 119 | - | |
| 120 | 106 | public function getPort($location) { |
| 121 | 107 | if(WINDOWS_OS) { |
| 122 | 108 | $myIni = "my.ini"; |
| ... | ... | @@ -125,8 +111,8 @@ class MigrateUtil extends InstallUtil { |
| 125 | 111 | } |
| 126 | 112 | $dbConfigPath = $location.DS."mysql".DS."$myIni"; |
| 127 | 113 | if(file_exists($dbConfigPath)) { |
| 128 | - $ini = $this->loadInstallIni($dbConfigPath); | |
| 129 | - $dbSettings = $ini->getSection('mysqladmin'); | |
| 114 | + $this->iniUtilities->load($dbConfigPath); | |
| 115 | + $dbSettings = $this->iniUtilities->getSection('mysqladmin'); | |
| 130 | 116 | return $dbSettings['port']; |
| 131 | 117 | } |
| 132 | 118 | ... | ... |
setup/migrate/migrateWizard.php
| ... | ... | @@ -52,16 +52,14 @@ function __autoload($class) { // Attempt and autoload classes |
| 52 | 52 | if ($class == "template") { // Load existing templating classes |
| 53 | 53 | require_once("../wizard/template.php"); |
| 54 | 54 | require_once("../wizard/lib/helpers/htmlHelper.php"); |
| 55 | - return ; | |
| 56 | - } | |
| 57 | - if(file_exists(WIZARD_DIR."$class.php")) { | |
| 58 | - require_once(WIZARD_DIR."$class.php"); | |
| 59 | - } elseif (file_exists(STEP_DIR."$class.php")) { | |
| 60 | - require_once(STEP_DIR."$class.php"); | |
| 61 | - } elseif (file_exists(WIZARD_LIB."$class.php")) { | |
| 62 | - require_once(WIZARD_LIB."$class.php"); | |
| 63 | 55 | } else { |
| 64 | - return null; | |
| 56 | + if(file_exists(WIZARD_DIR."$class.php")) { | |
| 57 | + require_once(WIZARD_DIR."$class.php"); | |
| 58 | + } elseif (file_exists(STEP_DIR."$class.php")) { | |
| 59 | + require_once(STEP_DIR."$class.php"); | |
| 60 | + } elseif (file_exists(WIZARD_LIB."$class.php")) { | |
| 61 | + require_once(WIZARD_LIB."$class.php"); | |
| 62 | + } | |
| 65 | 63 | } |
| 66 | 64 | } |
| 67 | 65 | |
| ... | ... | @@ -233,8 +231,6 @@ class MigrateWizard { |
| 233 | 231 | return true; |
| 234 | 232 | break; |
| 235 | 233 | } |
| 236 | - | |
| 237 | - return $res; | |
| 238 | 234 | } |
| 239 | 235 | |
| 240 | 236 | /** | ... | ... |
setup/migrate/migrater.php
| ... | ... | @@ -157,7 +157,7 @@ class Migrater { |
| 157 | 157 | $this->simpleXmlObj = simplexml_load_file(CONF_DIR.$name); |
| 158 | 158 | } catch (Exception $e) { |
| 159 | 159 | $util = new MigrateUtil(); |
| 160 | - $util->error("Error reading configuration file: $name"); | |
| 160 | + $util->error("Error reading configuration file: $e"); | |
| 161 | 161 | exit(); |
| 162 | 162 | } |
| 163 | 163 | } |
| ... | ... | @@ -431,8 +431,7 @@ class Migrater { |
| 431 | 431 | if($class->runMigrate()) { // Check if step needs to be migrated |
| 432 | 432 | $class->setDataFromSession($className); // Set Session Information |
| 433 | 433 | $class->setPostConfig(); // Set any posted variables |
| 434 | - $response = $class->migrateStep(); // Run migrate step | |
| 435 | - // TODO : Break on error response | |
| 434 | + $class->migrateStep(); // Run migrate step | |
| 436 | 435 | } |
| 437 | 436 | } else { |
| 438 | 437 | $util = new MigrateUtil(); | ... | ... |
setup/migrate/step.php
setup/migrate/stepAction.php
| ... | ... | @@ -224,17 +224,18 @@ class stepAction { |
| 224 | 224 | if($this->action->storeInSession()) { // Check if class values need to be stored in session |
| 225 | 225 | $this->_loadStepToSession($this->stepName); // Send class to session |
| 226 | 226 | } |
| 227 | - if ($response == 'error') { | |
| 228 | - $this->_handleErrors(); // Send Errors to session | |
| 229 | - } else { | |
| 230 | - $this->_clearErrors($this->stepName); // Send Errors to session | |
| 231 | - } | |
| 232 | - return $response; | |
| 233 | 227 | } else { |
| 234 | 228 | $this->stepName = 'errors'; |
| 235 | 229 | $this->action = $this->createStep(); |
| 236 | 230 | $this->action->error = array('Class File Missing in Step Directory'); |
| 231 | + | |
| 232 | + } | |
| 233 | + if ($response == 'error') { | |
| 234 | + $this->_handleErrors(); // Send Errors to session | |
| 235 | + } else { | |
| 236 | + $this->_clearErrors($this->stepName); // Send Errors to session | |
| 237 | 237 | } |
| 238 | + return $response; | |
| 238 | 239 | } |
| 239 | 240 | |
| 240 | 241 | /** |
| ... | ... | @@ -308,7 +309,7 @@ class stepAction { |
| 308 | 309 | $menu = ''; |
| 309 | 310 | $active = false; |
| 310 | 311 | if($this->stepClassNames) { |
| 311 | - foreach ($this->stepClassNames as $k=>$step) { | |
| 312 | + foreach ($this->stepClassNames as $step) { | |
| 312 | 313 | if($this->step_names[$step] != '') { |
| 313 | 314 | $item = $this->step_names[$step]; |
| 314 | 315 | } else { |
| ... | ... | @@ -452,7 +453,7 @@ class stepAction { |
| 452 | 453 | * @access private |
| 453 | 454 | * @return void |
| 454 | 455 | */ |
| 455 | - private function _loadValueToSession($class, $k, $v, $overwrite = false) { | |
| 456 | + private function _loadValueToSession($class, $k, $v) { | |
| 456 | 457 | if($this->session != null) { |
| 457 | 458 | $this->session->setClass($class, $k, $v); |
| 458 | 459 | } else { |
| ... | ... | @@ -502,8 +503,7 @@ class stepAction { |
| 502 | 503 | * @access private |
| 503 | 504 | * @return void |
| 504 | 505 | */ |
| 505 | - private function _loadErrorToSession($class, $k, $v, $overwrite = false) { | |
| 506 | - $k = "errors"; | |
| 506 | + private function _loadErrorToSession($class, $k = "errors", $v) { | |
| 507 | 507 | if($this->session != null) { |
| 508 | 508 | $this->session->setClassError($class, $k, $v); |
| 509 | 509 | } else { | ... | ... |
setup/migrate/steps/migrateInstallation.php
| ... | ... | @@ -225,8 +225,10 @@ class migrateInstallation extends step |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | private function loadConfig($path) { |
| 228 | - $ini = $this->util->loadInstallIni($path); | |
| 229 | - $dbSettings = $ini->getSection('db'); | |
| 228 | +// $ini = $this->util->loadInstallIni($path); | |
| 229 | + $this->util->iniUtilities->load($path); | |
| 230 | +// $dbSettings = $ini->getSection('db'); | |
| 231 | + $dbSettings = $this->util->iniUtilities->getSection('db'); | |
| 230 | 232 | $this->dbSettings = array('dbHost'=> $dbSettings['dbHost'], |
| 231 | 233 | 'dbName'=> $dbSettings['dbName'], |
| 232 | 234 | 'dbUser'=> $dbSettings['dbUser'], |
| ... | ... | @@ -235,14 +237,16 @@ class migrateInstallation extends step |
| 235 | 237 | 'dbAdminUser'=> $dbSettings['dbAdminUser'], |
| 236 | 238 | 'dbAdminPass'=> $dbSettings['dbAdminPass'], |
| 237 | 239 | ); |
| 238 | - $ktSettings = $ini->getSection('KnowledgeTree'); | |
| 240 | + $ktSettings = $this->util->iniUtilities->getSection('KnowledgeTree'); | |
| 241 | +// $ktSettings = $ini->getSection('KnowledgeTree'); | |
| 239 | 242 | $froot = $ktSettings['fileSystemRoot']; |
| 240 | 243 | if ($froot == 'default') { |
| 241 | 244 | $froot = $this->location; |
| 242 | 245 | } |
| 243 | 246 | $this->ktSettings = array('fileSystemRoot'=> $froot, |
| 244 | 247 | ); |
| 245 | - $urlPaths = $ini->getSection('urls'); | |
| 248 | +// $urlPaths = $ini->getSection('urls'); | |
| 249 | + $urlPaths = $this->util->iniUtilities->getSection('urls'); | |
| 246 | 250 | $varDir = $froot.DS.'var'; |
| 247 | 251 | $this->urlPaths = array(array('name'=> 'Var Directory', 'path'=> $varDir), |
| 248 | 252 | array('name'=> 'Log Directory', 'path'=> $varDir.DS.'log'), | ... | ... |
setup/migrate/steps/migrateServices.php
| ... | ... | @@ -127,7 +127,6 @@ class migrateServices extends Step |
| 127 | 127 | public function doStep() |
| 128 | 128 | { |
| 129 | 129 | $this->temp_variables = array("step_name"=>"services", "silent"=>$this->silent); |
| 130 | - $this->installServices = $this->util->loadInstallUtil(); // Use installer utility class | |
| 131 | 130 | $this->services = $this->util->loadInstallServices(); // Use installer services class |
| 132 | 131 | $this->storeSilent(); |
| 133 | 132 | if(!$this->inStep("services")) { | ... | ... |
setup/upgrade/step.php
setup/upgrade/steps/upgradeDatabase.php
| ... | ... | @@ -242,7 +242,9 @@ class upgradeDatabase extends Step |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | private function readConfig($path) { |
| 245 | - $ini = $this->util->loadInstallIni($path); | |
| 245 | + //$ini = $this->util->loadInstallIni($path); | |
| 246 | + $ini = $this->util->iniUtilities; | |
| 247 | + $ini->load($path); | |
| 246 | 248 | $dbSettings = $ini->getSection('db'); |
| 247 | 249 | $this->dbSettings = array('dbHost'=> $dbSettings['dbHost'], |
| 248 | 250 | 'dbName'=> $dbSettings['dbName'], | ... | ... |
setup/upgrade/steps/upgradeWelcome.php
| ... | ... | @@ -40,6 +40,9 @@ |
| 40 | 40 | * @version Version 0.1 |
| 41 | 41 | */ |
| 42 | 42 | |
| 43 | +//require_once('../../config/dmsDefaults.php'); | |
| 44 | +//require_once KT_LIB_DIR . '/authentication/authenticationutil.inc.php'; | |
| 45 | + | |
| 43 | 46 | class upgradeWelcome extends step { |
| 44 | 47 | |
| 45 | 48 | protected $silent = false; |
| ... | ... | @@ -91,15 +94,9 @@ class upgradeWelcome extends step { |
| 91 | 94 | $dconf = $ini->getSection('db'); |
| 92 | 95 | $this->dbhandler->load($dconf['dbHost'], $dconf['dbUser'], $dconf['dbPass'], $dconf['dbName']); |
| 93 | 96 | } |
| 94 | - $sQuery = "SELECT count(*) AS match_count FROM users WHERE username = '$username' AND password = '".md5($password)."'"; | |
| 95 | - $res = $this->dbhandler->query($sQuery); | |
| 96 | - $ass = $this->dbhandler->fetchAssoc($res); | |
| 97 | - if(isset($ass[0]['match_count'])) { | |
| 98 | - if($ass[0]['match_count']) | |
| 99 | - return true; | |
| 100 | - } | |
| 101 | 97 | $this->error[] = 'Could Not Authenticate User'; |
| 102 | 98 | return false; |
| 99 | + | |
| 103 | 100 | } |
| 104 | 101 | |
| 105 | 102 | public function getErrors() { | ... | ... |
setup/upgrade/upgradeUtil.php
| ... | ... | @@ -40,10 +40,9 @@ |
| 40 | 40 | * @version Version 0.1 |
| 41 | 41 | */ |
| 42 | 42 | |
| 43 | -//require_once('../../config/dmsDefaults.php'); | |
| 44 | 43 | require_once("../wizard/installUtil.php"); |
| 45 | 44 | |
| 46 | -class UpgradeUtil extends InstallUtil { | |
| 45 | +class UpgradeUtil extends InstallUtil { | |
| 47 | 46 | /** |
| 48 | 47 | * Check if system needs to be upgraded |
| 49 | 48 | * |
| ... | ... | @@ -75,16 +74,6 @@ class UpgradeUtil extends InstallUtil { |
| 75 | 74 | echo $contents; |
| 76 | 75 | } |
| 77 | 76 | |
| 78 | - public function loadInstallIni($path) { | |
| 79 | - require_once("../wizard/iniUtilities.php"); | |
| 80 | - return new iniUtilities($path); | |
| 81 | - } | |
| 82 | - | |
| 83 | - public function loadInstallDBUtil() { | |
| 84 | - require_once("../wizard/dbUtilities.php"); | |
| 85 | - return new dbUtilities(); | |
| 86 | - } | |
| 87 | - | |
| 88 | 77 | /** |
| 89 | 78 | * Function to send output to the browser prior to normal dynamic loading of a template after code execution |
| 90 | 79 | * | ... | ... |
setup/wizard/iniUtilities.php
| ... | ... | @@ -43,11 +43,8 @@ class iniUtilities { |
| 43 | 43 | private $lineNum = 0; |
| 44 | 44 | private $exists = ''; |
| 45 | 45 | |
| 46 | - function iniUtilities() { | |
| 47 | - $this->iniFile = ''; | |
| 48 | - } | |
| 49 | - | |
| 50 | - function load($iniFile) { | |
| 46 | + | |
| 47 | + function load($iniFile) { | |
| 51 | 48 | if($this->iniFile != $iniFile) { |
| 52 | 49 | $this->cleanArray = array(); |
| 53 | 50 | $this->lineNum = 0; |
| ... | ... | @@ -56,9 +53,11 @@ class iniUtilities { |
| 56 | 53 | $this->iniFile = $iniFile; |
| 57 | 54 | $this->backupIni($iniFile); |
| 58 | 55 | $this->read($iniFile); |
| 59 | - | |
| 60 | 56 | } |
| 61 | 57 | |
| 58 | + function __construct() { | |
| 59 | + } | |
| 60 | + | |
| 62 | 61 | /** |
| 63 | 62 | * Create a backup with the date as an extension in the same location as the original config.ini |
| 64 | 63 | * | ... | ... |
setup/wizard/installUtil.php
| ... | ... | @@ -40,12 +40,14 @@ |
| 40 | 40 | * @version Version 0.1 |
| 41 | 41 | */ |
| 42 | 42 | |
| 43 | +require_once("../wizard/iniUtilities.php"); | |
| 44 | +require_once("../wizard/dbUtilities.php"); | |
| 43 | 45 | |
| 44 | 46 | class InstallUtil { |
| 45 | 47 | |
| 46 | 48 | private $salt = 'installers'; |
| 47 | - public $dbHandler = null; | |
| 48 | - public $iniHandler = null; | |
| 49 | + public $dbUtilities = null; | |
| 50 | + public $iniUtilities = null; | |
| 49 | 51 | |
| 50 | 52 | /** |
| 51 | 53 | * Constructs installation object |
| ... | ... | @@ -54,8 +56,8 @@ class InstallUtil { |
| 54 | 56 | * @access public |
| 55 | 57 | */ |
| 56 | 58 | public function __construct() { |
| 57 | - $this->dbHandler = new dbUtilities(); | |
| 58 | - $this->iniHandler = new iniUtilities(); | |
| 59 | + $this->dbUtilities = new dbUtilities(); | |
| 60 | + $this->iniUtilities = new iniUtilities(); | |
| 59 | 61 | } |
| 60 | 62 | |
| 61 | 63 | /** | ... | ... |
setup/wizard/step.php
setup/wizard/steps/complete.php
| ... | ... | @@ -142,8 +142,8 @@ class complete extends Step { |
| 142 | 142 | // retrieve database information from session |
| 143 | 143 | $dbconf = $this->getDataFromSession("database"); |
| 144 | 144 | // make db connection - admin |
| 145 | - $this->util->dbHandler->load($dbconf['dhost'], $dbconf['dmsname'], $dbconf['dmspassword'], $dbconf['dname']); | |
| 146 | - $loaded = $this->util->dbHandler->getDatabaseLink(); | |
| 145 | + $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dmsname'], $dbconf['dmspassword'], $dbconf['dname']); | |
| 146 | + $loaded = $this->util->dbUtilities->getDatabaseLink(); | |
| 147 | 147 | if (!$loaded) { |
| 148 | 148 | $this->temp_variables['dbConnectAdmin'] .= '<td><div class="cross"></div></td>' |
| 149 | 149 | . '<td class="error">Unable to connect to database (user: ' |
| ... | ... | @@ -157,20 +157,20 @@ class complete extends Step { |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | // make db connection - user |
| 160 | - $this->util->dbHandler->load($dbconf['dhost'], $dbconf['dmsusername'], $dbconf['dmsuserpassword'], $dbconf['dname']); | |
| 161 | - $loaded = $this->util->dbHandler->getDatabaseLink(); | |
| 160 | + $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dmsusername'], $dbconf['dmsuserpassword'], $dbconf['dname']); | |
| 161 | + $loaded = $this->util->dbUtilities->getDatabaseLink(); | |
| 162 | 162 | // if we can log in to the database, check access |
| 163 | 163 | // TODO check write access? |
| 164 | 164 | if ($loaded) |
| 165 | 165 | { |
| 166 | 166 | $this->temp_variables['dbConnectUser'] .= sprintf($html, 'tick', '', 'Database connectivity successful (user: ' . $dbconf['dmsusername'] . ')'); |
| 167 | 167 | |
| 168 | - $qresult = $this->util->dbHandler->query('SELECT COUNT(id) FROM documents'); | |
| 168 | + $qresult = $this->util->dbUtilities->query('SELECT COUNT(id) FROM documents'); | |
| 169 | 169 | if (!$qresult) |
| 170 | 170 | { |
| 171 | 171 | $this->temp_variables['dbPrivileges'] .= '<td style="width:15px;"><div class="cross" style="float:left;"></div></td>' |
| 172 | 172 | . '<td class="error" style="width:500px;">' |
| 173 | - . 'Unable to do a basic database query. Error: ' . $this->util->dbHandler->getLastError() | |
| 173 | + . 'Unable to do a basic database query. Error: ' . $this->util->dbUtilities->getLastError() | |
| 174 | 174 | . '</td>'; |
| 175 | 175 | $this->privileges_check = 'cross'; |
| 176 | 176 | $this->privileges_check = 'cross'; |
| ... | ... | @@ -183,17 +183,17 @@ class complete extends Step { |
| 183 | 183 | |
| 184 | 184 | // check transaction support |
| 185 | 185 | $sTable = 'system_settings'; |
| 186 | - $this->util->dbHandler->startTransaction(); | |
| 187 | - $this->util->dbHandler->query('INSERT INTO ' . $sTable . ' (name, value) VALUES ("transactionTest", "1")'); | |
| 188 | - $this->util->dbHandler->rollback(); | |
| 189 | - $res = $this->util->dbHandler->query("SELECT id FROM $sTable WHERE name = 'transactionTest' LIMIT 1"); | |
| 186 | + $this->util->dbUtilities->startTransaction(); | |
| 187 | + $this->util->dbUtilities->query('INSERT INTO ' . $sTable . ' (name, value) VALUES ("transactionTest", "1")'); | |
| 188 | + $this->util->dbUtilities->rollback(); | |
| 189 | + $res = $this->util->dbUtilities->query("SELECT id FROM $sTable WHERE name = 'transactionTest' LIMIT 1"); | |
| 190 | 190 | if (!$res) { |
| 191 | 191 | $this->temp_variables['dbTransaction'] .= sprintf($html, 'cross', 'class="error"', 'Transaction support not available in database'); |
| 192 | 192 | $this->privileges_check = 'cross'; |
| 193 | 193 | } else { |
| 194 | 194 | $this->temp_variables['dbTransaction'] .= sprintf($html, 'tick', '', 'Database has transaction support'); |
| 195 | 195 | } |
| 196 | - $this->util->dbHandler->query('DELETE FROM ' . $sTable . ' WHERE name = "transactionTest"'); | |
| 196 | + $this->util->dbUtilities->query('DELETE FROM ' . $sTable . ' WHERE name = "transactionTest"'); | |
| 197 | 197 | } |
| 198 | 198 | else |
| 199 | 199 | { | ... | ... |
setup/wizard/steps/configuration.php
| ... | ... | @@ -307,7 +307,7 @@ class configuration extends Step |
| 307 | 307 | { |
| 308 | 308 | $conf = $this->getDataFromSession("configuration"); // get data from the server |
| 309 | 309 | $dbconf = $this->getDataFromSession("database"); |
| 310 | - $this->util->dbHandler->load($dbconf['dhost'], $dbconf['dmsname'], $dbconf['dmspassword'], $dbconf['dname']); | |
| 310 | + $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dmsname'], $dbconf['dmspassword'], $dbconf['dname']); | |
| 311 | 311 | $server = $conf['server']; |
| 312 | 312 | $paths = $conf['paths']; |
| 313 | 313 | if ($this->util->isMigration()) { // Check if its an upgrade |
| ... | ... | @@ -317,24 +317,24 @@ class configuration extends Step |
| 317 | 317 | $this->readConfigPath(); // initialise writing to config.ini |
| 318 | 318 | } |
| 319 | 319 | $this->getFromConfigPath(); // Sets config Paths |
| 320 | - if(file_exists($this->confpaths['configIni'])) { | |
| 321 | - $this->util->iniHandler->load($this->confpaths['configIni']); | |
| 320 | + if(file_exists($configPath)) { | |
| 321 | + $this->util->iniUtilities->load($configPath); | |
| 322 | 322 | } |
| 323 | - if(!$this->util->iniHandler === false){ // write out the config.ini file | |
| 324 | - $this->writeUrlSection(); | |
| 325 | - $this->writeDBSection($server); | |
| 326 | - $this->writeDBPathSection($paths); | |
| 327 | - $this->util->iniHandler->write(); | |
| 323 | + $this->writeUrlSection(); | |
| 324 | + $this->writeDBSection($server); | |
| 325 | + $this->writeDBPathSection($paths); | |
| 326 | + if(!$this->util->iniUtilities === false){ // write out the config.ini file | |
| 327 | + $this->util->iniUtilities->write(); | |
| 328 | 328 | } |
| 329 | - $this->util->dbHandler->close(); // close the database connection | |
| 330 | - $this->writeCachePath($this->getCachePath(), $paths['cacheDirectory']['path']); // Write cache path file | |
| 331 | - $this->writeConfigPath($this->getContentPath(), $this->confpaths['configIni']); // Write config file | |
| 329 | + $this->util->dbUtilities->close(); // close the database connection | |
| 330 | + $this->writeCachePath(); // Write cache path file | |
| 331 | + $this->writeConfigPath($configPath); // Write config file | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | private function writeUrlSection() { |
| 335 | 335 | $directories = $this->registerDirs(); |
| 336 | 336 | foreach($directories as $item) { // write server settings to config_settings table and config.ini |
| 337 | - $this->util->iniHandler->updateItem($item['section'], $item['setting'], $item['value']); | |
| 337 | + $this->util->iniUtilities->updateItem($item['section'], $item['setting'], $item['value']); | |
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | |
| ... | ... | @@ -348,14 +348,14 @@ class configuration extends Step |
| 348 | 348 | $value = mysql_real_escape_string($item['path']); |
| 349 | 349 | $setting = mysql_real_escape_string($item['setting']); |
| 350 | 350 | $sql = "UPDATE {$table} SET value = '{$value}' WHERE item = '{$setting}'"; |
| 351 | - $this->util->dbHandler->query($sql); | |
| 351 | + $this->util->dbUtilities->query($sql); | |
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | private function writeDBSection($server) { |
| 357 | 357 | $dbconf = $this->getDataFromSession("database"); // retrieve database information from session |
| 358 | - $this->util->dbHandler->load($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); // initialise the db connection | |
| 358 | + $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); // initialise the db connection | |
| 359 | 359 | $server = $this->registerDBConfig($server, $dbconf); // add db config to server variables |
| 360 | 360 | $table = 'config_settings'; |
| 361 | 361 | foreach($server as $item) { // write server settings to config_settings table and config.ini |
| ... | ... | @@ -368,14 +368,14 @@ class configuration extends Step |
| 368 | 368 | if($value == 'no'){ |
| 369 | 369 | $value = 'false'; |
| 370 | 370 | } |
| 371 | - $this->util->iniHandler->updateItem($item['section'], $item['setting'], $value); | |
| 371 | + $this->util->iniUtilities->updateItem($item['section'], $item['setting'], $value); | |
| 372 | 372 | break; |
| 373 | 373 | case 'db': |
| 374 | 374 | $value = mysql_real_escape_string($item['value']); |
| 375 | 375 | $setting = mysql_real_escape_string($item['setting']); |
| 376 | 376 | |
| 377 | 377 | $sql = "UPDATE {$table} SET value = '{$value}' WHERE item = '{$setting}'"; |
| 378 | - $this->util->dbHandler->query($sql); | |
| 378 | + $this->util->dbUtilities->query($sql); | |
| 379 | 379 | break; |
| 380 | 380 | } |
| 381 | 381 | } |
| ... | ... | @@ -573,12 +573,13 @@ class configuration extends Step |
| 573 | 573 | |
| 574 | 574 | public function readConfigPathIni() { |
| 575 | 575 | if(isset($this->temp_variables['paths']['configFile']['path'])) { |
| 576 | - return $this->temp_variables['paths']['configFile']['path']; | |
| 576 | + if($this->temp_variables['paths']['configFile']['path'] != '') | |
| 577 | + return $this->temp_variables['paths']['configFile']['path']; | |
| 577 | 578 | } |
| 578 | 579 | $configPath = $this->getContentPath(); |
| 579 | 580 | if(!$configPath) return false; |
| 580 | - $this->util->iniHandler->load($configPath); | |
| 581 | - $data = $this->util->iniHandler->getFileByLine(); | |
| 581 | + $this->util->iniUtilities->load($configPath); | |
| 582 | + $data = $this->util->iniUtilities->getFileByLine(); | |
| 582 | 583 | $firstline = true; |
| 583 | 584 | foreach ($data as $k=>$v) { |
| 584 | 585 | if(preg_match('/config.ini/', $k)) { // Find config.ini |
| ... | ... | @@ -600,8 +601,8 @@ class configuration extends Step |
| 600 | 601 | private function readConfigPath() { |
| 601 | 602 | $configPath = $this->getContentPath(); |
| 602 | 603 | if(!$configPath) return false; |
| 603 | - $this->util->iniHandler->load($configPath); | |
| 604 | - $data = $this->util->iniHandler->getFileByLine(); | |
| 604 | + $this->util->iniUtilities->load($configPath); | |
| 605 | + $data = $this->util->iniUtilities->getFileByLine(); | |
| 605 | 606 | $firstline = true; |
| 606 | 607 | foreach ($data as $k=>$v) { |
| 607 | 608 | if($firstline) { // First line holds the var directory | ... | ... |
setup/wizard/steps/database.php
| ... | ... | @@ -320,11 +320,11 @@ class database extends Step |
| 320 | 320 | return false; |
| 321 | 321 | } |
| 322 | 322 | if($this->dport == '') { |
| 323 | - $this->util->dbHandler->load($this->dhost, $this->duname, $this->dpassword, $this->dname); | |
| 323 | + $this->util->dbUtilities->load($this->dhost, $this->duname, $this->dpassword, $this->dname); | |
| 324 | 324 | } else { |
| 325 | - $this->util->dbHandler->load($this->dhost.":".$this->dport, $this->duname, $this->dpassword, $this->dname); | |
| 325 | + $this->util->dbUtilities->load($this->dhost.":".$this->dport, $this->duname, $this->dpassword, $this->dname); | |
| 326 | 326 | } |
| 327 | - if (!$this->util->dbHandler->getDatabaseLink()) { | |
| 327 | + if (!$this->util->dbUtilities->getDatabaseLink()) { | |
| 328 | 328 | $this->error['con'] = "Could not connect to the database, please check username and password"; |
| 329 | 329 | return false; |
| 330 | 330 | } else { |
| ... | ... | @@ -339,7 +339,7 @@ class database extends Step |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | public function dbExists() { |
| 342 | - return $this->util->dbHandler->useDb(); | |
| 342 | + return $this->util->dbUtilities->useDb(); | |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | public function match($str1, $str2) { |
| ... | ... | @@ -500,7 +500,6 @@ class database extends Step |
| 500 | 500 | * @return object SimpleXmlObject |
| 501 | 501 | */ |
| 502 | 502 | public function readXml() { |
| 503 | -// echo CONF_DIR."databases.xml"; | |
| 504 | 503 | $simplexml = simplexml_load_file(CONF_DIR."databases.xml"); |
| 505 | 504 | |
| 506 | 505 | return $simplexml; |
| ... | ... | @@ -583,7 +582,7 @@ class database extends Step |
| 583 | 582 | * @return object mysql connection |
| 584 | 583 | */ |
| 585 | 584 | private function connectMysql() { |
| 586 | - $this->util->dbHandler->load($this->dhost, $this->duname, $this->dpassword, $this->dname); | |
| 585 | + $this->util->dbUtilities->load($this->dhost, $this->duname, $this->dpassword, $this->dname); | |
| 587 | 586 | } |
| 588 | 587 | |
| 589 | 588 | /** |
| ... | ... | @@ -642,7 +641,7 @@ class database extends Step |
| 642 | 641 | $this->error['con'] = "Could not create database: "; |
| 643 | 642 | } |
| 644 | 643 | } |
| 645 | - $this->util->dbHandler->clearErrors(); | |
| 644 | + $this->util->dbUtilities->clearErrors(); | |
| 646 | 645 | if(!$this->createDmsUser()) { // Create dms users |
| 647 | 646 | $this->error['con'] = "Could not create database users "; |
| 648 | 647 | } |
| ... | ... | @@ -666,8 +665,7 @@ class database extends Step |
| 666 | 665 | */ |
| 667 | 666 | private function create() { |
| 668 | 667 | $sql = "CREATE DATABASE {$this->dname}"; |
| 669 | - if ($this->util->dbHandler->query($sql)) { | |
| 670 | - | |
| 668 | + if ($this->util->dbUtilities->query($sql)) { | |
| 671 | 669 | return true; |
| 672 | 670 | } |
| 673 | 671 | |
| ... | ... | @@ -683,7 +681,7 @@ class database extends Step |
| 683 | 681 | * @return boolean |
| 684 | 682 | */ |
| 685 | 683 | private function usedb() { |
| 686 | - if($this->util->dbHandler->useDb()) { | |
| 684 | + if($this->util->dbUtilities->useDb()) { | |
| 687 | 685 | return true; |
| 688 | 686 | } else { |
| 689 | 687 | $this->error['con'] = "Error using database: {$this->dname}"; |
| ... | ... | @@ -702,7 +700,7 @@ class database extends Step |
| 702 | 700 | private function dropdb() { |
| 703 | 701 | if($this->ddrop) { |
| 704 | 702 | $sql = "DROP DATABASE {$this->dname};"; |
| 705 | - if(!$this->util->dbHandler->query($sql)) { | |
| 703 | + if(!$this->util->dbUtilities->query($sql)) { | |
| 706 | 704 | $this->error['con'] = "Cannot drop database: {$this->dname}"; |
| 707 | 705 | return false; |
| 708 | 706 | } |
| ... | ... | @@ -724,7 +722,7 @@ class database extends Step |
| 724 | 722 | private function createDmsUser() { |
| 725 | 723 | $user1 = "GRANT SELECT, INSERT, UPDATE, DELETE ON {$this->dname}.* TO {$this->dmsusername}@{$this->dhost} IDENTIFIED BY \"{$this->dmsuserpassword}\";"; |
| 726 | 724 | $user2 = "GRANT ALL PRIVILEGES ON {$this->dname}.* TO {$this->dmsname}@{$this->dhost} IDENTIFIED BY \"{$this->dmspassword}\";"; |
| 727 | - if ($this->util->dbHandler->query($user1) && $this->util->dbHandler->query($user2)) { | |
| 725 | + if ($this->util->dbUtilities->query($user1) && $this->util->dbUtilities->query($user2)) { | |
| 728 | 726 | return true; |
| 729 | 727 | } else { |
| 730 | 728 | $this->error['con'] = "Could not create users for database: {$this->dname}"; |
| ... | ... | @@ -751,7 +749,7 @@ class database extends Step |
| 751 | 749 | while (!feof($handle)) { |
| 752 | 750 | $query.= fgets($handle, 4096); |
| 753 | 751 | if (substr(rtrim($query), -1) == ';') { |
| 754 | - $this->util->dbHandler->query($query); | |
| 752 | + $this->util->dbUtilities->query($query); | |
| 755 | 753 | $query = ''; |
| 756 | 754 | } |
| 757 | 755 | } |
| ... | ... | @@ -778,9 +776,9 @@ class database extends Step |
| 778 | 776 | $sqlFile = $dbMigrate['dumpLocation']; |
| 779 | 777 | $this->parse_mysql_dump($sqlFile); |
| 780 | 778 | $dropPluginHelper = "TRUNCATE plugin_helper;"; |
| 781 | - $this->util->dbHandler->query($dropPluginHelper); | |
| 779 | + $this->util->dbUtilities->query($dropPluginHelper); | |
| 782 | 780 | $updateUrls = 'UPDATE config_settings c SET c.value = "default" where c.group_name = "urls";'; |
| 783 | - $this->util->dbHandler->query($updateUrls); | |
| 781 | + $this->util->dbUtilities->query($updateUrls); | |
| 784 | 782 | return true; |
| 785 | 783 | } |
| 786 | 784 | /** |
| ... | ... | @@ -793,7 +791,7 @@ class database extends Step |
| 793 | 791 | */ |
| 794 | 792 | private function closeMysql() { |
| 795 | 793 | try { |
| 796 | - $this->util->dbHandler->close(); | |
| 794 | + $this->util->dbUtilities->close(); | |
| 797 | 795 | } catch (Exeption $e) { |
| 798 | 796 | $this->error['con'] = "Could not close: " . $e; |
| 799 | 797 | } |
| ... | ... | @@ -844,7 +842,7 @@ class database extends Step |
| 844 | 842 | $this->dpassword = 'root'; |
| 845 | 843 | $this->dname = 'dms_install'; |
| 846 | 844 | $this->dbbinary = 'mysql'; |
| 847 | - $this->util->dbHandler->load($this->dhost, $this->duname, $this->dpassword, $this->dname); | |
| 845 | + $this->util->dbUtilities->load($this->dhost, $this->duname, $this->dpassword, $this->dname); | |
| 848 | 846 | $this->createSchema(); |
| 849 | 847 | echo 'Schema loaded<br>'; |
| 850 | 848 | } | ... | ... |
setup/wizard/steps/install.php
| ... | ... | @@ -107,14 +107,14 @@ class install extends step |
| 107 | 107 | public function callHome() { |
| 108 | 108 | $conf = $this->getDataFromSession("install"); // retrieve database information from session |
| 109 | 109 | $dbconf = $this->getDataFromSession("database"); |
| 110 | - $this->util->dbHandler->load($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); // initialise the db connection | |
| 110 | + $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); // initialise the db connection | |
| 111 | 111 | $complete = 1; |
| 112 | 112 | if($conf['call_home'] == 'enable'){ |
| 113 | 113 | $complete = 0; |
| 114 | 114 | } |
| 115 | 115 | $query = "UPDATE scheduler_tasks SET is_complete = {$complete} WHERE task = 'Call Home'"; |
| 116 | - $this->util->dbHandler->query($query); | |
| 117 | - $this->util->dbHandler->close(); // close the database connection | |
| 116 | + $this->util->dbUtilities->query($query); | |
| 117 | + $this->util->dbUtilities->close(); // close the database connection | |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | ?> |
| 121 | 121 | \ No newline at end of file | ... | ... |
thirdparty/Smarty/internals/core.write_compiled_resource.php
| ... | ... | @@ -17,7 +17,7 @@ function smarty_core_write_compiled_resource($params, &$smarty) |
| 17 | 17 | if(!@is_writable($smarty->compile_dir)) { |
| 18 | 18 | // compile_dir not writable, see if it exists |
| 19 | 19 | if(!@is_dir($smarty->compile_dir)) { |
| 20 | - $smarty->trigger_error('the $compile_dir ' . $smarty->compile_dir . ' does not exist, or is not a directory.', E_USER_ERROR); | |
| 20 | + $smarty->trigger_error('the '.$compile_dir.' ' . $smarty->compile_dir . ' does not exist, or is not a directory.', E_USER_ERROR); | |
| 21 | 21 | return false; |
| 22 | 22 | } |
| 23 | 23 | $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); | ... | ... |