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


PHP Dog::getUID方法代码示例

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


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

示例1: getValue

 public function getValue()
 {
     $key = $this->name;
     $def = $this->default;
     $sid = Dog::getServer()->getID();
     $c = Dog::getChannel();
     if ($this->module !== NULL) {
         $mod = $this->module;
         switch ($this->scope) {
             case 'g':
                 return Dog_Conf_Mod::getConf($mod, $key, $def);
             case 's':
                 return Dog_Conf_Mod_Serv::getConf($mod, $sid, $key, $def);
             case 'c':
                 return $c === false ? $def : Dog_Conf_Mod_Chan::getConf($mod, $c->getID(), $key, $def);
             case 'u':
                 return Dog_Conf_Mod_User::getConf($mod, Dog::getUID(), $key, $def);
         }
     } elseif ($this->plugin !== NULL) {
         $plg = $this->plugin;
         switch ($this->scope) {
             case 'g':
                 return Dog_Conf_Plug::getConf($plg, $key, $def);
             case 's':
                 return Dog_Conf_Plug_Serv::getConf($plg, $sid, $key, $def);
             case 'c':
                 return $c === false ? $def : Dog_Conf_Plug_Chan::getConf($plg, $c->getID(), $key, $def);
             case 'u':
                 return Dog_Conf_Plug_User::getConf($plg, Dog::getUID(), $key, $def);
         }
     }
     return $def;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:33,代码来源:Dog_Var.php

示例2: array

$lang = array('en' => array('help' => 'Usage: %CMD% <expression>. Evaluate a mathematical expression and print results. Use _ and $ to referr to the last result.', '00' => '1 ... No ... 0 ... No ... UNDEFINED!', 'err_in' => 'Error in expression.', 'err_lib' => 'The "EvalMath" class by Miles Kaufmann is missing.'));
$plugin = Dog::getPlugin();
if ('' === ($message = $plugin->msg())) {
    return $plugin->showHelp();
}
if (false !== ($last = Dog_Conf_Plug_User::getConf($plugin->getName(), Dog::getUID(), 'last', false))) {
    $message = str_replace(array('_', '$'), $last, $message);
}
if ($message === '0^0') {
    return $plugin->rply('00');
}
if ($message === 'pi') {
    return $plugin->reply('4');
}
$path = GWF_PATH . 'core/inc/3p/EvalMath.php';
if (!Common::isFile($path)) {
    return $plugin->rply('err_lib');
}
require_once $path;
$eval = new EvalMath();
if (false === ($result = $eval->e($message))) {
    return $plugin->rply('err_in');
}
$result = sprintf('%.09f', $result);
if (strpos($result, '.') !== false) {
    $result = rtrim($result, '0');
    $result = rtrim($result, '.');
}
Dog_Conf_Plug_User::setConf($plugin->getName(), Dog::getUID(), 'last', $result);
Dog::reply($result);
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:math_Pb.php

示例3: preg_split

# Split and clean data
$message = $plugin->msg();
$data = preg_split('/(?: or | oder |\\|\\||\\|)/', $message);
$data = array_map('trim', $data);
foreach ($data as $i => $s) {
    if ($s === '') {
        unset($data[$i]);
    }
}
$data = array_unique($data);
# Same data?
$diff = 1;
if (count($last) === count($data)) {
    $t = $last;
    sort($t);
    sort($data);
    $diff = count(array_diff($t, $data));
}
# Yes, same data
if ($diff === 0) {
    return $plugin->rply('just');
}
# New choose
Dog_Conf_Plug_User::setConf($plg, Dog::getUID(), 'last', serialize($last));
# Yes/No
if (count($data) === 1) {
    $key = rand(0, 1) ? 'y' : 'n';
    return $plugin->rply($key);
}
# Random
Dog::reply($data[rand(0, count($data) - 1)]);
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:decide_Pb.php


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