本文整理汇总了PHP中ModuleManager::runEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleManager::runEvent方法的具体用法?PHP ModuleManager::runEvent怎么用?PHP ModuleManager::runEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleManager
的用法示例。
在下文中一共展示了ModuleManager::runEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ServerInformation
<?php
include_once "SessionManager.php";
include_once "ServerResponse.php";
include_once "ServerInformation.php";
include_once "UserControl.php";
include_once "ClientRequest.php";
include_once "SystemFunctions.php";
$serverInfo = new ServerInformation();
include_once $serverInfo->UsersFile;
$userControl = new UserControl($users, $admins);
$serverResponse = new ServerResponse();
$clientRequest = new ClientRequest();
$sessionManager = new SessionManager();
$userControl->setUser($sessionManager->user, $sessionManager->pass);
$event = $clientRequest->ajaxModuleEventName;
// INCLUDE MODULES! //
include_once "Modules.php";
$moduleManager = new ModuleManager("../Modules/");
$moduleManager->importModules();
$moduleManager->runEvent($event);
// DEFINES FOR YOUR EVENTS THE ABOVE INSTANCES //
// FINISH //
$serverResponse->send();
示例2: ModuleManager
include_once "System.php";
$userControl->setUser($clientRequest->user, $clientRequest->pass);
// SAVING INFORMATION //
if ($clientRequest->action == "login") {
if ($userControl->isValid) {
$_SESSION['mts_saved_username'] = $clientRequest->user;
$_SESSION['mts_saved_password'] = $clientRequest->pass;
$_SESSION['mts_is_logged_in'] = true;
$_SESSION['mts_user_is_admin'] = true;
$serverResponse->setBoolean("login", true);
$serverResponse->setBoolean("admin", $userControl->isAdmin);
} else {
$serverResponse->setBoolean("login", false);
}
} else {
if ($clientRequest->action == "logout") {
session_unset();
session_destroy();
$serverResponse->setBoolean("logout", true);
$serverResponse->setString("checkuser", $_SESSION['mts_saved_username']);
} else {
$serverResponse->setBoolean("error", true);
$serverResponse->setString("message", "Action was not specified: " . $clientRequest->action);
}
}
// INCLUDE MODULES! //
include_once "Modules.php";
$moduleManager = new ModuleManager($serverInfo->ModulesDirectory);
$moduleManager->importModules();
$moduleManager->runEvent("MainLoginEvent");
$serverResponse->send();
示例3: elseif
} elseif (preg_match_all("/{$regexp1}/siU", $tiddlersDiv, $tiddlers, PREG_SET_ORDER)) {
foreach ($tiddlers as $tiddler) {
# title: [tiddlerDivAsString,tiddlerText]
$tiddlersMap[$tiddler[1]] = array($tiddler[0], $tiddler[2]);
}
}
return $tiddlersMap;
}
// ACTIONS! //
$clientRequest = new SavePostRequest();
// UPDATES AND DELETES //
if ($clientRequest->updatesDiv == "" && $clientRequest->deletedTiddlers == "") {
$serverResponse->setBoolean("saved", true);
$serverResponse->setBoolean("nothing", true);
$serverResponse->send();
exit;
}
// END INCLUDE MODULES ! //
$tiddlyWiki = new TiddlyWiki($clientRequest->sourceFile, $serverResponse);
$tiddlyWikiInfo = new TiddlyWikiInfo();
$savingMachine = new SavingMachine($serverResponse, $tiddlyWiki, $clientRequest, $tiddlyWikiInfo);
// INCLUDE MODULES! //
include_once "Modules.php";
$moduleManager = new ModuleManager($serverInfo->ModulesDirectory);
$moduleManager->importModules();
$moduleManager->runEvent("MainSaveEvent");
$tiddlyWiki->init();
$savingMachine->goSave();
// POST SAVE //
$moduleManager->runEvent("PostSaveEvent");
$serverResponse->send();