当前位置: 首页>>代码示例>>PHP>>正文


PHP ModuleManager::runEvent方法代码示例

本文整理汇总了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();
开发者ID:pohly,项目名称:mts,代码行数:24,代码来源:ModuleEvent.php

示例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();
开发者ID:pohly,项目名称:mts,代码行数:31,代码来源:Login.php

示例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();
开发者ID:pohly,项目名称:mts,代码行数:31,代码来源:Save.php


注:本文中的ModuleManager::runEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。