advagg_css_compress.install

  1. cis7 sites/all/modules/ulmus/advagg/advagg_css_compress/advagg_css_compress.install
  2. cle7 sites/all/modules/ulmus/advagg/advagg_css_compress/advagg_css_compress.install
  3. ecd7 sites/all/modules/ulmus/advagg/advagg_css_compress/advagg_css_compress.install
  4. elmsmedia7 sites/all/modules/ulmus/advagg/advagg_css_compress/advagg_css_compress.install
  5. harmony7 sites/all/modules/ulmus/advagg/advagg_css_compress/advagg_css_compress.install
  6. icor7 sites/all/modules/ulmus/advagg/advagg_css_compress/advagg_css_compress.install
  7. meedjum_blog7 sites/all/modules/ulmus/advagg/advagg_css_compress/advagg_css_compress.install
  8. mooc7 sites/all/modules/ulmus/advagg/advagg_css_compress/advagg_css_compress.install

Handles AdvAgg CSS compress installation and upgrade tasks.

Functions

Namesort descending Description
advagg_css_compress_requirements Implements hook_requirements().
advagg_css_compress_update_7200 Upgrade AdvAgg CSS Compress previous versions (6.x-1.x & 7.x-1.x) to 7.x-2.x.

File

sites/all/modules/ulmus/advagg/advagg_css_compress/advagg_css_compress.install
View source
  1. <?php
  2. /**
  3. * @file
  4. * Handles AdvAgg CSS compress installation and upgrade tasks.
  5. */
  6. /**
  7. * Implements hook_requirements().
  8. */
  9. function advagg_css_compress_requirements($phase) {
  10. $requirements = array();
  11. // Ensure translations don't break at install time.
  12. $t = get_t();
  13. // If not at runtime, return here.
  14. if ($phase != 'runtime') {
  15. return $requirements;
  16. }
  17. // Make sure a compressor is being used.
  18. if ( variable_get('advagg_css_compressor', ADVAGG_CSS_COMPRESSOR) == 0
  19. && variable_get('advagg_css_inline_compressor', ADVAGG_CSS_INLINE_COMPRESSOR) == 0
  20. ) {
  21. // Check all files.
  22. $file_settings = variable_get('advagg_css_compressor_file_settings', array());
  23. $compression_used = FALSE;
  24. foreach ($file_settings as $form_api_filename => $setting) {
  25. if (!empty($setting)) {
  26. $compression_used = TRUE;
  27. break;
  28. }
  29. }
  30. if (!$compression_used) {
  31. $config_path = advagg_admin_config_root_path();
  32. $requirements['advagg_css_compress_not_on'] = array(
  33. 'title' => $t('AdvAgg CSS Compressor'),
  34. 'severity' => REQUIREMENT_WARNING,
  35. 'value' => $t('AdvAgg CSS Compression is disabled.'),
  36. 'description' => $t('Go to the <a href="@settings">advagg css compress settings page</a> and select a compressor, or go to the <a href="@modules">modules page</a> and disable the "AdvAgg Compress CSS" module.', array(
  37. '@settings' => url($config_path . '/advagg/css-compress'),
  38. '@modules' => url('admin/modules', array(
  39. 'fragment' => 'edit-modules-advanced-cssjs-aggregation',
  40. )),
  41. )),
  42. );
  43. }
  44. }
  45. return $requirements;
  46. }
  47. /**
  48. * Upgrade AdvAgg CSS Compress previous versions (6.x-1.x & 7.x-1.x) to 7.x-2.x.
  49. *
  50. * Implements hook_update_N().
  51. */
  52. function advagg_css_compress_update_7200(&$sandbox) {
  53. // Bail if old DB Table does not exist.
  54. if (!db_table_exists('cache_advagg_css_compress_inline')) {
  55. return t('Nothing needed to happen in AdvAgg CSS Compress.');
  56. }
  57. // Remove all old advagg css compress variables.
  58. db_delete('variable')
  59. ->condition('name', 'advagg_css%compress%', 'LIKE')
  60. ->execute();
  61. // Remove old schema.
  62. db_drop_table('cache_advagg_css_compress_inline');
  63. return t('Upgraded AdvAgg CSS Compress to 7.x-2.x.');
  64. }
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.