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


PHP Scheduler::getParser方法代码示例

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


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

示例1: nextScheduledDate

 /**
  * nextScheduledDate
  *
  * @param   string  $unix_mhdmd  Param
  * @param   string  $now         Param
  *
  * @return	string
  */
 public static function nextScheduledDate($unix_mhdmd, $now = 'now')
 {
     JLoader::import('extly.scheduler.scheduler');
     try {
         $cron = Scheduler::getParser($unix_mhdmd);
         $cron->setExpression($unix_mhdmd);
         $nextDate = $cron->getNextRunDate($now)->getTimestamp();
         $nextDate = JFactory::getDate($nextDate);
         return $nextDate;
     } catch (Exception $e) {
         $logger = AutotweetLogger::getInstance();
         $logger->log(JLog::ERROR, 'nextScheduledDate: ' . $e->getMessage());
         return null;
     }
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:23,代码来源:text.php

示例2: cronjobExpressionControl

 /**
  * cronjobExpressionControl
  *
  * @param   string  $selected         Value
  * @param   string  $name             The name for the field
  * @param   string  $label            Label
  * @param   string  $desc             Description
  * @param   array   $idTag            Additional HTML attributes for the <select> tag
  * @param   string  $class            Class
  * @param   string  $extensionmainjs  Module name
  *
  * @return  string  HTML
  */
 public static function cronjobExpressionControl($selected, $name, $label, $desc, $idTag = null, $class = null, $extensionmainjs = null)
 {
     static $initialized = false;
     if (!$initialized) {
         $initialized = true;
         if ($extensionmainjs) {
             $dependencies = array();
             // $dependencies['xtcronjob-expression-field'] = array('backbone');
             $file = 'media/lib_extly/js/utils/xtcronjob-expression-field.min';
             $paths = array('xtcronjob-expression-field' => $file);
             Extly::addAppDependency($extensionmainjs, $dependencies, $paths);
         } else {
             JHtml::script('lib_extly/utils/xtcronjob-expression-field.js', false, true);
         }
     }
     $blankText = false;
     if (empty($selected)) {
         $blankText = true;
         $selected = '* * * * *';
     }
     JLoader::import('extly.scheduler.scheduler');
     $cronExpression = Scheduler::getParser($selected);
     $minute = $cronExpression->getExpression(0);
     $hour = $cronExpression->getExpression(1);
     $day = $cronExpression->getExpression(2);
     $month = $cronExpression->getExpression(3);
     $weekday = $cronExpression->getExpression(4);
     $controlI = EHtmlSelect::minuteList($minute, $idTag . '_minute', array('class' => 'minute-part'));
     $controlH = EHtmlSelect::hourList($hour, $idTag . '_hour', array('class' => 'hour-part'));
     $controlD = EHtmlSelect::dayList($day, $idTag . '_day', array('class' => 'day-part'));
     $controlM = EHtmlSelect::monthList($month, $idTag . '_month', array('class' => 'month-part'));
     $controlW = EHtmlSelect::weekdayList($weekday, $idTag . '_weekday', array('class' => 'weekday-part'));
     $controlT = self::textControl($blankText ? '' : $selected, $name, $label, $desc, $idTag, 256, 'unix_mhdmd-part');
     $controls = array();
     $controls[] = self::genericControl('COM_XTCRONJOB_TASKS_FIELD_MINUTE', 'COM_XTCRONJOB_TASKS_FIELD_MINUTE_DESC', $idTag . '_minute', $controlI);
     $controls[] = self::genericControl('COM_XTCRONJOB_TASKS_FIELD_HOUR', 'COM_XTCRONJOB_TASKS_FIELD_HOUR_DESC', $idTag . '_hour', $controlH);
     $controls[] = self::genericControl('COM_XTCRONJOB_TASKS_FIELD_DAY', 'COM_XTCRONJOB_TASKS_FIELD_DAY_DESC', $idTag . '_day', $controlD);
     $controls[] = self::genericControl('COM_XTCRONJOB_TASKS_FIELD_MONTH', 'COM_XTCRONJOB_TASKS_FIELD_MONTH_DESC', $idTag . '_month', $controlM);
     $controls[] = self::genericControl('COM_XTCRONJOB_TASKS_FIELD_WEEKDAY', 'COM_XTCRONJOB_TASKS_FIELD_WEEKDAY_DESC', $idTag . '_weekday', $controlW);
     $controls[] = $controlT;
     return implode("\n", $controls);
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:55,代码来源:ehtml.php


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