mirror of
https://github.com/CyanoFresh/SmartHomePHP.git
synced 2026-03-03 00:24:01 +01:00
Refactored for events system
This commit is contained in:
44
modules/customModule/Module.php
Normal file
44
modules/customModule/Module.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace app\modules\customModule;
|
||||
|
||||
use app\modules\BaseModule;
|
||||
use app\modules\server\components\CoreServer;
|
||||
|
||||
/**
|
||||
* customModule module definition class
|
||||
*/
|
||||
class Module extends BaseModule
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $controllerNamespace = 'app\modules\customModule\controllers';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function getEventHandlers()
|
||||
{
|
||||
return [
|
||||
[
|
||||
CoreServer::EVENT_INIT,
|
||||
/** @see EventHandler::onServerInit() */
|
||||
[EventHandler::class, 'onServerInit']
|
||||
],
|
||||
[
|
||||
CoreServer::EVENT_CONNECTION_MESSAGE,
|
||||
/** @see EventHandler::onConnectionOpen() */
|
||||
[EventHandler::class, 'onMessage']
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user