public function __construct() { $log_ids = IsSetPost(DBLogger::LOGID); if ($log_ids === false) { throw new UserActionException("nothing to delete"); } foreach($log_ids as $id) { if (!is_numeric($id)) { throw new SecurityException( "all message ids must be numeric"); } } try { DBLogger::delete($log_ids); } catch(DBLoggerException $e) { throw new UserActionException($e->getMessage()); } }
$inserts[] = DBLogger::log("hell", "o world10"); $inserts[] = DBLogger::log("hell", "o world11"); sleep(1); $inserts[] = DBLogger::log("hell", "o world12"); $inserts[] = DBLogger::log("hell", "o world13"); sleep(1); $inserts[] = DBLogger::log("hell", "o world14"); $inserts[] = DBLogger::log("hell", "o world15"); sleep(1); $inserts[] = DBLogger::log("hell", "o world16"); $inserts[] = DBLogger::log("hell", "o world17"); sleep(1); $inserts[] = DBLogger::log("hell", "o world18"); $inserts[] = DBLogger::log("hell", "o world19"); echo var_dump($inserts); $logs1 = DBLogger::GetLimitedBy("hell", 1, 10); echo var_dump($logs1); $logs2 = DBLogger::GetLimitedBy("hell", 11, 20); echo var_dump($logs2); if (sizeof($logs1) == 10 && sizeof($logs2) == 9) { echo "passed pageation<br />"; } else { echo "failed pageation<br />"; } DBLogger::delete($inserts); ?>