From 4b9c62980599228f070b401c7673dce8085b0c61 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 1 Jul 2011 17:40:48 -0500 Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance --- user_guide/helpers/file_helper.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'user_guide/helpers/file_helper.html') diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 2d06fa25b..c37235424 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -69,11 +69,11 @@ File Helper

read_file('path')

-

Returns the data contained in the file specified in the path. Example:

+

Returns the data contained in the file specified in the path. Example:

$string = read_file('./path/to/file.php'); -

The path can be a relative or full server path. Returns FALSE (boolean) on failure.

+

The path can be a relative or full server path. Returns FALSE (boolean) on failure.

Note: The path is relative to your main site index.php file, NOT your controller or view files. CodeIgniter uses a front controller so paths are always relative to the main site index.

@@ -83,7 +83,7 @@ might not work if you are trying to access a file above the calling script.

write_file('path', $data)

-

Writes data to the file specified in the path. If the file does not exist the function will create it. Example:

+

Writes data to the file specified in the path. If the file does not exist the function will create it. Example:

$data = 'Some file data';
@@ -101,7 +101,7 @@ else
write_file('./path/to/file.php', $data, 'r+'); -

The default mode is wb. Please see the PHP user guide for mode options.

+

The default mode is wb. Please see the PHP user guide for mode options.

Note: In order for this function to write data to a file its file permissions must be set such that it is writable (666, 777, etc.). If the file does not already exist, the directory containing it must be writable.

@@ -111,7 +111,7 @@ CodeIgniter uses a front controller so paths are always relative to the main sit

delete_files('path')

-

Deletes ALL files contained in the supplied path. Example:

+

Deletes ALL files contained in the supplied path. Example:

delete_files('./path/to/directory/');

If the second parameter is set to true, any directories contained within the supplied root path will be deleted as well. Example:

@@ -127,12 +127,12 @@ can optionally be added to the file names by setting the second parameter to TRU

get_dir_file_info('path/to/directory/', $top_level_only = TRUE)

-

Reads the specified directory and builds an array containing the filenames, filesize, dates, and permissions. Sub-folders contained within the specified path are only read if forced +

Reads the specified directory and builds an array containing the filenames, filesize, dates, and permissions. Sub-folders contained within the specified path are only read if forced by sending the second parameter, $top_level_only to FALSE, as this can be an intensive operation.

get_file_info('path/to/file', $file_information)

-

Given a file and path, returns the name, path, size, date modified. Second parameter allows you to explicitly declare what information you want returned; options are: name, server_path, size, date, readable, writable, executable, fileperms. Returns FALSE if the file cannot be found.

+

Given a file and path, returns the name, path, size, date modified. Second parameter allows you to explicitly declare what information you want returned; options are: name, server_path, size, date, readable, writable, executable, fileperms. Returns FALSE if the file cannot be found.

Note: The "writable" uses the PHP function is_writable() which is known to have issues on the IIS webserver. Consider using fileperms instead, which returns information from PHP's fileperms() function.

get_mime_by_extension('file')

@@ -142,7 +142,7 @@ can optionally be added to the file names by setting the second parameter to TRU $file = "somefile.png";
echo $file . ' is has a mime type of ' . get_mime_by_extension($file);

-

Note: This is not an accurate way of determining file mime types, and is here strictly as a convenience. It should not be used for security.

+

Note: This is not an accurate way of determining file mime types, and is here strictly as a convenience. It should not be used for security.

symbolic_permissions($perms)

-- cgit v1.2.3-24-g4f1b