Files
namaste/stubs/testCacheSmash.php
gramps 373ebc8c93 Archive: Namaste PHP AMQP framework v1.0 (2017-2020)
952 days continuous production uptime, 40k+ tp/s single node.
Original corpo Bitbucket history not included — clean archive commit.
2026-04-05 09:49:30 -07:00

26 lines
644 B
PHP

<?php
/**
* testCacheSmash.php
*
* Test Stub for check the cacheMash() and smashCache() methods and returns from both method
*
*/
// initialization
require_once(dirname(__DIR__) . '/config/sneakerstrap.inc');
$tokens = null;
$errors = [];
$maxKeys = mt_rand(100, 200);
for ($index = 0; $index < $maxKeys; $index++)
$tokens[] = [ guid() => 'this is a test'];
// call multi-cache to cache
$keyList = gasCache::cacheMash($tokens, NUMBER_CACHE_DEFAULT, $errors);
if (is_null($keyList)) exit ('cache mash failed');
// call cache-smash to remove records
if (!gasCache::smashCache($keyList, $errors)) exit('smash cache failed');
$x = 1;