Commit 71e2f37b3d86898868d804d8ca67269cebada4eb
1 parent
4daef597
Updated source only install 'Configuration Step'. Removed redundant 'Install Typ…
…e Step'. Updated ini class. Updated utilities class. Updated Open Office Service install Committed by: Jarrett Jordaan Reviewed by: Megan Watson
Showing
10 changed files
with
91 additions
and
99 deletions
dmsctl.sh
| @@ -32,7 +32,7 @@ SOFFICE_PIDFILE=$INSTALL_PATH/var/log/soffice.bin.pid | @@ -32,7 +32,7 @@ SOFFICE_PIDFILE=$INSTALL_PATH/var/log/soffice.bin.pid | ||
| 32 | SOFFICE_PID="" | 32 | SOFFICE_PID="" |
| 33 | SOFFICE_PORT="8100" | 33 | SOFFICE_PORT="8100" |
| 34 | SOFFICEBIN=/usr/bin/soffice | 34 | SOFFICEBIN=/usr/bin/soffice |
| 35 | -SOFFICE="$SOFFICEBIN -nofirststartwizard -nologo -headless -accept=socket,host=127.0.0.1,port=$SOFFICE_PORT;urp;StarOffice.ServiceManager" | 35 | +SOFFICE="$SOFFICEBIN -nofirststartwizard -nologo -headless -\"accept=socket,host=127.0.0.1,port=$SOFFICE_PORT;urp;StarOffice.ServiceManager\"" |
| 36 | SOFFICE_STATUS="" | 36 | SOFFICE_STATUS="" |
| 37 | 37 | ||
| 38 | # Lucene | 38 | # Lucene |
setup/wizard/config/config.xml
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | <steps> | 11 | <steps> |
| 12 | <step name="Welcome">welcome</step> | 12 | <step name="Welcome">welcome</step> |
| 13 | <step name="License Agreement">license</step> | 13 | <step name="License Agreement">license</step> |
| 14 | - <step name="Install Type">installtype</step> | 14 | +<!-- <step name="Install Type">installtype</step>--> |
| 15 | <step name="PHP Dependencies" mode="silent">dependencies</step> | 15 | <step name="PHP Dependencies" mode="silent">dependencies</step> |
| 16 | <step name="System Configuration" order="2">configuration</step> | 16 | <step name="System Configuration" order="2">configuration</step> |
| 17 | <step name="Service Dependency" order="3" mode="silent">services</step> | 17 | <step name="Service Dependency" order="3" mode="silent">services</step> |
setup/wizard/iniUtilities.php
| @@ -43,21 +43,15 @@ class iniUtilities { | @@ -43,21 +43,15 @@ class iniUtilities { | ||
| 43 | private $lineNum = 0; | 43 | private $lineNum = 0; |
| 44 | private $exists = ''; | 44 | private $exists = ''; |
| 45 | 45 | ||
| 46 | - | ||
| 47 | function load($iniFile) { | 46 | function load($iniFile) { |
| 48 | -// if($this->iniFile != $iniFile) { | ||
| 49 | - $this->cleanArray = array(); | ||
| 50 | - $this->lineNum = 0; | ||
| 51 | - $this->exists = ''; | ||
| 52 | -// } | 47 | + $this->cleanArray = array(); |
| 53 | $this->iniFile = $iniFile; | 48 | $this->iniFile = $iniFile; |
| 49 | + $this->lineNum = 0; | ||
| 50 | + $this->exists = ''; | ||
| 54 | $this->backupIni($iniFile); | 51 | $this->backupIni($iniFile); |
| 55 | $this->read($iniFile); | 52 | $this->read($iniFile); |
| 56 | } | 53 | } |
| 57 | 54 | ||
| 58 | -// function __construct() { | ||
| 59 | -// } | ||
| 60 | - | ||
| 61 | /** | 55 | /** |
| 62 | * Create a backup with the date as an extension in the same location as the original config.ini | 56 | * Create a backup with the date as an extension in the same location as the original config.ini |
| 63 | * | 57 | * |
| @@ -125,25 +119,23 @@ class iniUtilities { | @@ -125,25 +119,23 @@ class iniUtilities { | ||
| 125 | } | 119 | } |
| 126 | 120 | ||
| 127 | function write($iniFile = "") { | 121 | function write($iniFile = "") { |
| 128 | - | ||
| 129 | if(empty($iniFile)) { | 122 | if(empty($iniFile)) { |
| 130 | $iniFile = $this->iniFile; | 123 | $iniFile = $this->iniFile; |
| 131 | } | 124 | } |
| 132 | if (!is_writeable($iniFile)) { | 125 | if (!is_writeable($iniFile)) { |
| 133 | return; | 126 | return; |
| 134 | } | 127 | } |
| 135 | - | ||
| 136 | $fileHandle = fopen($iniFile, 'wb'); | 128 | $fileHandle = fopen($iniFile, 'wb'); |
| 137 | foreach ($this->cleanArray as $section => $items) { | 129 | foreach ($this->cleanArray as $section => $items) { |
| 138 | if (substr($section, 0, strlen('_blankline_')) === '_blankline_' ) { | 130 | if (substr($section, 0, strlen('_blankline_')) === '_blankline_' ) { |
| 139 | - @fwrite ($fileHandle, "\r\n"); | 131 | + fwrite ($fileHandle, "\r\n"); |
| 140 | continue; | 132 | continue; |
| 141 | } | 133 | } |
| 142 | if (substr($section, 0, strlen('_comment_')) === '_comment_' ) { | 134 | if (substr($section, 0, strlen('_comment_')) === '_comment_' ) { |
| 143 | - @fwrite ($fileHandle, "$items\r\n"); | 135 | + fwrite ($fileHandle, "$items\r\n"); |
| 144 | continue; | 136 | continue; |
| 145 | } | 137 | } |
| 146 | - @fwrite ($fileHandle, "[".$section."]\r\n"); | 138 | + fwrite ($fileHandle, "[".$section."]\r\n"); |
| 147 | foreach ($items as $key => $value) { | 139 | foreach ($items as $key => $value) { |
| 148 | if (substr($key, 0, strlen('_blankline_')) === '_blankline_' ) { | 140 | if (substr($key, 0, strlen('_blankline_')) === '_blankline_' ) { |
| 149 | fwrite ($fileHandle, "\r\n"); | 141 | fwrite ($fileHandle, "\r\n"); |
| @@ -155,11 +147,10 @@ class iniUtilities { | @@ -155,11 +147,10 @@ class iniUtilities { | ||
| 155 | } | 147 | } |
| 156 | 148 | ||
| 157 | $value = addcslashes($value,''); | 149 | $value = addcslashes($value,''); |
| 158 | - //fwrite ($fileHandle, $key.' = "'.$value."\"\r\n"); | ||
| 159 | - @fwrite ($fileHandle, $key.' = '.$value."\r\n"); | 150 | + fwrite ($fileHandle, $key.' = '.$value."\r\n"); |
| 160 | } | 151 | } |
| 161 | } | 152 | } |
| 162 | - @fclose($fileHandle); | 153 | + fclose($fileHandle); |
| 163 | } | 154 | } |
| 164 | 155 | ||
| 165 | function itemExists($checkSection, $checkItem) { | 156 | function itemExists($checkSection, $checkItem) { |
| @@ -195,10 +186,11 @@ class iniUtilities { | @@ -195,10 +186,11 @@ class iniUtilities { | ||
| 195 | } | 186 | } |
| 196 | 187 | ||
| 197 | function updateItem($addSection, $addItem, $value) { | 188 | function updateItem($addSection, $addItem, $value) { |
| 198 | - if(WINDOWS_OS) | 189 | + if(WINDOWS_OS) { |
| 199 | $this->cleanArray[$addSection][$addItem] = $value; | 190 | $this->cleanArray[$addSection][$addItem] = $value; |
| 200 | - else | 191 | + } else { |
| 201 | $this->cleanArray[$addSection][$addItem] = stripcslashes($value); | 192 | $this->cleanArray[$addSection][$addItem] = stripcslashes($value); |
| 193 | + } | ||
| 202 | return true; | 194 | return true; |
| 203 | } | 195 | } |
| 204 | 196 |
setup/wizard/installUtil.php
| @@ -264,11 +264,13 @@ class InstallUtil { | @@ -264,11 +264,13 @@ class InstallUtil { | ||
| 264 | */ | 264 | */ |
| 265 | public function checkPermission($dir, $create=false, $file = false) | 265 | public function checkPermission($dir, $create=false, $file = false) |
| 266 | { | 266 | { |
| 267 | - if(!$file) | 267 | + if(!$file) { |
| 268 | $exist = 'Directory doesn\'t exist'; | 268 | $exist = 'Directory doesn\'t exist'; |
| 269 | - else | 269 | + } else { |
| 270 | $exist = 'File doesn\'t exist'; | 270 | $exist = 'File doesn\'t exist'; |
| 271 | + } | ||
| 271 | $write = 'Directory not writable'; | 272 | $write = 'Directory not writable'; |
| 273 | + $fwrite = 'File not writable'; | ||
| 272 | $ret = array('class' => 'cross'); | 274 | $ret = array('class' => 'cross'); |
| 273 | 275 | ||
| 274 | if(!file_exists($dir)){ | 276 | if(!file_exists($dir)){ |
| @@ -298,7 +300,11 @@ class InstallUtil { | @@ -298,7 +300,11 @@ class InstallUtil { | ||
| 298 | } | 300 | } |
| 299 | 301 | ||
| 300 | $this->done = false; | 302 | $this->done = false; |
| 301 | - $ret['msg'] = $write; | 303 | + if(!$file) { |
| 304 | + $ret['msg'] = $write; | ||
| 305 | + } else { | ||
| 306 | + $ret['msg'] = $fwrite; | ||
| 307 | + } | ||
| 302 | return $ret; | 308 | return $ret; |
| 303 | } | 309 | } |
| 304 | 310 | ||
| @@ -364,13 +370,13 @@ class InstallUtil { | @@ -364,13 +370,13 @@ class InstallUtil { | ||
| 364 | * @return boolean | 370 | * @return boolean |
| 365 | */ | 371 | */ |
| 366 | public function canWriteFile($filename) { | 372 | public function canWriteFile($filename) { |
| 367 | - $fh = @fopen($filename, "w+"); | ||
| 368 | - $fr = @fwrite($fh, 'test'); | 373 | + $fh = fopen($filename, "w+"); |
| 374 | + $fr = fwrite($fh, 'test'); | ||
| 369 | if($fr === false) { | 375 | if($fr === false) { |
| 370 | return false; | 376 | return false; |
| 371 | } | 377 | } |
| 372 | 378 | ||
| 373 | - @fclose($fh); | 379 | + fclose($fh); |
| 374 | return true; | 380 | return true; |
| 375 | } | 381 | } |
| 376 | 382 | ||
| @@ -518,23 +524,23 @@ class InstallUtil { | @@ -518,23 +524,23 @@ class InstallUtil { | ||
| 518 | } | 524 | } |
| 519 | 525 | ||
| 520 | /** | 526 | /** |
| 521 | - * Check if system needs to be migrated | 527 | + * Check if system needs to be accessed |
| 522 | * | 528 | * |
| 523 | * @author KnowledgeTree Team | 529 | * @author KnowledgeTree Team |
| 524 | * @access public | 530 | * @access public |
| 525 | * @param none | 531 | * @param none |
| 526 | * @return boolean | 532 | * @return boolean |
| 527 | */ | 533 | */ |
| 528 | - public function migrationSpecified() { | ||
| 529 | - if(isset($_POST['installtype'])) { | ||
| 530 | - if($_POST['installtype'] == "Upgrade Installation") { | 534 | + public function finishSpecified() { |
| 535 | + if(isset($_GET['Finish'])) { | ||
| 536 | + if($_GET['Finish'] == "Finish") { | ||
| 531 | return true; | 537 | return true; |
| 532 | } | 538 | } |
| 533 | } | 539 | } |
| 534 | 540 | ||
| 535 | return false; | 541 | return false; |
| 536 | - } | ||
| 537 | - | 542 | + } |
| 543 | + | ||
| 538 | /** | 544 | /** |
| 539 | * Check if system needs to be migrated | 545 | * Check if system needs to be migrated |
| 540 | * | 546 | * |
| @@ -543,27 +549,9 @@ class InstallUtil { | @@ -543,27 +549,9 @@ class InstallUtil { | ||
| 543 | * @param none | 549 | * @param none |
| 544 | * @return boolean | 550 | * @return boolean |
| 545 | */ | 551 | */ |
| 546 | - public function upgradeSpecified() { | 552 | + public function migrationSpecified() { |
| 547 | if(isset($_POST['installtype'])) { | 553 | if(isset($_POST['installtype'])) { |
| 548 | - if($_POST['installtype'] == "Upgrade Only") { | ||
| 549 | - return true; | ||
| 550 | - } | ||
| 551 | - } | ||
| 552 | - | ||
| 553 | - return false; | ||
| 554 | - } | ||
| 555 | - | ||
| 556 | - /** | ||
| 557 | - * Check if system needs to be migrated | ||
| 558 | - * | ||
| 559 | - * @author KnowledgeTree Team | ||
| 560 | - * @access public | ||
| 561 | - * @param none | ||
| 562 | - * @return boolean | ||
| 563 | - */ | ||
| 564 | - public function loginSpecified() { | ||
| 565 | - if(isset($_GET['completeType'])) { | ||
| 566 | - if($_GET['completeType'] == "Login") { | 554 | + if($_POST['installtype'] == "Upgrade Installation") { |
| 567 | return true; | 555 | return true; |
| 568 | } | 556 | } |
| 569 | } | 557 | } |
| @@ -579,9 +567,9 @@ class InstallUtil { | @@ -579,9 +567,9 @@ class InstallUtil { | ||
| 579 | * @param none | 567 | * @param none |
| 580 | * @return boolean | 568 | * @return boolean |
| 581 | */ | 569 | */ |
| 582 | - public function zendSpecified() { | ||
| 583 | - if(isset($_GET['completeType'])) { | ||
| 584 | - if($_GET['completeType'] == "Zend Server Configuration") { | 570 | + public function upgradeSpecified() { |
| 571 | + if(isset($_POST['installtype'])) { | ||
| 572 | + if($_POST['installtype'] == "Upgrade Only") { | ||
| 585 | return true; | 573 | return true; |
| 586 | } | 574 | } |
| 587 | } | 575 | } |
| @@ -607,8 +595,6 @@ class InstallUtil { | @@ -607,8 +595,6 @@ class InstallUtil { | ||
| 607 | return false; | 595 | return false; |
| 608 | } | 596 | } |
| 609 | 597 | ||
| 610 | - | ||
| 611 | - | ||
| 612 | /** | 598 | /** |
| 613 | * Get session data from package | 599 | * Get session data from package |
| 614 | * | 600 | * |
| @@ -808,6 +794,19 @@ class InstallUtil { | @@ -808,6 +794,19 @@ class InstallUtil { | ||
| 808 | public function sqlInstallDir() { | 794 | public function sqlInstallDir() { |
| 809 | return SYSTEM_DIR."sql".DS."mysql".DS."install".DS; | 795 | return SYSTEM_DIR."sql".DS."mysql".DS."install".DS; |
| 810 | } | 796 | } |
| 797 | + | ||
| 798 | + public function getFileByLine($file) { | ||
| 799 | + $fileLines = array(); | ||
| 800 | + $file_handle = fopen($file, "rb"); | ||
| 801 | + while (!feof($file_handle) ) { | ||
| 802 | + $line_of_text = fgets($file_handle); | ||
| 803 | + $parts = explode('=', $line_of_text); | ||
| 804 | + $fileLines[] = $line_of_text; | ||
| 805 | + } | ||
| 806 | + fclose($file_handle); | ||
| 807 | + return $fileLines; | ||
| 808 | + } | ||
| 809 | + | ||
| 811 | /** | 810 | /** |
| 812 | * Portably execute a command on any of the supported platforms. | 811 | * Portably execute a command on any of the supported platforms. |
| 813 | * | 812 | * |
setup/wizard/lib/services/unixScheduler.php
| @@ -108,7 +108,7 @@ class unixScheduler extends unixService { | @@ -108,7 +108,7 @@ class unixScheduler extends unixService { | ||
| 108 | 108 | ||
| 109 | function writeSchedulerTask() { | 109 | function writeSchedulerTask() { |
| 110 | $fLoc = $this->getSchedulerDir().$this->getSchedulerSource(); | 110 | $fLoc = $this->getSchedulerDir().$this->getSchedulerSource(); |
| 111 | - $fp = @fopen($fLoc, "w+"); | 111 | + $fp = fopen($fLoc, "w+"); |
| 112 | $content = "#!/bin/sh\n"; | 112 | $content = "#!/bin/sh\n"; |
| 113 | $content .= "cd ".SYS_BIN_DIR."\n"; | 113 | $content .= "cd ".SYS_BIN_DIR."\n"; |
| 114 | $content .= "while true; do\n"; | 114 | $content .= "while true; do\n"; |
| @@ -116,8 +116,8 @@ class unixScheduler extends unixService { | @@ -116,8 +116,8 @@ class unixScheduler extends unixService { | ||
| 116 | $content .= "{$this->phpCli} -Cq scheduler.php\n"; | 116 | $content .= "{$this->phpCli} -Cq scheduler.php\n"; |
| 117 | $content .= "sleep 30\n"; | 117 | $content .= "sleep 30\n"; |
| 118 | $content .= "done"; | 118 | $content .= "done"; |
| 119 | - @fwrite($fp, $content); | ||
| 120 | - @fclose($fp); | 119 | + fwrite($fp, $content); |
| 120 | + fclose($fp); | ||
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | function install() { | 123 | function install() { |
setup/wizard/steps/complete.php
| @@ -54,7 +54,6 @@ class complete extends Step { | @@ -54,7 +54,6 @@ class complete extends Step { | ||
| 54 | private $database_check = 'tick'; | 54 | private $database_check = 'tick'; |
| 55 | private $migrate_check = false; | 55 | private $migrate_check = false; |
| 56 | public $silent = true; | 56 | public $silent = true; |
| 57 | - private $install_environment = 'Zend'; | ||
| 58 | private $servicesValidation = false; | 57 | private $servicesValidation = false; |
| 59 | 58 | ||
| 60 | function doStep() { | 59 | function doStep() { |
| @@ -68,7 +67,6 @@ class complete extends Step { | @@ -68,7 +67,6 @@ class complete extends Step { | ||
| 68 | $this->checkDb(); // check database | 67 | $this->checkDb(); // check database |
| 69 | $this->checkServices(); // check services | 68 | $this->checkServices(); // check services |
| 70 | $this->checkInstallType();// Set silent mode variables | 69 | $this->checkInstallType();// Set silent mode variables |
| 71 | - $this->install_environment = $this->util->installEnvironment(); // Determine installation environment | ||
| 72 | $this->storeSilent();// Set silent mode variables | 70 | $this->storeSilent();// Set silent mode variables |
| 73 | } | 71 | } |
| 74 | 72 | ||
| @@ -239,7 +237,6 @@ class complete extends Step { | @@ -239,7 +237,6 @@ class complete extends Step { | ||
| 239 | $this->temp_variables['privileges_check'] = $this->privileges_check; | 237 | $this->temp_variables['privileges_check'] = $this->privileges_check; |
| 240 | $this->temp_variables['database_check'] = $this->database_check; | 238 | $this->temp_variables['database_check'] = $this->database_check; |
| 241 | $this->temp_variables['migrate_check'] = $this->migrate_check; | 239 | $this->temp_variables['migrate_check'] = $this->migrate_check; |
| 242 | - $this->temp_variables['install_environment'] = $this->install_environment; | ||
| 243 | $this->temp_variables['servicesValidation'] = $this->servicesValidation; | 240 | $this->temp_variables['servicesValidation'] = $this->servicesValidation; |
| 244 | } | 241 | } |
| 245 | } | 242 | } |
setup/wizard/steps/configuration.php
| @@ -252,6 +252,12 @@ class configuration extends Step | @@ -252,6 +252,12 @@ class configuration extends Step | ||
| 252 | $paths = $this->getPathInfo($server['file_system_root']['value']); | 252 | $paths = $this->getPathInfo($server['file_system_root']['value']); |
| 253 | if(!$edit) $this->temp_variables['paths'] = $paths; | 253 | if(!$edit) $this->temp_variables['paths'] = $paths; |
| 254 | 254 | ||
| 255 | + // Rewrite file system root | ||
| 256 | + if(!$this->fpath) { | ||
| 257 | + $froot = $this->temp_variables['server']['file_system_root']['value']; | ||
| 258 | + $this->temp_variables['server']['file_system_root']['value'] = 'default'; | ||
| 259 | + } | ||
| 260 | + | ||
| 255 | return $this->done; | 261 | return $this->done; |
| 256 | } | 262 | } |
| 257 | 263 | ||
| @@ -295,6 +301,7 @@ class configuration extends Step | @@ -295,6 +301,7 @@ class configuration extends Step | ||
| 295 | */ | 301 | */ |
| 296 | public function installStep() | 302 | public function installStep() |
| 297 | { | 303 | { |
| 304 | + $this->file_system_root = realpath(SYSTEM_DIR); | ||
| 298 | $conf = $this->getDataFromSession("configuration"); // get data from the server | 305 | $conf = $this->getDataFromSession("configuration"); // get data from the server |
| 299 | $dbconf = $this->getDataFromSession("database"); | 306 | $dbconf = $this->getDataFromSession("database"); |
| 300 | $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dport'], $dbconf['dmsname'], $dbconf['dmspassword'], $dbconf['dname']); | 307 | $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dport'], $dbconf['dmsname'], $dbconf['dmspassword'], $dbconf['dname']); |
| @@ -382,6 +389,7 @@ class configuration extends Step | @@ -382,6 +389,7 @@ class configuration extends Step | ||
| 382 | { | 389 | { |
| 383 | $script = $_SERVER['SCRIPT_NAME']; | 390 | $script = $_SERVER['SCRIPT_NAME']; |
| 384 | $file_system_root = realpath(SYSTEM_DIR); | 391 | $file_system_root = realpath(SYSTEM_DIR); |
| 392 | + $this->file_system_root = $file_system_root; | ||
| 385 | $host = $_SERVER['SERVER_NAME']; | 393 | $host = $_SERVER['SERVER_NAME']; |
| 386 | $port = $_SERVER['SERVER_PORT']; | 394 | $port = $_SERVER['SERVER_PORT']; |
| 387 | $ssl_enabled = isset($_SERVER['HTTPS']) ? (strtolower($_SERVER['HTTPS']) === 'on' ? 'yes' : 'no') : 'no'; | 395 | $ssl_enabled = isset($_SERVER['HTTPS']) ? (strtolower($_SERVER['HTTPS']) === 'on' ? 'yes' : 'no') : 'no'; |
| @@ -394,12 +402,7 @@ class configuration extends Step | @@ -394,12 +402,7 @@ class configuration extends Step | ||
| 394 | $ssl_enabled = (isset($_POST['ssl_enabled'])) ? $_POST['ssl_enabled'] : $ssl_enabled; | 402 | $ssl_enabled = (isset($_POST['ssl_enabled'])) ? $_POST['ssl_enabled'] : $ssl_enabled; |
| 395 | $server = array(); | 403 | $server = array(); |
| 396 | $server['root_url'] = array('name' => 'Root Url', 'setting' => 'rootUrl', 'where' => 'db', 'value' => $root_url); | 404 | $server['root_url'] = array('name' => 'Root Url', 'setting' => 'rootUrl', 'where' => 'db', 'value' => $root_url); |
| 397 | - if(!$this->fpath) { | ||
| 398 | - $system_root = 'default'; | ||
| 399 | - } else { | ||
| 400 | - $system_root = $file_system_root; | ||
| 401 | - } | ||
| 402 | - $server['file_system_root'] = array('name' => 'File System Root', 'section' => 'KnowledgeTree', 'setting' => 'fileSystemRoot', 'where' => 'file', 'value' => $system_root); | 405 | + $server['file_system_root'] = array('name' => 'File System Root', 'section' => 'KnowledgeTree', 'setting' => 'fileSystemRoot', 'where' => 'file', 'value' => $file_system_root); |
| 403 | $server['host'] = array('name' => 'Host', 'setting' => 'server_name', 'where' => 'db', 'value' => $host); | 406 | $server['host'] = array('name' => 'Host', 'setting' => 'server_name', 'where' => 'db', 'value' => $host); |
| 404 | $server['port'] = array('name' => 'Port', 'setting' => 'server_port', 'where' => 'db', 'value' => $port); | 407 | $server['port'] = array('name' => 'Port', 'setting' => 'server_port', 'where' => 'db', 'value' => $port); |
| 405 | $server['ssl_enabled'] = array('name' => 'SSL Enabled', 'section' => 'KnowledgeTree', 'setting' => 'sslEnabled', 'where' => 'file', 'value' => $ssl_enabled); | 408 | $server['ssl_enabled'] = array('name' => 'SSL Enabled', 'section' => 'KnowledgeTree', 'setting' => 'sslEnabled', 'where' => 'file', 'value' => $ssl_enabled); |
| @@ -573,10 +576,9 @@ class configuration extends Step | @@ -573,10 +576,9 @@ class configuration extends Step | ||
| 573 | if(!$configPath) { | 576 | if(!$configPath) { |
| 574 | return false; | 577 | return false; |
| 575 | } | 578 | } |
| 576 | - $this->util->iniUtilities->load($configPath); | ||
| 577 | - $data = $this->util->iniUtilities->getFileByLine(); | 579 | + $data = $this->util->getFileByLine($configPath); |
| 578 | $firstline = true; | 580 | $firstline = true; |
| 579 | - foreach ($data as $k=>$v) { | 581 | + foreach ($data as $k) { |
| 580 | if(preg_match('/config.ini/', $k)) { // Find config.ini | 582 | if(preg_match('/config.ini/', $k)) { // Find config.ini |
| 581 | if($k == "config/config.ini") { // Source install and source upgrades | 583 | if($k == "config/config.ini") { // Source install and source upgrades |
| 582 | $configIniPath = realpath(SYSTEM_DIR.$k); | 584 | $configIniPath = realpath(SYSTEM_DIR.$k); |
| @@ -595,10 +597,9 @@ class configuration extends Step | @@ -595,10 +597,9 @@ class configuration extends Step | ||
| 595 | if(!$cachePath) { | 597 | if(!$cachePath) { |
| 596 | return false; | 598 | return false; |
| 597 | } | 599 | } |
| 598 | - $this->util->iniUtilities->load($cachePath); | ||
| 599 | - $data = $this->util->iniUtilities->getFileByLine(); | 600 | + $data = $this->util->getFileByLine($cachePath); |
| 600 | $firstline = true; | 601 | $firstline = true; |
| 601 | - foreach ($data as $k=>$v) { | 602 | + foreach ($data as $k) { |
| 602 | if(preg_match('/cache/', $k)) { // Find config.ini | 603 | if(preg_match('/cache/', $k)) { // Find config.ini |
| 603 | if($k == "var/cache") { // Source install and source upgrades | 604 | if($k == "var/cache") { // Source install and source upgrades |
| 604 | $configIniPath = realpath(SYSTEM_DIR.$k); | 605 | $configIniPath = realpath(SYSTEM_DIR.$k); |
| @@ -623,10 +624,9 @@ class configuration extends Step | @@ -623,10 +624,9 @@ class configuration extends Step | ||
| 623 | private function readConfigPath() { | 624 | private function readConfigPath() { |
| 624 | $configPath = $this->getContentPath(); | 625 | $configPath = $this->getContentPath(); |
| 625 | if(!$configPath) return false; | 626 | if(!$configPath) return false; |
| 626 | - $this->util->iniUtilities->load($configPath); | ||
| 627 | - $data = $this->util->iniUtilities->getFileByLine(); | 627 | + $data = $this->util->getFileByLine($configPath); |
| 628 | $firstline = true; | 628 | $firstline = true; |
| 629 | - foreach ($data as $k=>$v) { | 629 | + foreach ($data as $k) { |
| 630 | if($firstline) { // First line holds the var directory | 630 | if($firstline) { // First line holds the var directory |
| 631 | $firstline = false; | 631 | $firstline = false; |
| 632 | if(!preg_match('/config.ini/', $k)) { // Make sure it is not the old config.ini | 632 | if(!preg_match('/config.ini/', $k)) { // Make sure it is not the old config.ini |
| @@ -651,7 +651,11 @@ class configuration extends Step | @@ -651,7 +651,11 @@ class configuration extends Step | ||
| 651 | $this->confpaths['tmp'] = $k; | 651 | $this->confpaths['tmp'] = $k; |
| 652 | } | 652 | } |
| 653 | } | 653 | } |
| 654 | - | 654 | + // Source Installs |
| 655 | + if($this->confpaths['configIni'] == 'config/config.ini') { | ||
| 656 | + $this->confpaths['configIni'] = $this->file_system_root .DS. $this->confpaths['configIni']; | ||
| 657 | + } | ||
| 658 | + | ||
| 655 | return true; | 659 | return true; |
| 656 | } | 660 | } |
| 657 | 661 | ||
| @@ -664,16 +668,24 @@ class configuration extends Step | @@ -664,16 +668,24 @@ class configuration extends Step | ||
| 664 | * @return boolean | 668 | * @return boolean |
| 665 | */ | 669 | */ |
| 666 | private function writeConfigPath($configPath, $configContent) { | 670 | private function writeConfigPath($configPath, $configContent) { |
| 667 | - $fp = @fopen($configPath, 'w+'); | ||
| 668 | - if(@fwrite($fp, $configContent)) | ||
| 669 | - return true; | 671 | + if($configContent == 'config/config.ini') { |
| 672 | + $configContent = $this->file_system_root . DS . 'config/config.ini'; | ||
| 673 | + } | ||
| 674 | + $fp = fopen($configPath, 'w+'); | ||
| 675 | + if($configContent != '' && $fp) { | ||
| 676 | + if(fwrite($fp, $configContent)) | ||
| 677 | + return true; | ||
| 678 | + } | ||
| 670 | return false; | 679 | return false; |
| 671 | } | 680 | } |
| 672 | 681 | ||
| 673 | private function writeCachePath($cachePath, $cacheContent) { | 682 | private function writeCachePath($cachePath, $cacheContent) { |
| 674 | - $fp = @fopen($cachePath, 'w+'); | ||
| 675 | - if($cacheContent != '') { | ||
| 676 | - if(@fwrite($fp, $cacheContent)) | 683 | + if($cacheContent == 'var/cache') { |
| 684 | + $cacheContent = $this->file_system_root . DS . 'var/cache'; | ||
| 685 | + } | ||
| 686 | + $fp = fopen($cachePath, 'w+'); | ||
| 687 | + if($cacheContent != '' && $fp) { | ||
| 688 | + if(fwrite($fp, $cacheContent)) | ||
| 677 | return true; | 689 | return true; |
| 678 | } | 690 | } |
| 679 | return false; | 691 | return false; |
setup/wizard/steps/database.php
| @@ -734,7 +734,7 @@ class database extends Step | @@ -734,7 +734,7 @@ class database extends Step | ||
| 734 | } | 734 | } |
| 735 | 735 | ||
| 736 | private function parse_mysql_dump($url) { | 736 | private function parse_mysql_dump($url) { |
| 737 | - $handle = @fopen($url, "r"); | 737 | + $handle = fopen($url, "r"); |
| 738 | $query = ""; | 738 | $query = ""; |
| 739 | if ($handle) { | 739 | if ($handle) { |
| 740 | while (!feof($handle)) { | 740 | while (!feof($handle)) { |
| @@ -744,7 +744,7 @@ class database extends Step | @@ -744,7 +744,7 @@ class database extends Step | ||
| 744 | $query = ''; | 744 | $query = ''; |
| 745 | } | 745 | } |
| 746 | } | 746 | } |
| 747 | - @fclose($handle); | 747 | + fclose($handle); |
| 748 | } | 748 | } |
| 749 | 749 | ||
| 750 | return true; | 750 | return true; |
setup/wizard/steps/registration.php
| @@ -183,7 +183,7 @@ class registration extends Step | @@ -183,7 +183,7 @@ class registration extends Step | ||
| 183 | $params['http']['header'] = $optional_headers; | 183 | $params['http']['header'] = $optional_headers; |
| 184 | } | 184 | } |
| 185 | $ctx = stream_context_create($params); | 185 | $ctx = stream_context_create($params); |
| 186 | - $fp = @fopen($url, 'r', false, $ctx); | 186 | + $fp = fopen($url, 'r', false, $ctx); |
| 187 | if (!$fp) { | 187 | if (!$fp) { |
| 188 | throw new Exception("Problem with $url, $php_errormsg"); | 188 | throw new Exception("Problem with $url, $php_errormsg"); |
| 189 | } | 189 | } |
| @@ -192,7 +192,7 @@ class registration extends Step | @@ -192,7 +192,7 @@ class registration extends Step | ||
| 192 | fclose($fp); | 192 | fclose($fp); |
| 193 | throw new Exception("Problem reading data from $url, $php_errormsg"); | 193 | throw new Exception("Problem reading data from $url, $php_errormsg"); |
| 194 | } | 194 | } |
| 195 | - @fclose($fp); | 195 | + fclose($fp); |
| 196 | return $response; | 196 | return $response; |
| 197 | } | 197 | } |
| 198 | 198 |
setup/wizard/templates/complete.tpl
| @@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
| 25 | <p class="disclaimer"> | 25 | <p class="disclaimer"> |
| 26 | <?php if(WINDOWS_OS) { ?> | 26 | <?php if(WINDOWS_OS) { ?> |
| 27 | cd KnowledgeTree_Installation_Folder<br/> | 27 | cd KnowledgeTree_Installation_Folder<br/> |
| 28 | - dmsctl.bat install | 28 | + dmsctl.bat install<br/> |
| 29 | dmsctl.bat start | 29 | dmsctl.bat start |
| 30 | <?php } else { ?> | 30 | <?php } else { ?> |
| 31 | cd /usr/share/knowledgetree-ce<br/> | 31 | cd /usr/share/knowledgetree-ce<br/> |
| @@ -162,13 +162,5 @@ | @@ -162,13 +162,5 @@ | ||
| 162 | <?php } else { ?> | 162 | <?php } else { ?> |
| 163 | <a href="../../login.php" class="back button_next" style="width:50px;" onclick="javascript:{w.clearSessions();}">Finish</a> | 163 | <a href="../../login.php" class="back button_next" style="width:50px;" onclick="javascript:{w.clearSessions();}">Finish</a> |
| 164 | <?php } ?> | 164 | <?php } ?> |
| 165 | - <?php | ||
| 166 | - if ($install_environment == 'Zend') { | ||
| 167 | - ?> | ||
| 168 | -<!-- <input type="submit" name="type" value="Zend Server Configuration" class="button_previous"/>--> | ||
| 169 | -<!-- <a href="<?php //echo "http://".$_SERVER['HTTP_HOST'].":10081/ZendServer/Index"; ?>" class="back" target="_blank" onclick="javascript:{w.clearSessions();}">Zend Server Configuration</a>--> | ||
| 170 | - <?php | ||
| 171 | - } | ||
| 172 | - ?> | ||
| 173 | </form> | 165 | </form> |
| 174 | <?php if (AJAX) { echo $html->js('form.js'); } ?> | 166 | <?php if (AJAX) { echo $html->js('form.js'); } ?> |
| 175 | \ No newline at end of file | 167 | \ No newline at end of file |