関数 get_temp_dir()
定義ファイル :/blog/wp-includes/functions.php 9
get_temp_dir()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | /** * Determine a writable directory for temporary files. * * Function's preference is the return value of sys_get_temp_dir(), * followed by your PHP temporary upload directory, followed by WP_CONTENT_DIR, * before finally defaulting to /tmp/ * * In the event that this function does not find a writable location, * It may be overridden by the WP_TEMP_DIR constant in your wp-config.php file. * * @since 2.5.0 * * @return string Writable temporary directory. */ function get_temp_dir() { static $temp; if ( defined('WP_TEMP_DIR') ) return trailingslashit(WP_TEMP_DIR); if ( $temp ) return trailingslashit( $temp ); if ( function_exists('sys_get_temp_dir') ) { $temp = sys_get_temp_dir(); if ( @is_dir( $temp ) && wp_is_writable( $temp ) ) return trailingslashit( $temp ); } $temp = ini_get('upload_tmp_dir'); if ( @is_dir( $temp ) && wp_is_writable( $temp ) ) return trailingslashit( $temp ); $temp = WP_CONTENT_DIR . '/'; if ( is_dir( $temp ) && wp_is_writable( $temp ) ) return $temp; $temp = '/tmp/'; return $temp; } |