当前位置: 首页>>代码示例>>PHP>>正文


PHP Cron::run方法代码示例

本文整理汇总了PHP中Cron::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Cron::run方法的具体用法?PHP Cron::run怎么用?PHP Cron::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cron的用法示例。


在下文中一共展示了Cron::run方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 function run()
 {
     global $ost;
     Cron::run();
     $ost->logDebug('Cron Job', 'Cron job executed [' . $_SERVER['REMOTE_ADDR'] . ']');
     $this->response(200, 'Completed');
 }
开发者ID:ed00m,项目名称:osTicket-1.8,代码行数:7,代码来源:api.cron.php

示例2: initialize

 /**
  * 
  * Initializes configs for the APP to run
  */
 public static function initialize()
 {
     /**
      * Load all the configs from DB
      */
     //Change the default cache system, based on your config /config/cache.php
     Cache::$default = Core::config('cache.default');
     //is not loaded yet in Kohana::$config
     Kohana::$config->attach(new ConfigDB(), FALSE);
     //overwrite default Kohana init configs.
     Kohana::$base_url = Core::config('general.base_url');
     //enables friendly url @todo from config
     Kohana::$index_file = FALSE;
     //cookie salt for the app
     Cookie::$salt = Core::config('auth.cookie_salt');
     /* if (empty(Cookie::$salt)) {
     			// @TODO missing cookie salt : add warning message
     		} */
     // -- i18n Configuration and initialization -----------------------------------------
     I18n::initialize(Core::config('i18n.locale'), Core::config('i18n.charset'));
     //Loading the OC Routes
     // if (($init_routes = Kohana::find_file('config','routes')))
     // 	require_once $init_routes[0];//returns array of files but we need only 1 file
     //faster loading
     require_once APPPATH . 'config/routes.php';
     //getting the selected theme, and loading options
     Theme::initialize();
     //run crontab
     if (core::config('general.cron') == TRUE) {
         Cron::run();
     }
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:36,代码来源:core.php

示例3: initialize

 /**
  * 
  * Initializes configs for the APP to run
  */
 public static function initialize()
 {
     //enables friendly url
     Kohana::$index_file = FALSE;
     //temporary cookie salt in case of exception
     Cookie::$salt = 'cookie_oc_temp';
     //Change the default cache system, based on your config /config/cache.php
     Cache::$default = Core::config('cache.default');
     //loading configs from table config
     //is not loaded yet in Kohana::$config
     Kohana::$config->attach(new ConfigDB(), FALSE);
     //overwrite default Kohana init configs.
     Kohana::$base_url = Core::config('general.base_url');
     //cookie salt for the app
     Cookie::$salt = Core::config('auth.cookie_salt');
     // i18n Configuration and initialization
     I18n::initialize(Core::config('i18n.locale'), Core::config('i18n.charset'));
     //Loading the OC Routes
     require_once APPPATH . 'config/routes.php';
     //getting the selected theme, and loading options
     Theme::initialize();
     //run crontab
     if (core::config('general.cron') == TRUE) {
         Cron::run();
     }
 }
开发者ID:ThomWensink,项目名称:common,代码行数:30,代码来源:core.php

示例4: poorMansCron

 static function poorMansCron()
 {
     $intervals = array("minute", "five", "fifteen", "hour", "week");
     foreach ($intervals as $interval) {
         $entity = getEntity(array("type" => "Cron", "metadata_name" => "interval", "metadata_value" => $interval));
         if (!$entity) {
             $entity = new Cron();
             $entity->interval = $interval;
             $entity->save();
         }
         Cron::run($interval, false);
     }
     return;
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:14,代码来源:Init.php

示例5: init

 public static function init()
 {
     if (!isset($_GET['cronTok'])) {
         return;
     }
     define('EDUCASK_ROOT', dirname(getcwd()));
     require_once EDUCASK_ROOT . '/core/classes/Bootstrap.php';
     Bootstrap::registerAutoloader();
     $database = Database::getInstance();
     $database->connect();
     if (!$database->isConnected()) {
         return;
     }
     Bootstrap::initializePlugins();
     $cron = new Cron($_GET['cronTok']);
     $cron->run();
 }
开发者ID:educask,项目名称:EducaskCore,代码行数:17,代码来源:cron.php

示例6: die

#!/usr/bin/php -q

<?php 
set_time_limit(0);
if (!@$argc) {
    die("<p>script can only be run from command line");
}
#error_reporting(0);
define("_ABSPATH", dirname(dirname(__FILE__)));
require_once _ABSPATH . '/lib/Cron.php';
define_syslog_variables();
$cron = new Cron();
$cron->run();
开发者ID:TheProjecter,项目名称:nessquik,代码行数:13,代码来源:cron.php

示例7: testAfterRunEvent

 /**
  *  Tests the Cron run events
  *
  *  @covers \Liebig\Cron\Cron::run
  */
 public function testAfterRunEvent()
 {
     $result = array();
     \Event::listen('cron.afterRun', function ($rundate, $inTime, $runtime, $errors, $crons, $lastRun) use(&$result) {
         array_push($result, array($rundate, $inTime, $runtime, $errors, $crons, $lastRun));
     });
     Cron::add('test1', "* * * * *", function () {
         return 'Test 1 done';
     });
     Cron::add('test2', "* * * * *", function () {
     });
     $firstRun = Cron::run();
     $this->assertEquals(-1, $firstRun['inTime']);
     $this->assertEquals(1, $firstRun['errors']);
     sleep(5);
     $secondRun = Cron::run();
     $this->assertEquals(false, $secondRun['inTime']);
     $this->assertEquals(1, $secondRun['errors']);
     // inTime
     $this->assertEquals(-1, $result[0][1]);
     $this->assertEquals(false, $result[1][1]);
     // errors
     $this->assertEquals(1, $result[0][3]);
     $this->assertEquals(1, $result[1][3]);
     // lastRun
     $this->assertEquals($result[0][5], array());
     $secondRundate = new \DateTime($result[1][5]['rundate']);
     $this->assertEquals($firstRun['rundate'], $secondRundate->getTimestamp());
 }
开发者ID:hilltool,项目名称:cron,代码行数:34,代码来源:CronTest.php

示例8: calls

<?php

/*********************************************************************
    cron.php

    File to handle cron job calls (local and remote).

    Peter Rotich <peter@osticket.com>
    Copyright (c)  2006-2010 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
    $Id: $
**********************************************************************/
@chdir(realpath(dirname(__FILE__)) . '/');
//Change dir.
require 'api.inc.php';
require_once INCLUDE_DIR . 'class.cron.php';
Cron::run();
Sys::log(LOG_DEBUG, 'Cron Job', 'Cron Job Externo ejecutado [' . $_SERVER['REMOTE_ADDR'] . ']');
开发者ID:e-gob,项目名称:chilesinpapeleo-soporte,代码行数:23,代码来源:cron.php

示例9: ignore_user_abort

<?php

/**
 * Cron model
 *
 *
 * @package    OC
 * @category   Cron
 * @author     Chema <chema@open-classifieds.com>
 * @copyright  (c) 2009-2014 Open Classifieds Team
 * @license    GPL v3
 */
ignore_user_abort(TRUE);
set_time_limit(0);
ini_set('memory_limit', '1024M');
// Path to Kohana's index.php // REVIEW this depends on your APP is in different folder
$system = dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR . 'index.php';
//$system = '/var/www/open-classifieds/index.php';
if (file_exists($system)) {
    defined('SUPPRESS_REQUEST') or define('SUPPRESS_REQUEST', TRUE);
    include $system;
    //execute all the crons
    echo Cron::run();
}
开发者ID:gnovaro,项目名称:kohana-cron,代码行数:24,代码来源:cron.php

示例10: run

 public static function run()
 {
     Cron::run();
 }
开发者ID:suxinde2009,项目名称:www,代码行数:4,代码来源:cron.ajax.php

示例11: buildCron

 private function buildCron()
 {
     if ($this->is_cron) {
         require fimport("class/cron");
         Cron::run();
     }
 }
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:7,代码来源:fanwe.service.php

示例12: app_path

});
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
/*
|--------------------------------------------------------------------------
| Lieberg Cron Jobs
|--------------------------------------------------------------------------
|	this will help us excute all our cron job functions
| 	
| 
| 
|
*/
Event::listen('cron.collectJobs', function () {
    Cron::add('update', '* * * * *', function () {
        // Do some crazy things unsuccessfully every minute
        $orders = Order::where('activity', '=', '0')->delete();
        return true;
    });
    Cron::setEnableJob('update');
    $report = Cron::run();
});
开发者ID:bernardowiredu,项目名称:unlocking-site,代码行数:31,代码来源:global.php

示例13: action_run

 public function action_run()
 {
     $this->auto_render = FALSE;
     $this->template = View::factory('js');
     $this->template->content = Cron::run();
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:6,代码来源:cron.php

示例14: cron

 private static function cron()
 {
     $config = Config::getInstance();
     if (!$config->cronIsEnabled()) {
         return;
     }
     require_once EDUCASK_ROOT . "/public_html/cron.php";
     $cron = new Cron(Config::getInstance()->getCronToken());
     $cron->run();
 }
开发者ID:educask,项目名称:EducaskCore,代码行数:10,代码来源:Bootstrap.php


注:本文中的Cron::run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。