c_ws_plugin__s2member_utils_dirs
public class c_ws_plugin__s2member_utils_dirs
3.5
( 7 Methods ) Method Summary | |
---|---|
public static str | basename_dir_app_data(str $path) Basename from a full directory or file path. |
public static bool | create_win_jctn(str $jctn, str $target) Creates a directory Junction in Windows®. |
public static str | doc_root_path(str $path) Shortens to a directory or file path, from document root. |
public static str|bool | get_temp_dir(str $fallback) Get the system's temporary directory. |
public static str | n_dir_seps(str $path) Normalizes directory separators in dir/file paths. |
public static str | rel_path(str $from, str $to, bool $try_realpaths, bool $use_win_diff_drive_jctn) Finds the relative path, from one location to another. |
public static str | strip_dir_app_data(str $path) Strips a trailing |
public static str basename_dir_app_data(str $path)
Basename from a full directory or file path.
110815
str $path - Directory or file path.
str - Basename; including a possible /app_data/
directory.
public static bool create_win_jctn(str $jctn, str $target)
Creates a directory Junction in Windows®.
111013
str $jctn - Directory location of the Junction (i.e. the link).
str $target - Target directory that this Junction will connect to.
bool - True if created successfully, or already exists, else false.
public static str doc_root_path(str $path)
Shortens to a directory or file path, from document root.
110815
str $path - Directory or file path.
str - Shorther path, from document root.
public static str|bool get_temp_dir(str $fallback)
Get the system's temporary directory.
111017
str $fallback - Defaults to true. If true, fallback on WordPress® routine if not available, or if not writable.
str|bool - Full string path to a writable temp directory, else false on failure.
public static str n_dir_seps(str $path)
Normalizes directory separators in dir/file paths.
111017
str $path - Directory or file path.
str - Directory or file path, after having been normalized by this routine.
public static str rel_path(str $from, str $to, bool $try_realpaths, bool $use_win_diff_drive_jctn)
Finds the relative path, from one location to another.
110815
str $from - The full directory path to calculate a relative path from
.
str $to - The full directory or file path, which this routine will build a relative path to
.
bool $try_realpaths - Defaults to true. When true, try to acquire realpath()
, thereby resolving all relative paths and/or symlinks in $from
and $to
args.
bool $use_win_diff_drive_jctn - Defaults to true. When true, we'll work around issues with different drives on Windows® by trying to create a directory junction.
str - String with the relative path to: $to
.
public static str strip_dir_app_data(str $path)
Strips a trailing /app_data/
sub-directory.
3.5
str $path - Directory or file path.
str - Directory or file path without /app_data/
.
Directory utilities.