[wp-trac] [WordPress Trac] #25153: Temporary directory (for installs, updates, etc.) is hard-coded instead of configurable

WordPress Trac noreply at wordpress.org
Mon Aug 26 20:52:24 UTC 2013


#25153: Temporary directory (for installs, updates, etc.) is hard-coded instead of
configurable
-----------------------------+-----------------------------
 Reporter:  Synetech         |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  3.6
 Severity:  normal           |   Keywords:
-----------------------------+-----------------------------
 Whenever WordPress installs or updates a theme, plugin, itself, etc. it
 always puts the temporary files (''.zip'', extracted, etc.) in the ''wp-
 content/upgrade'' directory.

 This is not ideal and it should be configurable. Theoretically it can be
 changed in at least a few ways (''php.ini'', ''WP_TEMP_DIR'', etc.), but
 WordPress seems to ignore all of them and '''always''' puts the temp files
 in there.

 I asked about this at [http://wordpress.stackexchange.com/questions/111720
 /how-can-the-temporary-update-directory-be-changed the WordPress
 StackExchange site] and it was revealed that this happens because the path
 is hard-coded.

 I can confirm that WordPress does not use the correct/specified temporary
 directory because the following chunk of code does not display the
 expected temp directory when run from WordPress:


 {{{
 echo "<br/><br/><br/><br/><hr /><pre style='background-
 color:#fff;color:#000;'>\n";
 echo "<br/>---------- WP_TEMP_DIR       :\t".  WP_TEMP_DIR
 ." ---------\n";
 echo "<br/>---------- upload_tmp_dir    :\t".  ini_get('upload_tmp_dir')
 ." ---------\n";
 echo "<br/>---------- sys_get_temp_dir  :\t".  sys_get_temp_dir()
 ." ---------\n";
 echo "<br/>---------- get_temp_dir      :\t".  get_temp_dir()
 ." ---------\n";
 echo "<br/>---------- getenv temp       :\t".  getenv('temp')
 ." ---------\n";
 echo "<br/>---------- getenv tmp        :\t".  getenv('tmp')
 ." ---------\n";
 echo "<br/>---------- getenv tempdir    :\t".  getenv('TEMPDIR')
 ." ---------\n";
 echo "<br/>---------- getenv tmpdir     :\t".  getenv('TMPDIR')
 ." ---------\n";
 echo "</pre><hr /><br/><br/><br/><br/>\n";

 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25153>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list