connect('localhost'); require_once "lib/Redis/Logger/Settings.php"; require_once "lib/Redis/Logger/Entry.php"; require_once "lib/Redis/Logger/Reader.php"; require_once "lib/Redis/Logger/Writer.php"; $reader = new Reader($redis); echo "\nscan()-ing Template pattern: " . Settings::REDIS_PATTERN . "\n"; echo implode(', ', $templates = $reader->scan(Settings::REDIS_PATTERN, 0, 50)) . "\n\n"; echo "getChannels: "; $channels = $reader->getChannels(); echo implode(', ', $channels) . "\n\n"; echo "getTemplates():\n"; $templates = $reader->getTemplates(); echo "Result: " . implode(', ', $templates) . "\n\n"; echo "getTemplates('cli'):\n"; $templates = $reader->getTemplates("cli"); echo "Result: " . implode(', ', $templates) . "\n\n"; echo "getTemplates('foo'):\n"; $templates = $reader->getTemplates("foo"); echo "Result: " . implode(', ', $templates) . "\n\n"; echo "getTemplates(NULL, 4):\n"; $templates = $reader->getTemplates(NULL, 4); echo "Result: " . implode(', ', $templates) . "\n\n"; echo "getTemplates(NULL, 5):\n"; $templates = $reader->getTemplates(NULL, 5); echo "Result: " . implode(', ', $templates) . "\n\n"; foreach ($reader->getTemplates() as $template) { echo "First page of events for template <$template>:\n"; $entries = $reader->getEntries($template); foreach ($entries as $entry) { echo "$entry\n"; } } echo "First page of events for template :\n"; $entries = $reader->getEntries("nonexistent"); foreach ($entries as $entry) { echo "$entry\n"; }