(PECL yaconf >= 1.1.0)
Yaconf::__debug_info — Inspect how a configuration value is stored
Returns debugging information about the value stored under
name: the memory address of the stored value
and whether the value still lives inside Yaconf's compacted storage
block.
This method exists solely for Yaconf's own test suite, which uses it to verify that the extension is working correctly. Do not use it in production code, and do not rely on the format of its output: the returned array may change at any time.
nameThe configuration name to inspect, using the same dot notation as Yaconf::get().
An array with four entries when the configuration
exists, null otherwise:
key — the name that was looked up.
address — the memory address of the stored
value. Values are stored as interned strings or immutable arrays,
so this address stays constant until the configuration is
reloaded.
val — the stored value itself.
changed — false while the value's data still
lives inside the compacted storage block, meaning the operating
system has not had to copy the page (copy-on-write still applies);
true when the value has been re-allocated outside the block.
Приклад #1 Yaconf::__debug_info() example
<?php
// assuming app.ini contains name="shop"
var_dump(Yaconf::__debug_info("app.name"));
/*
array(4) {
["key"]=>
string(8) "app.name"
["address"]=>
string(14) "0x7f8b1c0a3d20"
["val"]=>
string(4) "shop"
["changed"]=>
bool(false)
}
*/
var_dump(Yaconf::__debug_info("app.missing")); // NULL
?>