Revert r54244 which was stupid and fix this properly. Require commandLine.inc/Mainten...
[lhc/web/wiklou.git] / maintenance / http_session_download.php
1 <?php
2 /*
3 * simple entry point to initiate a background download
4 *
5 * arguments:
6 *
7 * -sid {$session_id} -usk {$upload_session_key}
8 */
9
10 global $optionsWithArgs;
11 $optionsWithArgs = Array('sid', 'usk');
12
13 //act like a "normal user"
14 $wgUseNormalUser = true;
15
16 require_once( dirname(__FILE__) . '/commandLine.inc' );
17
18 if(!isset($options['sid']) || !isset($options['usk'])){
19 print<<<EOT
20 simple entry point to initiate a background download
21
22 Usage: http_session_download.php [options]
23 Options:
24 --sid the session id (required)
25 --usk the upload session key (also required)
26 EOT;
27
28 exit();
29 }
30 wfProfileIn('http_session_download.php');
31
32 //run the download:
33 Http::doSessionIdDownload( $options['sid'], $options['usk'] );
34
35 //close up shop:
36 // Execute any deferred updates
37 wfDoUpdates();
38
39 // Log what the user did, for book-keeping purposes.
40 wfLogProfilingData();
41
42 // Shut down the database before exit
43 wfGetLBFactory()->shutdown();
44
45 wfProfileOut('http_session_download.php');
46 ?>