Files
namaste/stubs/testJSONHandler.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

38 lines
1.1 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: mshallop
* Date: 4/15/19
* Time: 11:23 AM
*/
// initialization
require_once(dirname(__DIR__) . '/config/sneakerstrap.inc');
$errors = [];
$meta = [
META_TEMPLATE => TEMPLATE_CLASS_TEST_MONGO,
META_CLIENT => CLIENT_CLIENT,
META_EVENT_GUID => guid(),
META_SYSTEM_NOTES => basename(__FILE__)
];
// instantiate a test class and generate some test data
$objTest = new gacFactory($meta, FACTORY_EVENT_NEW_CLASS, '',$errors);
if (!$objTest->status)
exit (ERROR_TEMPLATE_INSTANTIATE . TEMPLATE_CLASS_TEST_MONGO);
/** @var $widget gatTestMongo */
$widget = $objTest->widget;
$testData = $widget->template->buildTestData(100);
foreach ($testData as &$record) {
$record[CM_TST_TOKEN] = guid();
$record[CM_TST_FIELD_TEST_CDATE] = time();
$record[CM_TST_FIELD_TEST_STATUS] = STATUS_ACTIVE;
}
$cacheString = jsonHandler($testData, JSON_DIR_ENC, $errors, false);
if (is_null($cacheString))
exit('error processing json data - check logs');
$length = strlen($cacheString);
echo 'cache string is ' . strval($length/1024) . ' Kbytes long';