public static function run($type = 'manual') { Plugins::act('exportsnapshot_run_before'); // if we can't save the file, throw an error and bail if (!self::test_cache()) { return false; } // crontab hands us the cron object as the first param, filter for that if (is_array($type)) { $type = 'cron'; } $export_type = Options::get('exportsnapshot__type', 'blogml'); $export = new Export(); $xml = $export->run(false, $export_type); EventLog::log(_t('Export Snapshot completed!', 'exportsnapshot'), 'info', 'snapshot', 'ExportSnapshot', $type); Plugins::act('exportsnapshot_run_after'); $xml = Plugins::filter('exportsnapshot_contents', $xml); // save the snapshot $save_result = self::save($xml, $type); // cleanup old snapshots $clean_result = self::cleanup(); if ($save_result && $clean_result) { return true; } else { return false; } }