當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZSession::countActive方法代碼示例

本文整理匯總了PHP中eZSession::countActive方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZSession::countActive方法的具體用法?PHP eZSession::countActive怎麽用?PHP eZSession::countActive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eZSession的用法示例。


在下文中一共展示了eZSession::countActive方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: count

    if (strlen($filterSQL) + strlen($expirationFilterSQL) > 0) {
        $whereSQL = 'WHERE';
    }
    $db = eZDB::instance();
    $query = "SELECT count( DISTINCT ezsession.user_id ) AS count\n              FROM ezsession\n              {$whereSQL}\n              {$filterSQL}\n              {$expirationFilterSQL}";
    $rows = $db->arrayQuery($query);
    return $rows[0]['count'];
}
$param['sortby'] = false;
$param['filter_type'] = $filterType;
$param['expiration_filter'] = $expirationFilterType;
$param['user_id'] = $userID;
if (isset($viewParameters['sortby'])) {
    $param['sortby'] = $viewParameters['sortby'];
}
$sessionsActive = eZSession::countActive();
$sessionsCount = eZFetchActiveSessionCount($param);
$sessionsList = eZFetchActiveSessions($param);
if ($param['offset'] >= $sessionsActive and $sessionsActive != 0) {
    $module->redirectTo('/setup/session');
}
$tpl->setVariable("gc_sessions_completed", $gcSessionsCompleted);
$tpl->setVariable("sessions_removed", $sessionsRemoved);
$tpl->setVariable("sessions_active", $sessionsActive);
$tpl->setVariable("sessions_count", $sessionsCount);
$tpl->setVariable("sessions_list", $sessionsList);
$tpl->setVariable("page_limit", $param['limit']);
$tpl->setVariable("view_parameters", $viewParameters);
$tpl->setVariable("form_parameter_string", $viewParameters);
$tpl->setVariable('filter_type', $filterType);
$tpl->setVariable('expiration_filter_type', $expirationFilterType);
開發者ID:CG77,項目名稱:ezpublish-legacy,代碼行數:31,代碼來源:session.php

示例2: collection

        $cli->output( "Removing all sessions" );
        eZSession::cleanup();
    }
}

if ( $clean['expired_session'] )
{
    if ( !eZSession::getHandlerInstance()->hasBackendAccess() )
    {
        $cli->output( "Could not remove expired sessions, current session handler does not support session garbage collection (not backend based)." );
    }
    else
    {
        $cli->output( "Removing expired sessions,", false );
        eZSession::garbageCollector();
        $activeCount = eZSession::countActive();
        $cli->output( " " . $cli->stylize( 'emphasize', $activeCount ) . " left" );
    }
}

if ( $clean['preferences'] )
{
    $cli->output( "Removing all preferences" );
    eZPreferences::cleanup();
}

if ( $clean['browse'] )
{
    $cli->output( "Removing all recent items and bookmarks for browse page" );
    eZContentBrowseRecent::cleanup();
    eZContentBrowseBookmark::cleanup();
開發者ID:sushilbshinde,項目名稱:ezpublish-study,代碼行數:31,代碼來源:cleanup.php

示例3: count

    if (strlen($filterSQL) + strlen($expirationFilterSQL) > 0) {
        $whereSQL = 'WHERE';
    }
    $db = eZDB::instance();
    $query = "SELECT count( DISTINCT ezsession.user_id ) AS count\n              FROM ezsession\n              {$whereSQL}\n              {$filterSQL}\n              {$expirationFilterSQL}";
    $rows = $db->arrayQuery($query);
    return $rows[0]['count'];
}
$param['sortby'] = false;
$param['filter_type'] = $filterType;
$param['expiration_filter'] = $expirationFilterType;
$param['user_id'] = $userID;
if (isset($viewParameters['sortby'])) {
    $param['sortby'] = $viewParameters['sortby'];
}
$sessionsActive = eZSession::countActive($param);
$sessionsCount = eZFetchActiveSessionCount($param);
$sessionsList = eZFetchActiveSessions($param);
if ($param['offset'] >= $sessionsActive and $sessionsActive != 0) {
    $module->redirectTo('/setup/session');
}
$tpl->setVariable("gc_sessions_completed", $gcSessionsCompleted);
$tpl->setVariable("sessions_removed", $sessionsRemoved);
$tpl->setVariable("sessions_active", $sessionsActive);
$tpl->setVariable("sessions_count", $sessionsCount);
$tpl->setVariable("sessions_list", $sessionsList);
$tpl->setVariable("page_limit", $param['limit']);
$tpl->setVariable("view_parameters", $viewParameters);
$tpl->setVariable("form_parameter_string", $viewParameters);
$tpl->setVariable('filter_type', $filterType);
$tpl->setVariable('expiration_filter_type', $expirationFilterType);
開發者ID:nlenardou,項目名稱:ezpublish,代碼行數:31,代碼來源:session.php


注:本文中的eZSession::countActive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。