<?php
class AccessMonitor {

	private $_inUsers;
	
	public function __construct() {
		$this->_inUsers = array();
	}
	
	public function in($sessionID) {
		AOWP_Logger::logToFile('Now count: ' . count($this->_inUsers));
//		print_r($this->_inUsers);
		if (count($this->_inUsers) <= AccessMonitorAspect::MAX_ACCESS_NUMBER) {
			$this->_inUsers[] = $sessionID;
			return true;
		}
		else {
			return false;
		}
	}
	public function out($sessionID) {
		array_splice($this->_inUsers, array_search($sessionID, $this->_inUsers) - 1, 1);
	}

}