r50539 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50538‎ | r50539 | r50540 >
Date:00:56, 13 May 2009
Author:dale
Status:deferred (Comments)
Tags:
Comment:
added asyncdownload flag
Modified paths:
  • /branches/new-upload/phase3/includes/UploadFromUrl.php (modified) (history)
  • /branches/new-upload/phase3/includes/api/ApiUpload.php (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/includes/UploadFromUrl.php
@@ -15,10 +15,10 @@
1616 return $wgAllowCopyUploads && parent::isEnabled();
1717 }
1818 /*entry point for Api upload:: ASYNC_DOWNLOAD (if possible) */
19 - function initialize( $name, $url ) {
20 - global $wgTmpDirectory, $wgPhpCliPath;
 19+ function initialize( $name, $url, $asyncdownload) {
 20+ global $wgTmpDirectory, $wgPhpCliPath;
2121
22 - if(!$this->dl_mode && $wgPhpCliPath && wfShellExecEnabled() ){
 22+ if($asyncdownload && $wgPhpCliPath && wfShellExecEnabled() ){
2323 $this->dl_mode = Http::ASYNC_DOWNLOAD;
2424 }else{
2525 $this->dl_mode = Http::SYNC_DOWNLOAD;
Index: branches/new-upload/phase3/includes/api/ApiUpload.php
@@ -121,7 +121,7 @@
122122 } elseif( isset( $this->mParams['url'] ) ) {
123123
124124 $this->mUpload = new UploadFromUrl();
125 - $this->mUpload->initialize( $this->mParams['filename'], $this->mParams['url']);
 125+ $this->mUpload->initialize( $this->mParams['filename'], $this->mParams['url'], $this->mParam['asyncdownload']);
126126
127127 $status = $this->mUpload->fetchFile();
128128 if( !$status->isOK() ){
@@ -287,6 +287,7 @@
288288 'comment' => array(
289289 ApiBase :: PARAM_DFLT => ''
290290 ),
 291+ 'asyncdownload'=>false,
291292 'watch' => false,
292293 'ignorewarnings' => false,
293294 'done' => false,
@@ -305,6 +306,8 @@
306307 'url' => 'Url to upload from',
307308 'enablechunks' => 'Boolean If we are in chunk mode; accepts many small file POSTs',
308309 'comment' => 'Upload comment or initial page text',
 310+ 'asyncdownload' => 'If we should download asyncrously (returns a upload session key to get status updates)'.
 311+ "\nDefault:false",
309312 'watch' => 'Watch the page',
310313 'ignorewarnings' => 'Ignore any warnings',
311314 'done' => 'When used with "chunks", Is sent to notify the api The last chunk is being uploaded.',

Comments

#Comment by Catrope (talk | contribs)   11:24, 13 May 2009

The fact that the default is false should not be mentioned because:

  • Help text containing that kind of info (default, min, max, etc.) is autogenerated
  • Boolean parameters can't default to true anyway
  • It uses \n in the string; should use an array of strings instead
#Comment by Brion VIBBER (talk | contribs)   22:27, 14 May 2009

Changing from fixme to deferred with todo tag; this isn't trunk and doesn't block site sync.

#Comment by Catrope (talk | contribs)   09:41, 15 May 2009

Issues have been resolved in later commits, removing todo tag

Status & tagging log