コード例 #1
0
ファイル: utils-dirs.inc.php プロジェクト: JalpMi/v2contact
 /**
  * Get the system's temporary directory.
  *
  * @package optimizeMember\Utilities
  * @since 111017
  *
  * @param str $fallback Defaults to true. If true, fallback on WordPress routine if not available, or if not writable.
  * @return str|bool Full string path to a writable temp directory, else false on failure.
  */
 public static function get_temp_dir($fallback = TRUE)
 {
     $temp_dir = ($temp_dir = realpath(sys_get_temp_dir())) && is_writable($temp_dir) ? $temp_dir : false;
     $temp_dir = !$temp_dir && $fallback && ($wp_temp_dir = realpath(get_temp_dir())) && is_writable($wp_temp_dir) ? $wp_temp_dir : $temp_dir;
     /**/
     return $temp_dir ? c_ws_plugin__optimizemember_utils_dirs::n_dir_seps($temp_dir) : false;
 }