PHP utility collection with hybrid and fluent APIs.

⌈⌋ branch:  hybrid7 libraries


Check-in [b453cef6ba]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove debugging examples.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b453cef6ba2a444e76cd948aec81a5dac87f886c
User & Date: mario 2015-01-06 17:29:39
Context
2015-01-07
15:32
Silently return NULL for absent ->column data from first result row. check-in: 1cfd351bc9 user: mario tags: trunk
2015-01-06
17:29
Remove debugging examples. check-in: b453cef6ba user: mario tags: trunk
14:04
Cleaned up intro documentation, externalized and detailed in Wiki now. Prepare tree grouping via `:p`, order injector calls last, fix :version meta extractor. check-in: e71d6c53c0 user: mario tags: trunk
Changes

Changes to logstruck.php.

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128


129
130
131
132
133
134
135
 * Database keys are also used as internal dict names. Anything that doesn't
 * map will be merged into `context`.
 * 
 * 
 */


#ł(':info', ':test', "Just testing if anything works", ':backtrace', ':server');
#ł(':debug', ':test', "Second entry", "errno: 5", ':vars', "random: 2", "file: t.php", "line: 20");
#ł(':crit', ':logging', "Debug :vars = _ENV", ':vars', $_ENV);


/**
 * Automatically declare PHP handlers for Errors, Assertions, Exceptions.
 *
 */
set_error_handler("ł::error_handler");
set_exception_handler("ł::exception_handler");
assert_options(ASSERT_CALLBACK, "ł::assert_handler");

#test
function run() {
    assert(" 1 == 2;  // never true");
    UNDEFINED_THINGY;
    throw new Exception("Yikes", 0x200);
}
run(1,2,3);


/**
 * Hybrid invocation as plain function.
 *


 *
 */
function ł(/*...*/) {

    // keep one logger object around, which retains event parent/group id
    static $logger;
    if (!isset($logger)) {   // set default values and interpolators here







<
<
<
<









<
<
<
<
<
<
<



|
|
>
>







97
98
99
100
101
102
103




104
105
106
107
108
109
110
111
112







113
114
115
116
117
118
119
120
121
122
123
124
125
126
 * Database keys are also used as internal dict names. Anything that doesn't
 * map will be merged into `context`.
 * 
 * 
 */







/**
 * Automatically declare PHP handlers for Errors, Assertions, Exceptions.
 *
 */
set_error_handler("ł::error_handler");
set_exception_handler("ł::exception_handler");
assert_options(ASSERT_CALLBACK, "ł::assert_handler");










/**
 * Hybrid logger invocation.
 *               ‾‾‾‾‾‾‾‾‾‾
 * Accepts message, :prio, :section, [array], and :injector params
 * in any order. Instantiates a main logging group on first call.
 *
 */
function ł(/*...*/) {

    // keep one logger object around, which retains event parent/group id
    static $logger;
    if (!isset($logger)) {   // set default values and interpolators here