demo.api.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // $Id: demo.api.php,v 1.1 2009/11/09 23:28:08 sun Exp $
  3. /**
  4. * @file
  5. * Documentation for Demonstration site module.
  6. */
  7. /**
  8. * @addtogroup hooks
  9. * @{
  10. */
  11. /**
  12. * Alter snapshot options before a snapshot is created.
  13. *
  14. * @param &$options
  15. * A structured array consisting of submitted form values:
  16. * - filename: The base output filename, without extension.
  17. * - default: Whether to set this dump as new default snapshot.
  18. * - description: A description for the snapshot. If a snapshot with the same
  19. * name already exists and this is left blank, the new snapshot will reuse
  20. * the existing description.
  21. * - tables: An array of tables to dump, keyed by table name (including table
  22. * prefix, if any). The value is an array of dump options:
  23. * - schema: Whether to dump the table schema.
  24. * - data: Whether to dump the table data.
  25. */
  26. function hook_demo_dump_alter(&$options) {
  27. // Only export the table schema of table cache_table, but not the data.
  28. // Commonly used for cache tables.
  29. $options['tables']['cache_table']['data'] = FALSE;
  30. // Completely ignore tables starting with a certain prefix.
  31. foreach ($options['tables'] as $table => $dump_options) {
  32. // Test if the table name starts with 'unrelated_'.
  33. if (strncmp($table, 'unrelated_', 10) == 0) {
  34. unset($options['tables'][$table]);
  35. }
  36. }
  37. }
  38. /**
  39. * @} End of "addtogroup hooks".
  40. */