00001 <?php 00002 /* 00003 * Simple entry point to initiate a background download 00004 * 00005 * arguments: 00006 * --sid {$session_id} --usk {$upload_session_key} --wiki {wfWikiId()} 00007 * 00008 * This program is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License along 00019 * with this program; if not, write to the Free Software Foundation, Inc., 00020 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00021 * http://www.gnu.org/copyleft/gpl.html 00022 * 00023 * @ingroup Maintenance 00024 */ 00025 00026 require_once( dirname(__FILE__) . '/Maintenance.php' ); 00027 00028 class HttpSessionDownload extends Maintenance { 00029 public function __construct() { 00030 parent::__construct(); 00031 $this->mDescription = "Simple entry point to initiate a background download"; 00032 $this->addOption( 'sid', 'Session ID', true, true ); 00033 $this->addOption( 'usk', 'Upload session key', true, true ); 00034 } 00035 00036 public function execute() { 00037 wfProfileIn(__METHOD__); 00038 00039 //run the download: 00040 Http::doSessionIdDownload( $this->getOption('sid'), $this->getOption('usk') ); 00041 00042 // close up shop: 00043 // Execute any deferred updates 00044 wfDoUpdates(); 00045 00046 // Log what the user did, for book-keeping purposes. 00047 wfLogProfilingData(); 00048 00049 // Shut down the database before exit 00050 wfGetLBFactory()->shutdown(); 00051 00052 wfProfileOut(__METHOD__); 00053 } 00054 } 00055 00056 $maintClass = "HttpSessionDownload"; 00057 require_once( DO_MAINTENANCE );