public function mainAction() { Output::stdout('Init search Indexer'); $search = new Indexer(); $search->indexAll(); Output::stdout('Phanbook search successfully'); }
/** * Convert * * @param array $params */ public function mainAction($params = array()) { Output::stdout('Main Action'); TagsSeeder::run(); UsersSeeder::run(); PostsSeeder::run(); PostsTagsSeeder::run(); Output::stdout('Completed'); }
/** * The task updated core Phanbook * * @return mixed */ public function mainAction() { Output::stdout('======================================================'); Output::stdout('Loading phanbook repositories with package information'); Output::stdout('Call function ZFunction::gitUpdate()'); ZFunction::gitUpdate(); Output::stdout('Phanbook upgraded successfully'); Output::stdout('======================================================'); }
public function mainAction() { Output::stdout('Send email for post reply'); $spool = new SendSpool(); try { var_dump($spool->sendRemaining()); } catch (Exception $e) { echo $e->getMessage(), PHP_EOL; echo $e->getTraceAsString(); } }
public function mainAction() { Output::stdout('Send digest email'); $spool = new Digest(); try { var_dump($spool->send()); } catch (Exception $e) { Output::stdout($e->getMessage()); Output::stdout($e->getTraceAsString()); } }
/** * The task exports database Phanbook * * {cmd} * php cli Exports * {/cmd} * * @return mixed */ public function mainAction() { Output::stdout('======================================================'); Output::stdout('Starting exports your database'); $mysql = $this->config->database->mysql; $host = $mysql->host; $database = $mysql->dbname; $username = $mysql->username; $password = $mysql->password; $name = $database . date('Y-m-d-H:i:s'); $cmd = "mysqldump -u {$username} --password={$password} --host={$host} {$database} > {$name}.sql"; shell_exec($cmd); Output::stdout('Phanbook exports your database successfully'); Output::stdout('======================================================'); }
/** * handle script ending exception. * * @param Exception that caused the failure * @param id of the task you started * @param exit code status of the process */ protected function handleException(\Exception $e, $taskId, $exit) { $sub = '%s[ERROR]%s %s file: %s line: %d'; // Remove Process Instance if ($e->getCode() != self::ERROR_SINGLE) { $this->removeProcessInstance(); } // Update Failure if ($this->_isRecording && $taskId > 0) { $stdout = Output::getStdout(); $stderr = Output::getStderr(); // Update Task w/ error messages $task = new \Models\Task(); $task->updateFailed($taskId, $stdout, $stderr, $exit); } $msg = sprintf($sub, Output::COLOR_RED, Output::COLOR_NONE, $e->getMessage(), $e->getFile(), $e->getLine()); // Let user that ran this know it failed Output::stderr($msg); }
public function test2Action($paramArray) { Output::stdout("First param: {$paramArray['0']}"); Output::stdout("Second param: {$paramArray['1']}"); }