IndexController.php #1

  • //
  • guest/
  • perforce_software/
  • chronicle/
  • main/
  • application/
  • cron/
  • controllers/
  • IndexController.php
  • View
  • Commits
  • Open Download .zip Download (1 KB)
<?php
/**
 * Processes application's periodic tasks.
 *
 * @copyright   2011 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
 * @version     <release>/<patch>
 */
class Cron_IndexController extends Zend_Controller_Action
{
    public $contexts = array(
        'index' => array('json')
    );

    /**
     * Run cron to process application's periodic tasks.
     */
    public function indexAction()
    {
        // explicitly set json context as thats all we provide
        $this->contextSwitch->initContext('json');

        // if background is set, close the session early but
        // continue running the cron checks and tasks
        $background = $this->getRequest()->getParam('background');
        if ($background) {
            $this->getHelper('browserDisconnect')->disconnect(null, 0);
        } else {
            // force json context
            $this->contextSwitch->initContext('json');
        }

        // run cron and pass returned report to the view
        $this->view->report = Cron_Model_Cron::run();
    }
}
# Change User Description Committed
#1 16170 perforce_software Move Chronicle files to follow new path scheme for branching.
//guest/perforce_software/chronicle/application/cron/controllers/IndexController.php
#1 8972 Matt Attaway Initial add of the Chronicle source code