diff options
| author | Lester Caine <lester@lsces.co.uk> | 2006-02-08 08:24:21 +0000 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2006-02-08 08:24:21 +0000 |
| commit | afa0807ee31d9e7a9c3f615bf80a5c5b20176e2f (patch) | |
| tree | ab8eead67d7f3abab45cd1286aaf92a321148600 /cmd_line_reindex.php | |
| parent | 437f22fb08e220ceaf872d6ae0f98404ff1b2567 (diff) | |
| download | search-afa0807ee31d9e7a9c3f615bf80a5c5b20176e2f.tar.gz search-afa0807ee31d9e7a9c3f615bf80a5c5b20176e2f.tar.bz2 search-afa0807ee31d9e7a9c3f615bf80a5c5b20176e2f.zip | |
Merge from R1, de-tiki, R2 updates and checked against HEAD
Diffstat (limited to 'cmd_line_reindex.php')
| -rw-r--r-- | cmd_line_reindex.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cmd_line_reindex.php b/cmd_line_reindex.php new file mode 100644 index 0000000..be4aa89 --- /dev/null +++ b/cmd_line_reindex.php @@ -0,0 +1,33 @@ +<?php +/* + * Command line version of site reindex. + * Created withstub from jht001 (Thanks) + * and help from KainX + */ + +$_SERVER['SERVER_NAME'] = 'batch'; +$_SERVER['HTTP_HOST'] = 'batch'; +$_SERVER['HTTP_USER_AGENT'] = 'batch'; +$_SERVER['SCRIPT_URL'] = 'batch'; +$_SERVER['SERVER_SOFTWARE'] = 'batch'; +$HTTP_SERVER_VARS['HTTP_USER_AGENT'] = 'batch'; + +//foreach (headers_list() as $hdr) { header($hdr); } +require_once( '../bit_setup_inc.php' ); +require_once( LIBERTY_PKG_PATH.'LibertyBase.php'); +require_once( SEARCH_PKG_PATH.'refresh_functions.php'); + +$time_start = microtime_float(); +echo "\nBeginning Reindex ...\n"; +rebuild_index('pages'); +$time_end = microtime_float(); +$time = number_format($time_end - $time_start, 4); +echo "Index rebuild complete.\n"; +echo "Execution time: $time seconds\n"; +die(); + +function microtime_float() { + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); +} +?> |
