コード例 #1
0
The full text of the GPL is in the COPYING file.
*/
// Function to scan the event queue and execute any functions required.
require_once 'base.php';
require_once DP_BASE_DIR . '/includes/config.php';
require_once DP_BASE_DIR . '/includes/main_functions.php';
require_once DP_BASE_DIR . '/includes/db_connect.php';
require_once DP_BASE_DIR . '/classes/ui.class.php';
require_once DP_BASE_DIR . '/classes/event_queue.class.php';
require_once DP_BASE_DIR . '/classes/query.class.php';
$AppUI = new CAppUI();
$AppUI->setUserLocale();
$perms =& $AppUI->acl();
echo "Scanning Queue ...\n";
$queue = EventQueue::getInstance();
# Determine if we are called from the command line or from a web page,
# In either case we may have an argument telling us if we are scanning
# the batch or the immediate queue.  If no argument, scan everything.
$batch = null;
if (isset($_REQUEST['batch'])) {
    $batch = strtolower($_REQUEST['batch']);
} else {
    if (isset($argv) && !empty($argv[1])) {
        $batch = strtolower($argv[1]);
    }
}
if (!empty($batch)) {
    if (is_numeric($batch)) {
        $batch = intval($batch);
        if ($batch[0] == 'y' || $batch[0] == 't') {
コード例 #2
0
 /**
  *  Queue mail to allow the queue manager to trigger
  *  the email transfer.
  *  
  *  @access private
  */
 function QueueMail()
 {
     global $AppUI;
     require_once $AppUI->getSystemClass('event_queue');
     $ec = EventQueue::getInstance();
     $vars = get_object_vars($this);
     return $ec->add($this, $vars, 'SendQueuedMail');
 }
コード例 #3
0
ファイル: session.php プロジェクト: 222elm/dotprojectFrame
function dPsessionGC($maxlifetime)
{
    global $AppUI;
    dprint(__FILE__, __LINE__, 11, 'Session Garbage collection running');
    $now = time();
    $max = dPsessionConvertTime('max_lifetime');
    $idle = dPsessionConvertTime('idle_time');
    // First pass is to kill any users that are logged in at the time of the session.
    $where = 'UNIX_TIMESTAMP() - UNIX_TIMESTAMP(session_updated) > ' . $idle . ' OR UNIX_TIMESTAMP() - UNIX_TIMESTAMP(session_created) > ' . $max;
    $q = new DBQuery();
    $q->addTable('sessions');
    $q->addQuery('session_user');
    $q->addWhere($where);
    $sql2 = $q->prepare(true);
    $q->addTable('user_access_log');
    $q->addUpdate('date_time_out', date('Y-m-d H:i:s'));
    $q->addWhere('user_access_log_id IN (' . $sql2 . ')');
    $q->exec();
    $q->clear();
    // Now we simply delete the expired sessions.
    $q->setDelete('sessions');
    $q->addWhere($where);
    $q->exec();
    $q->clear();
    if (dPgetConfig('session_gc_scan_queue')) {
        // We need to scan the event queue.  If $AppUI isn't created yet
        // And it isn't likely that it will be, we create it and run the
        // queue scanner.
        if (!isset($AppUI)) {
            $AppUI = new CAppUI();
            $queue = EventQueue::getInstance();
            $queue->scan();
        }
    }
    return true;
}