本文整理汇总了PHP中Scheduler::start方法的典型用法代码示例。如果您正苦于以下问题:PHP Scheduler::start方法的具体用法?PHP Scheduler::start怎么用?PHP Scheduler::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scheduler
的用法示例。
在下文中一共展示了Scheduler::start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Scheduler
* @copyright Copyright (c) 2008, Wikidot Inc.
* @license http://www.gnu.org/licenses/agpl-3.0.html GNU Affero General Public License
*/
$applicationDir = $argv[1];
echo "The application dir is: " . $applicationDir . "\n";
require_once $applicationDir . "/conf/GlobalProperties.php";
require_once "../php/core/autoload.inc.php";
require_once "../php/core/functions.php";
$tz = GlobalProperties::$SERVER_TIMEZONE;
putenv("TZ={$tz}");
require_once '/usr/lib/php/Date.php';
require_once '/usr/lib/php/Date/TimeZone.php';
require_once '/usr/lib/php/Date/Span.php';
define('SMARTY_DIR', PathManager::smartyDir());
require_once SMARTY_DIR . 'Smarty.class.php';
// connect to the database
Database::init();
$db = Database::connection();
$scheduler = new Scheduler();
$scheduler->setClassPath($applicationDir . "/php/jobs");
$schedulerFiles = ls($applicationDir . "/conf/scheduler", "*-jobs.xml");
foreach ($schedulerFiles as $key => $file) {
echo "----------------------------------------\n";
echo "processing file {$file}:\n";
echo "----------------------------------------\n";
$xml = simplexml_load_file($applicationDir . "/conf/scheduler/{$file}");
##$database = new DBDatabase($xml);
$scheduler->parseConfigXml($xml);
}
$scheduler->start();