2
2
Filesystem Helper
3
3
#################
4
4
5
- The Directory Helper file contains functions that assist in working with
6
- directories.
5
+ The Filesystem Helper file contains functions that assist in working with
6
+ files and directories.
7
7
8
8
.. contents ::
9
9
:local:
@@ -24,7 +24,7 @@ The following functions are available:
24
24
.. php :function :: directory_map($sourceDir[, $directoryDepth = 0[, $hidden = false]])
25
25
26
26
:param string $sourceDir: Path to the source directory
27
- :param int $directoryDepth: Depth of directories to traverse (0 = fully recursive, 1 = current dir, etc)
27
+ :param int $directoryDepth: Depth of directories to traverse (`` 0 `` = fully recursive, `` 1 `` = current dir, etc)
28
28
:param bool $hidden: Whether to include hidden paths
29
29
:returns: An array of files
30
30
:rtype: array
@@ -33,17 +33,17 @@ The following functions are available:
33
33
34
34
.. literalinclude :: filesystem_helper/002.php
35
35
36
- .. note :: Paths are almost always relative to your main index.php file.
36
+ .. note :: Paths are almost always relative to your main ** index.php** file.
37
37
38
38
Sub-folders contained within the directory will be mapped as well. If
39
39
you wish to control the recursion depth, you can do so using the second
40
- parameter (integer). A depth of 1 will only map the top level directory:
40
+ parameter (integer). A depth of `` 1 `` will only map the top level directory:
41
41
42
42
.. literalinclude :: filesystem_helper/003.php
43
43
44
44
By default, hidden files will not be included in the returned array and
45
45
hidden directories will be skipped. To override this behavior, you may
46
- set a third parameter to true (boolean):
46
+ set a third parameter to `` true `` (boolean):
47
47
48
48
.. literalinclude :: filesystem_helper/004.php
49
49
@@ -99,7 +99,7 @@ The following functions are available:
99
99
:param string $path: File path
100
100
:param string $data: Data to write to file
101
101
:param string $mode: ``fopen() `` mode
102
- :returns: true if the write was successful, false in case of an error
102
+ :returns: `` true `` if the write was successful, `` false `` in case of an error
103
103
:rtype: bool
104
104
105
105
Writes data to the file specified in the path. If the file does not exist then the
@@ -113,14 +113,14 @@ The following functions are available:
113
113
114
114
.. literalinclude :: filesystem_helper/007.php
115
115
116
- The default mode is 'wb'. Please see the ` PHP user guide <https://www.php.net/manual/en/function.fopen.php >`_
116
+ The default mode is `` 'wb' `` . Please see ` fopen() <https://www.php.net/manual/en/function.fopen.php >`_ in the PHP manual
117
117
for mode options.
118
118
119
119
.. note :: In order for this function to write data to a file, its permissions must
120
120
be set such that it is writable. If the file does not already exist,
121
121
then the directory containing it must be writable.
122
122
123
- .. note :: The path is relative to your main site index.php file, NOT your
123
+ .. note :: The path is relative to your main site ** index.php** file, NOT your
124
124
controller or view files. CodeIgniter uses a front controller so paths
125
125
are always relative to the main site index.
126
126
@@ -132,7 +132,7 @@ The following functions are available:
132
132
:param bool $delDir: Whether to also delete directories
133
133
:param bool $htdocs: Whether to skip deleting .htaccess and index page files
134
134
:param bool $hidden: Whether to also delete hidden files (files beginning with a period)
135
- :returns: true on success, false in case of an error
135
+ :returns: `` true `` on success, `` false `` in case of an error
136
136
:rtype: bool
137
137
138
138
Deletes ALL files contained in the supplied path.
@@ -141,7 +141,7 @@ The following functions are available:
141
141
142
142
.. literalinclude :: filesystem_helper/008.php
143
143
144
- If the second parameter is set to true, any directories contained within the supplied
144
+ If the second parameter is set to `` true `` , any directories contained within the supplied
145
145
root path will be deleted as well.
146
146
147
147
Example:
@@ -204,7 +204,7 @@ The following functions are available:
204
204
:returns: Symbolic permissions string
205
205
:rtype: string
206
206
207
- Takes numeric permissions (such as is returned by `` fileperms() `` ) and returns
207
+ Takes numeric permissions (such as is returned by `fileperms() < https://www.php.net/manual/en/function.fileperms.php >`_ ) and returns
208
208
standard symbolic notation of file permissions.
209
209
210
210
.. literalinclude :: filesystem_helper/012.php
@@ -215,7 +215,7 @@ The following functions are available:
215
215
:returns: Octal permissions string
216
216
:rtype: string
217
217
218
- Takes numeric permissions (such as is returned by `` fileperms() `` ) and returns
218
+ Takes numeric permissions (such as is returned by `fileperms() < https://www.php.net/manual/en/function.fileperms.php >`_ ) and returns
219
219
a three character octal notation of file permissions.
220
220
221
221
.. literalinclude :: filesystem_helper/013.php
0 commit comments