diff options
author | Andrey Andreev <narf@devilix.net> | 2014-02-08 17:18:33 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-02-08 17:18:33 +0100 |
commit | f733d6db7345ccc5d7ed516fd22ea03cc245cbc4 (patch) | |
tree | 0f5eec61542d5c1142709610f5ccaf3908cf36f5 /user_guide_src/source/helpers/path_helper.rst | |
parent | 93326a5b1bbaade4d416ad17a768cab27337ec5b (diff) | |
parent | 28c2c975b118016d07212ed8e7c22ff280309f82 (diff) |
Merge branch 'feature/user-guide-cleanup' into develop
Diffstat (limited to 'user_guide_src/source/helpers/path_helper.rst')
-rw-r--r-- | user_guide_src/source/helpers/path_helper.rst | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst index 3a271b28f..705ca23b9 100644 --- a/user_guide_src/source/helpers/path_helper.rst +++ b/user_guide_src/source/helpers/path_helper.rst @@ -5,7 +5,12 @@ Path Helper The Path Helper file contains functions that permits you to work with file paths on the server. -.. contents:: Page Contents +.. contents:: + :local: + +.. raw:: html + + <div class="custom-index container"></div> Loading this Helper =================== @@ -14,33 +19,35 @@ This helper is loaded using the following code:: $this->load->helper('path'); +Available Functions +=================== + The following functions are available: -set_realpath() -============== -.. php:function:: set_realpath($path, $check_existance = FALSE) +.. function:: set_realpath($path[, $check_existance = FALSE]) :param string $path: Path :param bool $check_existance: Whether to check if the path actually exists - :returns: string + :returns: An absolute path + :rtype: string + + This function will return a server path without symbolic links or + relative directory structures. An optional second argument will + cause an error to be triggered if the path cannot be resolved. -This function will return a server path without symbolic links or -relative directory structures. An optional second argument will -cause an error to be triggered if the path cannot be resolved. + Examples:: -Examples:: + $file = '/etc/php5/apache2/php.ini'; + echo set_realpath($file); // Prints '/etc/php5/apache2/php.ini' - $file = '/etc/php5/apache2/php.ini'; - echo set_realpath($file); // Prints '/etc/php5/apache2/php.ini' + $non_existent_file = '/path/to/non-exist-file.txt'; + echo set_realpath($non_existent_file, TRUE); // Shows an error, as the path cannot be resolved + echo set_realpath($non_existent_file, FALSE); // Prints '/path/to/non-exist-file.txt' - $non_existent_file = '/path/to/non-exist-file.txt'; - echo set_realpath($non_existent_file, TRUE); // Shows an error, as the path cannot be resolved - echo set_realpath($non_existent_file, FALSE); // Prints '/path/to/non-exist-file.txt' + $directory = '/etc/php5'; + echo set_realpath($directory); // Prints '/etc/php5/' - $directory = '/etc/php5'; - echo set_realpath($directory); // Prints '/etc/php5/' - - $non_existent_directory = '/path/to/nowhere'; - echo set_realpath($non_existent_directory, TRUE); // Shows an error, as the path cannot be resolved - echo set_realpath($non_existent_directory, FALSE); // Prints '/path/to/nowhere'
\ No newline at end of file + $non_existent_directory = '/path/to/nowhere'; + echo set_realpath($non_existent_directory, TRUE); // Shows an error, as the path cannot be resolved + echo set_realpath($non_existent_directory, FALSE); // Prints '/path/to/nowhere'
\ No newline at end of file |