wpsc_get_realpath()
realpath() doesn't always remove the trailing slash
Хуков нет.
Возвращает
null
. Ничего.
Использование
wpsc_get_realpath( $directory );
- $directory (обязательный)
- -
Код wpsc_get_realpath() wpsc get realpath WPSCache 1.9.4
function wpsc_get_realpath( $directory ) { if ( $directory == '/' ) { wp_cache_debug( "wpsc_get_realpath: cannot get realpath of '/'" ); return false; } $original_dir = $directory; $directory = realpath( $directory ); if ( ! $directory ) { wp_cache_debug( "wpsc_get_realpath: directory does not exist - $original_dir" ); return false; } if ( substr( $directory, -1 ) == '/' || substr( $directory, -1 ) == '\\' ) { $directory = substr( $directory, 0, -1 ); // remove trailing slash } return $directory; }