本文整理汇总了PHP中eZSession::stop方法的典型用法代码示例。如果您正苦于以下问题:PHP eZSession::stop方法的具体用法?PHP eZSession::stop怎么用?PHP eZSession::stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZSession
的用法示例。
在下文中一共展示了eZSession::stop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleFileDownload
function handleFileDownload($contentObject, $contentObjectAttribute, $type, $fileInfo)
{
$fileName = $fileInfo['filepath'];
$file = eZClusterFileHandler::instance($fileName);
if ($fileName != "" and $file->exists()) {
$fileSize = $file->size();
if (isset($_SERVER['HTTP_RANGE']) && preg_match("/^bytes=(\\d+)-(\\d+)?\$/", trim($_SERVER['HTTP_RANGE']), $matches)) {
$fileOffset = $matches[1];
$contentLength = isset($matches[2]) ? $matches[2] - $matches[1] + 1 : $fileSize - $matches[1];
} else {
$fileOffset = 0;
$contentLength = $fileSize;
}
// Figure out the time of last modification of the file right way to get the file mtime ... the
$fileModificationTime = $file->mtime();
// stop output buffering, and stop the session so that browsing can be continued while downloading
eZSession::stop();
ob_end_clean();
eZFile::downloadHeaders($fileName, self::dispositionType($fileInfo['mime_type']) === 'attachment', false, $fileOffset, $contentLength, $fileSize);
try {
$file->passthrough($fileOffset, $contentLength);
} catch (eZClusterFileHandlerNotFoundException $e) {
eZDebug::writeError($e->getMessage, __METHOD__);
header($_SERVER["SERVER_PROTOCOL"] . ' 500 Internal Server Error');
} catch (eZClusterFileHandlerGeneralException $e) {
eZDebug::writeError($e->getMessage, __METHOD__);
header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
}
eZExecution::cleanExit();
}
return eZBinaryFileHandler::RESULT_UNAVAILABLE;
}
示例2: sessionArray
static private function sessionArray()
{
if( MMUserLogin::$isLogin )
{
eZSession::start();
return $_SESSION;
}
if ( is_null(self::$_localSession) )
{
eZSession::start();
self::$_localSession = $_SESSION;
if ( !isset($_COOKIE['eZSESSID']) )
{
setcookie( 'eZSESSID', session_id(), null, '/', CookieTool::getCookieDomain() );
$_COOKIE['eZSESSID'] = session_id();
}
eZSession::stop();
}
return self::$_localSession;
}
示例3: download
/**
* Prepares a file for Download and terminates the execution.
* This method will:
* - empty the output buffer
* - stop buffering
* - stop the active session (in order to allow concurrent browsing while downloading)
*
* @param string $file Path to the local file
* @param bool $isAttachedDownload Determines weather to download the file as an attachment ( download popup box ) or not.
* @param string $overrideFilename
* @param int $startOffset Offset to start transfer from, in bytes
* @param int $length Data size to transfer
*
* @return bool false if error
*/
static function download($file, $isAttachedDownload = true, $overrideFilename = false, $startOffset = 0, $length = false)
{
if (!file_exists($file)) {
return false;
}
ob_end_clean();
eZSession::stop();
self::downloadHeaders($file, $isAttachedDownload, $overrideFilename, $startOffset, $length);
self::downloadContent($file, $startOffset, $length);
eZExecution::cleanExit();
}
示例4: htmlspecialchars
}
break;
default:
// give a warning
$actionname = '[ERROR: unknown action] "' . $action . '"';
}
// Before calling execute, echo out brief description of action taken + date and time ???
// this gives good user feedback for long-running methods...
/// @todo use a template for html layout
if ($action != 'inspect' || $debug) {
echo '<h2>' . htmlspecialchars($actionname) . ' on server ' . htmlspecialchars($server) . " ...</h2>\n";
flush();
}
// avoid locking in case we are using a session for executing the action which
// is the sane session as used by the debugger and plain php session storage
eZSession::stop();
// execute method(s)
$response = null;
$responses = array();
$time = microtime(true);
foreach ($msg as $message) {
$response = $client->send($message);
$responses[] = $response;
if (!is_object($response) || $response->isFault()) {
break;
}
}
$time = microtime(true) - $time;
if ($debug) {
/// @todo should echo the request+response of all requests, when sending more than 1
echo '<div class="dbginfo"><h2>Debug info:</h2>';