/** * Perform WURFL data import. * * @return boolean */ public function execute() { $importer = new Tx_ContextsWurfl_Api_Model_Import(TeraWurflUpdater::SOURCE_REMOTE); $result = $importer->import(); // No update available, WURFL data is already up to date if ($result === Tx_ContextsWurfl_Api_Model_Import::STATUS_NO_UPDATE) { $this->scheduler->log('No update necessary. Your WURFL data is already up to date.'); return true; } $this->showStatus($result, $importer->getUpdater()); return true; }
/** * Imports the WURFL resource file from the specified source * (local or remote). * * @param boolean $force Force update (only valid for type "remote") * * @return boolean */ protected function importRemote($force) { $this->cli_echo('Beginning import from remote source.' . "\n"); $importer = new Tx_ContextsWurfl_Api_Model_Import(TeraWurflUpdater::SOURCE_REMOTE); $result = $importer->import($force); // No update available, WURFL data is already up to date if ($result === Tx_ContextsWurfl_Api_Model_Import::STATUS_NO_UPDATE) { $this->cli_echo('No update necessary. Your WURFL data is already up to date.' . "\n"); return true; } $this->showStatus($result, $importer->getUpdater()); return true; }
/** * Methods checks the post command and starts an database update. * * @param boolean $force Force update * * @return string */ protected function performDatabaseUpdate($force = false) { if ($_POST['cmd']['updateDatabase']) { $importer = new Tx_ContextsWurfl_Api_Model_Import(TeraWurflUpdater::SOURCE_REMOTE); $updateResult = $this->showStatus($importer->import($force), $importer->getUpdater()); return <<<HTML <div class="wurfl-module"> {$updateResult} </div> HTML; } return ''; }