summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers/path_helper.rst
diff options
context:
space:
mode:
authorEric Roberts <eric@cryode.com>2012-12-12 14:02:11 +0100
committerEric Roberts <eric@cryode.com>2012-12-12 14:02:11 +0100
commitb9e35f21e1c70b6aa67c47e9244ed83195abc00a (patch)
tree64f82db362deeac48cc20d1d1afd80651f36f5a5 /user_guide_src/source/helpers/path_helper.rst
parent0b05705c52c3bca7f9b3aee657c888e8ad1ff422 (diff)
parent545a7c86701875e1412bcde316e9bcc76d9a23a0 (diff)
Merge branch 'refs/heads/develop' into feature/form_error_msgs
Conflicts: system/language/english/form_validation_lang.php user_guide_src/source/libraries/form_validation.rst Signed-off-by: Eric Roberts <eric@cryode.com>
Diffstat (limited to 'user_guide_src/source/helpers/path_helper.rst')
-rw-r--r--user_guide_src/source/helpers/path_helper.rst31
1 files changed, 17 insertions, 14 deletions
diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst
index 847f5a08b..3a271b28f 100644
--- a/user_guide_src/source/helpers/path_helper.rst
+++ b/user_guide_src/source/helpers/path_helper.rst
@@ -10,9 +10,7 @@ file paths on the server.
Loading this Helper
===================
-This helper is loaded using the following code
-
-::
+This helper is loaded using the following code::
$this->load->helper('path');
@@ -21,23 +19,28 @@ 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.
+.. php: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
+
+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::
$file = '/etc/php5/apache2/php.ini';
- echo set_realpath($file); // returns "/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); // returns "/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); // returns "/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); // returns "/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