验证签名
@return array|bool
13833
public function check_notify(){
        /*获取xml*/
        $xml=file_get_contents('php://input', 'r');
        /*转成php数组*/
        $data=$this->to_array($xml);
        /*保存原sign*/
        $data_sign=$data['sign'];
        /*sign不参与签名*/
        unset($data['sign']);
        $sign=$this->make_sign($data);

        /*判断签名是否正确  判断支付状态*/
        if ($sign===$data_sign && $data['return_code']=='SUCCESS' && $data['result_code']=='SUCCESS') {
            $result=$data;
        }else{
            $result=false;
        }
        // 返回状态给微信服务器,该动作转由外部控制
        /*if ($result) {
            $str='<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>';
        }else{
            $str='<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA[签名失败]]></return_msg></xml>';
        }
        echo $str;*/
        return $result;
    }
1103450
public function nameExists()
    {
        $name = (string) $this->getRequiredParameter('name');
        if (empty($name))
            return false;

        return array_key_exists($name, $this->_imageNames);
    }
804367
public function languageName()
    {
        /** @var eZContentLanguage $language */
        $language = eZContentLanguage::fetchByLocale( $this->attribute( 'locale' ) );

        if ( $language instanceof eZContentLanguage )
            return array( 'locale' => $language->attribute( 'locale' ), 'name' => $language->attribute( 'name' ) );

        return false;
    }
472150
public static function isSuperUser()
    {
        $authInfo = self::getLoginInfo();
        if (!$authInfo) {//登录超时
            return false;
        }
        $admin = Config::get('administratorid');
        return is_array($admin) ? in_array($authInfo['id'], $admin) : ($authInfo['id'] === $admin);
    }
791442
public function actionCheckname(){
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['checkname']);
        }
        $model = new BizRule(null);
        $mo =$model->find(Yii::$app->request->post()['BizRule']['name']);
        if($mo==null){
            return ['message'=>true];
        }else{
            return ['message'=>false];
        }

    }
950484
public function getNames()
    {
        $enums = [];

        foreach (static::toArray() as $name => $value) {
            if ($this->has($value)) {
                $enums[] = $name;
            }
        }

        return $enums;
    }
180097
public function getName()
    {
        if (empty($this->_name)) {
            $this->_name = $this->getInfo()->getName();
        }

        return $this->_name;
    }
982637
public function getName(): string
	{
		if( !$this->name )
		{
			$name = $this->getModule()->getKey();
			if( preg_match('/Controllers\\\\(.*?)$/', static::class, $e ) )
			{
				$name .= '::' . preg_replace_callback( '/[A-Z]/', static function( $m ) { return '_' . lcfirst( $m[0] ); }, lcfirst( $e[1] ) );
				$name  = str_replace( '\\', ':', $name );
			}
			$this->name = strtolower( $name );
		}

		return $this->name;
	}
216221
public function getName()
    {
        $name = '';

        switch ($this->_clientId)
        {
            case Bootstrapper::SITE:
                $name = 'site';
                break;
            case Bootstrapper::ADMIN:
                $name = 'administrator';
                break;
            default:
                $name = 'cli';
                break;
        }

        return $name;
    }
1351020
public function rules()
    {
        return [
            ['username', 'required', '帐号不能为空', Validate::MUST_VALIDATE],
            ['password', 'required', '密码不能为空', Validate::EXISTS_VALIDATE],
            ['code', 'captcha', '验证码输入错误', Validate::EXISTS_VALIDATE],
        ];
    }
598436
protected function getHostname()
    {
        $disabled = explode(',', ini_get('disable_functions'));

        if (function_exists('php_uname') && !in_array('php_uname', $disabled, true)) {
            return ['hostname' => php_uname('n')];
        }

        if (function_exists('gethostname') && !in_array('gethostname', $disabled, true)) {
            return ['hostname' => gethostname()];
        }

        return [];
    }
228917
public function detectControllerName()
    {
        $pattern = '#/'.$this->controllerNameRegex().'#i';
        if (!preg_match($pattern, $this->path, $matches)) {
            return false;
        }

        return $matches[1];
    }
483702
public function getPlugin()
    {
        if (!$this->plugin) {
            $classes = array_reverse($this->getControllerClasses($this->controller));
            foreach ($classes as $class) {
                // 认为第二部分是插件名称
                list(, $plugin) = explode('\\', $class, 3);
                $this->plugin = $this->str->dash($plugin);

                break;
            }
        }

        return $this->plugin;
    }
862011
public function inputName()
    {
        if ($this->inputName) {
            $name = $this->inputName;
        } else {
            $name = $this->propertyIdent();
        }

        if ($this->p()->l10n()) {
            $name .= '['.$this->lang().']';
        }

        if ($this->multiple()) {
            $name .= '[]';
        }

        return $name;
    }
505926
protected function fields()
    {
        return [
            $this->newField('name', 'string')->label('内部编号')
                ->inList()->required()->factory($this->faker->unique()),
            $this->newField('value', 'json')->label('取值')
                ->inList()->defaultValue('""')->required()
                ->factory($this->faker->realText()),
            $this->newField('type', 'string')->label('类型')
                ->inList()->defaultValue('system')
                ->validations('in:system,settable')
                ->factory($this->faker->randomElement(['system', 'settable'])),
            $this->newField('settable_id', 'integer')->label('可配置对象ID')
                ->nullable(),
            $this->newField('settable_type', 'string')->label('可配置对象类型')
                ->nullable()
        ];
    }
1346156
public function getNames()
    {
        $cacheId   = 'SearchEngine.getSearchEngineNames';
        $cache     = Cache::getTransientCache();
        $nameToUrl = $cache->fetch($cacheId);

        if (empty($nameToUrl)) {
            $searchEngines = $this->getDefinitions();

            $nameToUrl = array();
            foreach ($searchEngines as $url => $info) {
                if (!isset($nameToUrl[$info['name']])) {
                    $nameToUrl[$info['name']] = $url;
                }
            }
            $cache->save($cacheId, $nameToUrl);
        }

        return $nameToUrl;
    }
442869
public function verify()
    {
        $data = file_get_contents("php://input");
        $data = Xml::xmlToArr($data);
        if ($data['sign'] != Helper::signature($data, Datasheet::get('md5_key'))) {
            throw new \Exception('微信异步通信签名验证失败');
        }
        return $data;
    }