diff --git a/bin/dbmaint.php b/bin/dbmaint.php index 49777c6..b40bd9c 100644 --- a/bin/dbmaint.php +++ b/bin/dbmaint.php @@ -54,5 +54,5 @@ if(!empty($tables)){ } $default->log->info('Done.'); - +exit; ?> \ No newline at end of file diff --git a/bin/expungeall.php b/bin/expungeall.php index a856833..d60a157 100644 --- a/bin/expungeall.php +++ b/bin/expungeall.php @@ -8,31 +8,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ */ @@ -100,4 +100,5 @@ $end_time = time(); $diff = $end_time - $start_time; $session->logout(); +exit; ?> diff --git a/bin/scheduler.php b/bin/scheduler.php index 316c1f9..160532d 100644 --- a/bin/scheduler.php +++ b/bin/scheduler.php @@ -210,7 +210,9 @@ if (empty($aList)) if ($ext == 'php') { - $phpPath = KTUtil::findCommand('externalBinary/php'); + $oKTConfig = KTConfig::getSingleton(); + $phpPath = $oKTConfig->get('externalBinary/php', 'php'); + //$phpPath = KTUtil::findCommand('externalBinary/php'); // being protective as some scripts work on relative paths $dirname = dirname($file); diff --git a/control.php b/control.php index 06e50bc..07a92be 100644 --- a/control.php +++ b/control.php @@ -37,7 +37,7 @@ */ // check if system has been installed -require_once("setup/wizard/install_util.php"); +require_once("setup/wizard/installUtil.php"); // Check if system has been installed $iu = new InstallUtil(); if(!$iu->isSystemInstalled()) { diff --git a/plugins/housekeeper/bin/UpdateStats.php b/plugins/housekeeper/bin/UpdateStats.php index 9d0fb76..a74c788 100644 --- a/plugins/housekeeper/bin/UpdateStats.php +++ b/plugins/housekeeper/bin/UpdateStats.php @@ -44,4 +44,5 @@ require_once('../HouseKeeper.inc.php'); HouseKeeper::getDiskUsageStats(); HouseKeeper::getKTUsageStats(); -?> +exit; +?> \ No newline at end of file diff --git a/resources/graphics/menu_corner_left.png b/resources/graphics/menu_corner_left.png index 0185915..65db634 100644 --- a/resources/graphics/menu_corner_left.png +++ b/resources/graphics/menu_corner_left.png diff --git a/resources/graphics/menubg.png b/resources/graphics/menubg.png index b6d37a2..20880fe 100644 --- a/resources/graphics/menubg.png +++ b/resources/graphics/menubg.png diff --git a/resources/graphics/portlet_bg_collapsed.gif b/resources/graphics/portlet_bg_collapsed.gif index 22599f3..a1da96a 100644 --- a/resources/graphics/portlet_bg_collapsed.gif +++ b/resources/graphics/portlet_bg_collapsed.gif diff --git a/resources/graphics/portlet_bg_collapsed.png b/resources/graphics/portlet_bg_collapsed.png index 2c94fee..34d515e 100644 --- a/resources/graphics/portlet_bg_collapsed.png +++ b/resources/graphics/portlet_bg_collapsed.png diff --git a/resources/graphics/portlet_corner_topleft_collapsed.gif b/resources/graphics/portlet_corner_topleft_collapsed.gif index 06d4623..9046ccd 100644 --- a/resources/graphics/portlet_corner_topleft_collapsed.gif +++ b/resources/graphics/portlet_corner_topleft_collapsed.gif diff --git a/resources/graphics/portlet_corner_topleft_collapsed.png b/resources/graphics/portlet_corner_topleft_collapsed.png index efe0bcf..5f0bcb8 100644 --- a/resources/graphics/portlet_corner_topleft_collapsed.png +++ b/resources/graphics/portlet_corner_topleft_collapsed.png diff --git a/resources/graphics/portlet_corner_topright.gif b/resources/graphics/portlet_corner_topright.gif index 4acd3c6..3ec1f96 100644 --- a/resources/graphics/portlet_corner_topright.gif +++ b/resources/graphics/portlet_corner_topright.gif diff --git a/resources/graphics/portlet_corner_topright.png b/resources/graphics/portlet_corner_topright.png index 7caaf52..377530e 100644 --- a/resources/graphics/portlet_corner_topright.png +++ b/resources/graphics/portlet_corner_topright.png diff --git a/resources/graphics/portlet_corner_topright_collapsed.gif b/resources/graphics/portlet_corner_topright_collapsed.gif index 13d58ed..9272474 100644 --- a/resources/graphics/portlet_corner_topright_collapsed.gif +++ b/resources/graphics/portlet_corner_topright_collapsed.gif diff --git a/resources/graphics/portlet_corner_topright_collapsed.png b/resources/graphics/portlet_corner_topright_collapsed.png index 41881b7..3e855e9 100644 --- a/resources/graphics/portlet_corner_topright_collapsed.png +++ b/resources/graphics/portlet_corner_topright_collapsed.png diff --git a/search2/bin/cronCleanup.php b/search2/bin/cronCleanup.php index 48ee585..d218a7f 100644 --- a/search2/bin/cronCleanup.php +++ b/search2/bin/cronCleanup.php @@ -81,5 +81,5 @@ function cleanupTempDirectory($dir, $force = false) } - -?> +exit; +?> \ No newline at end of file diff --git a/search2/bin/cronIndexStats.php b/search2/bin/cronIndexStats.php index 32d4ec2..41057cc 100644 --- a/search2/bin/cronIndexStats.php +++ b/search2/bin/cronIndexStats.php @@ -49,3 +49,6 @@ if ($verbose) print _kt("Cache index stats and diagnostics") . "...\n"; $indexer = Indexer::get(); $indexer->updateIndexStats(); + +exit; +?> \ No newline at end of file diff --git a/search2/bin/cronIndexer.php b/search2/bin/cronIndexer.php index 3d917f2..1eebb5f 100644 --- a/search2/bin/cronIndexer.php +++ b/search2/bin/cronIndexer.php @@ -7,31 +7,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -42,5 +42,5 @@ require_once(realpath('../../config/dmsDefaults.php')); KTUtil::call_page('search2/indexing/bin/cronIndexer.php'); - -?> +exit; +?> \ No newline at end of file diff --git a/search2/bin/cronMigration.php b/search2/bin/cronMigration.php index 8d0432c..30c2d1a 100644 --- a/search2/bin/cronMigration.php +++ b/search2/bin/cronMigration.php @@ -7,31 +7,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -42,4 +42,5 @@ require_once(realpath('../../config/dmsDefaults.php')); KTUtil::call_page('search2/indexing/bin/cronMigration.php'); -?> +exit; +?> \ No newline at end of file diff --git a/search2/bin/cronOptimize.php b/search2/bin/cronOptimize.php index cd3bc3c..d19fff0 100644 --- a/search2/bin/cronOptimize.php +++ b/search2/bin/cronOptimize.php @@ -39,5 +39,5 @@ require_once('optimise.php'); - -?> +exit; +?> \ No newline at end of file diff --git a/search2/bin/cronResources.php b/search2/bin/cronResources.php index 56cc96d..f21eb5f 100644 --- a/search2/bin/cronResources.php +++ b/search2/bin/cronResources.php @@ -95,4 +95,5 @@ class ResourceChecker $checker = new ResourceChecker(); $checker->check(); -?> +exit; +?> \ No newline at end of file diff --git a/search2/bin/optimise.php b/search2/bin/optimise.php index 571664e..1e69f7c 100644 --- a/search2/bin/optimise.php +++ b/search2/bin/optimise.php @@ -7,31 +7,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -42,5 +42,5 @@ require_once(realpath('../../config/dmsDefaults.php')); KTUtil::call_page('search2/indexing/bin/optimise.php'); - -?> +exit; +?> \ No newline at end of file diff --git a/search2/indexing/bin/cronIndexer.php b/search2/indexing/bin/cronIndexer.php index 1e85f9e..e1b3015 100755 --- a/search2/indexing/bin/cronIndexer.php +++ b/search2/indexing/bin/cronIndexer.php @@ -50,5 +50,6 @@ require_once('indexing/indexerCore.inc.php'); $indexer = Indexer::get(); $indexer->indexDocuments(); $indexer->updateIndexStats(); + exit; -?> +?> \ No newline at end of file diff --git a/search2/indexing/bin/cronMigration.php b/search2/indexing/bin/cronMigration.php index 616a72b..b965ae7 100644 --- a/search2/indexing/bin/cronMigration.php +++ b/search2/indexing/bin/cronMigration.php @@ -7,31 +7,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -51,4 +51,4 @@ $indexer = Indexer::get(); $indexer->migrateDocuments(); exit; -?> +?> \ No newline at end of file diff --git a/search2/indexing/bin/cronOptimize.php b/search2/indexing/bin/cronOptimize.php index f9e8d0c..d19fff0 100644 --- a/search2/indexing/bin/cronOptimize.php +++ b/search2/indexing/bin/cronOptimize.php @@ -39,4 +39,5 @@ require_once('optimise.php'); -?> +exit; +?> \ No newline at end of file diff --git a/search2/indexing/bin/optimise.php b/search2/indexing/bin/optimise.php index 9038582..08fa9d4 100755 --- a/search2/indexing/bin/optimise.php +++ b/search2/indexing/bin/optimise.php @@ -7,31 +7,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -58,4 +58,5 @@ $indexer->optimise(); if ($verbose) print _kt("Done.") . "\n"; -?> +exit; +?> \ No newline at end of file diff --git a/search2/indexing/bin/recreateIndex.php b/search2/indexing/bin/recreateIndex.php index 6663e99..f2e9fab 100755 --- a/search2/indexing/bin/recreateIndex.php +++ b/search2/indexing/bin/recreateIndex.php @@ -7,31 +7,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -107,5 +107,5 @@ if ($indexall) print _kt("Done.") . "\n"; - -?> +exit; +?> \ No newline at end of file diff --git a/search2/indexing/bin/registerTypes.php b/search2/indexing/bin/registerTypes.php index 65051b9..dadef7b 100755 --- a/search2/indexing/bin/registerTypes.php +++ b/search2/indexing/bin/registerTypes.php @@ -7,31 +7,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -84,4 +84,5 @@ $indexer = Indexer::get(); $indexer->registerTypes($clear); print _kt("Done.") . "\n"; +exit; ?> diff --git a/search2/indexing/bin/reportUnindexedDocuments.php b/search2/indexing/bin/reportUnindexedDocuments.php index 88cc157..c403a96 100644 --- a/search2/indexing/bin/reportUnindexedDocuments.php +++ b/search2/indexing/bin/reportUnindexedDocuments.php @@ -125,4 +125,5 @@ else print "-----END-----\n\nDone\n"; } -?> +exit; +?> \ No newline at end of file diff --git a/search2/indexing/bin/shutdown.php b/search2/indexing/bin/shutdown.php index 87671f4..b7bd87c 100644 --- a/search2/indexing/bin/shutdown.php +++ b/search2/indexing/bin/shutdown.php @@ -7,31 +7,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -86,5 +86,5 @@ print "\n* " . _kt("The request to shutdown has been sent to the server. It may print _kt("Done.") . "\n"; - -?> +exit; +?> \ No newline at end of file diff --git a/setup/wizard/config/config.xml b/setup/wizard/config/config.xml index 0c3cc13..5e3df31 100755 --- a/setup/wizard/config/config.xml +++ b/setup/wizard/config/config.xml @@ -10,10 +10,11 @@ welcome + dependencies + services + configuration license - dependency_check - configuration - database + database install complete diff --git a/setup/wizard/database.inc b/setup/wizard/dbUtil.php old mode 100644 new mode 100755 index 7cad7d2..46663ad --- a/setup/wizard/database.inc +++ b/setup/wizard/dbUtil.php @@ -39,7 +39,7 @@ * @package Installer * @version Version 0.1 */ -class DBUtil { +class dbUtil { /** * Host * @@ -112,7 +112,7 @@ class DBUtil { * @access public * @return boolean */ - public function DBUtil($dhost = 'localhost', $duname, $dpassword, $dbname = '') { + public function dbUtil($dhost = 'localhost', $duname, $dpassword, $dbname = '') { $this->dbhost = $dhost; $this->dbuname = $duname; $this->dbpassword = $dpassword; diff --git a/setup/wizard/index.php b/setup/wizard/index.php index d58ca1d..268329d 100755 --- a/setup/wizard/index.php +++ b/setup/wizard/index.php @@ -39,5 +39,5 @@ * @package Installer * @version Version 0.1 */ -require_once("installwizard.php"); +require_once("installWizard.php"); ?> \ No newline at end of file diff --git a/setup/wizard/Ini.inc b/setup/wizard/ini.php old mode 100644 new mode 100755 index 745602d..745602d --- a/setup/wizard/Ini.inc +++ b/setup/wizard/ini.php diff --git a/setup/wizard/install_util.php b/setup/wizard/installUtil.php old mode 100644 new mode 100755 index b87274c..1189e83 --- a/setup/wizard/install_util.php +++ b/setup/wizard/installUtil.php @@ -59,9 +59,9 @@ class InstallUtil { */ public function isSystemInstalled() { if (file_exists(dirname(__FILE__)."/install")) { - return false; + return true; } - return true; + return false; } /** @@ -312,13 +312,77 @@ class InstallUtil { return true; } - function execInBackground($cmd) { - if (substr(php_uname(), 0, 7) == "Windows"){ - pclose(popen("start /B ". $cmd, "r")); - } - else { - exec($cmd . " > /dev/null &"); - } - } + /** + * Portably execute a command on any of the supported platforms. + */ + function pexec($aCmd, $aOptions = null) { + if (is_array($aCmd)) { + $sCmd = $this->safeShellString($aCmd); + } else { + $sCmd = $aCmd; + } + $sAppend = $this->arrayGet($aOptions, 'append'); + if ($sAppend) { + $sCmd .= " >> " . escapeshellarg($sAppend); + } + $sPopen = $this->arrayGet($aOptions, 'popen'); + if ($sPopen) { + if (WINDOWS_OS) { + $sCmd = "start /b \"kt\" " . $sCmd; + } + return popen($sCmd, $sPopen); + } + // for exec, check return code and output... + $aRet = array(); + $aOutput = array(); + $iRet = ''; + if(WINDOWS_OS) { + $sCmd = 'call '.$sCmd; + } + exec($sCmd, $aOutput, $iRet); + $aRet['ret'] = $iRet; + $aRet['out'] = $aOutput; + + return $aRet; + } + + function arrayGet($aArray, $sKey, $mDefault = null, $bDefaultIfEmpty = true) { + if (!is_array($aArray)) { + $aArray = (array) $aArray; + } + + if ($aArray !== 0 && $aArray !== '0' && empty($aArray)) { + return $mDefault; + } + if (array_key_exists($sKey, $aArray)) { + $mVal =& $aArray[$sKey]; + if (empty($mVal) && $bDefaultIfEmpty) { + return $mDefault; + } + return $mVal; + } + return $mDefault; + } + + function safeShellString () { + $aArgs = func_get_args(); + $aSafeArgs = array(); + if (is_array($aArgs[0])) { + $aArgs = $aArgs[0]; + } + $aSafeArgs[] = escapeshellarg(array_shift($aArgs)); + if (is_array($aArgs[0])) { + $aArgs = $aArgs; + } + foreach ($aArgs as $sArg) { + if (empty($sArg)) { + $aSafeArgs[] = "''"; + } else { + $aSafeArgs[] = escapeshellarg($sArg); + } + } + return join(" ", $aSafeArgs); + } + } ?> \ No newline at end of file diff --git a/setup/wizard/installwizard.php b/setup/wizard/installWizard.php old mode 100644 new mode 100755 index 259a051..fe74219 --- a/setup/wizard/installwizard.php +++ b/setup/wizard/installWizard.php @@ -40,10 +40,17 @@ * @version Version 0.1 */ include("path.php"); // Paths -require_once("install_util.php"); // Utility functions -require_once("session.php"); // Session management -require_once("template.inc"); // Template management -require_once("step_action.php"); // Step actions control + +function __autoload($class) { // Attempt and autoload classes + $class = strtolower(substr($class,0,1)).substr($class,1); // Linux Systems. + if(file_exists(WIZARD_DIR."$class.php")) { + require(WIZARD_DIR."$class.php"); + } elseif (file_exists(STEP_DIR."$class.php")) { + require(STEP_DIR."$class.php"); + } else { + return false; + } +} class InstallWizard { /** @@ -63,7 +70,7 @@ class InstallWizard { * @var boolean */ protected $iutil = null; - + /** * Constructs installation wizard object * @@ -93,7 +100,6 @@ class InstallWizard { * @return void */ public function displayInstaller($response = null) { - require("installer.php"); if($response) { $ins = new Installer(); // Instantiate the installer $ins->resolveErrors($response); // Run step @@ -227,9 +233,9 @@ class InstallWizard { public function dispatch() { $this->load(); if($this->getBypass() === "1") { - $this->createInstallFile(); - } elseif ($this->getBypass() === "0") { $this->removeInstallFile(); + } elseif ($this->getBypass() === "0") { + $this->createInstallFile(); } if(!$this->isSystemInstalled()) { // Check if the systems not installed $response = $this->systemChecks(); diff --git a/setup/wizard/installer.php b/setup/wizard/installer.php index d97170e..4a74d1a 100755 --- a/setup/wizard/installer.php +++ b/setup/wizard/installer.php @@ -109,7 +109,7 @@ class Installer { * * @author KnowledgeTree Team * @access protected - * @var array boolean + * @var boolean */ protected $stepConfirmation = false; @@ -125,21 +125,6 @@ class Installer { } /** - * Sets any variables passed through for testing purposes - * - * @author KnowledgeTree Team - * @access private - * @param none - * @return void - */ - private function _setSessionVars() { - if(isset($_GET['bypass'])) { - $bypass = $_GET['bypass']; - $this->session->set('bypass', $bypass); - } - } - - /** * Read xml configuration file * * @author KnowledgeTree Team @@ -282,6 +267,7 @@ class Installer { * @return string */ private function _runStepAction($stepName) { + //echo $stepName."=="; $this->stepAction = new stepAction($stepName); $this->stepAction->setSteps($this->getSteps()); $this->stepAction->setStepNames($this->getStepNames()); @@ -314,13 +300,44 @@ class Installer { private function _xmlStepsToArray() { foreach($this->simpleXmlObj->steps->step as $d_step) { $step_name = (string) $d_step[0]; - $this->stepClassNames[] = $step_name; // Store steps as strings - $this->stepNames[$step_name] = (string) $d_step['name']; // Store steps as human readable strings - if(isset($d_step['order'])) { + $this->stepClassNames[] = $step_name; + } + $this->_loadToSession('stepClassNames', $this->stepClassNames); + } + + /** + * Set steps as human readable strings + * + * @author KnowledgeTree Team + * @param none + * @access private + * @return void + */ + private function _xmlStepsNames() { + foreach($this->simpleXmlObj->steps->step as $d_step) { + $step_name = (string) $d_step[0]; + $this->stepNames[$step_name] = (string) $d_step['name']; + } + $this->_loadToSession('stepNames', $this->stepNames); + } + + /** + * Set steps install order + * + * @author KnowledgeTree Team + * @param none + * @access private + * @return void + */ + private function _xmlStepsOrders() { + foreach($this->simpleXmlObj->steps->step as $d_step) { + if(isset($d_step['order'])) { + $step_name = (string) $d_step[0]; $order = (string) $d_step['order']; $this->installOrders[$order] = $step_name; // Store step install order } } + $this->_loadToSession('installOrders', $this->installOrders); } /** @@ -349,7 +366,7 @@ class Installer { * @return void */ private function _completeInstall() { - unlink("install"); + touch("install"); } /** @@ -371,7 +388,7 @@ class Installer { // TODO : Break on error response } } else { - die("$className : Class Files Missing"); + die("$className : Class Files Missing : Install Helper"); } } @@ -389,10 +406,32 @@ class Installer { foreach ($this->getSteps() as $class) { $this->session->un_setClass($class); } + foreach ($this->getStepNames() as $class) { + $this->session->un_setClass($class); + } + foreach ($this->_getInstallOrders() as $class) { + $this->session->un_setClass($class); + } } } } + private function loadNeeded() { + $this->_readXml(); // Xml steps + $this->_resetSessions(); // Make sure + $this->stepClassNames = $this->session->get('stepClassNames'); + if(!$this->stepClassNames) { + $this->_xmlStepsToArray(); // String steps + } + $this->stepNames = $this->session->get('stepNames'); + if(!$this->stepNames) { + $this->_xmlStepsNames(); + } + $this->installOrders = $this->session->get('installOrders'); + if(!$this->installOrders) { + $this->_xmlStepsOrders(); + } + } /** * Main control to handle the flow of install * @@ -402,10 +441,7 @@ class Installer { * @return void */ public function step() { - $this->_readXml(); // Xml steps - $this->_xmlStepsToArray(); // String steps - $this->_resetSessions(); // Make sure - $this->_setSessionVars(); + $this->loadNeeded(); $response = $this->_landing(); switch($response) { case 'next': @@ -518,7 +554,13 @@ class Installer { public function resolveErrors($errors) { echo $errors; exit(); - } + } + + private function _loadToSession($type, $values) { + if($values) { + $this->session->set($type , $values); + } + } } ?> \ No newline at end of file diff --git a/setup/wizard/output b/setup/wizard/output deleted file mode 100644 index e69de29..0000000 --- a/setup/wizard/output +++ /dev/null diff --git a/setup/wizard/path.php b/setup/wizard/path.php index 43a0f54..8cc4723 100755 --- a/setup/wizard/path.php +++ b/setup/wizard/path.php @@ -39,13 +39,30 @@ * @package Installer * @version Version 0.1 */ - define('DS', '/'); + // Define installer environment + if (substr(php_uname(), 0, 7) == "Windows"){ + define('WINDOWS_OS', true); + define('UNIX_OS', false); + } else { + define('WINDOWS_OS', false); + define('UNIX_OS', true); + } + if(WINDOWS_OS) { + define('DS', '\\'); + } else { + define('DS', '/'); + } define('WIZARD_DIR', dirname(__FILE__).DS); - define('SYSTEM_DIR', WIZARD_DIR."../../"); + define('SYSTEM_DIR', WIZARD_DIR."..".DS."..".DS); + define('SYS_BIN_DIR', WIZARD_DIR."..".DS."..".DS."bin".DS); + define('SYS_LOG_DIR', WIZARD_DIR."..".DS."..".DS."var".DS."log".DS); define('SQL_DIR', WIZARD_DIR.DS."sql".DS); - define('SQL_UPGRADE_DIR', SQL_DIR.DS."/upgrades/".DS); + define('SQL_UPGRADE_DIR', SQL_DIR.DS."upgrades".DS); define('CONF_DIR', WIZARD_DIR.DS."config".DS); define('RES_DIR', WIZARD_DIR.DS."resources".DS); define('STEP_DIR', WIZARD_DIR.DS."steps".DS); define('TEMP_DIR', WIZARD_DIR.DS."templates".DS); + + + ?> diff --git a/setup/wizard/resources/graphics/background.gif b/setup/wizard/resources/graphics/background.gif old mode 100644 new mode 100755 index d8039fb..d8039fb --- a/setup/wizard/resources/graphics/background.gif +++ b/setup/wizard/resources/graphics/background.gif diff --git a/setup/wizard/resources/graphics/cross_orange.png b/setup/wizard/resources/graphics/cross_orange.png old mode 100644 new mode 100755 index cb02cd5..cb02cd5 --- a/setup/wizard/resources/graphics/cross_orange.png +++ b/setup/wizard/resources/graphics/cross_orange.png diff --git a/setup/wizard/resources/wizard.css b/setup/wizard/resources/wizard.css old mode 100644 new mode 100755 index 2222080..2222080 --- a/setup/wizard/resources/wizard.css +++ b/setup/wizard/resources/wizard.css diff --git a/setup/wizard/resources/wizard.js b/setup/wizard/resources/wizard.js old mode 100644 new mode 100755 index d53f270..d53f270 --- a/setup/wizard/resources/wizard.js +++ b/setup/wizard/resources/wizard.js diff --git a/setup/wizard/service.php b/setup/wizard/service.php new file mode 100644 index 0000000..f096906 --- /dev/null +++ b/setup/wizard/service.php @@ -0,0 +1,77 @@ +. +* +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, +* California 94120-7775, or email info@knowledgetree.com. +* +* The interactive user interfaces in modified source and object code versions +* of this program must display Appropriate Legal Notices, as required under +* Section 5 of the GNU General Public License version 3. +* +* In accordance with Section 7(b) of the GNU General Public License version 3, +* these Appropriate Legal Notices must retain the display of the "Powered by +* KnowledgeTree" logo and retain the original copyright notice. If the display of the +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices +* must display the words "Powered by KnowledgeTree" and retain the original +* copyright notice. +* +* @copyright 2008-2009, KnowledgeTree Inc. +* @license GNU General Public License version 3 +* @author KnowledgeTree Team +* @package Installer +* @version Version 0.1 +*/ + +class Service { + private static $on = 1; + private static $off = 0; + public $pid; + public $status; + + public function start() { + +// $this->status = $this->on; + } + + public function stop() { + +// $this->status = $this->off; + } + + public function install() { + + } + + public function restart() { +// $this->status = $this->off; + +// $this->status = $this->on; + } + + public function uninstall() { + + } + + public function status() { +// return $this->status; + } +} +?> \ No newline at end of file diff --git a/setup/wizard/step_action.php b/setup/wizard/stepAction.php index d86efb6..6bd5108 100755 --- a/setup/wizard/step_action.php +++ b/setup/wizard/stepAction.php @@ -109,7 +109,7 @@ class stepAction { if($this->stepName != '') { $this->action = $this->createStep(); if(!$this->action) { - die("{$this->stepName} : Class Files Missing"); + die("{$this->stepName} : Class Files Missing : Create Step"); } $response = $this->action->doStep(); if($this->action->storeInSession()) { // Check if class values need to be stored in session @@ -122,7 +122,7 @@ class stepAction { } return $response; } else { - die("{$this->stepName} : Class Files Missing"); + die("{$this->stepName} : Class Files Missing : Do Action"); } } @@ -135,13 +135,8 @@ class stepAction { * @return object Step */ public function createStep() { - $filename = STEP_DIR."{$this->stepName}.php"; - if (file_exists($filename)) { - require_once($filename); - $step_class = $this->makeCamelCase($this->stepName); - return new $step_class(); - } - return false; + $step_class = $this->makeCamelCase($this->stepName); + return new $step_class(); } /** @@ -219,7 +214,7 @@ class stepAction { * @return string */ public function getCurrentStepName() { - return$this->step_names[$this->stepName]; + return $this->step_names[$this->stepName]; } /** diff --git a/setup/wizard/steps/complete.php b/setup/wizard/steps/complete.php index 2d20772..cfb2bc5 100755 --- a/setup/wizard/steps/complete.php +++ b/setup/wizard/steps/complete.php @@ -39,7 +39,6 @@ * @package Installer * @version Version 0.1 */ -require_once(WIZARD_DIR.'step.php'); class complete extends Step { @@ -48,5 +47,8 @@ class complete extends Step $this->temp_variables = array("step_name"=>"complete"); } + function doStep() { + return 'landing'; + } } ?> \ No newline at end of file diff --git a/setup/wizard/steps/configuration.php b/setup/wizard/steps/configuration.php index 3a79cbf..3a48a70 100755 --- a/setup/wizard/steps/configuration.php +++ b/setup/wizard/steps/configuration.php @@ -39,7 +39,6 @@ * @package Installer * @version Version 0.1 */ -require_once(WIZARD_DIR.'step.php'); class configuration extends Step { @@ -171,8 +170,6 @@ class configuration extends Step */ public function installStep() { - include_once('database.inc'); - include_once('Ini.inc'); // get data from the server $conf = $this->getDataFromSession("configuration"); $server = $conf['server']; @@ -187,13 +184,13 @@ class configuration extends Step } // initialise the db connection - $db = new DBUtil(); + $db = new dbUtil(); // retrieve database information from session $dbconf = $this->getDataFromSession("database"); // make db connection - $db->DBUtil($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); + $db->dbUtil($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); // add db config to server variables $server = $this->registerDBConfig($server, $dbconf); diff --git a/setup/wizard/steps/database.php b/setup/wizard/steps/database.php index 34a2f1b..7e9d2f2 100755 --- a/setup/wizard/steps/database.php +++ b/setup/wizard/steps/database.php @@ -39,8 +39,6 @@ * @package Installer * @version Version 0.1 */ -require_once(WIZARD_DIR.'step.php'); -require_once(WIZARD_DIR.'database.inc'); class database extends Step { @@ -223,7 +221,7 @@ class database extends Step * @param none */ public function __construct() { - $this->_dbhandler = new DBUtil(); + $this->_dbhandler = new dbUtil(); } /** @@ -300,9 +298,9 @@ class database extends Step return false; } if($this->dport == '') - $con = $this->_dbhandler->DBUtil($this->dhost, $this->duname, $this->dpassword, $this->dname); + $con = $this->_dbhandler->dbUtil($this->dhost, $this->duname, $this->dpassword, $this->dname); else - $con = $this->_dbhandler->DBUtil($this->dhost.":".$this->dport, $this->duname, $this->dpassword, $this->dname); + $con = $this->_dbhandler->dbUtil($this->dhost.":".$this->dport, $this->duname, $this->dpassword, $this->dname); if (!$con) { $this->error[] = "Could not connect: " . $this->_dbhandler->getErrors(); return false; @@ -533,7 +531,7 @@ class database extends Step * @return object mysql connection */ private function connectMysql() { - $con = $this->_dbhandler->DBUtil($this->dhost, $this->duname, $this->dpassword, $this->dname); + $con = $this->_dbhandler->dbUtil($this->dhost, $this->duname, $this->dpassword, $this->dname); if (!$con) { $this->error[] = "Could not connect: " . $this->_dbhandler->getErrors(); diff --git a/setup/wizard/steps/dependencies.php b/setup/wizard/steps/dependencies.php new file mode 100755 index 0000000..4a4d4a5 --- /dev/null +++ b/setup/wizard/steps/dependencies.php @@ -0,0 +1,359 @@ +. +* +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, +* California 94120-7775, or email info@knowledgetree.com. +* +* The interactive user interfaces in modified source and object code versions +* of this program must display Appropriate Legal Notices, as required under +* Section 5 of the GNU General Public License version 3. +* +* In accordance with Section 7(b) of the GNU General Public License version 3, +* these Appropriate Legal Notices must retain the display of the "Powered by +* KnowledgeTree" logo and retain the original copyright notice. If the display of the +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices +* must display the words "Powered by KnowledgeTree" and retain the original +* copyright notice. +* +* @copyright 2008-2009, KnowledgeTree Inc. +* @license GNU General Public License version 3 +* @author KnowledgeTree Team +* @package Installer +* @version Version 0.1 +*/ + +class dependencies extends Step +{ + private $maxPHPVersion = '6.0.0'; + private $minPHPVersion = '5.0.0'; + private $done; + + /** + * Flag to store class information in session + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + public $storeInSession = true; + + /** + * Constructor + * + * @author KnowledgeTree Team + * @access public + */ + public function __construct() { + $this->temp_variables = array("step_name"=>"dependencyCheck"); + $this->error = array(); + $this->done = true; + } + + /** + * Control function for position within the step + * + * @author KnowledgeTree Team + * @access public + * @return string The position in the step + */ + public function doStep() + { + // Check dependencies + $passed = $this->doRun(); + if($this->next()) { + if($passed) + return 'next'; + else + return 'error'; + } else if($this->previous()) { + + return 'previous'; + } + + return 'landing'; + } + + /** + * Execute the step + * + * @author KnowledgeTree Team + * @access public + * @return boolean True to continue | False if errors occurred + */ + public function doRun() + { + $check = $this->checkPhpVersion(); + $this->temp_variables['version'] = $check; + + $configs = $this->checkPhpConfiguration(); + $this->temp_variables['configurations'] = $configs; + + // get the list of extensions + $list = $this->getRequiredExtensions(); + $extensions = array(); + + foreach($list as $ext){ + + $ext['available'] = 'no'; + if($this->checkExtension($ext['extension'])){ + $ext['available'] = 'yes'; + }else { + if($ext['required'] == 'no'){ + $ext['available'] = 'optional'; + }else{ + $this->done = false; + $this->error[] = 'Missing required extension: '.$ext['name']; + } + } + + $extensions[] = $ext; + } + + $this->temp_variables['extensions'] = $extensions; + + return $this->done; + } + + /** + * Get any errors that occurred + * + * @author KnowledgeTree Team + * @access public + * @return array The error list + */ + public function getErrors() { + return $this->error; + } + + /** + * Get the variables to be passed to the template + * + * @author KnowledgeTree Team + * @access public + * @return array + */ + public function getStepVars() + { + return $this->temp_variables; + } + + /** + * Check the php configuration + * + * @author KnowledgeTree Team + * @access private + * @return array The configurations list + */ + private function checkPhpConfiguration() + { + $configs = $this->getConfigurations(); + + foreach($configs as $key => $config) { + $setting = ini_get($config['configuration']); + + switch($config['type']){ + case 'bool': + $value = ($setting == 1) ? 'ON' : 'OFF'; + break; + + case 'empty': + $value = ($setting === false || $setting === '') ? 'unset' : $setting; + break; + + default: + $value = $setting; + } + + $class = ($value == $config['recommended']) ? 'green' : 'orange'; + $configs[$key]['setting'] = $value; + $configs[$key]['class'] = $class; + } + + $limits = $this->getLimits(); + + foreach($limits as $key => $limit) { + $setting = ini_get($limit['configuration']); + + $setting = $this->prettySizeToActualSize($setting); + $recommended = $this->prettySizeToActualSize($limit['recommended']); + $class = ($recommended < $setting || $setting = -1) ? 'green' : 'orange'; + + $limits[$key]['setting'] = $this->prettySize($setting); + $limits[$key]['class'] = $class; + } + $configs = array_merge($configs, $limits); + + return $configs; + } + + /** + * Check that the version of php is correct + * + * @author KnowledgeTree Team + * @access private + * @return array Version check result + */ + private function checkPhpVersion() + { + $phpversion = phpversion(); + + $phpversion5 = version_compare($phpversion, $this->minPHPVersion, '>='); + $phpversion6 = version_compare($phpversion, $this->maxPHPVersion, '<'); + + $check['class'] = 'cross'; + if($phpversion5 != 1){ + $this->done = false; + $check['version'] = "Your PHP version needs to be PHP 5.0 or higher. You are running version {$phpversion}."; + return $check; + } + + if($phpversion6 != 1){ + $this->done = false; + $check['version'] = "KnowledgeTree is not supported on PHP 6.0 and higher. You are running version {$phpversion}."; + return $check; + } + $check['class'] = 'tick'; + $check['version'] = "You are running version {$phpversion}."; + return $check; + } + + /** + * Check whether the given extension is loaded + * + * @author KnowledgeTree Team + * @access private + * @param string $extension + * @return boolean + */ + private function checkExtension($extension) + { + if(extension_loaded($extension)){ + return true; + } + $this->continue = false; + return false; + } + + /** + * Convert a formatted string to a size integer + * + * @author KnowledgeTree Team + * @access string + * @param integer $pretty + * @return integer + */ + private function prettySizeToActualSize($pretty) { + if (strtoupper(substr($pretty, strlen($pretty) - 1)) == 'G') { + return (int)substr($pretty, 0, strlen($pretty)) * 1024 * 1024 * 1024; + } + if (strtoupper(substr($pretty, strlen($pretty) - 1)) == 'M') { + return (int)substr($pretty, 0, strlen($pretty)) * 1024 * 1024; + } + if (strtoupper(substr($pretty, strlen($pretty) - 1)) == 'K') { + return (int)substr($pretty, 0, strlen($pretty)) * 1024 * 1024; + } + return (int)$pretty; + } + + /** + * Convert a size integer to a formatted string + * + * @author KnowledgeTree Team + * @access private + * @param integer $v + * @return string + */ + private function prettySize($v) { + $v = (float)$v; + foreach (array('B', 'K', 'M', 'G') as $unit) { + if ($v < 1024) { + return $v . $unit; + } + $v = $v / 1024; + } + } + + /** + * Get the list of extensions used by the system + * + * @author KnowledgeTree Team + * @access private + * @return array + */ + private function getRequiredExtensions() + { + return array( + array('extension' => 'fileinfo', 'required' => 'no', 'name' => 'Fileinfo', 'details' => 'Provides better file identification support - not necessary if you use file extensions.'), + array('extension' => 'iconv', 'required' => 'no', 'name' => 'IconV', 'details' => 'Used for conversion between character sets.'), + array('extension' => 'mysql', 'required' => 'yes', 'name' => 'MySQL', 'details' => 'Used for accessing a MySQL database.'), + array('extension' => 'curl', 'required' => 'yes', 'name' => 'cURL', 'details' => 'Allows the connection and communication between different servers types using various protocols.'), + array('extension' => 'xmlrpc', 'required' => 'yes', 'name' => 'XMLRPC', 'details' => 'Used with XML-RPC servers and clients.'), + array('extension' => 'win32', 'required' => 'no', 'name' => 'Win32', 'details' => 'Allows control of Microsoft Windows services.'), + array('extension' => 'mbstring', 'required' => 'no', 'name' => 'Multi Byte Strings', 'details' => 'Used in the manipulation of multi-byte strings.'), + array('extension' => 'ldap', 'required' => 'no', 'name' => 'LDAP', 'details' => 'Used to access LDAP directory servers.'), + array('extension' => 'json', 'required' => 'yes', 'name' => 'JSON', 'details' => 'Implements the javascript object notation (json) data-interchange format.'), + array('extension' => 'openssl', 'required' => 'no', 'name' => 'Open SSL', 'details' => 'Used for the generation and verification of signatures and the encrypting and decrypting of data'), + ); + } + + /** + * Get the recommended configuration settings + * + * @author KnowledgeTree Team + * @access private + * @return array + */ + private function getConfigurations() + { + return array( + array('name' => 'Safe Mode', 'configuration' => 'safe_mode', 'recommended' => 'ON', 'type' => 'bool'), + array('name' => 'Display Errors', 'configuration' => 'display_errors', 'recommended' => 'OFF', 'type' => 'bool'), + array('name' => 'Display Startup Errors', 'configuration' => 'display_startup_errors', 'recommended' => 'ON', 'type' => 'bool'), + array('name' => 'File Uploads', 'configuration' => 'file_uploads', 'recommended' => 'ON', 'type' => 'bool'), + array('name' => 'Magic Quotes GPC', 'configuration' => 'magic_quotes_gpc', 'recommended' => 'OFF', 'type' => 'bool'), + array('name' => 'Magic Quotes Runtime', 'configuration' => 'magic_quotes_runtime', 'recommended' => 'OFF', 'type' => 'bool'), + array('name' => 'Register Globals', 'configuration' => 'register_globals', 'recommended' => 'OFF', 'type' => 'bool'), + array('name' => 'Output Buffering', 'configuration' => 'output_buffering', 'recommended' => 'OFF', 'type' => 'bool'), + array('name' => 'Session auto start', 'configuration' => 'session.auto_start', 'recommended' => 'OFF', 'type' => 'bool'), + array('name' => 'Automatic prepend file', 'configuration' => 'auto_prepend_file', 'recommended' => 'unset', 'type' => 'empty'), + array('name' => 'Automatic append file', 'configuration' => 'auto_append_file', 'recommended' => 'unset', 'type' => 'empty'), + array('name' => 'Open base directory', 'configuration' => 'open_basedir', 'recommended' => 'unset', 'type' => 'empty'), + array('name' => 'Default MIME type', 'configuration' => 'default_mimetype', 'recommended' => 'text/html', 'type' => 'string'), + ); + } + + /** + * Get the recommended limits settings + * + * @author KnowledgeTree Team + * @access private + * @return array + */ + private function getLimits() + { + return array( + array('name' => 'Maximum POST size', 'configuration' => 'post_max_size', 'recommended' => '32M', 'type' => 'int'), + array('name' => 'Maximum upload size', 'configuration' => 'upload_max_filesize', 'recommended' => '32M', 'type' => 'int'), + array('name' => 'Memory limit', 'configuration' => 'memory_limit', 'recommended' => '32M', 'type' => 'int'), + ); + } +} +?> \ No newline at end of file diff --git a/setup/wizard/steps/install.php b/setup/wizard/steps/install.php index f82fbb9..2cabcdc 100755 --- a/setup/wizard/steps/install.php +++ b/setup/wizard/steps/install.php @@ -40,8 +40,6 @@ * @version Version 0.1 */ -require_once(WIZARD_DIR.'step.php'); - class install extends step { diff --git a/setup/wizard/steps/license.php b/setup/wizard/steps/license.php index 40d20b1..b4221ce 100755 --- a/setup/wizard/steps/license.php +++ b/setup/wizard/steps/license.php @@ -39,7 +39,6 @@ * @package Installer * @version Version 0.1 */ -require_once(WIZARD_DIR.'step.php'); class license extends step { diff --git a/setup/wizard/steps/services.php b/setup/wizard/steps/services.php new file mode 100755 index 0000000..85bc961 --- /dev/null +++ b/setup/wizard/steps/services.php @@ -0,0 +1,153 @@ +. +* +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, +* California 94120-7775, or email info@knowledgetree.com. +* +* The interactive user interfaces in modified source and object code versions +* of this program must display Appropriate Legal Notices, as required under +* Section 5 of the GNU General Public License version 3. +* +* In accordance with Section 7(b) of the GNU General Public License version 3, +* these Appropriate Legal Notices must retain the display of the "Powered by +* KnowledgeTree" logo and retain the original copyright notice. If the display of the +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices +* must display the words "Powered by KnowledgeTree" and retain the original +* copyright notice. +* +* @copyright 2008-2009, KnowledgeTree Inc. +* @license GNU General Public License version 3 +* @author KnowledgeTree Team +* @package Installer +* @version Version 0.1 +*/ + + +//require_once('../../thirdparty/xmlrpc-2.2/xmlrpc.inc'); + +class services extends Step +{ + /** + * List of errors encountered + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + public $error = array(); + + /** + * Flag if step needs to be installed + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + protected $runInstall = true; + + + /** + * Constructs database object + * + * @author KnowledgeTree Team + * @access public + * @param none + */ + public function __construct() { + + } + + /** + * Main control of services setup + * + * @author KnowledgeTree Team + * @param none + * @access public + * @return string + */ + public function doStep() + { + // Check dependencies + $passed = $this->doRun(); + if($this->next()) { + if($passed) + return 'next'; + else + return 'error'; + } else if($this->previous()) { + + return 'previous'; + } + + return 'landing'; + } + + private function doRun() { + $util = new InstallUtil(); +// $response = $util->pexec("java"); // Java Runtime Check + $response = $util->pexec("java -version"); // Java Runtime Check + if(empty($response['out'])) { + $this->error[] = "Java runtime environment required"; +// return false; + } + $this->installStep(); + return true; + } + + + /** + * Runs step install if required + * + * @author KnowledgeTree Team + * @param none + * @access public + * @return void + */ + public function installStep() { + $util = new InstallUtil(); + if(WINDOWS_OS) { // Add service to tasks list if needed + $lucene = new windowsLucene(); + // Start service + } else { // Unix based systems + $lucene = new unixLucene(); + $lucene->load(); + } + + + + + } + + + + /** + * Returns database errors + * + * @author KnowledgeTree Team + * @access public + * @params none + * @return array + */ + public function getErrors() { + return $this->error; + } +} +?> \ No newline at end of file diff --git a/setup/wizard/steps/welcome.php b/setup/wizard/steps/welcome.php index de9b19a..6c44be2 100755 --- a/setup/wizard/steps/welcome.php +++ b/setup/wizard/steps/welcome.php @@ -39,11 +39,9 @@ * @package Installer * @version Version 0.1 */ -require_once(WIZARD_DIR.'step.php'); class welcome extends step { - function __construct() { $this->temp_variables = array("step_name"=>"license"); } diff --git a/setup/wizard/template.inc b/setup/wizard/template.php index 0d79d7a..0d79d7a 100755 --- a/setup/wizard/template.inc +++ b/setup/wizard/template.php diff --git a/setup/wizard/templates/dependencies.tpl b/setup/wizard/templates/dependencies.tpl new file mode 100755 index 0000000..1dd1b66 --- /dev/null +++ b/setup/wizard/templates/dependencies.tpl @@ -0,0 +1,96 @@ +

PHP Dependencies Check

+ +

+This checkup ensures that your environment is ready to support a KnowledgeTree installation. Settings marked in green are available, +settings marked in orange are optional and settings marked in red are required. +

+ +'; + foreach ($errors as $msg){ + echo $msg . "
\n"; + } + echo ''; +} +?> + +

PHP Version Check

+ +

+The PHP version must be higher than 5.0 and lower than 6.0. It is not recommended to run a version higher than 5.3.2. +

+ +     {$version['version']}"; ?> +

+

PHP Extensions

+ +

+The following determines your PHP installation environment. The extensions are required for KnowledgeTree to perform at an optimal level. +

+ + +'; + + switch($ext['available']){ + case 'yes': + $class = 'tick'; + break; + case 'optional': + $class = 'cross_orange'; + break; + case 'no': + default: + $class = 'cross'; + } + $row .= ""; + $row .= ""; + $row .= ($ext['available'] != 'yes') ? "" : ''; + + $row .= ''; + + echo $row."\n"; + } + +?> +
{$ext['name']}{$ext['details']}
+

+

PHP Configuration

+ +

+The following is the recommended PHP configuration for KnowledgeTree to perform at an optimal level. +

+ + + + + + + + + +'; + + $row .= ""; + $row .= ""; + $row .= ""; + + $row .= ''; + + echo $row."\n"; + } +?> + +
SettingRecommended valueCurrent value
{$config['name']}{$config['recommended']}{$config['setting']}
+
+ +
+ + +
+
\ No newline at end of file diff --git a/setup/wizard/templates/services.tpl b/setup/wizard/templates/services.tpl new file mode 100755 index 0000000..e1a50b4 --- /dev/null +++ b/setup/wizard/templates/services.tpl @@ -0,0 +1,24 @@ +

Services Dependencies Check

+ +

+This checkup ensures that your environment is ready to support a KnowledgeTree background services. +

+ +'; + foreach ($errors as $msg){ + echo $msg . "
\n"; + } + echo ''; +} +?> + + +
+ +
+ + +
+
\ No newline at end of file diff --git a/setup/wizard/unixLucene.php b/setup/wizard/unixLucene.php new file mode 100644 index 0000000..9e7ef53 --- /dev/null +++ b/setup/wizard/unixLucene.php @@ -0,0 +1,227 @@ +. +* +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, +* California 94120-7775, or email info@knowledgetree.com. +* +* The interactive user interfaces in modified source and object code versions +* of this program must display Appropriate Legal Notices, as required under +* Section 5 of the GNU General Public License version 3. +* +* In accordance with Section 7(b) of the GNU General Public License version 3, +* these Appropriate Legal Notices must retain the display of the "Powered by +* KnowledgeTree" logo and retain the original copyright notice. If the display of the +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices +* must display the words "Powered by KnowledgeTree" and retain the original +* copyright notice. +* +* @copyright 2008-2009, KnowledgeTree Inc. +* @license GNU General Public License version 3 +* @author KnowledgeTree Team +* @package Installer +* @version Version 0.1 +*/ + +define('LUCENE_SOURCE_DIR', SYSTEM_DIR."bin".DS."luceneserver".DS); +define('LUCENE_SOURCE_FILE', SYSTEM_DIR."bin".DS."luceneserver".DS."ktlucene.jar"); +require_once("service.php"); + +class unixLucene extends Service { + private $name; +// private $javaBin; +// private $javaSystem; +// protected $lucene_pid_file=""; +// protected $lucene_dir=""; +// protected $lucene_message=""; + protected $lucene_options = " -Xms512M -Xmx512M -jar "; + private $util = null; + + public function __construct() { + } + + function load() { + $this->name = "KTLuceneTest"; + $this->util = new InstallUtil(); +// $this->javaSystem = new Java('java.lang.System'); +// $this->setJavaBin($this->javaSystem->getProperty('java.home').DS."bin"); + } + + private function setJavaBin($javaBin) { + $this->javaBin = $javaBin; + } + + public function getJavaBin() { + return $this->javaBin; + } + + // Load default settings +// public function load() { +// $this->util = new InstallUtil(); +// $this->lucene_dir = SYSTEM_DIR."bin".DS."luceneserver".DS; +// $this->lucene_pid_file = SYSTEM_DIR."bin".DS."luceneserver".DS."lucene.pid"; +// $this->lucene_pid = ''; +// } + + // Stop lucene + public function stop() { + // TODO:Still need to figure out xmlrpc shutdown() + $cmd = "pkill -f lucene
"; + $response = $util->pexec($cmd); + echo 'Stop lucene'; + } + + public function install() { + + } + + // Start lucene + public function start() { + // TODO:A shot in the dark here + $this->util = new InstallUtil(); + $cmd = "nohup java".$this->lucene_options.LUCENE_SOURCE_FILE." &> ".SYS_LOG_DIR."lucene.log"; + $response = $this->util->pexec($cmd); + $this->status = $this->on; + echo 'Start lucene'; + } + + + public function _start_lucene() { + if($this->is_lucene_running()) { // Is service running + echo 'Already Running
'; + } else { + // Get to + //echo 'Install service'; + $this->is_lucene_running(); + //nohup $LUCENE &> $INSTALL_PATH/var/log/dmsctl.log & + + } + +/* + is_lucene_running + RUNNING=$? + + if [ $RUNNING -eq 1 ]; then + echo "$0 $ARG: lucene (pid $LUCENE_PID) already running" + else + cd $INSTALL_PATH/knowledgeTree/bin/luceneserver + nohup $LUCENE &> $INSTALL_PATH/var/log/dmsctl.log & + if [ $? -eq 0 ]; then + echo "$0 $ARG: lucene started" + ps ax | grep ktlucene.jar | awk {'print $1'} > $LUCENE_PIDFILE + sleep 2 + else + echo "$0 $ARG: lucene could not be started" + ERROR=3 + fi + cd $INSTALL_PATH +fi +*/ + } + + public function is_lucene_running() { + + $pid = $this->get_lucene_pid(); + if($this->is_service_running($pid)) { + echo 'Service is running'; + } else { + + } + +/* is_lucene_running() { + get_lucene_pid + is_service_running $LUCENE_PID + RUNNING=$? + if [ $RUNNING -eq 0 ]; then + LUCENE_STATUS="lucene not running" + else + LUCENE_STATUS="lucene already running" + fi + return $RUNNING*/ + } + + public function is_service_running($pid) { + $cmd = "kill -0 $pid 2>/dev/null"; + $response = $this->util->pexec($cmd); + + /* +is_service_running() { + PID=$1 + if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null ; then + RUNNING=1 + else + RUNNING=0 + fi + return $RUNNING +} +*/ + } + + public function get_lucene_pid() { + // TODO: PID FILE +/*get_lucene_pid() { + get_pid $LUCENE_PIDFILE + if [ ! $PID ]; then + return + fi + if [ $PID -gt 0 ]; then + LUCENE_PID=$PID + fi +}*/ + } + + public function get_pid() { + +/*get_pid() { + PID="" + PIDFILE=$1 + # check for pidfile + if [ -f $PIDFILE ] ; then + exec 6<&0 + exec < $PIDFILE + read pid + PID=$pid + exec 0<&6 6<&- + fi +}*/ + } + + function shutdown() + { + + $function=new xmlrpcmsg('control.shutdown',array( + php_xmlrpc_encode((string) $this->ktid), + php_xmlrpc_encode((string) $this->authToken))); + + $result=&$this->client->send($function); + if($result->faultCode()) + { + $this->error($result, 'shutdown'); + return false; + } + return true; + } +} + +//$luc = new Lucene(); +//$luc->load(); +//$luc->start(); +//$luc->stop(); +?> \ No newline at end of file diff --git a/setup/wizard/windowsLucene.php b/setup/wizard/windowsLucene.php new file mode 100644 index 0000000..4c65245 --- /dev/null +++ b/setup/wizard/windowsLucene.php @@ -0,0 +1,135 @@ +name = "KTLuceneTest"; + $this->javaSystem = new Java('java.lang.System'); + $this->setJavaBin($this->javaSystem->getProperty('java.home').DS."bin"); + $this->setLuceneDIR(SYS_DIR.DS."bin".DS."luceneserver"); + $this->setLuceneExe("KTLuceneService.exe"); + $this->setJavaJVM(); + $this->setLuceneSource("ktlucene.jar"); + $this->setLuceneServer("com.knowledgetree.lucene.KTLuceneServer"); + $this->setLuceneOut("lucene-out.txt"); + $this->setLuceneError("lucene-err.txt"); + + } + + private function setJavaBin($javaBin) { + $this->javaBin = $javaBin; + } + + public function getJavaBin() { + return $this->javaBin; + } + + private function setLuceneDIR($luceneDir) { + $this->luceneDir = $luceneDir; + } + + public function getluceneDir() { + return $this->luceneDir; + } + + private function setLuceneExe($luceneExe) { + $this->luceneExe = $this->getluceneDir().DS.$luceneExe; + } + + public function getLuceneExe() { + return $this->luceneExe; + } + + private function setLuceneSource($luceneSource) { + $this->luceneSource = $this->getluceneDir().DS.$luceneSource; + } + + public function getLuceneSource() { + return $this->luceneSource; + } + + private function setLuceneServer($luceneServer) { + $this->luceneServer = $luceneServer; + } + + public function getLuceneServer() { + return $this->luceneServer; + } + + private function setLuceneOut($luceneOut) { + $this->luceneOut = SYS_LOG_DIR.DS.$luceneOut; + } + + public function getLuceneOut() { + return $this->luceneOut; + } + + private function setLuceneError($luceneError) { + $this->luceneError = SYS_LOG_DIR.DS.$luceneError; + } + + public function getLuceneError() { + return $this->luceneError; + } + + private function setJavaJVM() { + if(file_exists($this->getJavaBin().DS."client".DS."jvm.dll")) { + $this->javaJVM = $this->getJavaBin().DS."client".DS."jvm.dll"; + } elseif (file_exists($this->getJavaBin().DS."server".DS."jvm.dll")) { + $this->javaJVM = $this->getJavaBin().DS."server".DS."jvm.dll"; + } + } + + public function getJavaJVM() { + return $this->javaJVM; + } + + function start() { + // windows + $cmd = "sc start {$this->name}"; +// echo "start\n$cmd
"; + $response = exec($cmd); + // linux + // zend + } + + function stop() { + $cmd = "sc stop {$this->name}"; + echo "stop\n$cmd
"; + $response = exec($cmd); + } + + function install() { + $cmd = $this->luceneExe." -install \"".$this->name."\" \"".$this->javaJVM. "\" -Djava.class.path=\"". $this->luceneSource."\"". " -start ".$this->luceneServer. " -out \"".$this->luceneOut."\" -err \"".$this->luceneError."\" -current \"".$this->luceneDir."\" -auto"; +// echo "install\n$cmd
"; + $response = exec($cmd); + } + + function uninstall() { + $cmd = "sc delete {$this->name}"; +// echo "uninstall\n$cmd
"; + $response = exec($cmd); + } +} +$lucene = new Lucene(); +$lucene->load(); +$lucene->install(); +$lucene->start(); +$lucene->stop(); +$lucene->uninstall(); +?> \ No newline at end of file