获取分页链接
@param array $option
@return string
@throws \Exception
970578
public function getLink($option = array()) {
		$option['total'] = $this->_total;
		$option['pageSize'] = $this->_pageSize;
		$option['page'] = $this->_index;
		$option['key'] = $this->_key;
		return PageLink::show($option);
	}
780955
public function get_data_from_cache($option = null)
    {
        if (isset(self::$localCache[$this->get_cache_key($option)])) {
            return self::$localCache[$this->get_cache_key($option)];
        }

        throw new Exception('no value');
    }
1367720
public static function GetGroupValue($group, $option)
    {
        self::CheckBackend();

        return self::$backend->GetGroupValue($group, $option);
    }
1295193
public function Get($option)
    {
        if(isset($this->preferences[$option]))
        {
            return $this->preferences[$option];
        }

        return false;
    }
834118
public function getOption($option)
    {
        if (!empty($this->options->{$option})) {
            return $this->options->{$option};
        }

        return false;
    }
1104106
private function _parseOptions($options=null)
    {
        if (!$options) return [];
        
        // 如果配置为多组式配置，取出其中一组
        $item = current($options);
        if (!isset($options['adapter']) && is_array($item) && isset($item['username'])) {
            $item = ArrayHelper::getItemArray($options);
            $options = array_values($item)[0];
        }
        
        // first check if dsn
        if (isset($options['dsn'])) {
            $options = static::parseDsn($options['dsn']);
        }
        
        // type is alias of adapter
        if (isset($options['type'])) {
            $options['adapter'] = $options['type'];
        }
        if (isset($options['adapter'])) {
            $options['adapter'] = preg_replace('/[^A-Z0-9_\.-]/i', '', $options['adapter']);
            $options['adapter'] = StringHelper::toCamelCase($options['adapter']);
            if ($options['adapter'] == 'Mysqli') {
                $options['adapter'] = 'Mysql';
            }
        }
        
        // dbname is alias of database
        if (isset($options['dbname'])) {
            $options['database'] = $options['dbname'];
            unset($options['dbname']);
        }
        
        // check database
        if (isset($options['database'])) {
            $options['database'] = preg_replace('/[^A-Z0-9_\.-]/i', '', $options['database']);
        }
        
        return $options;
    }
104902
public function option($option) 
	{
		$option['fieldtype'] = isset($option['fieldtype']) ? $option['fieldtype'] : '';
		$option['fieldlength'] = isset($option['fieldlength']) ? $option['fieldlength'] : '';
		$option['uptips'] = isset($option['uptips']) ? $option['uptips'] : '';
		$option['fvalue'] = isset($option['fvalue']) ? $option['fvalue'] : '';
		$option['value'] = isset($option['value']) ? $option['value'] : '';
		$option['size'] = isset($option['size']) ? $option['size'] : '2048';
		$option['ext'] = isset($option['ext']) ? $option['ext'] : 'jpg,png,gif,jpeg';
		$option['upauto'] = isset($option['upauto']) ? $option['upauto'] : 1;
		$option['upbuttontext'] = isset($option['upbuttontext']) ? $option['upbuttontext'] : '选择图片';
		$option['upapp'] = isset($option['upapp']) ? $option['upapp'] : '';
		$option['multiNum'] = isset($option['multiNum']) ? $option['multiNum'] : 5;
		return '
			<div class="hstui-form-group hstui-form-group-sm">
	          <label class="hstui-u-sm-2 hstui-form-label">'.hst_lang('hstcms::fields.file.size').'</label>
	          <div class="hstui-u-sm-10 hstui-form-input">
	              <input type="text" name="setting[option][size]" value="'.$option['size'].'" class="hstui-input hstui-length-5">
	            <div class="hstui-form-input-tips" id="J_form_tips_size" data-tips="'.hst_lang('hstcms::fields.file.size.tips').'">'.hst_lang('hstcms::fields.file.size.tips').'</div>
	          </div>
	          </div>
			<div class="hstui-form-group hstui-form-group-sm">
	          <label class="hstui-u-sm-2 hstui-form-label">'.hst_lang('hstcms::fields.file.ext').'</label>
	          <div class="hstui-u-sm-10 hstui-form-input">
	              <input type="text" name="setting[option][ext]" value="'.$option['ext'].'" class="hstui-input hstui-length-5">
	            <div class="hstui-form-input-tips" id="J_form_tips_ext" data-tips="'.hst_lang('hstcms::fields.file.ext.tips').'">'.hst_lang('hstcms::fields.file.ext.tips').'</div>
	          </div>
	        </div> 
			<div class="hstui-form-group hstui-form-group-sm">
	          <label class="hstui-u-sm-2 hstui-form-label">'.hst_lang('hstcms::fields.file.multi.num').'</label>
	          <div class="hstui-u-sm-10 hstui-form-input">
	              <input type="text" name="setting[option][multiNum]" value="'.$option['multiNum'].'" class="hstui-input hstui-length-5">
	            <div class="hstui-form-input-tips" id="J_form_tips_multiNum" data-tips="'.hst_lang('hstcms::fields.file.multi.num.tips').'">'.hst_lang('hstcms::fields.file.multi.num.tips').'</div>
	          </div>
	        </div> 
			<div class="hstui-form-group hstui-form-group-sm">
	          <label class="hstui-u-sm-2 hstui-form-label">'.hst_lang('hstcms::fields.file.upbuttontext').'</label>
	          <div class="hstui-u-sm-10 hstui-form-input">
	              <input type="text" name="setting[option][upbuttontext]" value="'.$option['upbuttontext'].'" class="hstui-input hstui-length-5">
	            <div class="hstui-form-input-tips" id="J_form_tips_upbuttontext" data-tips="'.hst_lang('hstcms::fields.file.upbuttontext.tips').'">'.hst_lang('hstcms::fields.file.upbuttontext.tips').'</div>
	          </div>
	        </div> 
			<div class="hstui-form-group hstui-form-group-sm">
	          <label class="hstui-u-sm-2 hstui-form-label">'.hst_lang('hstcms::fields.file.upapp').'</label>
	          <div class="hstui-u-sm-10 hstui-form-input">
	              <input type="text" name="setting[option][upapp]" value="'.$option['upapp'].'" class="hstui-input hstui-length-5">
	            <div class="hstui-form-input-tips" id="J_form_tips_upapp" data-tips="'.hst_lang('hstcms::fields.file.upapp.tips').'">'.hst_lang('hstcms::fields.file.upapp.tips').'</div>
	          </div>
	        </div> 
			<div class="hstui-form-group hstui-form-group-sm">
	          <label class="hstui-u-sm-2 hstui-form-label">'.hst_lang('hstcms::fields.file.uptips').'</label>
	          <div class="hstui-u-sm-10 hstui-form-input">
	              <input type="text" name="setting[option][uptips]" value="'.$option['uptips'].'" class="hstui-input hstui-length-5">
	            <div class="hstui-form-input-tips" id="J_form_tips_uptips" data-tips="'.hst_lang('hstcms::fields.file.uptips.tips').'">'.hst_lang('hstcms::fields.file.uptips.tips').'</div>
	          </div>
	        </div> 
			<div class="hstui-form-group hstui-form-group-sm">
	          <label class="hstui-u-sm-2 hstui-form-label">'.hst_lang('hstcms::fields.file.auto.upload').'</label>
	          <div class="hstui-u-sm-10 hstui-form-input">
                <div class="hstui-mr-sm"><input type="radio" name="setting[option][upauto]" '.hst_ifCheck(!$option['upauto']).' value="0" />'.hst_lang('hstcms::public.no').'
                    <input type="radio" name="setting[option][upauto]" '.hst_ifCheck($option['upauto']).' value="1" />'.hst_lang('hstcms::public.yes').'</div>
	            <div class="hstui-form-input-tips" id="J_form_tips_upauto" data-tips="'.hst_lang('hstcms::fields.file.auto.upload.tips').'">'.hst_lang('hstcms::fields.file.auto.upload.tips').'</div>
	          </div>
	        </div>
                '.$this->field_type($option['fieldtype'], $option['fieldlength'], $option['fvalue']);
	}
1209800
public function get(string $option)
    {
        if (!isset($this->options[$option])) {
            throw new \InvalidArgumentException(sprintf('Option "%s" does not exists.', $option));
        }

        return $this->options[$option];
    }
1249516
public function getOption($option)
    {
        if (null !== $this->logger) {
            $this->logger->startMethod('getOption', ['option' => $option]);
        }

        if (!$this->assertOption($option)) {
            $this->stopMethod();

            return false;
        }

        $this->setResultOK();
        $this->stopMethod();

        return array_key_exists($option, $this->options) ? $this->options[$option] : false;
    }
219213
private function replaceTokens($option)
    {
        if (is_array($option)) {
            $tokenizedOptions = [];
            foreach ($option as $key => $opt) {
                $tokenizedOptions[$key] = $this->replaceTokens($opt);
            }

            return $tokenizedOptions;
        }

        return preg_replace_callback(
            '/\$(.+)\$|\$\{(.+)\}/',
            function ($match) {
                $val = isset($match[2]) ? getenv($match[2]) : getenv($match[1]);

                return $val !== false ? $val : $match[0];
            },
            $option
        );
    }
97559
protected function checkOption($option)
    {
        // 请求类型检测
        if (!empty($option['method'])) {
            if (is_string($option['method']) && false === stripos($option['method'], Request::getMethod())) {
                return false;
            }
        }

        // AJAX PJAX 请求检查
        foreach (['ajax', 'pjax', 'mobile'] as $item) {
            if (isset($option[$item])) {
                $call = 'is' . $item;
                if ($option[$item] && !$request->$call() || !$option[$item] && $request->$call()) {
                    return false;
                }
            }
        }

        // 伪静态后缀检测
        if (Request::getRequestUri() != '/' && ((isset($option['ext']) && false === stripos('|' . $option['ext'] . '|', '|' . Request::ext() . '|'))
                || (isset($option['deny_ext']) && false !== stripos('|' . $option['deny_ext'] . '|', '|' . Request::ext() . '|')))) {
            return false;
        }

        // 域名检查
        if ((isset($option['domain']) && !in_array($option['domain'], [$request->host(true), $request->subDomain()]))) {
            return false;
        }

        // HTTPS检查
        if ((isset($option['https']) && $option['https'] && !$request->isSsl())
            || (isset($option['https']) && !$option['https'] && $request->isSsl())) {
            return false;
        }

        // 请求参数检查
        if (isset($option['filter'])) {
            foreach ($option['filter'] as $name => $value) {
                if ($request->param($name, '', null) != $value) {
                    return false;
                }
            }
        }
        return true;
    }
996699
function getOption( $option )
    {
        if ( !in_array( $option, $this->Options ) )
        {
            throw new Exception( "Option $option not supported" );
        }

        switch( $option )
        {
            case 'timeout':
                return $this->Timeout;
            case 'login':
                return $this->Login;
            case 'password':
                return $this->Password;
            case 'authType':
                return $this->AuthType;
            case 'requestCompression':
                return $this->RequestCompression;
            case 'method':
                return $this->Verb;
            case 'acceptedCompression':
                return $this->AcceptedCompression;
            case 'proxyHost':
                return $this->Proxy;
            case 'proxyPort':
                return $this->ProxyPort;
            case 'proxyUser':
                return $this->ProxyLogin;
            case 'proxyPassword':
                return $this->ProxyPassword;
            case 'proxyAuthType':
                return $this->ProxyAuthType;
            case 'forceCURL':
                return $this->ForceCURL;
            case 'debug':
                return $this->Debug;
            case 'SSLVerifyHost':
                return $this->SSLVerifyHost;
            case 'SSLVerifyPeer':
                return $this->SSLVerifyPeer;
            case 'SSLCAInfo':
                return $this->SSLCAInfo;
        }
    }
893137
private function analysis($tagname, $option)
    {
        $mode = is_int($option) ? $option : $option['mode'];
        $flags = is_int($option) ? null : $option['flags'];

        if ($flags !== null) {
            $end = end($this->stack);
            if ($end !== false && ($flags & $end) == 0) {
                return null;
            }
        }
        $exp = Rules::getItem($tagname, 'rule');
        if ($exp == null) {
            return null;
        }
        switch ($mode) {
            //前面可有空格
            case 0:
                $this->maps[] = ['tag' => $tagname, 'mode' => $mode];
                return '^\\s*(' . $exp . ')';
            //无空格
            case 1:
                $this->maps[] = ['tag' => $tagname, 'mode' => $mode];
                return '^(' . $exp . ')';
            //必须有空格
            case 4:
                $this->maps[] = ['tag' => $tagname, 'mode' => $mode];
                return '^\\s+(' . $exp . ')';
            //只要找到
            case 2:
            case 3:
            case 5:
                $this->maps[] = ['tag' => $tagname, 'mode' => $mode];
                return '(' . $exp . ')';
            case 6:
                $this->maps[] = ['tag' => $tagname, 'mode' => $mode];
                return '^\\s*(' . $exp . ')(?!=)';
            default:
                return;
        }
    }
269583
public function option($option) 
	{
		$option['width'] = isset($option['width']) ? $option['width'] : 300;
		$option['height'] = isset($option['height']) ? $option['height'] : 100;
		$option['value'] = isset($option['value']) ? $option['value'] : '';
		$option['fvalue'] = isset($option['fvalue']) ? $option['fvalue'] : '';
		$option['fieldtype'] = isset($option['fieldtype']) ? $option['fieldtype'] : 'TEXT';
		$option['fieldlength'] = isset($option['fieldlength']) ? $option['fieldlength'] : '';
		return '
			<div class="hstui-form-group hstui-form-group-sm">
	          <label class="hstui-u-sm-2 hstui-form-label">'.hst_lang('hstcms::public.width').'</label>
	          <div class="hstui-u-sm-10 hstui-form-input">
	              <input type="text" name="setting[option][width]" value="'.$option['width'].'" class="hstui-input  hstui-length-5">
	            <div class="hstui-form-input-tips" id="J_form_tips_name" data-tips="'.hst_lang('hstcms::manage.fields.type.width.tips').'">'.hst_lang('hstcms::manage.fields.type.width.tips').'</div>
	          </div>
	        </div>
			<div class="hstui-form-group hstui-form-group-sm">
	          <label class="hstui-u-sm-2 hstui-form-label">'.hst_lang('hstcms::public.height').'</label>
	          <div class="hstui-u-sm-10 hstui-form-input">
	              <input type="text" name="setting[option][height]" value="'.$option['height'].'" class="hstui-input hstui-length-5">
	            <div class="hstui-form-input-tips" id="J_form_tips_name" data-tips="'.hst_lang('hstcms::fields.type.height.tips').'">'.hst_lang('hstcms::fields.type.height.tips').'</div>
	          </div>
	        </div>
                '.$this->get_default_value($option['value']).$this->field_type($option['fieldtype'], $option['fieldlength'], $option['fvalue']);
	}
1070716
public function optionsGrouped($options = []) {
		$result = $this->options($options);
		if (!empty($result)) {
			$converted = \Helper\Tree::convertByParent($result, 'parent_id');
			$result = [];
			\Helper\Tree::convertTreeToOptionsMulti($converted, 0, ['name_field' => 'name'], $result);
		}
		return $result;
	}
954683
private function getOptionNames(Option $option) : string
    {
        $optionNames = "--{$option->getName()}";

        if ($option->getShortName() !== null) {
            $optionNames .= "|-{$option->getShortName()}";
        }

        return $optionNames;
    }
122497
protected function formatArrayBasedOption($option, array $new)
    {
        $value = Arr::get($new, $option, []);

        return is_string($value) ? explode('|', $value) : $value;
    }