~mysql/mysqlndstat/trunk

« back to all changes in this revision

Viewing changes to mysqlnd_stat.c

  • Committer: Johannes Schlueter
  • Date: 2008-09-30 19:37:39 UTC
  • Revision ID: johannes@mysql.com-20080930193739-jwg65n6ilj2jv73f
Add shutdown hook to the handler interface, that could be used for some cleanup
Currently I don't use it with the APC handler as I use APC'S timeout for
cleaning, but a later "file" handler might benefit from such a cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
mysqlnd_stat_handler_funcs_t* mysqlnd_stat_handler = NULL;
37
37
 
38
38
/* {{{ PHP_MINIT_FUNCTION
39
 
 *  */
 
39
 */
40
40
PHP_MINIT_FUNCTION(mysqlnd_stat)
41
41
{
42
42
#ifdef HAVE_APC
45
45
 
46
46
        return SUCCESS;
47
47
}
 
48
/* }}} */
 
49
 
 
50
/* {{{ PHP_MSHUTDOWN_FUNCTION
 
51
 */
 
52
PHP_MSHUTDOWN_FUNCTION(mysqlnd_stat)
 
53
{
 
54
        if (mysqlnd_stat_handler && mysqlnd_stat_handler->shutdown) {
 
55
                return mysqlnd_stat_handler->shutdown(TSRMLS_C);
 
56
        } else {
 
57
                return SUCCESS;
 
58
        }
 
59
}
 
60
/* }}} */
48
61
 
49
62
/* {{{ PHP_RSHUTDOWN_FUNCTION
50
63
 */
131
144
        "mysqlnd_stat",
132
145
        mysqlnd_stat_functions,
133
146
        PHP_MINIT(mysqlnd_stat),
134
 
        NULL,
 
147
        PHP_MSHUTDOWN(mysqlnd_stat),
135
148
        NULL,
136
149
        PHP_RSHUTDOWN(mysqlnd_stat),
137
150
        PHP_MINFO(mysqlnd_stat),