Commit 3c1b4245b555e2606c98204b151e248469839562
1 parent
9f8fcef9
KTS-2524
"Create document indexer shutdown script" Fixed. Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7431 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
52 additions
and
0 deletions
search2/indexing/bin/shutdown.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * PURPOSE: | ||
| 5 | + * | ||
| 6 | + * This script has the purpose of shutting down the java lucene server. | ||
| 7 | + * | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +session_start(); | ||
| 11 | +require_once(realpath('../../../config/dmsDefaults.php')); | ||
| 12 | + | ||
| 13 | +print _kt("Shutdown the Document Indexer") . "...\n"; | ||
| 14 | + | ||
| 15 | +$config = KTConfig::getSingleton(); | ||
| 16 | +$indexer = $config->get('indexer/coreClass'); | ||
| 17 | + | ||
| 18 | +$sure=false; | ||
| 19 | +$indexall = false; | ||
| 20 | +if ($argc > 0) | ||
| 21 | +{ | ||
| 22 | + foreach($argv as $arg) | ||
| 23 | + { | ||
| 24 | + switch (strtolower($arg)) | ||
| 25 | + { | ||
| 26 | + case 'positive': | ||
| 27 | + $sure=true; | ||
| 28 | + break; | ||
| 29 | + case 'help': | ||
| 30 | + print "Usage: shutdown.php [positive]\n"; | ||
| 31 | + exit; | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | +} | ||
| 35 | +if (!$sure) | ||
| 36 | +{ | ||
| 37 | + print "* " . _kt("Are you sure you want to do this? Add 'positive' as a parameter to continue.") . "\n"; | ||
| 38 | + exit; | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | +require_once('indexing/indexerCore.inc.php'); | ||
| 42 | + | ||
| 43 | +$indexer = Indexer::get(); | ||
| 44 | +$indexer->shutdown(); | ||
| 45 | + | ||
| 46 | +print "\n* " . _kt("The request to shutdown has been sent to the server. It may take a few seconds.") . "\n"; | ||
| 47 | + | ||
| 48 | + | ||
| 49 | +print _kt("Done.") . "\n"; | ||
| 50 | + | ||
| 51 | + | ||
| 52 | +?> | ||
| 0 | \ No newline at end of file | 53 | \ No newline at end of file |