wp_is_writable

函式
wp_is_writable ( $path )
引數
  • (string) $path Path to check for write-ability.
    Required:
返回值
  • (bool) Whether the path is writable.
相關
  • win_is_writable()
定義位置
相關方法
win_is_writableis_iterablewp_iso_descramblerwp_is_mobilewp_install
引入
3.6.0
棄用
-

wp_is_writable: 這個函式用於檢查一個檔案或目錄是否可寫。它接收一個檔案或目錄路徑作為引數,如果它是可寫的,則返回真,否則返回假。

確定一個目錄是否可寫。

這個函式是用來解決PHP中某些主要影響Windows伺服器的ACL問題。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_is_writable( $path ) {
if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
return win_is_writable( $path );
} else {
return @is_writable( $path );
}
}
function wp_is_writable( $path ) { if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) { return win_is_writable( $path ); } else { return @is_writable( $path ); } }
function wp_is_writable( $path ) {
	if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
		return win_is_writable( $path );
	} else {
		return @is_writable( $path );
	}
}

常見問題

FAQs
檢視更多 >