触发事件
@param string $name 事件名称
@param array $data 数据
@param mixed $target 目标对象
@param string $paramClass 参数类
@return void
506191
public function trigger($name, $data = [], $target = null, $paramClass = EventParam::class)
    {
        // ClassEventListener支持
        $callbacks = $this->getTriggerCallbacks($name);
        // 实例化参数
        $param = new $paramClass($name, $data, $target);
        $hasOne = false;
        foreach($callbacks as $callback)
        {
            // 事件配置
            if(isset($this->events[$name]))
            {
                $option = $this->events[$name]->offsetGet($callback);
            }
            // 回调类型处理，优先判断为类的情况
            $type = 'callback';
            if(is_string($callback) && class_exists($callback))
            {
                $type = 'class';
            }
            // 回调执行
            switch($type)
            {
                case 'callback':
                    call_user_func_array($callback, [$param]);
                    break;
                case 'class':
                    $obj = BeanFactory::newInstance($callback);
                    call_user_func_array([$obj, 'handle'], [$param]);
                    break;
            }
            // 仅触发一次
            if(isset($option['one']) && $option['one'])
            {
                $this->events[$name]->detach($callback);
                $hasOne = true;
            }
            // 阻止事件传播
            if($param->isPropagationStopped())
            {
                break;
            }
        }
        // 仅触发一次的处理
        if($hasOne)
        {
            $this->eventChangeRecords[$name] = true;
        }
    }
566258
public function on($type, $name, $callback)
    {
        $name = $type . '.' . $name;
        if (!isset($this->events[$name])) {
            $this->events[] = [];
        }

        $this->events[$name][] = $callback;
    }
199521
public function getNewActionEvent(string $name = null, $target = null, $params = null): ActionEvent
    {
        if ($name === null) {
            $name = 'action_event';
        }

        return new DefaultActionEvent($name, $target, $params);
    }
909478
private function _createObjectFromData($name, $data)
    {
        try {
            $cls = new $name();
            foreach ($data as $key => $value) {
                if ($name !== 'stdClass' && !array_key_exists(strtolower($key), get_object_vars($cls))) {
                    var_dump(get_object_vars($cls));
                    continue;
                }
                $key = strtolower($key);
                $cls->$key = $value;
            }
            return $cls;
        } catch (\Exception $e) {
            return null;
        }
    }
735152
private static function _object(&$data, $name)
	{
		?>
		<li class="krumo-child">

			<div <?php if (count($data) > 0) {?> onClick="krumo.toggle(this);"<?php } ?>
				class="krumo-element<?php echo count($data) > 0 ? ' krumo-expand' : '';?>" >

					<a class="krumo-name"><?php echo $name;?></a>
					(<em class="krumo-type">Object</em>)
					<strong class="krumo-class"><?php echo get_class($data);?></strong>
			</div>

			<?php if (count($data))
			{
				self::_vars($data);
			} ?>
		</li>
		<?php
	}
181320
public function event($name, $payload = null) {
		$this->log->log("EVENT: $name",  Net_XMPP_XMPPHP_Log::LEVEL_DEBUG);
		foreach($this->eventhandlers as $handler) {
			if($name == $handler[0]) {
				if($handler[2] === null) {
					$handler[2] = $this;
				}
				$handler[2]->$handler[1]($payload);
			}
		}
		foreach($this->until as $key => $until) {
			if(is_array($until)) {
				if(in_array($name, $until)) {
					$this->until_payload[$key][] = array($name, $payload);
					if(!isset($this->until_count[$key])) {
						$this->until_count[$key] = 0;
					}
					$this->until_count[$key] += 1;
					#$this->until[$key] = false;
				}
			}
		}
	}
357568
public function clickListElement(string $name): void
    {
        $this->context->getElementByText($name, $this->fields['listElement'])->click();
    }
1340725
public function parse(\Imi\Bean\Annotation\Base $annotation, string $className, string $target, string $targetName)
    {
        if($annotation instanceof \Imi\Bean\Annotation\Bean)
        {
            $beanName = $annotation->name ?? $className;
            $this->data[$className] = $this->data[$beanName] = [
                'beanName'      => $beanName,
                'className'     => $className,
                'instanceType'  => $annotation->instanceType,
            ];
        }
    }
1240394
public static function update($name,array $data, $expire = null) {
        return self::driver()->update($name,$data, $expire);
    }
1017001
public function trigger($event, $target = null, $argv = array()){
        if(!($event instanceof EventInterface)){
            $event = new Event($event, $target, $argv);
        }
        if(isset($this->listeners[$event->getName()])){
            $this->listeners[$event->getName()]->perform($event);
        }
    }
825911
protected function _fireEvent($name, $params) {
        if (is_null($this->_eventDispatcher)) {
            return;
        }
        $event = new Events\DbEvent($params);
        $this->_eventDispatcher->dispatch($name, $event);
    }
354739
public static function trigger(
        $class,
        string $name,
        self $event = null
    ): void {
        $wildcardEventHandlers = [];
        foreach (static::$_eventWildcards as
            $nameWildcard => $classHandlers) {
            if (!StringHelper::matchWildcard($nameWildcard, $name)) {
                continue;
            }
            $wildcardEventHandlers = array_merge(
                $wildcardEventHandlers,
                $classHandlers
            );
        }

        if (
            empty(static::$_events[$name])
            && empty($wildcardEventHandlers)
        ) {
            return;
        }

        $event === null && $event = new static;
        $event->handled = false;
        $event->name = $name;

        if (is_object($class)) {
            $event->sender === null && $event->sender = $class;
            $class = get_class($class);
        } else {
            $class = ltrim($class, '\\');
        }

        $classes = array_merge(
            [$class],
            class_parents($class, true),
            class_implements($class, true)
        );

        foreach ($classes as $class) {
            $eventHandlers = [];
            foreach ($wildcardEventHandlers as $classWildcard => $handlers) {
                if (StringHelper::matchWildcard($classWildcard, $class)) {
                    $eventHandlers = array_merge($eventHandlers, $handlers);
                    unset($wildcardEventHandlers[$classWildcard]);
                }
            }

            if (!empty(static::$_events[$name][$class])) {
                $eventHandlers = array_merge(
                    $eventHandlers,
                    static::$_events[$name][$class]
                );
            }

            foreach ($eventHandlers as $handler) {
                $event->data = $handler[1];
                call_user_func($handler[0], $event);
                if ($event->handled) {
                    return;
                }
            }
        }
    }
1245076
function(event, data, target){
            windowManager.eventEmitter.emit(event, {
                'emittedBy': windowManager.getCurrent().name,
                'target': target,
                'data': data
            });
        }
1020851
public function bind($name,$params) 
    {

        $this->instances[$name] = $params;
        $this->bind[$name] = true;

    }
1098764
public function fire($name, $params = [])
    {
        if ($this->prefixEventName === null) {
            $reflector = new \ReflectionClass($this);
            $this->prefixEventName = 'e' . $reflector->getShortName();
        }
        
        $event = new Event($params);
        if (method_exists($this, $this->prefixEventHandler . $name)) {
            call_user_func([$this, $this->prefixEventHandler . $name], $event);
        }
        Yii::$app->trigger($this->prefixEventName . ucfirst($name), $event);
    }
451343
public function set($data, $scope, $name)
    {
        $scope = $this->sanitizeInput($scope);
        $name = $this->sanitizeInput($name);

        if (empty($scope) || empty($name)) {
            return false;
        }

        $this->changedData[$scope][$name] = $data;
    }
843747
public function on($target, $event, $callback = null)
    {
        $echostr        = isset($_GET['echostr']) ? $_GET['echostr'] : null;
        $checkSignature = $this->checkSignature();

        if (!$checkSignature) {
            exit("签名验证失败");
        }

        if (!empty($echostr)) {
            echo $echostr;
            exit;
        }

        if (is_null($callback)) {
            $callback = $event;
            $event    = '*';
        }

        if (!is_callable($callback)) {
            exit("$callback 不是一个可调用的函数或方法");
        }

        $rest = $this->$target($event);

        $datas         = [];
        $datas['data'] = $rest;

        if (!empty($rest)) {
            $rest_user                 = [];
            $rest_user['ToUserName']   = $rest['FromUserName'];
            $rest_user['FromUserName'] = $rest['ToUserName'];
            $rest_msg                  = call_user_func_array($callback, $datas);

            if ($rest_msg == 'success') {
                exit('success');
            }

            $rest_array = array_merge($rest_user, $rest_msg);

            $rest_xml = $this->arrayToXml($rest_array);

            $msg_signature = isset($_GET['msg_signature']) ? $_GET['msg_signature'] : null;
            if (!empty($msg_signature) && $msg_signature != '') {
                $rest_xml = $this->encryptMsg($rest_xml);
            }

            exit($rest_xml);
        } else {
            return false;
        }
    }