Ejemplo n.º 1
0
 public function undoimportAction()
 {
     $fi_import = $this->findById();
     // change the status of the import
     $fi_import->status = FeedImporter_Import::STATUS_IN_PROGRESS_UNDO_IMPORT;
     $fi_import->save();
     // // dispatch the background process to undo the import
     $user = current_user();
     $args = array();
     $args['import_id'] = $fi_import->id;
     ProcessDispatcher::startProcess('FeedImporter_UndoImportProcess', $user, $args);
     // $this->flashSuccess("Successfully started to undo the import. Reload this page for status updates.");
     $this->redirect->gotoUrl('feeds/show/' . $fi_import->feed_id);
     //$this->redirect->gotoUrl('feeds/imports/show/' . $fi_import->id );
 }
Ejemplo n.º 2
0
 public function run($params = null)
 {
     _log("Running cron");
     $params = unserialize($params);
     $feed_id = $params[0];
     _log("Cron task: {$feed_id}");
     $feed = get_db()->getTable('FeedImporter_Feed')->find($feed_id);
     //make a new FI_Import
     $newImport = new FeedImporter_Import();
     $newImport->feed_id = $feed->id;
     $newImport->collection_id = $feed->collection_id;
     $newImport->status = STATUS_IN_PROGRESS_IMPORT;
     $newImport->created = date('Y-m-d G:i:s');
     $newImport->save();
     // dispatch the background process to import the items
     $user = current_user();
     $args = array();
     $args['import_id'] = $newImport->id;
     ProcessDispatcher::startProcess('FeedImporter_ImportProcess', $user, $args);
 }
Ejemplo n.º 3
0
 private function _hasValidPHPCliPath()
 {
     try {
         $p = ProcessDispatcher::getPHPCliPath();
     } catch (Exception $e) {
         $this->flashError('Your PHP-CLI path setting is invalid.' . "\n" . 'Please change the setting in ' . CONFIG_DIR . DIRECTORY_SEPARATOR . 'config.ini' . "\n" . 'If you do not know how to do this, please check with your system or server administrator.');
         return false;
     }
     return true;
 }