****************************************
创建样式列表
****************************************
964511
function classList(args, add) {
    args.forEach(argv => {
        if (argv) {
            var type = typeof argv;

            // 处理字符串
            if (type === 'string') {
                return argv.split(' ').forEach(add);
            }

            // 处理列表
            if (Array.isArray(argv)) {
                return classList(argv, add);
            }

            // 处理对象
            if (type === 'object') {
                return Object.keys(argv).forEach(key => argv[key] && add(key));
            }

            // 处理函数
            if (type === 'function') {
                return classList([argv()], add);
            }
        }
    });
}
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;
}
812269
static public function start() {
      // 注册AUTOLOAD方法
//      spl_autoload_register('Think\Think::autoload');
      // 设定错误和异常处理
    register_shutdown_function('Think\Think::fatalError');
    set_error_handler('Think\Think::appError');
    set_exception_handler('Think\Think::appException');
//
//      // 初始化文件存储方式
//
    Storage::connect(STORAGE_TYPE);
//
      $runtimefile  = RUNTIME_PATH.APP_MODE.'~runtime.php';
    if(!APP_DEBUG && Storage::has($runtimefile)){
      Storage::load($runtimefile);
    }else{
      if(Storage::has($runtimefile))
          Storage::unlink($runtimefile);
      $content =  '';
      // 读取应用模式
      $mode   =   include is_file(CONF_PATH.'core.php')?CONF_PATH.'core.php':MODE_PATH.APP_MODE.'.php';
      // 加载核心文件
      foreach ($mode['core'] as $file){
          if(is_file($file)) {
            include $file;
            if(!APP_DEBUG) $content   .= compile($file);
          }
      }

      // 加载应用模式配置文件
      foreach ($mode['config'] as $key=>$file){
          is_numeric($key)?C(load_config($file)):C($key,load_config($file));
      }

      // 读取当前应用模式对应的配置文件
      if('common' != APP_MODE && is_file(CONF_PATH.'config_'.APP_MODE.CONF_EXT))
          C(load_config(CONF_PATH.'config_'.APP_MODE.CONF_EXT));

      // 加载模式别名定义
      if(isset($mode['alias'])){
          self::addMap(is_array($mode['alias'])?$mode['alias']:include $mode['alias']);
      }

      // 加载应用别名定义文件
      if(is_file(CONF_PATH.'alias.php'))
          self::addMap(include CONF_PATH.'alias.php');

      // 加载模式行为定义
      if(isset($mode['tags'])) {
          Hook::import(is_array($mode['tags'])?$mode['tags']:include $mode['tags']);
      }

      // 加载应用行为定义
      if(is_file(CONF_PATH.'tags.php'))
          // 允许应用增加开发模式配置定义
          Hook::import(include CONF_PATH.'tags.php');

      // 加载框架底层语言包
      L(include THINK_PATH.'Lang/'.strtolower(C('DEFAULT_LANG')).'.php');

      if(!APP_DEBUG){
          $content  .=  "\nnamespace { Think\\Think::addMap(".var_export(self::$_map,true).");";
          $content  .=  "\nL(".var_export(L(),true).");\nC(".var_export(C(),true).');Think\Hook::import('.var_export(Hook::get(),true).');}';
          Storage::put($runtimefile,strip_whitespace('<?php '.$content));
      }else{
        // 调试模式加载系统默认的配置文件
        C(include THINK_PATH.'Conf/debug.php');
        // 读取应用调试配置文件
        if(is_file(CONF_PATH.'debug'.CONF_EXT))
            C(include CONF_PATH.'debug'.CONF_EXT);
      }
    }

      // 读取当前应用状态对应的配置文件
      if(APP_STATUS && is_file(CONF_PATH.APP_STATUS.CONF_EXT))
          C(include CONF_PATH.APP_STATUS.CONF_EXT);

      // 设置系统时区
      date_default_timezone_set(C('DEFAULT_TIMEZONE'));

      // 检查应用目录结构 如果不存在则自动创建
      if(C('CHECK_APP_DIR')) {
          $module     =   defined('BIND_MODULE') ? BIND_MODULE : C('DEFAULT_MODULE');
          if(!is_dir(APP_PATH.$module) || !is_dir(LOG_PATH)){
              // 检测应用目录结构
              Build::checkDir($module);
          }
      }
      // 记录加载文件时间
      G('loadTime');
      // 运行应用
      App::run();
    }
219430
function queryBat (queue, cb) {
  const res = []

  queue.forEach(item => {
    const { selector, single, fields, component } = item
    // selector 的容器节点
    /* eslint-disable */
    const container = (
      component !== null ?
        (Nerv.findDOMNode(component) || document) :
        document
    )
    /* eslint-enable */

    // 特殊处理 ---- 选自己
    let selectSelf = false
    if (container !== document) {
      const $nodeList = container.parentNode.querySelectorAll(selector)
      for (let i = 0, len = $nodeList.length; i < len; ++i) {
        if (container === $nodeList[i]) {
          selectSelf = true
          break
        }
      }
    }

    if (single) {
      const el = selectSelf === true ? container : container.querySelector(selector)
      res.push(filter(fields, el, selector))
    } else {
      const $children = container.querySelectorAll(selector)
      const children = []
      selectSelf === true && children.push(container)
      for (let i = 0, len = $children.length; i < len; ++i) {
        children.push($children[i])
      }
      res.push(children.map(dom => filter(fields, dom)))
    }
  })
  cb(res)
}
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());
        }
    }
486483
function() {
    var obj = {};
    var self = this;

    Object
      .keys(this)
      .forEach(function(key) {

        // 过滤掉私有属性。 _key
        // 但是不过滤 __key
        if (key !== 'cache' && key !== 'url' && !/^_[^_]/.test(key)) {
          obj[key] = self[key];
        }
      });

    return obj;
  }
75489
function callApi(params,key) {
  
  //如果没有设置URL,直接返回
  if(!params.api.url) {
     procRet(params,key);
     return;
  } 
  
  //缓存接口返回
  if (params.res.getCache && params.api.cache) {

    var cacheKey = params.res.genKey(params.domain, params.api.url, JSON.stringify(params.params));

    params.res.getCache(cacheKey, function(err, body) {
      if (!err && body) {
        debug(cacheKey + ' cached!');
        params.body = body;
        procRet(params,key);
      } else {
        callServer(params,key);
        debug(cacheKey + '  cache expired!');
      }
    });
  } else {
    callServer(params,key);
  }
}
407757
private function init()
    {
        $this->refClass = new \ReflectionClass($this->object);
        $className = $this->refClass->getParentClass()->getName();
        // 每个类只需处理一次
        if(!isset(static::$aspects[$className]))
        {
            static::$aspects[$className] = new \SplPriorityQueue;
            $aspects = AnnotationManager::getAnnotationPoints(Aspect::class);
            foreach($aspects as $item)
            {
                // 判断是否属于当前类方法的切面
                $pointCutsSet = AnnotationManager::getMethodsAnnotations($item['class'], PointCut::class);
                foreach($pointCutsSet as $methodName => $pointCuts)
                {
                    foreach($pointCuts as $pointCut)
                    {
                        switch($pointCut->type)
                        {
                            case PointCutType::METHOD:
                                foreach($pointCut->allow as $allowItem)
                                {
                                    if(Imi::checkClassRule($allowItem, $className))
                                    {
                                        static::$aspects[$className]->insert([
                                            'class'     =>  $item['class'],
                                            'method'    =>  $methodName,
                                            'pointCut'  =>  $pointCut,
                                        ], $item['annotation']->priority);
                                        break;
                                    }
                                }
                                break;
                            case PointCutType::ANNOTATION:
                                foreach($this->refClass->getMethods() as $method)
                                {
                                    $methodAnnotations = AnnotationManager::getMethodAnnotations($className, $method->getName());
                                    foreach($pointCut->allow as $allowItem)
                                    {
                                        foreach($methodAnnotations as $annotation)
                                        {
                                            if($annotation instanceof $allowItem)
                                            {
                                                static::$aspects[$className]->insert([
                                                    'class'     =>  $item['class'],
                                                    'method'    =>  $methodName,
                                                    'pointCut'  =>  $pointCut,
                                                ], $item['annotation']->priority);
                                                break 3;
                                            }
                                        }
                                    }
                                }
                                break;
                        }
                    }
                }
                // 判断是否属于当前类的切面
                $pointCuts = AnnotationManager::getMethodsAnnotations($item['class'], PointCut::class);
                foreach($pointCuts as $methodName => $pointCuts)
                {
                    foreach($pointCuts as $pointCut)
                    {
                        switch($pointCut->type)
                        {
                            case PointCutType::CONSTRUCT:
                                // 构造方法
                                foreach($pointCut->allow as $allowItem)
                                {
                                    if(Imi::checkRuleMatch($allowItem, $className))
                                    {
                                        static::$aspects[$className]->insert([
                                            'class'     =>  $item['class'],
                                            'method'    =>  $methodName,
                                            'pointCut'  =>  $pointCut,
                                        ], $item['annotation']->priority);
                                        break;
                                    }
                                }
                                break;
                            case PointCutType::ANNOTATION_CONSTRUCT:
                                // 注解构造方法
                                $classAnnotations = AnnotationManager::getClassAnnotations($className);
                                foreach($pointCut->allow as $allowItem)
                                {
                                    foreach($classAnnotations as $annotation)
                                    {
                                        if($annotation instanceof $allowItem)
                                        {
                                            static::$aspects[$className]->insert([
                                                'class'     =>  $item['class'],
                                                'method'    =>  $methodName,
                                                'pointCut'  =>  $pointCut,
                                            ], $item['annotation']->priority);
                                            break 2;
                                        }
                                    }
                                }
                                break;
                        }
                    }
                }
            }
        }
    }
424178
private function checkUser() {
        //事件监听守护进程的配置(跟事件及其监听器的配置是两码事)
        $config = $this->appContext->getConfig('eventListend') ?: [];
        $username = isset($config['user']) ? $config['user'] : 'nobody';
        $groupName = isset($config['group']) ? $config['group'] : 'nobody';

        $userInfo = posix_getpwnam($username);
        if (!$userInfo) {
            _throw("用户“{$username}”不存在，启动失败");
        }

        $groupInfo = posix_getgrnam($groupName);
        if (!$groupInfo) {
            _throw("用户组“{$groupName}”不存在，启动失败");
        }

        return [$userInfo, $groupInfo];
    }
122775
public function init()
    {

        parent::init();

        //注册资源文件
        $asset = UeditorAsset::register($this->getView());

        //设置UEditor实例的名字
        if (! $this->name) {
            $this->name = $this->hasModel() ? $this->model->formName() . '_' . $this->attribute : 'ueditor_' . $this->id;
        }

        //常用配置项
        if (empty($this->config['UEDITOR_HOME_URL'])) {
            $this->config['UEDITOR_HOME_URL'] = $asset->baseUrl . '/';
        }

        if (empty($this->config['serverUrl'])) {
            $this->config['serverUrl'] = Url::to(['/assets/ueditor']);
        } elseif (is_array($this->config['serverUrl'])) {
            $this->config['serverUrl'] = Url::to($this->config['serverUrl']);
        }

        if (empty($this->config['lang'])) {
            $this->config['lang'] = 'zh-cn';
        }

        if (empty($this->config['initialFrameHeight'])) {
            $this->config['initialFrameHeight'] = 400;
        }

        if (empty($this->config['initialFrameWidth'])) {
            $this->config['initialFrameWidth'] = '100%';
        }

        if (empty($this->config['enableAutoSave'])) {
            $this->config['enableAutoSave'] = false;
        }

        //扩展默认不直接引入config.js文件，因此需要自定义配置项.
        if (empty($this->config['toolbars'])) {
            //为了避免每次使用都输入乱七八糟的按钮，这里预先定义一些常用的编辑器按钮。
            //这是一个丑陋的二维数组
            $this->config['toolbars'] = [
                [
                    'fullscreen',
                    'source',
                    'undo',
                    'redo',
                    '|',
                    'customstyle',
                    'paragraph',
                    'fontfamily',
                    'fontsize'
                ],
                [
                    'bold',
                    'italic',
                    'underline',
                    'fontborder',
                    'strikethrough',
                    'superscript',
                    'subscript',
                    'removeformat',
                    'formatmatch',
                    'autotypeset',
                    'blockquote',
                    'pasteplain',
                    '|',
                    'forecolor',
                    'backcolor',
                    'insertorderedlist',
                    'insertunorderedlist',
                    '|',
                    'rowspacingtop',
                    'rowspacingbottom',
                    'lineheight',
                    '|',
                    'directionalityltr',
                    'directionalityrtl',
                    'indent',
                    '|'
                ],
                [
                    'justifyleft',
                    'justifycenter',
                    'justifyright',
                    'justifyjustify',
                    '|',
                    'link',
                    'unlink',
                    '|',
                    'insertimage',
                    'emotion',
                    'scrawl',
                    'insertvideo',
                    'music',
                    'attachment',
                    'map',
                    'insertcode',
                    'pagebreak',
                    '|',
                    'horizontal',
                    'inserttable',
                    '|',
                    'print',
                    'preview',
                    'searchreplace',
                    'help'
                ]
            ];
        }
    }
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();
    }
14469
function UserInfo() {
	//使用者帳號(索引用)
	this.strAccount = "";
	//電子信箱
	this.strEmail = "";
	//信箱通知勾選
	this.bEmailNotify = false;
	//電話資料
	this.strPhone = "";
	//簡訊通知勾選
	this.bSMSNotify = false;
	//使用者名稱(暱稱?)
	this.strUserName = "";
	//語系控制
	this.strLanguages = "";
	//系統保護
	this.bSystemAegis = false;
	//登入次數
	this.iLoginCount = 0;
	//登入時間
	this.iLogin = 0;
	//最後登出時間
	this.iLastLogout = 0;
}
107846
function matchState(model) {
    return function match(...args) {
        let url = model.pathname,
            path = resolve(...args);

        // 完全匹配
        if (url === path) {
            return { url, path, matched: true, isExact: true };
        }

        // 部分匹配
        if (path === '/' || url.startsWith(path + '/')) {
            return { url, path, matched: true, isExact: false };
        }

        // 不匹配
        return { url, path, matched: false, isExact: false };
    };
}
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 ;
    }
192275
function () {
            var _this = this;

            /* 滚动拉取图片 */
            domUtils.on($G('imageList'), 'scroll', function(e){
                var panel = this;
                if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) {
                    _this.getImageData();
                }
            });
            /* 选中图片 */
            domUtils.on(this.container, 'click', function (e) {
                var target = e.target || e.srcElement,
                    li = target.parentNode,
                    nodes = $G('imageListUl').childNodes;

                if (li.tagName.toLowerCase() == 'li') {
                    updateFormState('nocolor', null, '');
                    for (var i = 0, node; node = nodes[i++];) {
                        if (node == li && !domUtils.hasClass(node, 'selected')) {
                            domUtils.addClass(node, 'selected');
                            updateFormState('colored', null, li.firstChild.getAttribute("_src"), 'repeat');
                        } else {
                            domUtils.removeClasses(node, 'selected');
                        }
                    }
                    updateBackground();
                }
            });
        }
1044028
function Module(id, deps, maker, root) {

        this.id = id;
        this.deps = deps; //必须是数组
        this.maker = maker;
        this.root = root || $;
        // _modulesMap[id] = 1;//定义之前
        // this.queue = new Queue();
        if(checkDeps(id)) {

            this.namespace();

        } else {

            this.init();
        }
    }
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');
            }
        }