From 466039ab97e67a23168798731084d4127c7f30a1 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 11 Feb 2008 12:46:24 +0000 Subject: added Path Helper --- user_guide/helpers/path_helper.html | 102 ++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 user_guide/helpers/path_helper.html (limited to 'user_guide/helpers/path_helper.html') diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html new file mode 100644 index 000000000..cc8042597 --- /dev/null +++ b/user_guide/helpers/path_helper.html @@ -0,0 +1,102 @@ + + + + +CodeIgniter User Guide : Inflector Helper + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

CodeIgniter User Guide Version 1.6.1

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Path Helper

+ +

The Path Helper file contains functions that permits you to work with file paths on the server.

+ + +

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/not/found';
+echo set_realpath($non_existent_directory, TRUE);
+// returns "/path/not/found"
+
+echo set_realpath($non_existent_directory, FALSE);
+// returns an error, as the path could not be resolved
+

 

+
+ + + + + + + \ No newline at end of file -- cgit v1.2.3-24-g4f1b