1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class RunqueueAction extends Action
- {
- protected $qm = null;
- protected function prepare(array $args=array())
- {
- parent::prepare($args);
- $args = array();
- foreach (array('qmkey') as $key) {
- if ($this->arg($key) !== null) {
- $args[$key] = $this->arg($key);
- }
- }
- try {
- $this->qm = new OpportunisticQueueManager($args);
- } catch (RunQueueBadKeyException $e) {
- return false;
- }
- header('Content-type: text/plain; charset=utf-8');
- return true;
- }
- protected function handle() {
-
-
- if ($this->qm->runQueue() === true) {
-
- $this->text('0');
- } else {
-
- $this->text('1');
- }
- }
- }
|