SQLite

Implements the QueueInteface using as SQLite as the queue backend.

Requires PHP SQLite3 support

__construct

__construct($filename, $queue_name, $enc_key)
$filename:Path to the SQLite database, or :memory: to use in-memory database.
$queue_name:Name of the queue, defaults to ‘default’.
$enc_key:The encryption key, default not set.

See also

For using sqlite3 databases encrypted you need to install sqlcipher: sqlcipher.net.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<?php

 require_once 'dalmp.php';

 $queue = new DALMP\Queue(new DALMP\Queue\SQLite('/tmp/dalmp_queue.db'));

 echo 'enqueue status: ', var_dump($queue->enqueue('this is a teste')), PHP_EOL;

 echo 'dequeue all: ', print_r($queue->dequeue(), true), PHP_EOL;

 echo 'dequeue only 3: ', print_r($queue->dequeue(3), true), PHP_EOL;

 echo 'delete from queue: ', var_dump($queue->delete(63)), PHP_EOL;

See also

Queue Examples.

Thanks Navicat for supporting Open Source projects.

Navicat



A great amount of time has been spent creating, crafting and maintaining this software, please consider donating.

Donating helps ensure continued support, development and availability.

dalmp


comments powered by Disqus