You are here

function patterns_export_start_engine in Patterns 7.2

Same name and namespace in other branches
  1. 7 patterns_export/patterns_export.module \patterns_export_start_engine()

Start the exporting process

Parameters

string $filename The name or path of the exported file :

array $tagmodules The index of modules/tags/exports_functions :

array $info The info section of the export:

string $to Optional. A valid export destionation (e.g. zip,file,database).: Defaults, 'db'.

string $format A valid patterns format (e.g. yaml,xml,php):

string $mode Optional. A valid patterns execution mode. E.g. (php,batch).: Defaults 'php'.

string $type Defines the type of actions (CREATE or MODIFY) that are going to be created during the export process:

2 calls to patterns_export_start_engine()
drush_patterns_export in ./patterns.drush.inc
Export data from the patterns components to file, zip archive, or database
patterns_export_submit in patterns_export/patterns_export.module
Submit hook of the export form

File

patterns_export/patterns_export.module, line 265

Code

function patterns_export_start_engine($filename, $tagmodules = array(), $info = array(), $to = PATTERNS_EXPORT_TO_DB, $format = PATTERNS_FORMAT_UNKNOWN, $mode = PATTERNS_EXEC_PHP, $type = PATTERNS_EXPORT_TYPE_MODIFY) {
  $format = patterns_io_get_format_from_file($filename, $format);
  if (!$format) {
    drupal_set_message(t('Unkwnown export format. Aborting.'), 'error');
    return FALSE;
  }
  if (!in_array($mode, array(
    'php',
    'batch',
  ))) {
    drupal_set_message(t('Unknown execution mode: %mode', array(
      '%mode' => $mode,
    )), 'error');
    return FALSE;
  }
  $func = 'patterns_export_' . $mode;
  return $func($filename, $tagmodules, $info, $to, $format, $type);
}