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: 2014-10-22 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-2014 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@mysql.com>                           |
      16             :   |          Ulf Wendel <uwendel@mysql.com>                              |
      17             :   |          Georg Richter <georg@mysql.com>                             |
      18             :   +----------------------------------------------------------------------+
      19             : */
      20             : 
      21             : /* $Id: mysqlnd.c 317989 2011-10-10 20:49:28Z andrey $ */
      22             : #include "php.h"
      23             : #include "mysqlnd.h"
      24             : #include "mysqlnd_priv.h"
      25             : #include "mysqlnd_debug.h"
      26             : #include "mysqlnd_reverse_api.h"
      27             : 
      28             : 
      29             : static HashTable mysqlnd_api_ext_ht;
      30             : 
      31             : 
      32             : /* {{{ mysqlnd_reverse_api_init */
      33             : PHPAPI void
      34       20423 : mysqlnd_reverse_api_init(TSRMLS_D)
      35             : {
      36       20423 :         zend_hash_init(&mysqlnd_api_ext_ht, 3, NULL, NULL, 1);
      37       20423 : }
      38             : /* }}} */
      39             : 
      40             : 
      41             : /* {{{ mysqlnd_reverse_api_end */
      42             : PHPAPI void
      43       20457 : mysqlnd_reverse_api_end(TSRMLS_D)
      44             : {
      45       20457 :         zend_hash_destroy(&mysqlnd_api_ext_ht);
      46       20457 : }
      47             : /* }}} */
      48             : 
      49             : 
      50             : /* {{{ myslqnd_get_api_extensions */
      51             : PHPAPI HashTable *
      52         143 : mysqlnd_reverse_api_get_api_list(TSRMLS_D)
      53             : {
      54         143 :         return &mysqlnd_api_ext_ht;
      55             : }
      56             : /* }}} */
      57             : 
      58             : 
      59             : /* {{{ mysqlnd_reverse_api_register_api */
      60             : PHPAPI void
      61       61269 : mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext TSRMLS_DC)
      62             : {
      63       61269 :         zend_hash_str_add_ptr(&mysqlnd_api_ext_ht, apiext->module->name, strlen(apiext->module->name), apiext);
      64       61269 : }
      65             : /* }}} */
      66             : 
      67             : 
      68             : /* {{{ zval_to_mysqlnd */
      69             : PHPAPI MYSQLND *
      70           0 : zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned int * save_client_api_capabilities TSRMLS_DC)
      71             : {
      72             :         MYSQLND * retval;
      73             : #ifdef OLD_CODE
      74             :         MYSQLND_REVERSE_API * elem;
      75             :         ZEND_HASH_FOREACH_PTR(&mysqlnd_api_ext_ht, elem) {
      76             :                 if (elem->conversion_cb) {
      77             :                         retval = elem->conversion_cb(zv TSRMLS_CC);
      78             :                         if (retval) {
      79             :                                 if (retval->data) {
      80             :                                         *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities TSRMLS_CC);
      81             :                                 }
      82             :                                 return retval;
      83             :                         }
      84             :                 }
      85             :         } ZEND_HASH_FOREACH_END();
      86             : #else
      87             :         MYSQLND_REVERSE_API * api;
      88           0 :         ZEND_HASH_FOREACH_PTR(&mysqlnd_api_ext_ht, api) {
      89           0 :                 if (api && api->conversion_cb) {
      90           0 :                         retval = api->conversion_cb(zv TSRMLS_CC);
      91           0 :                         if (retval) {
      92           0 :                                 if (retval->data) {
      93           0 :                                         *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities TSRMLS_CC);
      94             :                                 }
      95           0 :                                 return retval;
      96             :                         }
      97             :                 }
      98             :         } ZEND_HASH_FOREACH_END();
      99             : #endif
     100           0 :         return NULL;
     101             : }
     102             : /* }}} */
     103             : 
     104             : 
     105             : /*
     106             :  * Local variables:
     107             :  * tab-width: 4
     108             :  * c-basic-offset: 4
     109             :  * End:
     110             :  * vim600: noet sw=4 ts=4 fdm=marker
     111             :  * vim<600: noet sw=4 ts=4
     112             :  */

Generated by: LCOV version 1.10

Generated at Wed, 22 Oct 2014 07:24:52 +0000 (2 hours ago)

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