summaryrefslogtreecommitdiff
path: root/includes/file.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-04-10 17:30:15 +0000
committerDries Buytaert <dries@buytaert.net>2010-04-10 17:30:15 +0000
commitbdb7e56143d52bb8528042591f0e8df9afde45db (patch)
tree6801086da136619cdecfe34a94d482118f5fe4e7 /includes/file.inc
parente892ed5c317f7d37da09a2ad3a0e113703437b10 (diff)
downloadbrdo-bdb7e56143d52bb8528042591f0e8df9afde45db.tar.gz
brdo-bdb7e56143d52bb8528042591f0e8df9afde45db.tar.bz2
- Patch #741578 by nikgregory, andypost, Berdir, noahb: 'File' is a reserved word that should not be used.
Diffstat (limited to 'includes/file.inc')
-rw-r--r--includes/file.inc17
1 files changed, 9 insertions, 8 deletions
diff --git a/includes/file.inc b/includes/file.inc
index baa0a9473..96da7ad4e 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -509,13 +509,13 @@ function file_save(stdClass $file) {
$file->filesize = filesize($file->uri);
if (empty($file->fid)) {
- drupal_write_record('file', $file);
+ drupal_write_record('file_managed', $file);
// Inform modules about the newly added file.
module_invoke_all('file_insert', $file);
entity_invoke('insert', 'file', $file);
}
else {
- drupal_write_record('file', $file, 'fid');
+ drupal_write_record('file_managed', $file, 'fid');
// Inform modules that the file has been updated.
module_invoke_all('file_update', $file);
entity_invoke('update', 'file', $file);
@@ -974,7 +974,7 @@ function file_delete(stdClass $file, $force = FALSE) {
// Make sure the file is deleted before removing its row from the
// database, so UIs can still find the file in the database.
if (file_unmanaged_delete($file->uri)) {
- db_delete('file')->condition('fid', $file->fid)->execute();
+ db_delete('file_managed')->condition('fid', $file->fid)->execute();
return TRUE;
}
return FALSE;
@@ -1069,7 +1069,7 @@ function file_unmanaged_delete_recursive($path) {
* An integer containing the number of bytes used.
*/
function file_space_used($uid = NULL, $status = FILE_STATUS_PERMANENT) {
- $query = db_select('file', 'f');
+ $query = db_select('file_managed', 'f');
// Use separate placeholders for the status to avoid a bug in some versions
// of PHP. See http://drupal.org/node/352956.
$query->where('f.status & :status1 = :status2', array(':status1' => $status, ':status2' => $status));
@@ -1083,9 +1083,9 @@ function file_space_used($uid = NULL, $status = FILE_STATUS_PERMANENT) {
/**
* Saves a file upload to a new location.
*
- * The file will be added to the {file} table as a temporary file. Temporary
- * files are periodically cleaned. To make the file a permanent file, assign
- * the status and use file_save() to save the changes.
+ * The file will be added to the {file_managed} table as a temporary file.
+ * Temporary files are periodically cleaned. To make the file a permanent file,
+ * assign the status and use file_save() to save the changes.
*
* @param $source
* A string specifying the filepath or URI of the uploaded file to save.
@@ -1504,7 +1504,8 @@ function file_save_data($data, $destination = NULL, $replace = FILE_EXISTS_RENAM
* Save a string to the specified destination without invoking file API.
*
* This function is identical to file_save_data() except the file will not be
- * saved to the {file} table and none of the file_* hooks will be called.
+ * saved to the {file_managed} table and none of the file_* hooks will be
+ * called.
*
* @param $data
* A string containing the contents of the file.