Commit 8c2f1c51544f15bd9870f46a5d564e824771b51c

Authored by sergem
2 parents 4de249dc e3c1352a

Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge

config/cache-path
1 -var/cache  
config/config-path
1 -config/config.ini 1 +C:\ktdms\config\config.ini
2 \ No newline at end of file 2 \ No newline at end of file
config/config.ini
@@ -9,14 +9,14 @@ @@ -9,14 +9,14 @@
9 dbType = mysql 9 dbType = mysql
10 10
11 ; Database login details 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 [KnowledgeTree] 21 [KnowledgeTree]
22 22
@@ -31,7 +31,7 @@ dbAdminPass = js9281djw @@ -31,7 +31,7 @@ dbAdminPass = js9281djw
31 ; 31 ;
32 ; Leave as default to have it automatically detected. 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 ; Webserver name (host name) 36 ; Webserver name (host name)
37 ; 37 ;
@@ -43,7 +43,7 @@ serverName = default @@ -43,7 +43,7 @@ serverName = default
43 ; 43 ;
44 ; Leave as default to have it automatically detected. 44 ; Leave as default to have it automatically detected.
45 ; 45 ;
46 -sslEnabled = default 46 +sslEnabled = false
47 47
48 ; Path to the web application from the root of the web site. 48 ; Path to the web application from the root of the web site.
49 ; If KT is at http://example.org/foo/, then rootUrl should be '/foo' 49 ; If KT is at http://example.org/foo/, then rootUrl should be '/foo'
@@ -115,11 +115,11 @@ phpErrorLogFile = false @@ -115,11 +115,11 @@ phpErrorLogFile = false
115 115
116 [urls] 116 [urls]
117 ; directories 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 uiDirectory = ${fileSystemRoot}/presentation/lookAndFeel/knowledgeTree 121 uiDirectory = ${fileSystemRoot}/presentation/lookAndFeel/knowledgeTree
122 -tmpDirectory = ${varDirectory}/tmp 122 +tmpDirectory = C:\Program Files\ktdms\var\tmp
123 123
124 ;dedicated feed url 124 ;dedicated feed url
125 ;dedicatedrsstitle = RSS Feed Title 125 ;dedicatedrsstitle = RSS Feed Title
@@ -146,4 +146,4 @@ encoding = default @@ -146,4 +146,4 @@ encoding = default
146 ; 146 ;
147 cacheEnabled = true 147 cacheEnabled = true
148 cacheDirectory = ${varDirectory}/cache 148 cacheDirectory = ${varDirectory}/cache
149 -cachePlugins = true  
150 \ No newline at end of file 149 \ No newline at end of file
  150 +cachePlugins = true
setup/migrate/migrateUtil.php
@@ -63,14 +63,14 @@ class MigrateUtil extends InstallUtil { @@ -63,14 +63,14 @@ class MigrateUtil extends InstallUtil {
63 $template_vars['error'] = $error; 63 $template_vars['error'] = $error;
64 $file = "templates/error.tpl"; 64 $file = "templates/error.tpl";
65 if (!file_exists($file)) { 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,19 +89,10 @@ class MigrateUtil extends InstallUtil {
89 89
90 return true; 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 public function loadInstallServices() { 93 public function loadInstallServices() {
104 - $s = $this->loadInstallUtil(); 94 + require_once("../wizard/steps/services.php");
  95 + $s = new services();
105 return $s->getServices(); 96 return $s->getServices();
106 } 97 }
107 98
@@ -112,11 +103,6 @@ class MigrateUtil extends InstallUtil { @@ -112,11 +103,6 @@ class MigrateUtil extends InstallUtil {
112 return new $serviceName(); 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 public function getPort($location) { 106 public function getPort($location) {
121 if(WINDOWS_OS) { 107 if(WINDOWS_OS) {
122 $myIni = "my.ini"; 108 $myIni = "my.ini";
@@ -125,8 +111,8 @@ class MigrateUtil extends InstallUtil { @@ -125,8 +111,8 @@ class MigrateUtil extends InstallUtil {
125 } 111 }
126 $dbConfigPath = $location.DS."mysql".DS."$myIni"; 112 $dbConfigPath = $location.DS."mysql".DS."$myIni";
127 if(file_exists($dbConfigPath)) { 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 return $dbSettings['port']; 116 return $dbSettings['port'];
131 } 117 }
132 118
setup/migrate/migrateWizard.php
@@ -52,16 +52,14 @@ function __autoload($class) { // Attempt and autoload classes @@ -52,16 +52,14 @@ function __autoload($class) { // Attempt and autoload classes
52 if ($class == "template") { // Load existing templating classes 52 if ($class == "template") { // Load existing templating classes
53 require_once("../wizard/template.php"); 53 require_once("../wizard/template.php");
54 require_once("../wizard/lib/helpers/htmlHelper.php"); 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 } else { 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,8 +231,6 @@ class MigrateWizard {
233 return true; 231 return true;
234 break; 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,7 +157,7 @@ class Migrater {
157 $this->simpleXmlObj = simplexml_load_file(CONF_DIR.$name); 157 $this->simpleXmlObj = simplexml_load_file(CONF_DIR.$name);
158 } catch (Exception $e) { 158 } catch (Exception $e) {
159 $util = new MigrateUtil(); 159 $util = new MigrateUtil();
160 - $util->error("Error reading configuration file: $name"); 160 + $util->error("Error reading configuration file: $e");
161 exit(); 161 exit();
162 } 162 }
163 } 163 }
@@ -431,8 +431,7 @@ class Migrater { @@ -431,8 +431,7 @@ class Migrater {
431 if($class->runMigrate()) { // Check if step needs to be migrated 431 if($class->runMigrate()) { // Check if step needs to be migrated
432 $class->setDataFromSession($className); // Set Session Information 432 $class->setDataFromSession($className); // Set Session Information
433 $class->setPostConfig(); // Set any posted variables 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 } else { 436 } else {
438 $util = new MigrateUtil(); 437 $util = new MigrateUtil();
setup/migrate/step.php
@@ -128,7 +128,6 @@ class Step @@ -128,7 +128,6 @@ class Step
128 128
129 public function __construct() { 129 public function __construct() {
130 $this->util = new MigrateUtil(); 130 $this->util = new MigrateUtil();
131 - $this->dbhandler = $this->util->loadInstallDBUtil();  
132 } 131 }
133 132
134 /** 133 /**
setup/migrate/stepAction.php
@@ -224,17 +224,18 @@ class stepAction { @@ -224,17 +224,18 @@ class stepAction {
224 if($this->action->storeInSession()) { // Check if class values need to be stored in session 224 if($this->action->storeInSession()) { // Check if class values need to be stored in session
225 $this->_loadStepToSession($this->stepName); // Send class to session 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 } else { 227 } else {
234 $this->stepName = 'errors'; 228 $this->stepName = 'errors';
235 $this->action = $this->createStep(); 229 $this->action = $this->createStep();
236 $this->action->error = array('Class File Missing in Step Directory'); 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,7 +309,7 @@ class stepAction {
308 $menu = ''; 309 $menu = '';
309 $active = false; 310 $active = false;
310 if($this->stepClassNames) { 311 if($this->stepClassNames) {
311 - foreach ($this->stepClassNames as $k=>$step) { 312 + foreach ($this->stepClassNames as $step) {
312 if($this->step_names[$step] != '') { 313 if($this->step_names[$step] != '') {
313 $item = $this->step_names[$step]; 314 $item = $this->step_names[$step];
314 } else { 315 } else {
@@ -452,7 +453,7 @@ class stepAction { @@ -452,7 +453,7 @@ class stepAction {
452 * @access private 453 * @access private
453 * @return void 454 * @return void
454 */ 455 */
455 - private function _loadValueToSession($class, $k, $v, $overwrite = false) { 456 + private function _loadValueToSession($class, $k, $v) {
456 if($this->session != null) { 457 if($this->session != null) {
457 $this->session->setClass($class, $k, $v); 458 $this->session->setClass($class, $k, $v);
458 } else { 459 } else {
@@ -502,8 +503,7 @@ class stepAction { @@ -502,8 +503,7 @@ class stepAction {
502 * @access private 503 * @access private
503 * @return void 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 if($this->session != null) { 507 if($this->session != null) {
508 $this->session->setClassError($class, $k, $v); 508 $this->session->setClassError($class, $k, $v);
509 } else { 509 } else {
setup/migrate/steps/migrateDatabase.php
@@ -122,16 +122,16 @@ class migrateDatabase extends Step @@ -122,16 +122,16 @@ class migrateDatabase extends Step
122 $manual = false; // If file was exported manually 122 $manual = false; // If file was exported manually
123 $dbSettings = $installation['dbSettings']; 123 $dbSettings = $installation['dbSettings'];
124 $location = $installation['location']; 124 $location = $installation['location'];
125 - $uname = $this->temp_variables['duname'];  
126 - $pwrd = $this->temp_variables['dpassword']; 125 +// $uname = $this->temp_variables['duname'];
  126 +// $pwrd = $this->temp_variables['dpassword'];
127 $port = $this->util->getPort($location); 127 $port = $this->util->getPort($location);
128 $tmpFolder = $this->resolveTempDir(); 128 $tmpFolder = $this->resolveTempDir();
129 if(WINDOWS_OS) { 129 if(WINDOWS_OS) {
130 $termOrBash = "command prompt window"; 130 $termOrBash = "command prompt window";
131 - $exe = "\"$location\mysql\bin\mysqldump.exe\""; // Location of dump 131 + $exe = DS."$location".DS."mysql".DS."bin".DS."mysqldump.exe".DS; // Location of dump
132 } else { 132 } else {
133 $termOrBash = "terminal window"; 133 $termOrBash = "terminal window";
134 - $exe = "'$location/mysql/bin/mysqldump'"; // Location of dump 134 + $exe = "'$location".DS."mysql".DS."bin".DS."mysqldump'"; // Location of dump
135 } 135 }
136 $date = date('Y-m-d-H-i-s'); 136 $date = date('Y-m-d-H-i-s');
137 if(isset($database['manual_export'])) { 137 if(isset($database['manual_export'])) {
@@ -147,7 +147,7 @@ class migrateDatabase extends Step @@ -147,7 +147,7 @@ class migrateDatabase extends Step
147 if(!$manual) { // Try to export database 147 if(!$manual) { // Try to export database
148 $sqlFile = $tmpFolder."/kt-backup-$date.sql"; 148 $sqlFile = $tmpFolder."/kt-backup-$date.sql";
149 $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile; 149 $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile;
150 - $response = $this->util->pexec($cmd); 150 + $this->util->pexec($cmd);
151 } 151 }
152 if(file_exists($sqlFile)) { 152 if(file_exists($sqlFile)) {
153 $fileContents = file_get_contents($sqlFile); 153 $fileContents = file_get_contents($sqlFile);
setup/migrate/steps/migrateInstallation.php
@@ -85,10 +85,6 @@ class migrateInstallation extends step @@ -85,10 +85,6 @@ class migrateInstallation extends step
85 private $ktSettings = array(); 85 private $ktSettings = array();
86 86
87 private $urlPaths = array(); 87 private $urlPaths = array();
88 -  
89 - private $knownWindowsLocations = array("C:\Program Files\ktdms"=>"C:\Program Files\ktdms\knowledgeTree\config\config-path","C:\Program Files x86\ktdms"=>"C:\Program Files x86\ktdms\knowledgeTree\config\config-path","C:\ktdms"=>"C:\ktdms\knowledgeTree\config\config-path");  
90 -  
91 - private $knownUnixLocations = array("/opt/ktdms","/var/www/ktdms");  
92 88
93 /** 89 /**
94 * Installation Settings 90 * Installation Settings
@@ -132,12 +128,14 @@ class migrateInstallation extends step @@ -132,12 +128,14 @@ class migrateInstallation extends step
132 128
133 public function detectInstallation() { 129 public function detectInstallation() {
134 if(WINDOWS_OS) { 130 if(WINDOWS_OS) {
135 - foreach ($this->knownWindowsLocations as $loc=>$configPath) { 131 + $knownWindowsLocations = array("C:\Program Files\ktdms"=>"C:\Program Files\ktdms\knowledgeTree\config\config-path","C:\Program Files x86\ktdms"=>"C:\Program Files x86\ktdms\knowledgeTree\config\config-path","C:\ktdms"=>"C:\ktdms\knowledgeTree\config\config-path");
  132 + foreach ($knownWindowsLocations as $loc=>$configPath) {
136 if(file_exists($configPath)) 133 if(file_exists($configPath))
137 $this->location = $loc; 134 $this->location = $loc;
138 } 135 }
139 } else { 136 } else {
140 - foreach ($this->knownUnixLocations as $loc=>$configPath) { 137 + $knownUnixLocations = array("/opt/ktdms"=>"/opt/ktdms/knowledgeTree/config/config-path","/var/www/ktdms"=>"/var/www/ktdms/knowledgeTree/config/config-path");
  138 + foreach ($knownUnixLocations as $loc=>$configPath) {
141 if(file_exists($configPath)) 139 if(file_exists($configPath))
142 $this->location = $loc; 140 $this->location = $loc;
143 } 141 }
@@ -162,9 +160,10 @@ class migrateInstallation extends step @@ -162,9 +160,10 @@ class migrateInstallation extends step
162 if($this->foundVersion < $this->supportedVersion) { 160 if($this->foundVersion < $this->supportedVersion) {
163 $this->versionError = true; 161 $this->versionError = true;
164 $this->error[] = "KT installation needs to be 3.6.1 or higher"; 162 $this->error[] = "KT installation needs to be 3.6.1 or higher";
165 - } else {  
166 - return true; 163 + return false;
167 } 164 }
  165 +
  166 + return true;
168 } 167 }
169 168
170 public function readVersion() { 169 public function readVersion() {
@@ -222,11 +221,15 @@ class migrateInstallation extends step @@ -222,11 +221,15 @@ class migrateInstallation extends step
222 } else { 221 } else {
223 $this->error[] = "Please Enter a Location"; 222 $this->error[] = "Please Enter a Location";
224 } 223 }
  224 +
  225 + return false;
225 } 226 }
226 227
227 private function loadConfig($path) { 228 private function loadConfig($path) {
228 - $ini = $this->util->loadInstallIni($path);  
229 - $dbSettings = $ini->getSection('db'); 229 +// $ini = $this->util->loadInstallIni($path);
  230 + $this->util->iniUtilities->load($path);
  231 +// $dbSettings = $ini->getSection('db');
  232 + $dbSettings = $this->util->iniUtilities->getSection('db');
230 $this->dbSettings = array('dbHost'=> $dbSettings['dbHost'], 233 $this->dbSettings = array('dbHost'=> $dbSettings['dbHost'],
231 'dbName'=> $dbSettings['dbName'], 234 'dbName'=> $dbSettings['dbName'],
232 'dbUser'=> $dbSettings['dbUser'], 235 'dbUser'=> $dbSettings['dbUser'],
@@ -235,14 +238,16 @@ class migrateInstallation extends step @@ -235,14 +238,16 @@ class migrateInstallation extends step
235 'dbAdminUser'=> $dbSettings['dbAdminUser'], 238 'dbAdminUser'=> $dbSettings['dbAdminUser'],
236 'dbAdminPass'=> $dbSettings['dbAdminPass'], 239 'dbAdminPass'=> $dbSettings['dbAdminPass'],
237 ); 240 );
238 - $ktSettings = $ini->getSection('KnowledgeTree'); 241 + $ktSettings = $this->util->iniUtilities->getSection('KnowledgeTree');
  242 +// $ktSettings = $ini->getSection('KnowledgeTree');
239 $froot = $ktSettings['fileSystemRoot']; 243 $froot = $ktSettings['fileSystemRoot'];
240 if ($froot == 'default') { 244 if ($froot == 'default') {
241 $froot = $this->location; 245 $froot = $this->location;
242 } 246 }
243 $this->ktSettings = array('fileSystemRoot'=> $froot, 247 $this->ktSettings = array('fileSystemRoot'=> $froot,
244 ); 248 );
245 - $urlPaths = $ini->getSection('urls'); 249 +// $urlPaths = $ini->getSection('urls');
  250 +// $urlPaths = $this->util->iniUtilities->getSection('urls');
246 $varDir = $froot.DS.'var'; 251 $varDir = $froot.DS.'var';
247 $this->urlPaths = array(array('name'=> 'Var Directory', 'path'=> $varDir), 252 $this->urlPaths = array(array('name'=> 'Var Directory', 'path'=> $varDir),
248 array('name'=> 'Log Directory', 'path'=> $varDir.DS.'log'), 253 array('name'=> 'Log Directory', 'path'=> $varDir.DS.'log'),
setup/migrate/steps/migrateServices.php
@@ -127,7 +127,6 @@ class migrateServices extends Step @@ -127,7 +127,6 @@ class migrateServices extends Step
127 public function doStep() 127 public function doStep()
128 { 128 {
129 $this->temp_variables = array("step_name"=>"services", "silent"=>$this->silent); 129 $this->temp_variables = array("step_name"=>"services", "silent"=>$this->silent);
130 - $this->installServices = $this->util->loadInstallUtil(); // Use installer utility class  
131 $this->services = $this->util->loadInstallServices(); // Use installer services class 130 $this->services = $this->util->loadInstallServices(); // Use installer services class
132 $this->storeSilent(); 131 $this->storeSilent();
133 if(!$this->inStep("services")) { 132 if(!$this->inStep("services")) {
@@ -202,11 +201,11 @@ class migrateServices extends Step @@ -202,11 +201,11 @@ class migrateServices extends Step
202 */ 201 */
203 public function unixStop() { 202 public function unixStop() {
204 $cmd = $this->conf['location']."/dmsctl.sh stop lucene"; 203 $cmd = $this->conf['location']."/dmsctl.sh stop lucene";
205 - $res = $this->util->pexec($cmd); 204 + $this->util->pexec($cmd);
206 $cmd = $this->conf['location']."/dmsctl.sh stop scheduler"; 205 $cmd = $this->conf['location']."/dmsctl.sh stop scheduler";
207 - $res = $this->util->pexec($cmd); 206 + $this->util->pexec($cmd);
208 $cmd = $this->conf['location']."/dmsctl.sh stop soffice"; 207 $cmd = $this->conf['location']."/dmsctl.sh stop soffice";
209 - $res = $this->util->pexec($cmd); 208 + $this->util->pexec($cmd);
210 } 209 }
211 210
212 /** 211 /**
@@ -215,11 +214,11 @@ class migrateServices extends Step @@ -215,11 +214,11 @@ class migrateServices extends Step
215 */ 214 */
216 public function windowsStop() { 215 public function windowsStop() {
217 $cmd = "sc delete KTLucene"; 216 $cmd = "sc delete KTLucene";
218 - $res = $this->util->pexec($cmd); 217 + $this->util->pexec($cmd);
219 $cmd = "sc delete KTScheduler"; 218 $cmd = "sc delete KTScheduler";
220 - $res = $this->util->pexec($cmd); 219 + $this->util->pexec($cmd);
221 $cmd = "sc delete KTOpenoffice"; 220 $cmd = "sc delete KTOpenoffice";
222 - $res = $this->util->pexec($cmd); 221 + $this->util->pexec($cmd);
223 } 222 }
224 223
225 /** 224 /**
@@ -233,7 +232,7 @@ class migrateServices extends Step @@ -233,7 +232,7 @@ class migrateServices extends Step
233 $serv->load(); 232 $serv->load();
234 $sStatus = $serv->status(); 233 $sStatus = $serv->status();
235 if($sStatus != '') { 234 if($sStatus != '') {
236 - $res = $serv->uninstall(); 235 + $serv->uninstall();
237 } 236 }
238 } 237 }
239 } 238 }
setup/upgrade/step.php
@@ -110,7 +110,7 @@ class Step @@ -110,7 +110,7 @@ class Step
110 110
111 public function __construct() { 111 public function __construct() {
112 $this->util = new UpgradeUtil(); 112 $this->util = new UpgradeUtil();
113 - $this->dbhandler = $this->util->loadInstallDBUtil(); 113 + //$this->dbhandler = $this->util->dbUtilities;
114 } 114 }
115 115
116 /** 116 /**
setup/upgrade/steps/upgradeDatabase.php
@@ -242,7 +242,9 @@ class upgradeDatabase extends Step @@ -242,7 +242,9 @@ class upgradeDatabase extends Step
242 } 242 }
243 243
244 private function readConfig($path) { 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 $dbSettings = $ini->getSection('db'); 248 $dbSettings = $ini->getSection('db');
247 $this->dbSettings = array('dbHost'=> $dbSettings['dbHost'], 249 $this->dbSettings = array('dbHost'=> $dbSettings['dbHost'],
248 'dbName'=> $dbSettings['dbName'], 250 'dbName'=> $dbSettings['dbName'],
setup/upgrade/steps/upgradeWelcome.php
@@ -40,6 +40,9 @@ @@ -40,6 +40,9 @@
40 * @version Version 0.1 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 class upgradeWelcome extends step { 46 class upgradeWelcome extends step {
44 47
45 protected $silent = false; 48 protected $silent = false;
@@ -91,15 +94,9 @@ class upgradeWelcome extends step { @@ -91,15 +94,9 @@ class upgradeWelcome extends step {
91 $dconf = $ini->getSection('db'); 94 $dconf = $ini->getSection('db');
92 $this->dbhandler->load($dconf['dbHost'], $dconf['dbUser'], $dconf['dbPass'], $dconf['dbName']); 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 $this->error[] = 'Could Not Authenticate User'; 97 $this->error[] = 'Could Not Authenticate User';
102 return false; 98 return false;
  99 +
103 } 100 }
104 101
105 public function getErrors() { 102 public function getErrors() {
setup/upgrade/upgradeUtil.php
@@ -40,10 +40,9 @@ @@ -40,10 +40,9 @@
40 * @version Version 0.1 40 * @version Version 0.1
41 */ 41 */
42 42
43 -//require_once('../../config/dmsDefaults.php');  
44 require_once("../wizard/installUtil.php"); 43 require_once("../wizard/installUtil.php");
45 44
46 -class UpgradeUtil extends InstallUtil { 45 +class UpgradeUtil extends InstallUtil {
47 /** 46 /**
48 * Check if system needs to be upgraded 47 * Check if system needs to be upgraded
49 * 48 *
@@ -75,16 +74,6 @@ class UpgradeUtil extends InstallUtil { @@ -75,16 +74,6 @@ class UpgradeUtil extends InstallUtil {
75 echo $contents; 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 * Function to send output to the browser prior to normal dynamic loading of a template after code execution 78 * Function to send output to the browser prior to normal dynamic loading of a template after code execution
90 * 79 *
setup/wizard/dbUtilities.php
@@ -105,15 +105,13 @@ class dbUtilities { @@ -105,15 +105,13 @@ class dbUtilities {
105 } 105 }
106 106
107 public function load($dhost = 'localhost', $duname, $dpassword, $dbname) { 107 public function load($dhost = 'localhost', $duname, $dpassword, $dbname) {
108 - if($this->isConnected($dhost, $duname, $dpassword, $dbname)) return true;  
109 - $this->dbhost = $dhost;  
110 - $this->dbuname = $duname;  
111 - $this->dbpassword = $dpassword;  
112 - $this->dbconnection = @mysql_connect($dhost, $duname, $dpassword);  
113 - if(!$this->dbconnection) {  
114 - $this->error[] = @mysql_error(); 108 + if(!$this->isConnected($dhost, $duname, $dpassword, $dbname)) {
  109 + $this->dbhost = $dhost;
  110 + $this->dbuname = $duname;
  111 + $this->dbpassword = $dpassword;
  112 + $this->dbconnection = @mysql_connect($dhost, $duname, $dpassword);
  113 + $this->dbname = $dbname;
115 } 114 }
116 - $this->dbname = $dbname;  
117 } 115 }
118 116
119 public function isConnected($dhost = 'localhost', $duname, $dpassword, $dbname) { 117 public function isConnected($dhost = 'localhost', $duname, $dpassword, $dbname) {
@@ -235,6 +233,9 @@ class dbUtilities { @@ -235,6 +233,9 @@ class dbUtilities {
235 * @return array. 233 * @return array.
236 */ 234 */
237 public function getErrors() { 235 public function getErrors() {
  236 + if(!$this->dbconnection) {
  237 + $this->error[] = @mysql_error();
  238 + }
238 return $this->error; 239 return $this->error;
239 } 240 }
240 241
setup/wizard/iniUtilities.php
@@ -43,11 +43,8 @@ class iniUtilities { @@ -43,11 +43,8 @@ class iniUtilities {
43 private $lineNum = 0; 43 private $lineNum = 0;
44 private $exists = ''; 44 private $exists = '';
45 45
46 - function iniUtilities() {  
47 - $this->iniFile = '';  
48 - }  
49 -  
50 - function load($iniFile) { 46 +
  47 + function load($iniFile) {
51 if($this->iniFile != $iniFile) { 48 if($this->iniFile != $iniFile) {
52 $this->cleanArray = array(); 49 $this->cleanArray = array();
53 $this->lineNum = 0; 50 $this->lineNum = 0;
@@ -56,9 +53,11 @@ class iniUtilities { @@ -56,9 +53,11 @@ class iniUtilities {
56 $this->iniFile = $iniFile; 53 $this->iniFile = $iniFile;
57 $this->backupIni($iniFile); 54 $this->backupIni($iniFile);
58 $this->read($iniFile); 55 $this->read($iniFile);
59 -  
60 } 56 }
61 57
  58 + function __construct() {
  59 + }
  60 +
62 /** 61 /**
63 * Create a backup with the date as an extension in the same location as the original config.ini 62 * Create a backup with the date as an extension in the same location as the original config.ini
64 * 63 *
@@ -68,23 +67,23 @@ class iniUtilities { @@ -68,23 +67,23 @@ class iniUtilities {
68 function backupIni($iniFile) 67 function backupIni($iniFile)
69 { 68 {
70 $content = file_get_contents($iniFile); 69 $content = file_get_contents($iniFile);
71 - if ($content === false) 70 + if (!$content === false)
72 { 71 {
73 - return false;  
74 - }  
75 - $date = date('YmdHis');  
76 -  
77 - $backupFile = $iniFile . '.' .$date;  
78 - if (is_writeable($backupFile)) {  
79 - file_put_contents($backupFile, $content);  
80 - } 72 + $date = date('YmdHis');
  73 +
  74 + $backupFile = $iniFile . '.' .$date;
  75 + if (is_writeable($backupFile)) {
  76 + file_put_contents($backupFile, $content);
  77 + }
  78 + }
  79 + return false;
81 } 80 }
82 81
83 function read($iniFile) { 82 function read($iniFile) {
84 $iniArray = file($iniFile); 83 $iniArray = file($iniFile);
85 $section = ''; 84 $section = '';
86 foreach($iniArray as $iniLine) { 85 foreach($iniArray as $iniLine) {
87 - $this->lineNum++; 86 + ++$this->lineNum;
88 $iniLine = trim($iniLine); 87 $iniLine = trim($iniLine);
89 $firstChar = substr($iniLine, 0, 1); 88 $firstChar = substr($iniLine, 0, 1);
90 if($firstChar == ';') { 89 if($firstChar == ';') {
@@ -164,12 +163,12 @@ class iniUtilities { @@ -164,12 +163,12 @@ class iniUtilities {
164 } 163 }
165 164
166 function itemExists($checkSection, $checkItem) { 165 function itemExists($checkSection, $checkItem) {
167 -  
168 $this->exists = ''; 166 $this->exists = '';
169 foreach($this->cleanArray as $section => $items) { 167 foreach($this->cleanArray as $section => $items) {
170 if($section == $checkSection) { 168 if($section == $checkSection) {
171 $this->exists = 'section'; 169 $this->exists = 'section';
172 - foreach ($items as $key => $value) { 170 + $items = array_flip($items);
  171 + foreach ($items as $key) {
173 if($key == $checkItem) { 172 if($key == $checkItem) {
174 return true; 173 return true;
175 } 174 }
setup/wizard/installUtil.php
@@ -39,13 +39,14 @@ @@ -39,13 +39,14 @@
39 * @package Installer 39 * @package Installer
40 * @version Version 0.1 40 * @version Version 0.1
41 */ 41 */
42 - 42 +require_once("path.php"); // Include if util is loaded directly
  43 +require_once(WIZARD_DIR."iniUtilities.php");
  44 +require_once(WIZARD_DIR."dbUtilities.php");
43 45
44 class InstallUtil { 46 class InstallUtil {
45 -  
46 private $salt = 'installers'; 47 private $salt = 'installers';
47 - public $dbHandler = null;  
48 - public $iniHandler = null; 48 + public $dbUtilities = null;
  49 + public $iniUtilities = null;
49 50
50 /** 51 /**
51 * Constructs installation object 52 * Constructs installation object
@@ -54,8 +55,8 @@ class InstallUtil { @@ -54,8 +55,8 @@ class InstallUtil {
54 * @access public 55 * @access public
55 */ 56 */
56 public function __construct() { 57 public function __construct() {
57 - $this->dbHandler = new dbUtilities();  
58 - $this->iniHandler = new iniUtilities(); 58 + $this->dbUtilities = new dbUtilities();
  59 + $this->iniUtilities = new iniUtilities();
59 } 60 }
60 61
61 /** 62 /**
@@ -76,15 +77,17 @@ class InstallUtil { @@ -76,15 +77,17 @@ class InstallUtil {
76 public function error($error) { 77 public function error($error) {
77 $template_vars['error'] = $error; 78 $template_vars['error'] = $error;
78 $file = "templates/error.tpl"; 79 $file = "templates/error.tpl";
79 - if (!file_exists($file)) {  
80 - return false; 80 + if (file_exists($file)) {
  81 + extract($template_vars); // Extract the vars to local namespace
  82 + ob_start();
  83 + include($file);
  84 + $contents = ob_get_contents();
  85 + ob_end_clean();
  86 + echo $contents;
81 } 87 }
82 - extract($template_vars); // Extract the vars to local namespace  
83 - ob_start();  
84 - include($file);  
85 - $contents = ob_get_contents();  
86 - ob_end_clean();  
87 - echo $contents; 88 +
  89 + return false;
  90 +
88 } 91 }
89 /** 92 /**
90 * Check if system needs to be installed 93 * Check if system needs to be installed
@@ -171,7 +174,7 @@ class InstallUtil { @@ -171,7 +174,7 @@ class InstallUtil {
171 return $url; 174 return $url;
172 } 175 }
173 if (!empty($protocol)) { 176 if (!empty($protocol)) {
174 - $url = $protocol .':'. end($array = explode(':', $url, 2)); 177 + $url = $protocol .':'. end(explode(':', $url, 2));
175 } 178 }
176 if (!empty($port)) { 179 if (!empty($port)) {
177 $url = preg_replace('!^(([a-z0-9]+)://[^/:]+)(:[\d]+)?!i', 180 $url = preg_replace('!^(([a-z0-9]+)://[^/:]+)(:[\d]+)?!i',
@@ -331,9 +334,11 @@ class InstallUtil { @@ -331,9 +334,11 @@ class InstallUtil {
331 return false; 334 return false;
332 elseif(!is_dir($fullpath)) { 335 elseif(!is_dir($fullpath)) {
333 $perms = substr(sprintf('%o', fileperms($fullpath)), -4); 336 $perms = substr(sprintf('%o', fileperms($fullpath)), -4);
334 - if($perms != $filemode)  
335 - if (!chmod($fullpath, $filemode)) 337 + if($perms != $filemode) {
  338 + if (!chmod($fullpath, $filemode)) {
336 return false; 339 return false;
  340 + }
  341 + }
337 } elseif(!$this->chmodRecursive($fullpath, $filemode)) 342 } elseif(!$this->chmodRecursive($fullpath, $filemode))
338 return false; 343 return false;
339 } 344 }
@@ -360,7 +365,8 @@ class InstallUtil { @@ -360,7 +365,8 @@ class InstallUtil {
360 */ 365 */
361 public function canWriteFile($filename) { 366 public function canWriteFile($filename) {
362 $fh = fopen($filename, "w+"); 367 $fh = fopen($filename, "w+");
363 - if($fr = fwrite($fh, 'test') === false) { 368 + $fr = fwrite($fh, 'test');
  369 + if($fr === false) {
364 return false; 370 return false;
365 } 371 }
366 372
@@ -378,9 +384,9 @@ class InstallUtil { @@ -378,9 +384,9 @@ class InstallUtil {
378 */ 384 */
379 public function javaBridge() { 385 public function javaBridge() {
380 try { 386 try {
381 - $javaSystem = new Java('java.lang.System'); 387 + new Java('java.lang.System');
382 } catch (JavaException $e) { 388 } catch (JavaException $e) {
383 - return false; 389 + return $e;
384 } 390 }
385 return true; 391 return true;
386 } 392 }
@@ -455,6 +461,8 @@ class InstallUtil { @@ -455,6 +461,8 @@ class InstallUtil {
455 return preg_replace('/java:/', '', $r); 461 return preg_replace('/java:/', '', $r);
456 } 462 }
457 } 463 }
  464 +
  465 + return '';
458 } 466 }
459 467
460 /** 468 /**
@@ -732,6 +740,7 @@ class InstallUtil { @@ -732,6 +740,7 @@ class InstallUtil {
732 * @return string 740 * @return string
733 */ 741 */
734 public function installEnvironment() { 742 public function installEnvironment() {
  743 + $matches = false;
735 preg_match('/Zend/', SYSTEM_DIR, $matches); // Install Type 744 preg_match('/Zend/', SYSTEM_DIR, $matches); // Install Type
736 if($matches) { 745 if($matches) {
737 return 'Zend'; 746 return 'Zend';
@@ -759,7 +768,7 @@ class InstallUtil { @@ -759,7 +768,7 @@ class InstallUtil {
759 array_pop($sysdir); 768 array_pop($sysdir);
760 array_pop($sysdir); 769 array_pop($sysdir);
761 $zendsys = ''; 770 $zendsys = '';
762 - foreach ($sysdir as $k=>$v) { 771 + foreach ($sysdir as $v) {
763 $zendsys .= $v.DS; 772 $zendsys .= $v.DS;
764 } 773 }
765 $bin = $zendsys."ZendServer".DS."bin".DS; 774 $bin = $zendsys."ZendServer".DS."bin".DS;
@@ -784,15 +793,16 @@ class InstallUtil { @@ -784,15 +793,16 @@ class InstallUtil {
784 if(WINDOWS_OS) { // Mysql bin [Windows] 793 if(WINDOWS_OS) { // Mysql bin [Windows]
785 $serverPaths = explode(';',$_SERVER['PATH']); 794 $serverPaths = explode(';',$_SERVER['PATH']);
786 foreach ($serverPaths as $apath) { 795 foreach ($serverPaths as $apath) {
  796 + $matches = false;
787 preg_match('/mysql/i', $apath, $matches); 797 preg_match('/mysql/i', $apath, $matches);
788 if($matches) { 798 if($matches) {
789 return $apath.DS; 799 return $apath.DS;
790 break; 800 break;
791 } 801 }
792 } 802 }
793 - } else {  
794 - return "mysql"; // Assume its linux and can be executed from command line  
795 } 803 }
  804 +
  805 + return "mysql"; // Assume its linux and can be executed from command line
796 } 806 }
797 807
798 public function sqlInstallDir() { 808 public function sqlInstallDir() {
setup/wizard/installWizard.php
@@ -63,8 +63,8 @@ function __autoload($class) { // Attempt and autoload classes @@ -63,8 +63,8 @@ function __autoload($class) { // Attempt and autoload classes
63 if(preg_match('/Helper/', $class)) { 63 if(preg_match('/Helper/', $class)) {
64 require_once(HELPER_DIR."$class.php"); 64 require_once(HELPER_DIR."$class.php");
65 } 65 }
66 - return null;  
67 } 66 }
  67 + return false;
68 } 68 }
69 69
70 class InstallWizard { 70 class InstallWizard {
@@ -263,8 +263,6 @@ class InstallWizard { @@ -263,8 +263,6 @@ class InstallWizard {
263 return true; 263 return true;
264 break; 264 break;
265 } 265 }
266 -  
267 - return $res;  
268 } 266 }
269 267
270 /** 268 /**
setup/wizard/installer.php
@@ -157,7 +157,7 @@ class Installer { @@ -157,7 +157,7 @@ class Installer {
157 $this->simpleXmlObj = simplexml_load_file(CONF_DIR.$name); 157 $this->simpleXmlObj = simplexml_load_file(CONF_DIR.$name);
158 } catch (Exception $e) { 158 } catch (Exception $e) {
159 $util = new InstallUtil(); 159 $util = new InstallUtil();
160 - $util->error("Error reading configuration file: $name"); 160 + $util->error("Error reading configuration file: $e");
161 exit(); 161 exit();
162 } 162 }
163 } 163 }
@@ -431,8 +431,7 @@ class Installer { @@ -431,8 +431,7 @@ class Installer {
431 if($class->runInstall()) { // Check if step needs to be installed 431 if($class->runInstall()) { // Check if step needs to be installed
432 $class->setDataFromSession($className); // Set Session Information 432 $class->setDataFromSession($className); // Set Session Information
433 $class->setPostConfig(); // Set any posted variables 433 $class->setPostConfig(); // Set any posted variables
434 - $response = $class->installStep(); // Run install step  
435 - // TODO : Break on error response 434 + $class->installStep(); // Run install step
436 } 435 }
437 } else { 436 } else {
438 $util = new InstallUtil(); 437 $util = new InstallUtil();
setup/wizard/lib/helpers/htmlHelper.php
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 */ 41 */
42 class htmlHelper { 42 class htmlHelper {
43 43
44 - var $tags = array( 44 + private $tags = array(
45 'meta' => '<meta%s/>', 45 'meta' => '<meta%s/>',
46 'metalink' => '<link href="%s"%s/>', 46 'metalink' => '<link href="%s"%s/>',
47 'link' => '<a href="%s"%s>%s</a>', 47 'link' => '<a href="%s"%s>%s</a>',
setup/wizard/lib/services/unixLucene.php
@@ -59,7 +59,7 @@ class unixLucene extends unixService { @@ -59,7 +59,7 @@ class unixLucene extends unixService {
59 * @param string 59 * @param string
60 * @return void 60 * @return void
61 */ 61 */
62 - public function load($options = null) { 62 + public function load() {
63 $this->setLuceneSource("ktlucene.jar"); 63 $this->setLuceneSource("ktlucene.jar");
64 $this->setLuceneDir(SYSTEM_DIR."bin".DS."luceneserver".DS); 64 $this->setLuceneDir(SYSTEM_DIR."bin".DS."luceneserver".DS);
65 $this->setIndexerDir(SYSTEM_DIR."search2".DS."indexing".DS."bin".DS); 65 $this->setIndexerDir(SYSTEM_DIR."search2".DS."indexing".DS."bin".DS);
@@ -148,14 +148,13 @@ class unixLucene extends unixService { @@ -148,14 +148,13 @@ class unixLucene extends unixService {
148 * @return array 148 * @return array
149 */ 149 */
150 public function stop() { 150 public function stop() {
151 - // TODO: Breaks things  
152 $state = $this->status(); 151 $state = $this->status();
153 if($state != '') { 152 if($state != '') {
154 $cmd = "pkill -f ".$this->getLuceneSource(); 153 $cmd = "pkill -f ".$this->getLuceneSource();
155 $response = $this->util->pexec($cmd); 154 $response = $this->util->pexec($cmd);
156 return $response; 155 return $response;
157 } 156 }
158 - 157 + return $state;
159 } 158 }
160 159
161 public function install() { 160 public function install() {
@@ -173,6 +172,7 @@ class unixLucene extends unixService { @@ -173,6 +172,7 @@ class unixLucene extends unixService {
173 if(is_array($response['out'])) { 172 if(is_array($response['out'])) {
174 if(count($response['out']) > 1) { 173 if(count($response['out']) > 1) {
175 foreach ($response['out'] as $r) { 174 foreach ($response['out'] as $r) {
  175 + $matches = false;
176 preg_match('/grep/', $r, $matches); // Ignore grep 176 preg_match('/grep/', $r, $matches); // Ignore grep
177 if(!$matches) { 177 if(!$matches) {
178 return 'STARTED'; 178 return 'STARTED';
@@ -207,20 +207,14 @@ class unixLucene extends unixService { @@ -207,20 +207,14 @@ class unixLucene extends unixService {
207 $cmd .= "nohup java {$this->getJavaXmx()} {$this->getJavaXmx()} -jar ".$this->getLuceneSource()." > ".$logFile." 2>&1 & echo $!"; 207 $cmd .= "nohup java {$this->getJavaXmx()} {$this->getJavaXmx()} -jar ".$this->getLuceneSource()." > ".$logFile." 2>&1 & echo $!";
208 if(DEBUG) { 208 if(DEBUG) {
209 echo "Command : $cmd<br/>"; 209 echo "Command : $cmd<br/>";
210 - return ; 210 + return false;
211 } 211 }
212 $response = $this->util->pexec($cmd); 212 $response = $this->util->pexec($cmd);
213 213
214 return $response; 214 return $response;
215 - } elseif ($state == '') {  
216 - // Start Service  
217 - return true;  
218 - } else {  
219 - // Service Running Already  
220 - return true;  
221 } 215 }
222 216
223 - return false; 217 + return true;
224 } 218 }
225 219
226 public function getName() { 220 public function getName() {
setup/wizard/lib/services/unixOpenOffice.php
@@ -106,13 +106,14 @@ class unixOpenOffice extends unixService { @@ -106,13 +106,14 @@ class unixOpenOffice extends unixService {
106 } 106 }
107 } 107 }
108 108
109 - public function status($updrade = false) { 109 + public function status() {
110 sleep(1); 110 sleep(1);
111 $cmd = "ps ax | grep soffice"; 111 $cmd = "ps ax | grep soffice";
112 $response = $this->util->pexec($cmd); 112 $response = $this->util->pexec($cmd);
113 if(is_array($response['out'])) { 113 if(is_array($response['out'])) {
114 if(count($response['out']) > 1) { 114 if(count($response['out']) > 1) {
115 foreach ($response['out'] as $r) { 115 foreach ($response['out'] as $r) {
  116 + $matches = false;
116 preg_match('/grep/', $r, $matches); // Ignore grep 117 preg_match('/grep/', $r, $matches); // Ignore grep
117 if(!$matches) { 118 if(!$matches) {
118 return 'STARTED'; 119 return 'STARTED';
@@ -140,20 +141,13 @@ class unixOpenOffice extends unixService { @@ -140,20 +141,13 @@ class unixOpenOffice extends unixService {
140 $cmd = "nohup ".$this->getBin().' -nofirststartwizard -nologo -headless -"accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" '." > /dev/null 2>&1 & echo $!"; 141 $cmd = "nohup ".$this->getBin().' -nofirststartwizard -nologo -headless -"accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" '." > /dev/null 2>&1 & echo $!";
141 if(DEBUG) { 142 if(DEBUG) {
142 echo "Command : $cmd<br/>"; 143 echo "Command : $cmd<br/>";
143 - return ; 144 + return false;
144 } 145 }
145 - $response = $this->util->pexec($cmd);  
146 -  
147 - return $response;  
148 - } elseif ($state == '') {  
149 - // Start Service  
150 - return true;  
151 - } else {  
152 - // Service Running Already  
153 - return true; 146 +
  147 + return $this->util->pexec($cmd);
154 } 148 }
155 149
156 - return false; 150 + return true;
157 } 151 }
158 152
159 /** 153 /**
setup/wizard/lib/validation/openofficeValidation.php
@@ -154,7 +154,7 @@ class openofficeValidation extends serviceValidation { @@ -154,7 +154,7 @@ class openofficeValidation extends serviceValidation {
154 $bin = "soffice"; 154 $bin = "soffice";
155 } 155 }
156 foreach ($locations as $loc) { 156 foreach ($locations as $loc) {
157 - $pathToBinary = $loc.$bin; 157 + $pathToBinary = $loc.DS.$bin;
158 if(file_exists($pathToBinary)) { 158 if(file_exists($pathToBinary)) {
159 return $pathToBinary; 159 return $pathToBinary;
160 } 160 }
setup/wizard/step.php
@@ -127,7 +127,6 @@ class Step @@ -127,7 +127,6 @@ class Step
127 // public $dbhandler; 127 // public $dbhandler;
128 128
129 public function __construct() { 129 public function __construct() {
130 -// $this->dbhandler = new dbUtilities();  
131 $this->util = new InstallUtil(); 130 $this->util = new InstallUtil();
132 } 131 }
133 /** 132 /**
setup/wizard/steps/complete.php
@@ -142,8 +142,8 @@ class complete extends Step { @@ -142,8 +142,8 @@ class complete extends Step {
142 // retrieve database information from session 142 // retrieve database information from session
143 $dbconf = $this->getDataFromSession("database"); 143 $dbconf = $this->getDataFromSession("database");
144 // make db connection - admin 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 if (!$loaded) { 147 if (!$loaded) {
148 $this->temp_variables['dbConnectAdmin'] .= '<td><div class="cross"></div></td>' 148 $this->temp_variables['dbConnectAdmin'] .= '<td><div class="cross"></div></td>'
149 . '<td class="error">Unable to connect to database (user: ' 149 . '<td class="error">Unable to connect to database (user: '
@@ -157,20 +157,20 @@ class complete extends Step { @@ -157,20 +157,20 @@ class complete extends Step {
157 } 157 }
158 158
159 // make db connection - user 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 // if we can log in to the database, check access 162 // if we can log in to the database, check access
163 // TODO check write access? 163 // TODO check write access?
164 if ($loaded) 164 if ($loaded)
165 { 165 {
166 $this->temp_variables['dbConnectUser'] .= sprintf($html, 'tick', '', 'Database connectivity successful (user: ' . $dbconf['dmsusername'] . ')'); 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 if (!$qresult) 169 if (!$qresult)
170 { 170 {
171 $this->temp_variables['dbPrivileges'] .= '<td style="width:15px;"><div class="cross" style="float:left;"></div></td>' 171 $this->temp_variables['dbPrivileges'] .= '<td style="width:15px;"><div class="cross" style="float:left;"></div></td>'
172 . '<td class="error" style="width:500px;">' 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 . '</td>'; 174 . '</td>';
175 $this->privileges_check = 'cross'; 175 $this->privileges_check = 'cross';
176 $this->privileges_check = 'cross'; 176 $this->privileges_check = 'cross';
@@ -183,17 +183,17 @@ class complete extends Step { @@ -183,17 +183,17 @@ class complete extends Step {
183 183
184 // check transaction support 184 // check transaction support
185 $sTable = 'system_settings'; 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 if (!$res) { 190 if (!$res) {
191 $this->temp_variables['dbTransaction'] .= sprintf($html, 'cross', 'class="error"', 'Transaction support not available in database'); 191 $this->temp_variables['dbTransaction'] .= sprintf($html, 'cross', 'class="error"', 'Transaction support not available in database');
192 $this->privileges_check = 'cross'; 192 $this->privileges_check = 'cross';
193 } else { 193 } else {
194 $this->temp_variables['dbTransaction'] .= sprintf($html, 'tick', '', 'Database has transaction support'); 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 else 198 else
199 { 199 {
setup/wizard/steps/configuration.php
@@ -307,26 +307,26 @@ class configuration extends Step @@ -307,26 +307,26 @@ class configuration extends Step
307 { 307 {
308 $conf = $this->getDataFromSession("configuration"); // get data from the server 308 $conf = $this->getDataFromSession("configuration"); // get data from the server
309 $dbconf = $this->getDataFromSession("database"); 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 $server = $conf['server']; 311 $server = $conf['server'];
312 $paths = $conf['paths']; 312 $paths = $conf['paths'];
313 if ($this->util->isMigration()) { // Check if its an upgrade 313 if ($this->util->isMigration()) { // Check if its an upgrade
314 $this->readInstallation(); 314 $this->readInstallation();
315 - $configPath = $paths['configFile']['path']; 315 + $this->confpaths['configIni'] = $paths['configFile']['path'];
316 } else { 316 } else {
317 $this->readConfigPath(); // initialise writing to config.ini 317 $this->readConfigPath(); // initialise writing to config.ini
318 } 318 }
319 $this->getFromConfigPath(); // Sets config Paths 319 $this->getFromConfigPath(); // Sets config Paths
320 if(file_exists($this->confpaths['configIni'])) { 320 if(file_exists($this->confpaths['configIni'])) {
321 - $this->util->iniHandler->load($this->confpaths['configIni']); 321 + $this->util->iniUtilities->load($this->confpaths['configIni']);
322 } 322 }
323 - if(!$this->util->iniHandler === false){ // write out the config.ini file 323 + if(!$this->util->iniUtilities=== false){ // write out the config.ini file
324 $this->writeUrlSection(); 324 $this->writeUrlSection();
325 $this->writeDBSection($server); 325 $this->writeDBSection($server);
326 $this->writeDBPathSection($paths); 326 $this->writeDBPathSection($paths);
327 - $this->util->iniHandler->write(); 327 + $this->util->iniUtilities->write();
328 } 328 }
329 - $this->util->dbHandler->close(); // close the database connection 329 + $this->util->dbUtilities->close(); // close the database connection
330 $this->writeCachePath($this->getCachePath(), $paths['cacheDirectory']['path']); // Write cache path file 330 $this->writeCachePath($this->getCachePath(), $paths['cacheDirectory']['path']); // Write cache path file
331 $this->writeConfigPath($this->getContentPath(), $this->confpaths['configIni']); // Write config file 331 $this->writeConfigPath($this->getContentPath(), $this->confpaths['configIni']); // Write config file
332 } 332 }
@@ -334,7 +334,7 @@ class configuration extends Step @@ -334,7 +334,7 @@ class configuration extends Step
334 private function writeUrlSection() { 334 private function writeUrlSection() {
335 $directories = $this->registerDirs(); 335 $directories = $this->registerDirs();
336 foreach($directories as $item) { // write server settings to config_settings table and config.ini 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,14 +348,14 @@ class configuration extends Step
348 $value = mysql_real_escape_string($item['path']); 348 $value = mysql_real_escape_string($item['path']);
349 $setting = mysql_real_escape_string($item['setting']); 349 $setting = mysql_real_escape_string($item['setting']);
350 $sql = "UPDATE {$table} SET value = '{$value}' WHERE item = '{$setting}'"; 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 private function writeDBSection($server) { 356 private function writeDBSection($server) {
357 $dbconf = $this->getDataFromSession("database"); // retrieve database information from session 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 $server = $this->registerDBConfig($server, $dbconf); // add db config to server variables 359 $server = $this->registerDBConfig($server, $dbconf); // add db config to server variables
360 $table = 'config_settings'; 360 $table = 'config_settings';
361 foreach($server as $item) { // write server settings to config_settings table and config.ini 361 foreach($server as $item) { // write server settings to config_settings table and config.ini
@@ -368,14 +368,14 @@ class configuration extends Step @@ -368,14 +368,14 @@ class configuration extends Step
368 if($value == 'no'){ 368 if($value == 'no'){
369 $value = 'false'; 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 break; 372 break;
373 case 'db': 373 case 'db':
374 $value = mysql_real_escape_string($item['value']); 374 $value = mysql_real_escape_string($item['value']);
375 $setting = mysql_real_escape_string($item['setting']); 375 $setting = mysql_real_escape_string($item['setting']);
376 376
377 $sql = "UPDATE {$table} SET value = '{$value}' WHERE item = '{$setting}'"; 377 $sql = "UPDATE {$table} SET value = '{$value}' WHERE item = '{$setting}'";
378 - $this->util->dbHandler->query($sql); 378 + $this->util->dbUtilities->query($sql);
379 break; 379 break;
380 } 380 }
381 } 381 }
@@ -573,12 +573,13 @@ class configuration extends Step @@ -573,12 +573,13 @@ class configuration extends Step
573 573
574 public function readConfigPathIni() { 574 public function readConfigPathIni() {
575 if(isset($this->temp_variables['paths']['configFile']['path'])) { 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 $configPath = $this->getContentPath(); 579 $configPath = $this->getContentPath();
579 if(!$configPath) return false; 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 $firstline = true; 583 $firstline = true;
583 foreach ($data as $k=>$v) { 584 foreach ($data as $k=>$v) {
584 if(preg_match('/config.ini/', $k)) { // Find config.ini 585 if(preg_match('/config.ini/', $k)) { // Find config.ini
@@ -600,8 +601,8 @@ class configuration extends Step @@ -600,8 +601,8 @@ class configuration extends Step
600 private function readConfigPath() { 601 private function readConfigPath() {
601 $configPath = $this->getContentPath(); 602 $configPath = $this->getContentPath();
602 if(!$configPath) return false; 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 $firstline = true; 606 $firstline = true;
606 foreach ($data as $k=>$v) { 607 foreach ($data as $k=>$v) {
607 if($firstline) { // First line holds the var directory 608 if($firstline) { // First line holds the var directory
setup/wizard/steps/database.php
@@ -320,11 +320,11 @@ class database extends Step @@ -320,11 +320,11 @@ class database extends Step
320 return false; 320 return false;
321 } 321 }
322 if($this->dport == '') { 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 } else { 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 $this->error['con'] = "Could not connect to the database, please check username and password"; 328 $this->error['con'] = "Could not connect to the database, please check username and password";
329 return false; 329 return false;
330 } else { 330 } else {
@@ -339,7 +339,7 @@ class database extends Step @@ -339,7 +339,7 @@ class database extends Step
339 } 339 }
340 340
341 public function dbExists() { 341 public function dbExists() {
342 - return $this->util->dbHandler->useDb(); 342 + return $this->util->dbUtilities->useDb();
343 } 343 }
344 344
345 public function match($str1, $str2) { 345 public function match($str1, $str2) {
@@ -500,7 +500,6 @@ class database extends Step @@ -500,7 +500,6 @@ class database extends Step
500 * @return object SimpleXmlObject 500 * @return object SimpleXmlObject
501 */ 501 */
502 public function readXml() { 502 public function readXml() {
503 -// echo CONF_DIR."databases.xml";  
504 $simplexml = simplexml_load_file(CONF_DIR."databases.xml"); 503 $simplexml = simplexml_load_file(CONF_DIR."databases.xml");
505 504
506 return $simplexml; 505 return $simplexml;
@@ -583,7 +582,7 @@ class database extends Step @@ -583,7 +582,7 @@ class database extends Step
583 * @return object mysql connection 582 * @return object mysql connection
584 */ 583 */
585 private function connectMysql() { 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,7 +641,7 @@ class database extends Step
642 $this->error['con'] = "Could not create database: "; 641 $this->error['con'] = "Could not create database: ";
643 } 642 }
644 } 643 }
645 - $this->util->dbHandler->clearErrors(); 644 + $this->util->dbUtilities->clearErrors();
646 if(!$this->createDmsUser()) { // Create dms users 645 if(!$this->createDmsUser()) { // Create dms users
647 $this->error['con'] = "Could not create database users "; 646 $this->error['con'] = "Could not create database users ";
648 } 647 }
@@ -666,8 +665,7 @@ class database extends Step @@ -666,8 +665,7 @@ class database extends Step
666 */ 665 */
667 private function create() { 666 private function create() {
668 $sql = "CREATE DATABASE {$this->dname}"; 667 $sql = "CREATE DATABASE {$this->dname}";
669 - if ($this->util->dbHandler->query($sql)) {  
670 - 668 + if ($this->util->dbUtilities->query($sql)) {
671 return true; 669 return true;
672 } 670 }
673 671
@@ -683,7 +681,7 @@ class database extends Step @@ -683,7 +681,7 @@ class database extends Step
683 * @return boolean 681 * @return boolean
684 */ 682 */
685 private function usedb() { 683 private function usedb() {
686 - if($this->util->dbHandler->useDb()) { 684 + if($this->util->dbUtilities->useDb()) {
687 return true; 685 return true;
688 } else { 686 } else {
689 $this->error['con'] = "Error using database: {$this->dname}"; 687 $this->error['con'] = "Error using database: {$this->dname}";
@@ -702,7 +700,7 @@ class database extends Step @@ -702,7 +700,7 @@ class database extends Step
702 private function dropdb() { 700 private function dropdb() {
703 if($this->ddrop) { 701 if($this->ddrop) {
704 $sql = "DROP DATABASE {$this->dname};"; 702 $sql = "DROP DATABASE {$this->dname};";
705 - if(!$this->util->dbHandler->query($sql)) { 703 + if(!$this->util->dbUtilities->query($sql)) {
706 $this->error['con'] = "Cannot drop database: {$this->dname}"; 704 $this->error['con'] = "Cannot drop database: {$this->dname}";
707 return false; 705 return false;
708 } 706 }
@@ -724,7 +722,7 @@ class database extends Step @@ -724,7 +722,7 @@ class database extends Step
724 private function createDmsUser() { 722 private function createDmsUser() {
725 $user1 = "GRANT SELECT, INSERT, UPDATE, DELETE ON {$this->dname}.* TO {$this->dmsusername}@{$this->dhost} IDENTIFIED BY \"{$this->dmsuserpassword}\";"; 723 $user1 = "GRANT SELECT, INSERT, UPDATE, DELETE ON {$this->dname}.* TO {$this->dmsusername}@{$this->dhost} IDENTIFIED BY \"{$this->dmsuserpassword}\";";
726 $user2 = "GRANT ALL PRIVILEGES ON {$this->dname}.* TO {$this->dmsname}@{$this->dhost} IDENTIFIED BY \"{$this->dmspassword}\";"; 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 return true; 726 return true;
729 } else { 727 } else {
730 $this->error['con'] = "Could not create users for database: {$this->dname}"; 728 $this->error['con'] = "Could not create users for database: {$this->dname}";
@@ -751,7 +749,7 @@ class database extends Step @@ -751,7 +749,7 @@ class database extends Step
751 while (!feof($handle)) { 749 while (!feof($handle)) {
752 $query.= fgets($handle, 4096); 750 $query.= fgets($handle, 4096);
753 if (substr(rtrim($query), -1) == ';') { 751 if (substr(rtrim($query), -1) == ';') {
754 - $this->util->dbHandler->query($query); 752 + $this->util->dbUtilities->query($query);
755 $query = ''; 753 $query = '';
756 } 754 }
757 } 755 }
@@ -778,9 +776,9 @@ class database extends Step @@ -778,9 +776,9 @@ class database extends Step
778 $sqlFile = $dbMigrate['dumpLocation']; 776 $sqlFile = $dbMigrate['dumpLocation'];
779 $this->parse_mysql_dump($sqlFile); 777 $this->parse_mysql_dump($sqlFile);
780 $dropPluginHelper = "TRUNCATE plugin_helper;"; 778 $dropPluginHelper = "TRUNCATE plugin_helper;";
781 - $this->util->dbHandler->query($dropPluginHelper); 779 + $this->util->dbUtilities->query($dropPluginHelper);
782 $updateUrls = 'UPDATE config_settings c SET c.value = "default" where c.group_name = "urls";'; 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 return true; 782 return true;
785 } 783 }
786 /** 784 /**
@@ -793,7 +791,7 @@ class database extends Step @@ -793,7 +791,7 @@ class database extends Step
793 */ 791 */
794 private function closeMysql() { 792 private function closeMysql() {
795 try { 793 try {
796 - $this->util->dbHandler->close(); 794 + $this->util->dbUtilities->close();
797 } catch (Exeption $e) { 795 } catch (Exeption $e) {
798 $this->error['con'] = "Could not close: " . $e; 796 $this->error['con'] = "Could not close: " . $e;
799 } 797 }
@@ -844,7 +842,7 @@ class database extends Step @@ -844,7 +842,7 @@ class database extends Step
844 $this->dpassword = 'root'; 842 $this->dpassword = 'root';
845 $this->dname = 'dms_install'; 843 $this->dname = 'dms_install';
846 $this->dbbinary = 'mysql'; 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 $this->createSchema(); 846 $this->createSchema();
849 echo 'Schema loaded<br>'; 847 echo 'Schema loaded<br>';
850 } 848 }
setup/wizard/steps/install.php
@@ -107,14 +107,14 @@ class install extends step @@ -107,14 +107,14 @@ class install extends step
107 public function callHome() { 107 public function callHome() {
108 $conf = $this->getDataFromSession("install"); // retrieve database information from session 108 $conf = $this->getDataFromSession("install"); // retrieve database information from session
109 $dbconf = $this->getDataFromSession("database"); 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 $complete = 1; 111 $complete = 1;
112 if($conf['call_home'] == 'enable'){ 112 if($conf['call_home'] == 'enable'){
113 $complete = 0; 113 $complete = 0;
114 } 114 }
115 $query = "UPDATE scheduler_tasks SET is_complete = {$complete} WHERE task = 'Call Home'"; 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 \ No newline at end of file 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, &amp;$smarty) @@ -17,7 +17,7 @@ function smarty_core_write_compiled_resource($params, &amp;$smarty)
17 if(!@is_writable($smarty->compile_dir)) { 17 if(!@is_writable($smarty->compile_dir)) {
18 // compile_dir not writable, see if it exists 18 // compile_dir not writable, see if it exists
19 if(!@is_dir($smarty->compile_dir)) { 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 return false; 21 return false;
22 } 22 }
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); 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);
var/bin/taskrunner.bat
1 -// DO NOT DELETE  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +@echo off
  3 +"D:\Program Files\Zend\ZendServer\bin\php.exe" "D:\Program Files\Zend\Apache2\htdocs\knowledgetree\bin\win32\schedulerService.php"
3 \ No newline at end of file 4 \ No newline at end of file