本文整理汇总了PHP中Kernel::exitSystemMode方法的典型用法代码示例。如果您正苦于以下问题:PHP Kernel::exitSystemMode方法的具体用法?PHP Kernel::exitSystemMode怎么用?PHP Kernel::exitSystemMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kernel
的用法示例。
在下文中一共展示了Kernel::exitSystemMode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processRequest
public function processRequest(MMapRequest $request, MMapResponse $response)
{
ob_start('mb_output_handler');
MMapManager::startSession();
MMapManager::checkSessionExpiration();
$username = $request->issetPOST('username') ? $request->getPOST('username') : '';
$password = $request->issetPOST('password') ? $request->getPOST('password') : '';
$loginPage = $request->issetPOST('loginPage') ? $request->getPOST('loginPage') : '';
$subject = new Subject();
$loginContext = new LoginContext('eyeos-login', $subject);
$cred = new EyeosPasswordCredential();
$cred->setUsername($username);
$cred->setPassword($password, true);
$subject->getPrivateCredentials()->append($cred);
try {
$loginContext->login();
$memoryManager = MemoryManager::getInstance();
Kernel::enterSystemMode();
$memoryManager->set('isExternLogin', 1);
$memoryManager->set('username', $username);
$memoryManager->set('password', $password);
$memoryManager->set('loginPage', $loginPage);
Kernel::exitSystemMode();
header("Location: index.php");
} catch (Exception $e) {
header("Location:" . $loginPage . "?errorLogin=1");
}
}
示例2: checkSessionExpiration
/**
* @throws EyeSessionExpiredException
*/
public static function checkSessionExpiration()
{
Kernel::enterSystemMode();
$regenerated = MemoryManager::getInstance()->get('regenerated', 1);
Kernel::exitSystemMode();
if ($regenerated == 1) {
MemoryManager::getInstance()->reset();
throw new EyeSessionExpiredException('Session expired.');
}
}
示例3: __run
public static function __run(AppExecutionContext $context, MMapResponse $response)
{
$myMemoryManager = MemoryManager::getInstance();
Kernel::enterSystemMode();
$isExternLogin = $myMemoryManager->get('isExternLogin');
$loginPage = $myMemoryManager->get('loginPage');
Kernel::exitSystemMode();
$context->getArgs()->append($isExternLogin);
if ($isExternLogin) {
$context->getArgs()->append($loginPage);
}
}
示例4: __run
public static function __run(AppExecutionContext $context, MMapResponse $response)
{
$memoryManager = MemoryManager::getInstance();
Kernel::enterSystemMode();
$isExternLogin = $memoryManager->get('isExternLogin');
Kernel::exitSystemMode();
$list = new ArrayList();
$list->append($isExternLogin);
if ($isExternLogin) {
Kernel::enterSystemMode();
$username = $memoryManager->get('username');
$password = $memoryManager->get('password');
Kernel::exitSystemMode();
$list->append($username);
$list->append($password);
}
$context->setArgs($list);
$response->appendToBody('eyeos.isRegisterActive=' . self::isRegisterActive() . ';');
}
示例5: processRequest
public function processRequest(MMapRequest $request, MMapResponse $response)
{
$urlName = $request->getGET('download');
if (is_array($urlName)) {
exit;
}
$urlShare = new UrlShare();
$urlShare->setName($urlName);
$urlShareController = UrlShareController::getInstance();
$urlShare = current($urlShareController->searchUrl($urlShare));
if ($urlShare) {
if ($urlShare->getExpirationDate() < time()) {
self::renderErrorMessage($response, 'Url Expired');
return;
}
$file = new UrlFile();
$file->setId($urlShare->getFileId());
$urlShareController->readFile($file);
if ($file) {
$fileName = basename($file->getPath());
$currentFile = FSI::getFile($file->getPath());
$size = $currentFile->getSize();
$unim = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
$c = 0;
while ($size >= 1024) {
$c++;
$size = $size / 1024;
}
$size = number_format($size, $c ? 2 : 0, ',', '.') . ' ' . $unim[$c];
if ($request->issetGET('wrongPassword')) {
$wrongPassword = $request->getGET('wrongPassword');
} else {
$wrongPassword = 0;
}
Kernel::exitSystemMode();
self::renderFoundFile($fileName, $size, $urlName, $response, $urlShare->getPassword(), $wrongPassword);
} else {
self::renderErrorMessage($response, 'File not available');
}
} else {
self::renderErrorMessage($response, 'File not available');
}
}
示例6: setProcessLoginContext
/**
* Change the LoginContext associated with an existing process
*
* @param int $pid
* @param LoginContext $loginContext
* @throws EyeInvalidArgumentException If the arguments are incorrect
* @throws EyeProcException If there is no such process with the given pid
*/
public function setProcessLoginContext($pid, LoginContext $loginContext)
{
$processTable = $this->getProcessesTable();
if (!isset($processTable[$pid])) {
throw new EyeProcException('Process $proc with PID ' . $pid . ' not found.');
}
$processTable[$pid]->setLoginContext($loginContext);
if ($this->currentProcess->getPid() == $pid) {
$this->currentProcess = $processTable[$pid];
}
Kernel::enterSystemMode();
$this->memoryManager->set('processTable', $processTable);
Kernel::exitSystemMode();
$this->fireEvent('loginContextChanged', new ProcEvent($processTable[$pid]));
}