Back to index

php5  5.3.10
Functions
collator_create.c File Reference
#include "php_intl.h"
#include "collator_class.h"
#include "collator_create.h"
#include "intl_data.h"

Go to the source code of this file.

Functions

static void collator_ctor (INTERNAL_FUNCTION_PARAMETERS)
 PHP_FUNCTION (collator_create)
 PHP_METHOD (Collator, __construct)

Function Documentation

static void collator_ctor ( INTERNAL_FUNCTION_PARAMETERS  ) [static]

Definition at line 28 of file collator_create.c.

{
       char*            locale;
       int              locale_len = 0;
       zval*            object;
       Collator_object* co;

       intl_error_reset( NULL TSRMLS_CC );
       object = return_value;
       /* Parse parameters. */
       if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
              &locale, &locale_len ) == FAILURE )
       {
              intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                     "collator_create: unable to parse input params", 0 TSRMLS_CC );
              zval_dtor(return_value);
              RETURN_NULL();
       }

       INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
       co = (Collator_object *) zend_object_store_get_object( object TSRMLS_CC );

       if(locale_len == 0) {
              locale = INTL_G(default_locale);
       }

       /* Open ICU collator. */
       co->ucoll = ucol_open( locale, COLLATOR_ERROR_CODE_P( co ) );
       INTL_CTOR_CHECK_STATUS(co, "collator_create: unable to open ICU collator");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 63 of file collator_create.c.

Here is the call graph for this function:

PHP_METHOD ( Collator  ,
__construct   
)

Definition at line 73 of file collator_create.c.

Here is the call graph for this function: