/var/www/hkosl.com/b2b2c/webadmin/libraies/klein/klein/tests/functions-bootstrap.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
 * Klein (klein.php) - A fast & flexible router for PHP
 *
 * @author      Chris O'Hara <cohara87@gmail.com>
 * @author      Trevor Suarez (Rican7) (contributor and v2 refactorer)
 * @copyright   (c) Chris O'Hara
 * @link        https://github.com/klein/klein.php
 * @license     MIT
 */

/**
 * Really exploiting some functional/global PHP behaviors here. :P
 */
function implement_custom_fastcgi_function()
{
    
// Check if the function doesn't exist
    
if (!function_exists('fastcgi_finish_request')) {
        
// Let's just define it then
        
function fastcgi_finish_request()
        {
            echo 
'fastcgi_finish_request';
        }
    }
}

function 
implement_custom_apc_cache_functions()
{
    
// Check if the function doesn't exist
    
if (!function_exists('apc_fetch')) {

        function 
apc_fetch($key)
        {
            return 
false;
        }

        function 
apc_store($key$value)
        {
            return 
false;
        }
    }
}

function 
test_num_args_wrapper($args)
{
    echo 
func_num_args();
}

function 
test_response_edit_wrapper($klein)
{
    
$klein->response()->body('after callbacks!');
}