キャッシュを消去する。
@return boolean キャッシュ消去の成否。
970299
public function clear(){
		$result = false;
		$path_json = $this->exdb->conf()->path_cache_dir.'/table_definition.json';
		if(is_file($path_json)){
			unlink($path_json);
		}
		$result = !is_file($path_json);
		return $result;
	}
212801
public static function isAjax()
    {
        $request = Yii::$app->request;
        return (bool) $request->get(self::QUEYR_PARAM_AJAX, $request->getIsAjax());
    }
350353
public function verify()
    {
        if(strtoupper($this->vitex->env->method()) == 'POST' ||
            strtoupper($this->vitex->env->method()) == 'PUT'
        ) {
            $token = $this->vitex->req->body->_token;
            if(!$token){
                $token = $this->vitex->env->get('HTTP_X_CSRF_TOKEN');
            }
            $cookieToken = $this->vitex->req->cookies->csrf_token;
            $pathinfo = $this->vitex->env->getPathinfo();
            $except = $this->vitex->getConfig('csrf.except');
            if($token != $cookieToken){
                /*
                 * 一个符合排除的链接就排除
                 */
                foreach($except as $pattern){
                    if($this->vitex->route->router->checkUrlMatch($pattern,$pathinfo)){
                        return true;
                    }
                }

                //验证失败出错
                $callback = $this->vitex->getConfig('csrf.onmismatch');
                if($callback){
                    call_user_func_array($callback,[$token,$cookieToken]);
                    exit;
                } else {
                    throw new TokenMismatchException("CSRF TOKEN验证失败",Exception::CODE_PARAM_VALUE_ERROR);
                }
            }
        }
        return true;
    }
54459
public function hasAlpha(): bool
    {
        return $this->bands === 2 ||
            ($this->bands === 4 &&
                $this->interpretation !== Interpretation::CMYK) ||
            $this->bands > 4;
    }
1325296
public static function isAjax()
    {
        $returnValue = (bool) false;

		if(isset($_SERVER['HTTP_X_REQUESTED_WITH'])){
			if(strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){
				$returnValue = true;
			}
		}
                
        return (bool) $returnValue;
    }
942723
public function cliMode(): bool
    {
        if (!isset($this->cache[self::CLI_MODE])) {
            $this->cache[self::CLI_MODE] = php_sapi_name() === 'cli';
        }

        return $this->cache[self::CLI_MODE];
    }
814845
public function isAjax()
    {
        if (isset($this->_isAjax)) {
            return $this->_isAjax;
        }
        return $this->_isAjax = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest';
    }
765300
public static function checkToken()
    {
        $token = Input::postString('CML_TOKEN');
        if (empty($token)) return false;
        if ($token !== self::getToken()) return false;
        unset($_COOKIE['CML_TOKEN']);
        return true;
    }
579623
public function nextTokenIsAdjacent() : bool
    {
        return $this->token === null
            || ($this->lookahead !== null
                && ($this->lookahead['position'] - $this->token['position']) === strlen($this->token['value']));
    }
1234375
public function isSakai() {
        $ext_lms = $this->ltiRawParameter('ext_lms', false);
        $ext_lms = strtolower($ext_lms);
        return strpos($ext_lms, 'sakai') === 0 ;
    }
1090431
public static function checkBrowserNokia()
    {
        if (preg_match("/Nokia([^\/]+)\/([^ SP]+)/i", self::$userAgentString, $matches)) {
            self::$browser->setVersion($matches[2]);
            if (stripos(self::$userAgentString, 'Series60') !== false ||
                strpos(self::$userAgentString, 'S60') !== false
            ) {
                self::$browser->setName(Browser::NOKIA_S60);
            } else {
                self::$browser->setName(Browser::NOKIA);
            }

            return true;
        }

        return false;
    }
1138241
public function isAjax()
    {
        if ($this->isXmlHttpRequest()) {
            return true;
        }
        if ($this->getParam('ajax') || $this->getParam('isAjax')) {
            return true;
        }
        return false;
    }
806001
protected function isValid()
    {
        if (!$this->request->ajax()) {
            return false;
        }
        $search = $this->request->input('search');
        if (!is_string($search) or strlen($this->request->input('search')) <= 0) {
            return false;
        }
        $token = $this->request->header('search-protection');
        if (!$this->validateToken($token)) {
            return false;
        }
        return true;
    }
1195963
public function isValid() {
		$this->apiTokens = $this->_loadApiTokens ();
		$key = $this->_getHeaderToken ();
		if ($this->apiTokens->isExpired ( $key )) {
			return false;
		} else {
			$this->_addHeaderToken ( $key );
			return true;
		}
	}
58423
public function isAjax() {
        return (isset($this->http->xRequestedWith) && $this->http->xRequestedWith = 'XMLHttpRequest' ||
                isset($this->http->requestedWith) && $this->http->requestedWith = 'XMLHttpRequest');
    }
1096789
protected function doIt()
    {

        $request = Craft::$app->getRequest();

        if ($request->getIsAjax()) {

            if (!$request->getIsPost()) {
                return false;
            }

            $segments = $request->segments;
            $actionSegment = $segments[count($segments) - 1];

            if ($actionSegment !== 'get-editor-html') {
                return false;
            }

            Craft::$app->getView()->registerJs('Craft.CpFieldInspectPlugin.initElementEditor();');

        } else {

            $data = array(
                'redirectUrl' => Craft::$app->getSecurity()->hashData(implode('/', $request->segments)),
                'fields' => array(),
                'entryTypeIds' => array(),
                'baseEditFieldUrl' => rtrim(UrlHelper::cpUrl('settings/fields/edit'), '/'),
                'baseEditEntryTypeUrl' => rtrim(UrlHelper::cpUrl('settings/sections/sectionId/entrytypes'), '/'),
                'baseEditGlobalSetUrl' => rtrim(UrlHelper::cpUrl('settings/globals'), '/'),
                'baseEditCategoryGroupUrl' => rtrim(UrlHelper::cpUrl('settings/categories'), '/'),
                'baseEditCommerceProductTypeUrl' => rtrim(UrlHelper::cpUrl('commerce/settings/producttypes'), '/'),
            );

            $sectionIds = Craft::$app->getSections()->getAllSectionIds();
            foreach ($sectionIds as $sectionId)
            {
                $entryTypes = Craft::$app->getSections()->getEntryTypesBySectionId($sectionId);
                $data['entryTypeIds']['' . $sectionId] = array();
                foreach ($entryTypes as $entryType)
                {
                    $data['entryTypeIds']['' . $sectionId][] = $entryType->id;
                }
            }


            $fields = Craft::$app->getFields()->getAllFields();

            foreach ($fields as $field)
            {

                $data['fields'][$field->handle] = array(
                    'id' => $field->id,
                    'handle' => $field->handle,
                );
            }

            Craft::$app->getView()->registerAssetBundle(CpFieldInspectBundle::class);
            Craft::$app->getView()->registerJs('Craft.CpFieldInspectPlugin.init('.json_encode($data).');');
        }
    }
226328
public function getToken()
    {
        // 加锁防止重复生成token
        $lockKey = 'wechat:getToken:' . $this->getAppId();
        if (!$this->cache->add($lockKey, 1, $this->http->getOption('timeout') / 1000)) {
            return false;
        }

        $http = $this->http([
            'url' => $this->baseUrl . 'cgi-bin/token?grant_type=client_credential',
            'dataType' => 'json',
            'throwException' => false,
            'data' => [
                'appid' => $this->getAppId(),
                'secret' => $this->getAppSecret(),
            ],
        ]);

        $this->cache->remove($lockKey);
        if ($this->isError($http)) {
            return $this->prepareError($http);
        } else {
            return $http;
        }
    }