blob: 1a70af45883ce9ee2e8ad5d1081e120e82cfa723 [file] [log] [blame]
Derek Jones8ede1a22011-10-05 13:34:52 -05001###########
2Path Helper
3###########
4
5The Path Helper file contains functions that permits you to work with
6file paths on the server.
7
8.. contents:: Page Contents
9
10Loading this Helper
11===================
12
13This helper is loaded using the following code
14
15::
16
17 $this->load->helper('path');
18
19The following functions are available:
20
21set_realpath()
22==============
23
24Checks to see if the path exists. This function will return a server
25path without symbolic links or relative directory structures. An
26optional second argument will cause an error to be triggered if the path
27cannot be resolved.
28
29::
30
31 $directory = '/etc/passwd';
32 echo set_realpath($directory); // returns "/etc/passwd"
33 $non_existent_directory = '/path/to/nowhere';
34 echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved
35 echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere"
36
37