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.
This commit is contained in:
2026-04-05 09:49:30 -07:00
commit 373ebc8c93
1284 changed files with 409372 additions and 0 deletions

37
stubs/testLogging.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
require_once(dirname(__DIR__) . '/config/sneakerstrap.inc');
/*
* what we are testing is connecting to the new log channel,
* posting a message to the channel,
* so that we can see what brokers picked-up the message...
*
*/
$errors = [];
// instantiate a logger client
$logger = new gacErrorLogger();
if (!$logger->status) die(ERROR_FAILED_TO_INSTANTIATE . RESOURCE_LOGGER);
$meta = [
META_CLIENT => CLIENT_SYSTEM, // back-door the meta-data checks
META_LIMIT => 1,
META_TEMPLATE => TEMPLATE_CLASS_GRAPHS,
META_TEMPLATE => TEMPLATE_CLASS_TEST_PDO,
META_CLIENT_IP => STRING_SESSION_HOME, // required
META_EVENT_GUID => guid() // simulate a broker event by generating the event guid
];
$objTest = new gacFactory($meta, FACTORY_EVENT_NEW_CLASS, '', $errors);
// this next part just does a non-broker fetch of a single record so that we can fire-off a metrics-fetch event
$meta[META_TEMPLATE] = TEMPLATE_CLASS_TEST_MONGO;
$logger->fatal(STRING_TEST);
// fetch a test record so that we create a metrics event
// set up the data payloads
$objTest = new gacFactory($meta, FACTORY_EVENT_NEW_CLASS, '', $errors);
if (!$objTest->status) die(ERROR_FAILED_TO_INSTANTIATE . $meta[META_TEMPLATE]);
$widget = $objTest->widget;
$query = null;
$request = [BROKER_DATA => [ STRING_QUERY_DATA => $query]];
$widget->_fetchRecords($request);
if (!$widget->status) var_export($widget->eventMessages);
echo 'done' . PHP_EOL;