diff --git a/lib/util/ktutil.inc b/lib/util/ktutil.inc index 2dc71e1..d9c6f58 100644 --- a/lib/util/ktutil.inc +++ b/lib/util/ktutil.inc @@ -53,8 +53,22 @@ class KTUtil { { global $default; - return ($default->sslEnabled ? 'https' : 'http') .'://'.$_SERVER['HTTP_HOST'] . $default->rootUrl; + $config = KTConfig::getSingleton(); + $serverName = $config->get('knowledgeTree/serverName', $_SERVER['HTTP_HOST']); + return ($default->sslEnabled ? 'https' : 'http') .'://'.$serverName . $default->rootUrl; + + } + + static function call_page($path) + { + $kt_url = KTUtil::kt_url(); + + $full_url = $kt_url . '/' . $path; + + $ch = curl_init($full_url); + curl_exec($ch); + curl_close($ch); } static function computePeriod($diff, $suffix = null, $returnArray=false) diff --git a/search2/bin/cronIndexer.php b/search2/bin/cronIndexer.php new file mode 100644 index 0000000..485bbf8 --- /dev/null +++ b/search2/bin/cronIndexer.php @@ -0,0 +1,45 @@ +. + * + * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, + * Blake Street, Observatory, 7925 South Africa. 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. + * Contributor( s): ______________________________________ + * + */ + +chdir(dirname(__FILE__)); +require_once(realpath('../../config/dmsDefaults.php')); + +KTUtil::call_page('search2/indexing/bin/cronIndexer.php'); + + +?> \ No newline at end of file diff --git a/search2/bin/cronMigration.php b/search2/bin/cronMigration.php new file mode 100644 index 0000000..ae03d10 --- /dev/null +++ b/search2/bin/cronMigration.php @@ -0,0 +1,44 @@ +. + * + * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, + * Blake Street, Observatory, 7925 South Africa. 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. + * Contributor( s): ______________________________________ + * + */ + +chdir(dirname(__FILE__)); +require_once(realpath('../../config/dmsDefaults.php')); + +KTUtil::call_page('search2/indexing/bin/cronMigration.php'); + +?> \ No newline at end of file diff --git a/search2/bin/optimise.php b/search2/bin/optimise.php new file mode 100644 index 0000000..6921f03 --- /dev/null +++ b/search2/bin/optimise.php @@ -0,0 +1,45 @@ +. + * + * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, + * Blake Street, Observatory, 7925 South Africa. 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. + * Contributor( s): ______________________________________ + * + */ + +chdir(dirname(__FILE__)); +require_once(realpath('../../config/dmsDefaults.php')); + +KTUtil::call_page('search2/indexing/bin/optimise.php'); + + +?> \ No newline at end of file diff --git a/sql/mysql/install/data.sql b/sql/mysql/install/data.sql index 961f50f..a94d388 100644 --- a/sql/mysql/install/data.sql +++ b/sql/mysql/install/data.sql @@ -804,9 +804,9 @@ UNLOCK TABLES; LOCK TABLES `scheduler_tasks` WRITE; /*!40000 ALTER TABLE `scheduler_tasks` DISABLE KEYS */; INSERT INTO `scheduler_tasks` VALUES -(1,'Indexing','search2/indexing/bin/cronIndexer.php','',0,'1min','2007-10-01',NULL,0,'system'), -(2,'Index Migration','search2/indexing/bin/cronMigration.php','',0,'5mins','2007-10-01',NULL,0,'system'), -(3,'Index Optimisation','search2/indexing/bin/optimise.php','',0,'weekly','2007-10-01',NULL,0,'system'), +(1,'Indexing','search2/bin/cronIndexer.php','',0,'1min','2007-10-01',NULL,0,'system'), +(2,'Index Migration','search2/bin/cronMigration.php','',0,'5mins','2007-10-01',NULL,0,'system'), +(3,'Index Optimisation','search2/bin/optimise.php','',0,'weekly','2007-10-01',NULL,0,'system'), (4,'Periodic Document Expunge','bin/expungeall.php','',0,'weekly','2007-10-01',NULL,0,'disabled'), (5,'Database Maintenance','bin/dbmaint.php','optimize',0,'monthly','2007-10-01',NULL,0,'disabled'), (6,'Open Office test','bin/checkopenoffice.php','',0,'1min','2007-10-01',NULL,0,'enabled'); diff --git a/sql/mysql/upgrade/3.5.2/scheduler_permissions.sql b/sql/mysql/upgrade/3.5.2/scheduler_permissions.sql new file mode 100644 index 0000000..87eb271 --- /dev/null +++ b/sql/mysql/upgrade/3.5.2/scheduler_permissions.sql @@ -0,0 +1,3 @@ +UPDATE scheduler_tasks SET script_url='search2/bin/cronIndexer.php' WHERE task='Indexing'; +UPDATE scheduler_tasks SET script_url='search2/bin/cronMigration.php' WHERE task='Index Migration'; +UPDATE scheduler_tasks SET script_url='search2/bin/optimise.php' WHERE task='Index Optimisation'; \ No newline at end of file