| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Source view] [Print] [Project Stats]
(no description)
| File Size: | 1406 lines (53 kb) |
| Included or required: | 7 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| file_create_url($path) X-Ref |
| Create the download path to a file. param: $path A string containing the path of the file to generate URL for. return: A string containing a URL that can be used to download the file. |
| file_create_path($dest = 0) X-Ref |
| Make sure the destination is a complete path and resides in the file system directory, if it is not prepend the file system directory. param: $dest A string containing the path to verify. If this value is return: A string containing the path to file, with file system directory |
| file_check_directory(&$directory, $mode = 0, $form_item = NULL) X-Ref |
| Check that the directory exists and is writable. Directories need to have execute permissions to be considered a directory by FTP servers, etc. param: $directory A string containing the name of a directory path. param: $mode A Boolean value to indicate if the directory should be created param: $form_item An optional string containing the name of a form item that return: FALSE when directory not found, or TRUE when directory exists. |
| file_check_path(&$path) X-Ref |
| Checks path to see if it is a directory, or a dir/file. param: $path A string containing a file path. This will be set to the return: If the directory is not in a Drupal writable directory, FALSE is |
| file_check_location($source, $directory = '') X-Ref |
| Check if a file is really located inside $directory. Should be used to make sure a file specified is really located within the directory to prevent exploits. param: $source A string set to the file to check. param: $directory A string where the file should be located. return: 0 for invalid path or the real path of the source. |
| file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) X-Ref |
| Copies a file to a new location. This is a powerful function that in many ways performs like an advanced version of copy(). - Checks if $source and $dest are valid and readable/writable. - Performs a file copy if $source is not equal to $dest. - If file already exists in $dest either the call will error out, replace the file or rename the file based on the $replace parameter. param: $source param: $dest param: $replace return: |
| file_destination($destination, $replace) X-Ref |
| Determines the destination path for a file depending on how replacement of existing files should be handled. param: $destination A string specifying the desired path. param: $replace Replace behavior when the destination file already exists. return: The destination file path or FALSE if the file already exists and |
| file_move(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) X-Ref |
| Moves a file to a new location. - Checks if $source and $dest are valid and readable/writable. - Performs a file move if $source is not equal to $dest. - If file already exists in $dest either the call will error out, replace the file or rename the file based on the $replace parameter. param: $source param: $dest param: $replace return: |
| file_munge_filename($filename, $extensions, $alerts = TRUE) X-Ref |
| Modify a filename as needed for security purposes. Munging a file name prevents unknown file extensions from masking exploit files. When web servers such as Apache decide how to process a URL request, they use the file extension. If the extension is not recognized, Apache skips that extension and uses the previous file extension. For example, if the file being requested is exploit.php.pps, and Apache does not recognize the '.pps' extension, it treats the file as PHP and executes it. To make this file name safe for Apache and prevent it from executing as PHP, the .php extension is "munged" into .php_, making the safe file name exploit.php_.pps. Specifically, this function adds an underscore to all extensions that are between 2 and 5 characters in length, internal to the file name, and not included in $extensions. Function behavior is also controlled by the Drupal variable 'allow_insecure_uploads'. If 'allow_insecure_uploads' evaluates to TRUE, no alterations will be made, if it evaluates to FALSE, the filename is 'munged'. param: $filename param: $extensions param: $alerts return: |
| file_unmunge_filename($filename) X-Ref |
| Undo the effect of upload_munge_filename(). param: $filename string filename return: string |
| file_create_filename($basename, $directory) X-Ref |
| Create a full file path from a directory and filename. If a file with the specified name already exists, an alternative will be used. param: $basename string filename param: $directory string directory return: |
| file_delete($path) X-Ref |
| Delete a file. param: $path A string containing a file path. return: TRUE for success, FALSE for failure. |
| file_space_used($uid = NULL) X-Ref |
| Determine total disk space used by a single user or the whole filesystem. param: $uid |
| file_save_upload($source, $validators = array() X-Ref |
| Saves a file upload to a new location. The source file is validated as a proper upload and handled as such. The file will be added to the files table as a temporary file. Temporary files are periodically cleaned. To make the file permanent file call file_set_status() to change its status. param: $source param: $validators param: $dest param: $replace return: |
| file_validate_name_length($file) X-Ref |
| Check for files with names longer than we can store in the database. param: $file return: |
| file_validate_extensions($file, $extensions) X-Ref |
| Check that the filename ends with an allowed extension. This check is not enforced for the user #1. param: $file param: $extensions return: |
| file_validate_size($file, $file_limit = 0, $user_limit = 0) X-Ref |
| Check that the file's size is below certain limits. This check is not enforced for the user #1. param: $file param: $file_limit param: $user_limit return: |
| file_validate_is_image(&$file) X-Ref |
| Check that the file is recognized by image_get_info() as an image. param: $file return: |
| file_validate_image_resolution(&$file, $maximum_dimensions = 0, $minimum_dimensions = 0) X-Ref |
| If the file is an image verify that its dimensions are within the specified maximum and minimum dimensions. Non-image files will be ignored. param: $file param: $maximum_dimensions param: $minimum_dimensions return: |
| file_save_data($data, $dest, $replace = FILE_EXISTS_RENAME) X-Ref |
| Save a string to the specified destination. param: $data A string containing the contents of the file. param: $dest A string containing the destination location. param: $replace Replace behavior when the destination file already exists. return: A string containing the resulting filename or 0 on error |
| file_set_status(&$file, $status) X-Ref |
| Set the status of a file. param: file A Drupal file object param: status A status value to set the file to. return: FALSE on failure, TRUE on success and $file->status will contain the |
| file_transfer($source, $headers) X-Ref |
| Transfer file using http to client. Pipes a file through Drupal to the client. param: $source File to transfer. param: $headers An array of http headers to send along with file. |
| file_download() X-Ref |
| Call modules that implement hook_file_download() to find out if a file is accessible and what headers it should be transferred with. If a module returns -1 drupal_access_denied() will be returned. If one or more modules returned headers the download will start with the returned headers. If no modules respond drupal_not_found() will be returned. |
| file_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS') X-Ref |
| Finds all files that match a given mask in a given directory. Directories and files beginning with a period are excluded; this prevents hidden files and directories (such as SVN working directories) from being scanned. param: $dir param: $mask param: $nomask param: $callback param: $recurse param: $key param: $min_depth param: $depth return: |
| file_directory_temp() X-Ref |
| Determine the default temporary directory. return: A string containing a temp directory. |
| file_directory_path() X-Ref |
| Determine the default 'files' directory. return: A string containing the path to Drupal's 'files' directory. |
| file_upload_max_size() X-Ref |
| Determine the maximum file upload size by querying the PHP settings. return: |
| file_get_mimetype($filename, $mapping = NULL) X-Ref |
| Determine an Internet Media Type, or MIME type from a filename. param: $filename param: $mapping return: |
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |