PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/mysqlnd - mysqlnd_reverse_api.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 11 20 55.0 %
Date: 2016-08-24 Functions: 4 5 80.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   +----------------------------------------------------------------------+
       3             :   | PHP Version 7                                                        |
       4             :   +----------------------------------------------------------------------+
       5             :   | Copyright (c) 2006-2016 The PHP Group                                |
       6             :   +----------------------------------------------------------------------+
       7             :   | This source file is subject to version 3.01 of the PHP license,      |
       8             :   | that is bundled with this package in the file LICENSE, and is        |
       9             :   | available through the world-wide-web at the following url:           |
      10             :   | http://www.php.net/license/3_01.txt                                  |
      11             :   | If you did not receive a copy of the PHP license and are unable to   |
      12             :   | obtain it through the world-wide-web, please send a note to          |
      13             :   | license@php.net so we can mail you a copy immediately.               |
      14             :   +----------------------------------------------------------------------+
      15             :   | Authors: Andrey Hristov <andrey@php.net>                             |
      16             :   |          Johannes Schlüter <johannes@php.net>                        |
      17             :   |          Ulf Wendel <uw@php.net>                                     |
      18             :   +----------------------------------------------------------------------+
      19             : */
      20             : 
      21             : #include "php.h"
      22             : #include "mysqlnd.h"
      23             : #include "mysqlnd_priv.h"
      24             : #include "mysqlnd_debug.h"
      25             : #include "mysqlnd_reverse_api.h"
      26             : 
      27             : 
      28             : static HashTable mysqlnd_api_ext_ht;
      29             : 
      30             : 
      31             : /* {{{ mysqlnd_reverse_api_init */
      32             : PHPAPI void
      33       23504 : mysqlnd_reverse_api_init(void)
      34             : {
      35       23504 :         zend_hash_init(&mysqlnd_api_ext_ht, 3, NULL, NULL, 1);
      36       23504 : }
      37             : /* }}} */
      38             : 
      39             : 
      40             : /* {{{ mysqlnd_reverse_api_end */
      41             : PHPAPI void
      42       23544 : mysqlnd_reverse_api_end(void)
      43             : {
      44       23544 :         zend_hash_destroy(&mysqlnd_api_ext_ht);
      45       23544 : }
      46             : /* }}} */
      47             : 
      48             : 
      49             : /* {{{ myslqnd_get_api_extensions */
      50             : PHPAPI HashTable *
      51         150 : mysqlnd_reverse_api_get_api_list(void)
      52             : {
      53         150 :         return &mysqlnd_api_ext_ht;
      54             : }
      55             : /* }}} */
      56             : 
      57             : 
      58             : /* {{{ mysqlnd_reverse_api_register_api */
      59             : PHPAPI void
      60       47008 : mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext)
      61             : {
      62       47008 :         zend_hash_str_add_ptr(&mysqlnd_api_ext_ht, apiext->module->name, strlen(apiext->module->name), apiext);
      63       47008 : }
      64             : /* }}} */
      65             : 
      66             : 
      67             : /* {{{ zval_to_mysqlnd */
      68             : PHPAPI MYSQLND *
      69           0 : zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned int * save_client_api_capabilities)
      70             : {
      71             :         MYSQLND * retval;
      72             : #ifdef OLD_CODE
      73             :         MYSQLND_REVERSE_API * elem;
      74             :         ZEND_HASH_FOREACH_PTR(&mysqlnd_api_ext_ht, elem) {
      75             :                 if (elem->conversion_cb) {
      76             :                         retval = elem->conversion_cb(zv);
      77             :                         if (retval) {
      78             :                                 if (retval->data) {
      79             :                                         *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities);
      80             :                                 }
      81             :                                 return retval;
      82             :                         }
      83             :                 }
      84             :         } ZEND_HASH_FOREACH_END();
      85             : #else
      86             :         MYSQLND_REVERSE_API * api;
      87           0 :         ZEND_HASH_FOREACH_PTR(&mysqlnd_api_ext_ht, api) {
      88           0 :                 if (api && api->conversion_cb) {
      89           0 :                         retval = api->conversion_cb(zv);
      90           0 :                         if (retval) {
      91           0 :                                 if (retval->data) {
      92           0 :                                         *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities);
      93             :                                 }
      94           0 :                                 return retval;
      95             :                         }
      96             :                 }
      97             :         } ZEND_HASH_FOREACH_END();
      98             : #endif
      99           0 :         return NULL;
     100             : }
     101             : /* }}} */
     102             : 
     103             : 
     104             : /*
     105             :  * Local variables:
     106             :  * tab-width: 4
     107             :  * c-basic-offset: 4
     108             :  * End:
     109             :  * vim600: noet sw=4 ts=4 fdm=marker
     110             :  * vim<600: noet sw=4 ts=4
     111             :  */

Generated by: LCOV version 1.10

Generated at Wed, 24 Aug 2016 12:20:23 +0000 (32 hours ago)

Copyright © 2005-2016 The PHP Group
All rights reserved.