function advagg_insert_update_db

cis7 advagg.inc advagg_insert_update_db($files, $type, $root)
cle7 advagg.inc advagg_insert_update_db($files, $type, $root)
elmsmedia7 advagg.inc advagg_insert_update_db($files, $type, $root)
icor7 advagg.inc advagg_insert_update_db($files, $type, $root)
meedjum_blog7 advagg.inc advagg_insert_update_db($files, $type, $root)
mooc7 advagg.inc advagg_insert_update_db($files, $type, $root)

Insert/Update data in advagg_files, advagg_aggregates, & advagg_aggregates_versions tables.

Parameters

array $files: List of files in the aggregate as well as the aggregate name.

string $type: css or js.

int $root: Is this a root aggregate.

Return value

bool Return TRUE if anything was written to the database.

1 call to advagg_insert_update_db()
advagg_build_aggregate_plans in sites/all/modules/ulmus/advagg/advagg.inc
Replacement for drupal_build_css_cache() and drupal_build_js_cache().

File

sites/all/modules/ulmus/advagg/advagg.inc, line 26
Advanced CSS/JS aggregation module

Code

function advagg_insert_update_db($files, $type, $root) {
  // Record if a database write was done.
  $write_done = FALSE;

  // Loop through all files.
  foreach ($files as $aggregate_file_name => $values) {
    // Build lock name variable.
    $lock_name = 'advagg_insert_update_db:' . $values['aggregate_filenames_hash'] . ADVAGG_SPACE . $values['aggregate_contents_hash'];

    // If lock is already acquired, return here.
    if (!lock_acquire($lock_name, 5)) {
      continue;
    }

    // Insert files into the advagg_files table if it doesn't exist.
    // Update if needed.
    if (advagg_insert_update_files($values['files'], $type)) {
      $write_done = TRUE;
    }

    // Insert aggregate into the advagg_aggregates table if it doesn't exist.
    if (advagg_insert_aggregate($values['files'], $values['aggregate_filenames_hash'])) {
      $write_done = TRUE;
    }

    // Insert aggregate version information into advagg_aggregates_versions.
    if (advagg_insert_aggregate_version($values['aggregate_filenames_hash'], $values['aggregate_contents_hash'], $root)) {
      $write_done = TRUE;
    }

    // Release Lock.
    lock_release($lock_name);
  }
  return $write_done;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.