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


PHP Dog::getScope方法代码示例

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


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

示例1: dog_plugin_alert_func4

if (0 >= ($seconds = GWF_TimeConvert::humanToSeconds($seconds))) {
    return $plug->rply('err_seconds');
}
if (GWF_Time::ONE_DAY * 8 < $seconds) {
    return $plug->rply('err_too_long');
}
// Try to parse back duration from parsed seconds
if (false === ($delay = GWF_TimeConvert::humanDurationISO(Dog::getLangISO(), $seconds))) {
    return $plug->rply('err_seconds');
}
$user = Dog::getUser();
if (!isset($DOG_PLUG_ALERT_TIMERS[$user->getID()])) {
    $DOG_PLUG_ALERT_TIMERS[$user->getID()] = 0;
}
if ($DOG_PLUG_ALERT_TIMERS[$user->getID()] >= 3) {
    return $plug->rply('err_too_much');
}
if (!function_exists('dog_plugin_alert_func4')) {
    function dog_plugin_alert_func4(array $args)
    {
        global $DOG_PLUG_ALERT_TIMERS;
        $scope = $args[0];
        $scope instanceof Dog_Scope;
        Dog::setScope($scope);
        Dog::reply($args[1]);
        $DOG_PLUG_ALERT_TIMERS[$scope->getUser()->getID()]--;
    }
}
Dog_Timer::addTimer('dog_plugin_alert_func4', array(Dog::getScope(), $plug->argvMsgFrom(1)), $seconds, false);
$DOG_PLUG_ALERT_TIMERS[$user->getID()]++;
$plug->rply('msg_remember', array($delay));
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:alert_Pb.php

示例2: async

 /**
  * Queue something for async.
  * @param string $type
  * @param mixed $message - Input for typefunc
  * @param mixed $callback
  * @param array $args - callback args
  */
 public function async($type, $message, $callback = null, array $args = array(), array $includes = array())
 {
     if (!GWF_Callback::isCallback($callback, true, true)) {
         echo "Dog_WorkerThread::async() - Invalid Callback!\n";
     } elseif (!in_array($type, self::$TYPES, true)) {
         echo "Dog_WorkerThread::async() - Unknown Type: {$type}\n";
     } elseif (!is_array($args)) {
         echo "Dog_WorkerThread::async() - Args is not an array\n";
     } elseif (!$this->forked) {
         # Fallback to synchronous
         return $this->sync($type, $message, $callback, $args, $includes);
     } else {
         return $this->queue($type, Dog::getScope(), $message, $callback, $args, $includes);
     }
     return false;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:23,代码来源:Dog_WorkerThread.php


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