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/intl/resourcebundle - resourcebundle_class.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 134 164 81.7 %
Date: 2014-09-19 Functions: 14 14 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    +----------------------------------------------------------------------+
       3             :    | PHP Version 5                                                        |
       4             :    +----------------------------------------------------------------------+
       5             :    | This source file is subject to version 3.01 of the PHP license,      |
       6             :    | that is bundled with this package in the file LICENSE, and is        |
       7             :    | available through the world-wide-web at the following url:           |
       8             :    | http://www.php.net/license/3_01.txt                                  |
       9             :    | If you did not receive a copy of the PHP license and are unable to   |
      10             :    | obtain it through the world-wide-web, please send a note to          |
      11             :    | license@php.net so we can mail you a copy immediately.               |
      12             :    +----------------------------------------------------------------------+
      13             :    | Authors: Hans-Peter Oeri (University of St.Gallen) <hp@oeri.ch>      |
      14             :    +----------------------------------------------------------------------+
      15             :  */
      16             : 
      17             : #include <stdlib.h>
      18             : #include <unicode/ures.h>
      19             : #include <unicode/uenum.h>
      20             : 
      21             : #include <zend.h>
      22             : #include <Zend/zend_exceptions.h>
      23             : #include <Zend/zend_interfaces.h>
      24             : #include <php.h>
      25             : 
      26             : #include "php_intl.h"
      27             : #include "intl_data.h"
      28             : 
      29             : #include "resourcebundle/resourcebundle.h"
      30             : #include "resourcebundle/resourcebundle_iterator.h"
      31             : #include "resourcebundle/resourcebundle_class.h"
      32             : 
      33             : zend_class_entry *ResourceBundle_ce_ptr = NULL;
      34             : 
      35             : static zend_object_handlers ResourceBundle_object_handlers;
      36             : 
      37             : /* {{{ ResourceBundle_object_dtor */
      38          24 : static void ResourceBundle_object_destroy( zend_object *object TSRMLS_DC )
      39             : {
      40          24 :         ResourceBundle_object *rb = php_intl_resourcebundle_fetch_object(object);
      41             : 
      42             :         // only free local errors
      43          24 :         intl_error_reset( INTL_DATA_ERROR_P(rb) TSRMLS_CC );
      44             : 
      45          24 :         if (rb->me) {
      46          21 :                 ures_close( rb->me );
      47             :         }
      48          24 :         if (rb->child) {
      49          12 :                 ures_close( rb->child );
      50             :         }
      51             : 
      52             :         //???zend_object_std_dtor( object TSRMLS_CC );
      53          24 : }
      54             : /* }}} */
      55             : 
      56             : /* {{{ ResourceBundle_object_create */
      57          26 : static zend_object *ResourceBundle_object_create( zend_class_entry *ce TSRMLS_DC )
      58             : {
      59             :         ResourceBundle_object *rb;
      60             : 
      61          26 :         rb = ecalloc( 1, sizeof(ResourceBundle_object) + sizeof(zval) * (ce->default_properties_count - 1) );
      62             : 
      63          26 :         zend_object_std_init( &rb->zend, ce TSRMLS_CC );
      64          26 :         object_properties_init( &rb->zend, ce);
      65             : 
      66          26 :         intl_error_init( INTL_DATA_ERROR_P(rb) TSRMLS_CC );
      67          26 :         rb->me = NULL;
      68          26 :         rb->child = NULL;
      69             : 
      70          26 :         rb->zend.handlers = &ResourceBundle_object_handlers;
      71             : 
      72          26 :         return &rb->zend;
      73             : }
      74             : /* }}} */
      75             : 
      76             : /* {{{ ResourceBundle_ctor */
      77          16 : static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS) 
      78             : {
      79             :         const char      *bundlename;
      80          16 :         size_t                  bundlename_len = 0;
      81             :         const char      *locale;
      82          16 :         size_t                  locale_len = 0;
      83          16 :         zend_bool       fallback = 1;
      84             : 
      85          16 :         zval                  *object = return_value;
      86          16 :         ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P( object );
      87             : 
      88          16 :         intl_error_reset( NULL TSRMLS_CC );
      89             : 
      90          16 :         if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s!s!|b", 
      91             :                 &locale, &locale_len, &bundlename, &bundlename_len, &fallback ) == FAILURE )
      92             :         {
      93           1 :                 intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
      94             :                         "resourcebundle_ctor: unable to parse input parameters", 0 TSRMLS_CC );
      95           1 :                 Z_OBJ_P(return_value) = NULL;
      96           1 :                 return;
      97             :         }
      98             : 
      99          15 :         INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
     100             :         
     101          15 :         if (locale == NULL) {
     102           0 :                 locale = intl_locale_get_default(TSRMLS_C);
     103             :         }
     104             : 
     105          15 :         if (fallback) {
     106          13 :                 rb->me = ures_open(bundlename, locale, &INTL_DATA_ERROR_CODE(rb));
     107             :         } else {
     108           2 :                 rb->me = ures_openDirect(bundlename, locale, &INTL_DATA_ERROR_CODE(rb));
     109             :         }
     110             : 
     111          17 :         INTL_CTOR_CHECK_STATUS(rb, "resourcebundle_ctor: Cannot load libICU resource bundle");
     112             : 
     113          11 :         if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING ||
     114           0 :                         INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) {
     115             :                 char *pbuf;
     116           0 :                 intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC);
     117           0 :                 spprintf(&pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource "
     118             :                                 "'%s' without fallback from %s to %s",
     119           0 :                                 bundlename ? bundlename : "(default data)", locale,
     120             :                                 ures_getLocaleByType(
     121           0 :                                         rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb)));
     122           0 :                 intl_errors_set_custom_msg(INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC);
     123           0 :                 efree(pbuf);
     124           0 :                 Z_OBJ_P(return_value) = NULL;
     125             :         }
     126             : }
     127             : /* }}} */
     128             : 
     129             : /* {{{ arginfo_resourcebundle__construct */
     130             : ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle___construct, 0, 0, 2 )
     131             :         ZEND_ARG_INFO( 0, locale )
     132             :         ZEND_ARG_INFO( 0, bundlename )
     133             :         ZEND_ARG_INFO( 0, fallback )
     134             : ZEND_END_ARG_INFO()
     135             : /* }}} */
     136             : 
     137             : /* {{{ proto void ResourceBundle::__construct( string $locale [, string $bundlename [, bool $fallback = true ]] )
     138             :  * ResourceBundle object constructor
     139             :  */
     140           9 : PHP_METHOD( ResourceBundle, __construct )
     141             : {
     142           9 :         zval orig_this = *getThis();
     143             : 
     144           9 :         return_value = getThis();
     145           9 :         resourcebundle_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
     146             : 
     147           9 :         if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
     148           2 :                 zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
     149             :                 zval_dtor(&orig_this);
     150           2 :                 ZEND_CTOR_MAKE_NULL();
     151             :         }
     152           9 : }
     153             : /* }}} */
     154             : 
     155             : /* {{{ proto ResourceBundle ResourceBundle::create( string $locale [, string $bundlename [, bool $fallback = true ]] )
     156             : proto ResourceBundle resourcebundle_create( string $locale [, string $bundlename [, bool $fallback = true ]] )
     157             : */
     158           7 : PHP_FUNCTION( resourcebundle_create ) 
     159             : {
     160           7 :         object_init_ex( return_value, ResourceBundle_ce_ptr );
     161           7 :         resourcebundle_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
     162           7 :         if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
     163           1 :                 RETURN_NULL();
     164             :         }
     165             : }
     166             : /* }}} */
     167             : 
     168             : /* {{{ resourcebundle_array_fetch */
     169          35 : static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_value, int fallback TSRMLS_DC) 
     170             : {
     171          35 :         int32_t     meindex = 0;
     172          35 :         char *      mekey = NULL;
     173          35 :     zend_bool    is_numeric = 0;
     174             :         char         *pbuf;
     175             :         ResourceBundle_object *rb;
     176             : 
     177          35 :         intl_error_reset( NULL TSRMLS_CC );     
     178          35 :         RESOURCEBUNDLE_METHOD_FETCH_OBJECT;
     179             : 
     180          35 :         if(Z_TYPE_P(offset) == IS_LONG) {
     181           3 :                 is_numeric = 1;
     182           3 :                 meindex = Z_LVAL_P(offset);
     183           3 :                 rb->child = ures_getByIndex( rb->me, meindex, rb->child, &INTL_DATA_ERROR_CODE(rb) );
     184          32 :         } else if(Z_TYPE_P(offset) == IS_STRING) {
     185          32 :                 mekey = Z_STRVAL_P(offset);
     186          32 :                 rb->child = ures_getByKey(rb->me, mekey, rb->child, &INTL_DATA_ERROR_CODE(rb) );
     187             :         } else {
     188           0 :                 intl_errors_set(INTL_DATA_ERROR_P(rb), U_ILLEGAL_ARGUMENT_ERROR,        
     189             :                         "resourcebundle_get: index should be integer or string", 0 TSRMLS_CC);
     190           0 :                 RETURN_NULL();
     191             :         }
     192             : 
     193          35 :         intl_error_set_code( NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC );        
     194          35 :         if (U_FAILURE(INTL_DATA_ERROR_CODE(rb))) {
     195           5 :                 if (is_numeric) {
     196           0 :                         spprintf( &pbuf, 0, "Cannot load resource element %d", meindex );
     197             :                 } else {
     198           5 :                         spprintf( &pbuf, 0, "Cannot load resource element '%s'", mekey );
     199             :                 }
     200           5 :                 intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC );
     201           5 :                 efree(pbuf);
     202           5 :                 RETURN_NULL();
     203             :         }
     204             : 
     205          30 :         if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING || INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) {
     206             :                 UErrorCode icuerror;
     207           0 :                 const char * locale = ures_getLocaleByType( rb->me, ULOC_ACTUAL_LOCALE, &icuerror );
     208           0 :                 if (is_numeric) {
     209           0 :                         spprintf( &pbuf, 0, "Cannot load element %d without fallback from to %s", meindex, locale );
     210             :                 } else {
     211           0 :                         spprintf( &pbuf, 0, "Cannot load element '%s' without fallback from to %s", mekey, locale );
     212             :                 }
     213           0 :                 intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC );
     214           0 :                 efree(pbuf);
     215           0 :                 RETURN_NULL();
     216             :         }
     217             : 
     218          30 :         resourcebundle_extract_value( return_value, rb TSRMLS_CC );
     219             : }
     220             : /* }}} */
     221             : 
     222             : /* {{{ resourcebundle_array_get */
     223          15 : zval *resourcebundle_array_get(zval *object, zval *offset, int type, zval *rv TSRMLS_DC) 
     224             : {
     225          15 :         if(offset == NULL) {
     226           0 :                 php_error( E_ERROR, "Cannot apply [] to ResourceBundle object" );
     227             :         }
     228          15 :         ZVAL_NULL(rv);
     229          15 :         resourcebundle_array_fetch(object, offset, rv, 1 TSRMLS_CC);
     230          15 :         return rv;
     231             : }
     232             : /* }}} */
     233             : 
     234             : /* {{{ arginfo_resourcebundle_get */
     235             : ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get, 0, 0, 1 )
     236             :         ZEND_ARG_INFO( 0, index )
     237             :         ZEND_ARG_INFO( 0, fallback )
     238             : ZEND_END_ARG_INFO()
     239             : /* }}} */
     240             : 
     241             : /* {{{ proto mixed ResourceBundle::get( integer|string $resindex [, bool $fallback = true ] )
     242             :  * proto mixed resourcebundle_get( ResourceBundle $rb, integer|string $resindex [, bool $fallback = true ] )
     243             :  * Get resource identified by numerical index or key name.
     244             :  */
     245          21 : PHP_FUNCTION( resourcebundle_get )
     246             : {
     247          21 :         zend_bool   fallback = 1;
     248             :         zval *          offset;
     249             :         zval *      object;
     250             : 
     251          21 :         if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz|b",        &object, ResourceBundle_ce_ptr, &offset, &fallback ) == FAILURE) {
     252           1 :                 intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,  
     253             :                         "resourcebundle_get: unable to parse input params", 0 TSRMLS_CC);
     254           1 :                 RETURN_FALSE;
     255             :         }
     256             : 
     257          20 :         resourcebundle_array_fetch(object, offset, return_value, fallback TSRMLS_CC);
     258             : }
     259             : /* }}} */
     260             : 
     261             : /* {{{ resourcebundle_array_count */
     262           1 : int resourcebundle_array_count(zval *object, zend_long *count TSRMLS_DC) 
     263             : {
     264             :         ResourceBundle_object *rb;
     265           1 :         RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK;
     266             : 
     267           1 :         if (rb->me == NULL) {
     268           0 :                 intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR,
     269             :                                 "Found unconstructed ResourceBundle", 0 TSRMLS_CC);
     270           0 :                 return 0;
     271             :         }
     272             : 
     273           1 :         *count = ures_getSize( rb->me );
     274             : 
     275           1 :         return SUCCESS;
     276             : }
     277             : /* }}} */
     278             : 
     279             : /* {{{ arginfo_resourcebundle_count */
     280             : ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_count, 0, 0, 0 )
     281             : ZEND_END_ARG_INFO()
     282             : /* }}} */
     283             : 
     284             : /* {{{ proto int ResourceBundle::count()
     285             :  * proto int resourcebundle_count( ResourceBundle $bundle )
     286             :  * Get resources count
     287             :  */
     288           3 : PHP_FUNCTION( resourcebundle_count )
     289             : {
     290             :         int32_t                len;
     291           3 :         RESOURCEBUNDLE_METHOD_INIT_VARS;
     292             : 
     293           3 :         if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) {
     294           1 :                 intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,  
     295             :                         "resourcebundle_count: unable to parse input params", 0 TSRMLS_CC);
     296           1 :                 RETURN_FALSE;
     297             :         }
     298             : 
     299           2 :         RESOURCEBUNDLE_METHOD_FETCH_OBJECT;
     300             : 
     301           2 :         len = ures_getSize( rb->me );
     302           2 :         RETURN_LONG( len );
     303             : }
     304             : 
     305             : /* {{{ arginfo_resourcebundle_getlocales */
     306             : ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_getlocales, 0, 0, 1 )
     307             :         ZEND_ARG_INFO( 0, bundlename )
     308             : ZEND_END_ARG_INFO()
     309             : /* }}} */
     310             : 
     311             : /* {{{ proto array ResourceBundle::getLocales( string $bundlename )
     312             :  * proto array resourcebundle_locales( string $bundlename )
     313             :  * Get available locales from ResourceBundle name
     314             :  */
     315           3 : PHP_FUNCTION( resourcebundle_locales )
     316             : {
     317             :         char * bundlename;
     318           3 :         size_t    bundlename_len = 0;
     319             :         const char * entry;
     320             :         int entry_len;
     321             :         UEnumeration *icuenum;
     322           3 :         UErrorCode   icuerror = U_ZERO_ERROR;
     323             : 
     324           3 :         intl_errors_reset( NULL TSRMLS_CC );
     325             : 
     326           3 :         if( zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &bundlename, &bundlename_len ) == FAILURE )
     327             :         {
     328           1 :                 intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,  
     329             :                         "resourcebundle_locales: unable to parse input params", 0 TSRMLS_CC);
     330           1 :                 RETURN_FALSE;
     331             :         }
     332             : 
     333           2 :         if(bundlename_len == 0) {
     334             :                 // fetch default locales list
     335           0 :                 bundlename = NULL;
     336             :         }
     337             : 
     338           2 :         icuenum = ures_openAvailableLocales( bundlename, &icuerror );
     339           2 :         INTL_CHECK_STATUS(icuerror, "Cannot fetch locales list");             
     340             : 
     341           2 :         uenum_reset( icuenum, &icuerror );
     342           2 :         INTL_CHECK_STATUS(icuerror, "Cannot iterate locales list");           
     343             : 
     344           2 :         array_init( return_value );
     345           8 :         while ((entry = uenum_next( icuenum, &entry_len, &icuerror ))) {
     346           4 :                 add_next_index_stringl( return_value, (char *) entry, entry_len);
     347             :         }
     348           2 :         uenum_close( icuenum );
     349             : }
     350             : /* }}} */
     351             : 
     352             : /* {{{ arginfo_resourcebundle_get_error_code */
     353             : ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_error_code, 0, 0, 0 )
     354             : ZEND_END_ARG_INFO()
     355             : /* }}} */
     356             : 
     357             : /* {{{ proto string ResourceBundle::getErrorCode( )
     358             :  * proto string resourcebundle_get_error_code( ResourceBundle $bundle )
     359             :  * Get text description for ResourceBundle's last error code.
     360             :  */
     361           1 : PHP_FUNCTION( resourcebundle_get_error_code )
     362             : {
     363           1 :         RESOURCEBUNDLE_METHOD_INIT_VARS;
     364             : 
     365           1 :         if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
     366             :                 &object, ResourceBundle_ce_ptr ) == FAILURE )
     367             :         {
     368           1 :                 intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
     369             :                         "resourcebundle_get_error_code: unable to parse input params", 0 TSRMLS_CC );
     370           1 :                 RETURN_FALSE;
     371             :         }
     372             : 
     373           0 :         rb = Z_INTL_RESOURCEBUNDLE_P( object );
     374             : 
     375           0 :         RETURN_LONG(INTL_DATA_ERROR_CODE(rb));
     376             : }
     377             : /* }}} */
     378             : 
     379             : /* {{{ arginfo_resourcebundle_get_error_message */
     380             : ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_error_message, 0, 0, 0 )
     381             : ZEND_END_ARG_INFO()
     382             : /* }}} */
     383             : 
     384             : /* {{{ proto string ResourceBundle::getErrorMessage( )
     385             :  * proto string resourcebundle_get_error_message( ResourceBundle $bundle )
     386             :  * Get text description for ResourceBundle's last error.
     387             :  */
     388           1 : PHP_FUNCTION( resourcebundle_get_error_message )
     389             : {
     390           1 :         zend_string* message = NULL;
     391           1 :         RESOURCEBUNDLE_METHOD_INIT_VARS;
     392             : 
     393           1 :         if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
     394             :                 &object, ResourceBundle_ce_ptr ) == FAILURE )
     395             :         {
     396           1 :                 intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
     397             :                         "resourcebundle_get_error_message: unable to parse input params", 0 TSRMLS_CC );
     398           1 :                 RETURN_FALSE;
     399             :         }
     400             : 
     401           0 :         rb = Z_INTL_RESOURCEBUNDLE_P( object );
     402           0 :         message = intl_error_get_message(INTL_DATA_ERROR_P(rb) TSRMLS_CC);
     403           0 :         RETURN_STR(message);
     404             : }
     405             : /* }}} */
     406             : 
     407             : /* {{{ ResourceBundle_class_functions
     408             :  * Every 'ResourceBundle' class method has an entry in this table
     409             :  */
     410             : static zend_function_entry ResourceBundle_class_functions[] = {
     411             :         PHP_ME( ResourceBundle, __construct, arginfo_resourcebundle___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR )
     412             :         ZEND_NAMED_ME( create, ZEND_FN( resourcebundle_create ), arginfo_resourcebundle___construct, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
     413             :         ZEND_NAMED_ME( get, ZEND_FN(resourcebundle_get), arginfo_resourcebundle_get, ZEND_ACC_PUBLIC )
     414             :         ZEND_NAMED_ME( count, ZEND_FN(resourcebundle_count), arginfo_resourcebundle_count, ZEND_ACC_PUBLIC )
     415             :         ZEND_NAMED_ME( getLocales, ZEND_FN(resourcebundle_locales), arginfo_resourcebundle_getlocales, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC )
     416             :         ZEND_NAMED_ME( getErrorCode, ZEND_FN(resourcebundle_get_error_code), arginfo_resourcebundle_get_error_code, ZEND_ACC_PUBLIC )
     417             :         ZEND_NAMED_ME( getErrorMessage, ZEND_FN(resourcebundle_get_error_message), arginfo_resourcebundle_get_error_message, ZEND_ACC_PUBLIC )
     418             :         PHP_FE_END
     419             : };
     420             : /* }}} */
     421             : 
     422             : /* {{{ resourcebundle_register_class
     423             :  * Initialize 'ResourceBundle' class
     424             :  */
     425       20335 : void resourcebundle_register_class( TSRMLS_D )
     426             : {
     427             :         zend_class_entry ce;
     428             : 
     429       20335 :         INIT_CLASS_ENTRY( ce, "ResourceBundle", ResourceBundle_class_functions );
     430             : 
     431       20335 :         ce.create_object = ResourceBundle_object_create;
     432       20335 :         ce.get_iterator = resourcebundle_get_iterator;
     433             : 
     434       20335 :         ResourceBundle_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
     435             : 
     436       20335 :         if( !ResourceBundle_ce_ptr )
     437             :         {
     438           0 :                 zend_error(E_ERROR, "Failed to register ResourceBundle class");
     439           0 :                 return;
     440             :         }
     441             : 
     442       20335 :         ResourceBundle_object_handlers = std_object_handlers;
     443       20335 :         ResourceBundle_object_handlers.offset = XtOffsetOf(ResourceBundle_object, zend);
     444       20335 :         ResourceBundle_object_handlers.clone_obj          = NULL; /* ICU ResourceBundle has no clone implementation */
     445       20335 :         ResourceBundle_object_handlers.dtor_obj = ResourceBundle_object_destroy;
     446       20335 :         ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get;
     447       20335 :         ResourceBundle_object_handlers.count_elements = resourcebundle_array_count;
     448             : 
     449       20335 :         zend_class_implements(ResourceBundle_ce_ptr TSRMLS_CC, 1, zend_ce_traversable);
     450             : }
     451             : /* }}} */
     452             : 
     453             : /*
     454             :  * Local variables:
     455             :  * tab-width: 4
     456             :  * c-basic-offset: 4
     457             :  * End:
     458             :  * vim600: noet sw=4 ts=4 fdm=marker
     459             :  * vim<600: noet sw=4 ts=4
     460             :  */

Generated by: LCOV version 1.10

Generated at Fri, 19 Sep 2014 17:11:09 +0000 (4 days ago)

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