Source Code Documentation


Field Summary | Method Summary | Field Detail | Method Detail

Package s2Member\Utilities

s2member\includes\classes\utils-dirs.inc.php at line #28

Class c_ws_plugin__s2member_utils_dirs

c_ws_plugin__s2member_utils_dirs

public class c_ws_plugin__s2member_utils_dirs

Directory utilities.

Since:

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 /app_data/ sub-directory.

( 7 Methods )
Method Detail

s2member\includes\classes\utils-dirs.inc.php at line #65

basename_dir_app_data()

public static str basename_dir_app_data(str $path)

Basename from a full directory or file path.

Since:

110815

Parameters:

str $path - Directory or file path.

Returns:

str - Basename; including a possible /app_data/ directory.

[ back to top ]

s2member\includes\classes\utils-dirs.inc.php at line #171

create_win_jctn()

public static bool create_win_jctn(str $jctn, str $target)

Creates a directory Junction in Windows®.

Since:

111013

Parameters:

str $jctn - Directory location of the Junction (i.e. the link).

str $target - Target directory that this Junction will connect to.

Returns:

bool - True if created successfully, or already exists, else false.

[ back to top ]

s2member\includes\classes\utils-dirs.inc.php at line #80

doc_root_path()

public static str doc_root_path(str $path)

Shortens to a directory or file path, from document root.

Since:

110815

Parameters:

str $path - Directory or file path.

Returns:

str - Shorther path, from document root.

[ back to top ]

s2member\includes\classes\utils-dirs.inc.php at line #198

get_temp_dir()

public static str|bool get_temp_dir(str $fallback)

Get the system's temporary directory.

Since:

111017

Parameters:

str $fallback - Defaults to true. If true, fallback on WordPress® routine if not available, or if not writable.

Returns:

str|bool - Full string path to a writable temp directory, else false on failure.

[ back to top ]

s2member\includes\classes\utils-dirs.inc.php at line #39

n_dir_seps()

public static str n_dir_seps(str $path)

Normalizes directory separators in dir/file paths.

Since:

111017

Parameters:

str $path - Directory or file path.

Returns:

str - Directory or file path, after having been normalized by this routine.

[ back to top ]

s2member\includes\classes\utils-dirs.inc.php at line #98

rel_path()

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.

Since:

110815

Parameters:

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.

Returns:

str - String with the relative path to: $to.

[ back to top ]

s2member\includes\classes\utils-dirs.inc.php at line #52

strip_dir_app_data()

public static str strip_dir_app_data(str $path)

Strips a trailing /app_data/ sub-directory.

Since:

3.5

Parameters:

str $path - Directory or file path.

Returns:

str - Directory or file path without /app_data/.

[ back to top ]

Source Code Documentation


Field Summary | Method Summary | Field Detail | Method Detail