From 8ede1a2ecbb62577afd32996956c5feaf7ddf9b6 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 5 Oct 2011 13:34:52 -0500 Subject: replacing the old HTML user guide with a Sphinx-managed user guide --- user_guide_src/source/helpers/path_helper.rst | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 user_guide_src/source/helpers/path_helper.rst (limited to 'user_guide_src/source/helpers/path_helper.rst') diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst new file mode 100644 index 000000000..1a70af458 --- /dev/null +++ b/user_guide_src/source/helpers/path_helper.rst @@ -0,0 +1,37 @@ +########### +Path Helper +########### + +The Path Helper file contains functions that permits you to work with +file paths on the server. + +.. contents:: Page Contents + +Loading this Helper +=================== + +This helper is loaded using the following code + +:: + + $this->load->helper('path'); + +The following functions are available: + +set_realpath() +============== + +Checks to see if the path exists. 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. + +:: + + $directory = '/etc/passwd'; + echo set_realpath($directory); // returns "/etc/passwd" + $non_existent_directory = '/path/to/nowhere'; + echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved + echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" + + -- cgit v1.2.3-24-g4f1b