system_get_files_database

Versions
4.6 – 7
system_get_files_database(&$files, $type)

Retrieves the current status of an array of files in the system table.

Parameters

$files An array of files to check.

$type The type of the files.

▾ 2 functions call system_get_files_database()

system_rebuild_module_data in modules/system/system.module
Rebuild, save, and return data about all currently available modules.
system_rebuild_theme_data in modules/system/system.module
Rebuild, save, and return data about all currently available themes.

Code

modules/system/system.module, line 1972

<?php
function system_get_files_database(&$files, $type) {
  // Extract current files from database.
  $result = db_query("SELECT filename, name, type, status, schema_version, weight FROM {system} WHERE type = :type", array(':type' => $type));
  foreach ($result as $file) {
    if (isset($files[$file->name]) && is_object($files[$file->name])) {
      $file->uri = $file->filename;
      foreach ($file as $key => $value) {
        if (!isset($files[$file->name]->$key)) {
          $files[$file->name]->$key = $value;
        }
      }
    }
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.