****************************************
解析查询字符串值
****************************************
515192
function valueify(val) {
    return (
        val in bool ? bool[val] : (num.test(val) ? Number(val) : (val ? unescape(val) : true))
    );
}
1154803
function decoder(mtype) {
  const gen = util.codegen([ 'r', 'l' ], mtype.name + '$decode')('if(!(r instanceof Reader))')('r=Reader.create(r)')('var c=l===undefined?r.len:r.pos+l,m=new this.ctor' + (mtype.fieldsArray.filter(field => field.map).length ? ',k' : ''))('while(r.pos<c){')('var t=r.uint32()');

  if (mtype.group) {
    gen('if((t&7)===4)')('break');
  }
  gen('switch(t>>>3){');

  for (let i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {
    const field = mtype._fieldsArray[i].resolve();
    const type = field.resolvedType instanceof Enum ? 'int32' : field.type;
    const ref = 'm' + util.safeProp(field.name);
    gen('case %i:', field.id);

    // Map fields
    if (field.map) {
      gen('r.skip().pos++')('if(%s===util.emptyObject)', ref)('%s=new Map()', ref)('k=r.%s()', field.keyType)('r.pos++'); // assumes id 2 + value wireType
      // NOTE: 原来这里将 Long 对象转换成 hash 字符串是因为 Object 的 key 只能是字符串，现在用 Map 来实现后就让它原样输出就好了
      // if (types.long[field.keyType] !== undefined) {
      //   if (types.basic[type] === undefined) {
      //     gen('%s.set(typeof k==="object"?util.longToHash(k):k, types[%i].decode(r,r.uint32()));', ref, i); // can't be groups
      //   } else {
      //     gen('%s.set(typeof k==="object"?util.longToHash(k):k, r.%s());', ref, type);
      //   }
      // } else {
      if (types.basic[type] === undefined) {
        gen('%s.set(k, types[%i].decode(r,r.uint32()));', ref, i); // can't be groups
      } else {
        gen('%s.set(k, r.%s());', ref, type);
      }
      // }
      // Repeated fields
    } else if (field.repeated) {
      gen('if(!(%s&&%s.length))', ref, ref)('%s=[]', ref);

      // Packable (always check for forward and backward compatiblity)
      if (types.packed[type] !== undefined) {
        gen('if((t&7)===2){')('var c2=r.uint32()+r.pos')('while(r.pos<c2)')('%s.push(r.%s())', ref, type)('}else');
      }

      // Non-packed
      if (types.basic[type] === undefined) {
        gen(field.resolvedType.group ? '%s.push(types[%i].decode(r))' : '%s.push(types[%i].decode(r,r.uint32()))', ref, i);
      } else {
        gen('%s.push(r.%s())', ref, type);
      }
      // Non-repeated
    } else if (types.basic[type] === undefined) {
      gen(field.resolvedType.group ? '%s=types[%i].decode(r)' : '%s=types[%i].decode(r,r.uint32())', ref, i);
    } else {
      gen('%s=r.%s()', ref, type);
    }
    gen('break');
    // Unknown fields
  }
  gen('default:')('r.skipType(t&7)')('break')('}')('}');

  // Field presence
  for (let i = 0; i < mtype._fieldsArray.length; ++i) {
    const rfield = mtype._fieldsArray[i];
    if (rfield.required) {
      gen('if(!m.hasOwnProperty(%j))', rfield.name)('throw util.ProtocolError(%j,{instance:m})', missing(rfield));
    }
  }

  return gen('return m');
}
993028
public function handle()
    {
        $topicName = trim($this->argument('topic'));

        $prefix = trim($this->option('prefix'));
        $max = trim($this->option('max'));
        $next = trim($this->option('next'));

        /**
         * @var Client
         */
        $client = $this->mns;
        if (!$client) {
            $this->error('请先配置阿里云MSN服务，并在DI里面注册');

            return;
        }

        try {
            $data = [];
            $topic = $client->getTopicRef($topicName);
            $res = $topic->listSubscription($max, $prefix, $next);
            if ($res->isSucceed()) {
                foreach ($res->getSubscriptionNames() as $subscriptionName) {
                    $subscription['name'] = $subscriptionName;

                    $attr = $topic->getSubscriptionAttribute($subscriptionName)->getSubscriptionAttributes();

                    $subscription['endpoint'] = $attr->getEndpoint();
                    $subscription['filterTag'] = $attr->getFilterTag();
                    $subscription['strategy'] = $attr->getStrategy();
                    $subscription['contentFormat'] = $attr->getContentFormat();
                    $subscription['createTime'] = date('Y-m-d H:i:s', $attr->getCreateTime());
                    $subscription['updateTime'] = date('Y-m-d H:i:s', $attr->getLastModifyTime());
                    $data[] = $subscription;
                }
            }


            $subscriptionHeaders = ['Name', 'Endpoint', 'FilterTag', 'Strategy', 'ContentFormat', 'CreateTime', 'UpdateTime'];
            $this->line("List of Subscriptions for Topic: $topicName");
            $this->table($subscriptionHeaders, $data);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
    }
1104765
function (unloadedMods, errorList, stack, cache, ret) {
            var i, m, mod, modStatus,
                stackDepth,
                self = this;

            if ('@DEBUG@') {
                stack = stack || [];
            }
            ret = ret || [];
            // 提高性能，不用每个模块都再次全部依赖计算
            // 做个缓存，每个模块对应的待动态加载模块
            cache = cache || {};

            for (i = 0; i < unloadedMods.length; i++) {
                mod = unloadedMods[i];
                m = mod.name;

                if (cache[m]) {
                    continue;
                }

                if ('@DEBUG@') {
                    stackDepth = stack.length;
                }

                modStatus = mod.status;
                if (modStatus === ERROR) {
                    errorList.push(mod);
                    cache[m] = 1;
                    continue;
                }
                if (modStatus > LOADED) {
                    cache[m] = 1;
                    continue;
                } else if (modStatus !== LOADED && !mod.contains(self)) {
                    if (modStatus !== LOADING) {
                        mod.status = LOADING;
                        ret.push(mod);
                    }
                    mod.add(self);
                    self.wait(mod);
                }

                if ('@DEBUG@') {
                    // do not use indexOf, poor performance in ie8
                    if (stack[m]) {
                        S.log('find cyclic dependency between mods: ' + stack, 'warn');
                        cache[m] = 1;
                        continue;
                    } else {
                        stack[m] = 1;
                        stack.push(m);
                    }
                }

                self.calculate(mod.getNormalizedRequiredModules(), errorList, stack, cache, ret);
                cache[m] = 1;
                if ('@DEBUG@') {
                    for (var si = stackDepth; si < stack.length; si++) {
                        stack[stack[si]] = 0;
                    }
                    stack.length = stackDepth;
                }
            }

            return ret;
        }
819614
function() {
                // 获取现有颜色映射
                //     resource => color_index
                var colorMapping = this._getResourceColorIndexMapping();

                var resource, used, i;

                used = [];

                // 抽取已经使用的值到 used 数组
                for (resource in colorMapping) {
                    if (Object.prototype.hasOwnProperty.call(colorMapping, resource)) {
                        used.push(colorMapping[resource]);
                    }
                }

                // 枚举所有的可用值，如果还没被使用，返回
                for (i = 0; i < RESOURCE_COLOR_SERIES.length; i++) {
                    if (!~used.indexOf(i)) return i;
                }

                // 没有可用的颜色了
                return -1;
            }
233410
private static function init()
    {
        // 跳过初始化的工具
        foreach(Config::get('@Imi.skipInitTools') as $tool)
        {
            if(static::$toolName === $tool[0] && static::$toolOperation === $tool[1])
            {
                return;
            }
        }

        // 仅初始化项目及组件
        $initMains = [Helper::getMain(App::getNamespace())];
        foreach(Helper::getAppMains() as $mainName => $main)
        {
            foreach($main->getConfig()['components'] ?? [] as $componentName => $namespace)
            {
                $componentMain = Helper::getMain($namespace);
                if(null !== $componentMain)
                {
                    $initMains[] = $componentMain;
                }
            }
        }
        Annotation::getInstance()->init($initMains);

        RequestContext::create();
        // 获取配置
        $pools = $caches = [];
        foreach(Helper::getMains() as $main)
        {
            $pools = array_merge($pools, $main->getConfig()['pools'] ?? []);
            $caches = array_merge($caches, $main->getConfig()['caches'] ?? []);
        }
        // 同步池子初始化
        foreach($pools as $name => $pool)
        {
            if(isset($pool['sync']))
            {
                $pool = $pool['sync'];
                PoolManager::addName($name, $pool['pool']['class'], new PoolConfig($pool['pool']['config']), $pool['resource']);
            }
        }
        // 缓存初始化
        foreach($caches as $name => $cache)
        {
            CacheManager::addName($name, $cache['handlerClass'], $cache['option']);
        }
    }
17331
public function help()
    {
        //获取显示模板
        $tpl = \Grace\Base\Help::getplframe();

        //oblist
        $objectList = $this->objectList();

        $chr = $title = $_GET['chr'];

        //计算左侧菜单
        //<li  class="active"><a href="/index.php?book=01-grace&lm=controller&ar=controller.md"> Controller </a></li>
        $nav = '';
        foreach ($objectList as $key => $value) {
            if ($key == $chr) {
                $nav .= "<li  class=\"active\"><a href=\"?chr=$key\"> $key </a></li>";
            } else {
                $nav .= "<li><a href=\"?chr=$key\"> $key </a></li>";
            }
        }

        $nr = '';
        if ($objectList[$chr]) {
            //获取内容
            $file = $objectList[$chr];
            $nr = (new \Parsedown())->text(file_get_contents(__DIR__ . '/' . $file));

        } else {
            $nr = '';
        }

        $html = str_replace('##nav##', $nav, $tpl);
        $html = str_replace('##nr##', $nr, $html);
        $html = str_replace('##title##', $title, $html);
        echo $html;
        exit;
    }
391811
function () {
            var me = this, range;
            if (me.body.contentEditable == 'false') {
                me.body.contentEditable = true;
                range = me.selection.getRange();
                //有可能内容丢失了
                try {
                    range.moveToBookmark(me.lastBk);
                    delete me.lastBk
                } catch (e) {
                    range.setStartAtFirst(me.body).collapse(true)
                }
                range.select(true);
                if (me.bkqueryCommandState) {
                    me.queryCommandState = me.bkqueryCommandState;
                    delete me.bkqueryCommandState;
                }
                if (me.bkqueryCommandValue) {
                    me.queryCommandValue = me.bkqueryCommandValue;
                    delete me.bkqueryCommandValue;
                }
                me.fireEvent('selectionchange');
            }
        }
525767
function() {
		var t = this;

		var loading = document.createElement('div');
		loading.className = 'dec_loading';
		loading.style.display = 'none';
		t.container.appendChild(loading);

		var error = document.createElement('div');
		error.className = 'dec_error';
		error.style.display = 'none';
		error.innerHTML = '播放异常';
		t.container.appendChild(error);

		var bigPlay = document.createElement('div');

		if (!zyMedia.features.isVendorBigPlay) {
			bigPlay.className = 'dec_play';
			t.container.appendChild(bigPlay);
			bigPlay.addEventListener('click', function() {
				// For some device trigger 'play' event 
				t.media.isUserClick = true;

				t.media.play();
				// Controls bar auto hide after 3s
				if (!t.media.paused && !t.options.alwaysShowControls) {
					t.setControlsTimer(3000)
				}
			});
		}

		t.media.addEventListener('play', function() {
			// Only for user click
			if (t.media.isUserClick) {
				bigPlay.style.display = 'none';
				loading.style.display = '';
				t.buffering.style.display = 'none'
			}
		});

		t.media.addEventListener('playing', function() {
			bigPlay.style.display = 'none';
			loading.style.display = 'none';
			t.buffering.style.display = 'none';
			error.style.display = 'none';
		});

		t.media.addEventListener('seeking', function() {
			loading.style.display = '';
			bigPlay.style.display = 'none';
			t.buffering.style.display = '';
		});

		t.media.addEventListener('seeked', function() {
			loading.style.display = 'none';
			t.buffering.style.display = 'none';
		});

		t.media.addEventListener('pause', function() {
			bigPlay.style.display = ''
		});

		t.media.addEventListener('waiting', function() {
			loading.style.display = '';
			bigPlay.style.display = 'none';
			t.buffering.style.display = '';
		});

		// Don't listen to 'loadeddata' and 'canplay', 
		// some Android device can't fire 'canplay' or irregular working when use 'createEvent' to trigger 'canplay' (读者i800)

		// Error handling
		t.media.addEventListener('error', function(e) {
			loading.style.display = 'none';
			bigPlay.style.display = '';
			t.buffering.style.display = 'none';
			t.media.pause();
			error.style.display = '';

			if (typeof t.options.error == 'function') {
				t.options.error(e);
			}
		});
	}
481680
function (modNames, cache, ret) {
            var i,
                m,
                mod,
                modStatus,
                self = this,
                waitingModules = self.waitingModules,
                runtime = self.runtime;

            ret = ret || {};
            // 提高性能，不用每个模块都再次全部依赖计算
            // 做个缓存，每个模块对应的待动态加载模块
            cache = cache || {};

            for (i = 0; i < modNames.length; i++) {
                m = modNames[i];
                if (cache[m]) {
                    continue;
                }
                cache[m] = 1;
                mod = Utils.createModuleInfo(runtime, m);
                modStatus = mod.status;
                if (modStatus === ERROR || modStatus === ATTACHED) {
                    continue;
                }
                if (modStatus != LOADED) {
                    if (!waitingModules.contains(m)) {
                        if (modStatus != LOADING) {
                            mod.status = LOADING;
                            ret[m] = 1;
                        }
                        mod.wait(function (mod) {
                            waitingModules.remove(mod.getName());
                            // notify current loader instance
                            waitingModules.notifyAll();
                        });
                        waitingModules.add(m);
                    }
                }
                self.calculate(mod.getNormalizedRequires(), cache, ret);
            }

            return ret;
        }
711146
function(_dest, _src){
                var _nodeName, _attr;

                if (_dest.nodeType !== 1) {
                    return;
                }
                // lt ie9 才有
                if (_dest.clearAttributes) {
                    _dest.clearAttributes();
                    _dest.mergeAttributes(_src);
                }
                // 判断是否有需要处理属性的节点
                _nodeName = _dest.nodeName.toLowerCase();
                if(_prop = _definitions.fixProps[_nodeName]){
                    _dest[_prop] = _src[_prop];
                }
                //移除节点标示
                _dest.removeAttribute($._$signal);
                // 移除ID:  TODO? 是否允许有重复ID?
                _dest.removeAttribute("id");
            }
724842
static public function init() {
        // 加载动态应用公共文件和配置
        load_ext_file(COMMON_PATH);

        // 日志目录转换为绝对路径 默认情况下存储到公共模块下面
        C('LOG_PATH',   realpath(LOG_PATH).'/Common/');

        // 定义当前请求的系统常量
        define('NOW_TIME',      $_SERVER['REQUEST_TIME']);
        define('REQUEST_METHOD',$_SERVER['REQUEST_METHOD']);
        define('IS_GET',        REQUEST_METHOD =='GET' ? true : false);
        define('IS_POST',       REQUEST_METHOD =='POST' ? true : false);
        define('IS_PUT',        REQUEST_METHOD =='PUT' ? true : false);
        define('IS_DELETE',     REQUEST_METHOD =='DELETE' ? true : false);

        // URL调度
        Dispatcher:: ();

        if(C('REQUEST_VARS_FILTER')){
			// 全局安全过滤
			array_walk_recursive($_GET,		'think_filter');
			array_walk_recursive($_POST,	'think_filter');
			array_walk_recursive($_REQUEST,	'think_filter');
		}

        // URL调度结束标签
        Hook::listen('url_dispatch');

        define('IS_AJAX',       ((isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') || !empty($_POST[C('VAR_AJAX_SUBMIT')]) || !empty($_GET[C('VAR_AJAX_SUBMIT')])) ? true : false);

        // TMPL_EXCEPTION_FILE 改为绝对地址
        C('TMPL_EXCEPTION_FILE',realpath(C('TMPL_EXCEPTION_FILE')));
        return ;
    }
1038544
public function init()
    {
        // 缓存实例代码是否设置
        if (!empty($this->cacheInstanceString)) {
            $cache = str_eval($this->cacheInstanceString);
            if (isset($cache) && $cache instanceof Store) {
                $this->cache = $cache;
            }
        }

        // urlRule 预处理
        if (null === $this->cache) {
            $this->_rules = $this->parseUrlRule();
        } else if (null !== ($rules = $this->cache->get(self::CACHE_KEY))) {
            $this->_rules = $rules;
        } else {
            $this->_rules = $this->parseUrlRule();
            $this->cache->set(self::CACHE_KEY, $this->_rules);
        }
    }
504873
function Context(ret) {
    this.ret = ret;

    // 初始化文件列表
    var fileMap = this.filePathMap = ret.src;

    // 初始化资源映射表
    var fileIdMap = this.fileIdMap = {};
    var fileUrlMap = this.fileUrlMap = {};
    var files = this.files = [];
    Object.keys(fileMap).forEach(function (subpath) {
        var file = fileMap[subpath];
        files.push(file);
        fileIdMap[file.id] = file;
        if (file.release) {
            fileUrlMap[file.getUrl()] = file;
        }
    });
    this.resIdMap = {};
    this.root = fis.project.getProjectPath();
    this.requireConfig = getAmdConfig();
    this.moduleConfig = amdHelper.initModuleConfig(this.requireConfig, this.root);
    this.toPackItems = [];
}
1249164
public static function init()
    {
        // 如果没设置$pidFile，则生成默认值
        if (empty(self::$pidFile))
        {
            $backtrace = debug_backtrace();
            self::$_startFile = $backtrace[count($backtrace) - 1]['file'];
            self::$pidFile = sys_get_temp_dir() . "/workerman." . str_replace('/', '_', self::$_startFile) . ".pid";
        }
        // 没有设置日志文件，则生成一个默认值
        if (empty(self::$logFile))
        {
            self::$logFile = __DIR__ . '/../server.log';
        }
        // 标记状态为启动中
        self::$_status = self::STATUS_STARTING;

        // 启动时间戳
        self::$_globalStatistics['start_timestamp'] = time();
        Base::getLog()->debug(__METHOD__ . ' worker start timestamp', [
            'time' => self::$_globalStatistics['start_timestamp'],
        ]);

        // 设置status文件位置
        self::$statusFile = sys_get_temp_dir() . '/workerman.status';
        Base::getLog()->debug(__METHOD__ . ' set status file', [
            'file' => self::$statusFile,
        ]);

        // 尝试设置进程名称（需要php>=5.5或者安装了proctitle扩展）
        self::setProcessTitle('WorkerMan: master process  start_file=' . self::$_startFile);

        // 初始化ID
        self::initId();

        // 初始化定时器
        Timer::init();
    }
345784
function resolve(...args) {
    let path = '.',
        idx = 0;

    // 过滤元效参数
    path = args.reduce((str, curr) => {

        // 过滤非法参数
        if (!curr || typeof curr !== 'string') {
            return str;
        }

        // 返回绝对路径
        if (curr[0] === '/') {
            return curr;
        }

        // 返回连接后的路径
        return str + '/' + curr;
    }, path);

    // 解析路径层级
    path = path.split('/').reduce((arr, curr) => {

        if (curr === '.' || !curr) {
            return arr;
        }

        if (curr === '..') {
            idx > 0 && arr.pop();
            idx --;
        } else {
            idx >= 0 && arr.push(curr);
            idx ++;
        }

        return arr;
    }, []).join('/');

    // 返回结果
    return path[0] === '/' ? path : '/' + path;
}
1174983
function AccountPermissions() {
	this.admin = new Admin();
	//this.group = new Group();
	this.user = new User();
	//管理者密碼錯誤次數
	this.iPassErrorCount = 0;
	//強制管理者修改密碼
	this.bRevise = false;
	//AccountData[] 線上用戶列表
	//this.connIdList = {};
	//AccountData[] 線上用戶列表
	this.strUUIDList = {};
	//AccountData[] 線上用戶列表
	this.strUserList = {};
}