Back to index

php5  5.3.10
Functions | Variables
php_xsl.c File Reference
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_xsl.h"

Go to the source code of this file.

Functions

void xsl_objects_free_storage (void *object TSRMLS_DC)
zend_object_value xsl_objects_new (zend_class_entry *class_type TSRMLS_DC)
 PHP_MINIT_FUNCTION (xsl)
zval * xsl_object_get_data (void *obj)
static void xsl_object_set_data (void *obj, zval *wrapper TSRMLS_DC)
void php_xsl_set_object (zval *wrapper, void *obj TSRMLS_DC)
zval * php_xsl_create_object (xsltStylesheetPtr obj, int *found, zval *wrapper_in, zval *return_value TSRMLS_DC)
 PHP_MSHUTDOWN_FUNCTION (xsl)
 PHP_RINIT_FUNCTION (xsl)
 PHP_RSHUTDOWN_FUNCTION (xsl)
 PHP_MINFO_FUNCTION (xsl)

Variables

zend_class_entry * xsl_xsltprocessor_class_entry
static zend_object_handlers xsl_object_handlers
const zend_function_entry xsl_functions []
static const zend_module_dep xsl_deps []
zend_module_entry xsl_module_entry

Function Documentation

PHP_MINFO_FUNCTION ( xsl  )

Definition at line 304 of file php_xsl.c.

{
       php_info_print_table_start();
       {
              char buffer[128];
              int major, minor, subminor;

              php_info_print_table_row(2, "XSL", "enabled");
              major = xsltLibxsltVersion/10000;
              minor = (xsltLibxsltVersion - major * 10000) / 100;
              subminor = (xsltLibxsltVersion - major * 10000 - minor * 100);
              snprintf(buffer, 128, "%d.%d.%d", major, minor, subminor);
              php_info_print_table_row(2, "libxslt Version", buffer);
              major = xsltLibxmlVersion/10000;
              minor = (xsltLibxmlVersion - major * 10000) / 100;
              subminor = (xsltLibxmlVersion - major * 10000 - minor * 100);
              snprintf(buffer, 128, "%d.%d.%d", major, minor, subminor);
              php_info_print_table_row(2, "libxslt compiled against libxml Version", buffer);
       }
#if HAVE_XSL_EXSLT
       php_info_print_table_row(2, "EXSLT", "enabled");
       php_info_print_table_row(2, "libexslt Version", LIBEXSLT_DOTTED_VERSION);
#endif
       php_info_print_table_end();
}

Here is the call graph for this function:

PHP_MINIT_FUNCTION ( xsl  )

Definition at line 153 of file php_xsl.c.

{
       
       zend_class_entry ce;
       
       memcpy(&xsl_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
       xsl_object_handlers.clone_obj = NULL;

       REGISTER_XSL_CLASS(ce, "XSLTProcessor", NULL, php_xsl_xsltprocessor_class_functions, xsl_xsltprocessor_class_entry);
#if HAVE_XSL_EXSLT
       exsltRegisterAll();
#endif
 
       xsltRegisterExtModuleFunction ((const xmlChar *) "functionString",
                               (const xmlChar *) "http://php.net/xsl",
                               xsl_ext_function_string_php);
       xsltRegisterExtModuleFunction ((const xmlChar *) "function",
                               (const xmlChar *) "http://php.net/xsl",
                               xsl_ext_function_object_php);

       REGISTER_LONG_CONSTANT("XSL_CLONE_AUTO",      0,     CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("XSL_CLONE_NEVER",    -1,     CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("XSL_CLONE_ALWAYS",    1,     CONST_CS | CONST_PERSISTENT);

       REGISTER_LONG_CONSTANT("XSL_SECPREF_NONE",             XSL_SECPREF_NONE,             CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("XSL_SECPREF_READ_FILE",        XSL_SECPREF_READ_FILE,        CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("XSL_SECPREF_WRITE_FILE",       XSL_SECPREF_WRITE_FILE,       CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("XSL_SECPREF_CREATE_DIRECTORY", XSL_SECPREF_CREATE_DIRECTORY, CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("XSL_SECPREF_READ_NETWORK",     XSL_SECPREF_READ_NETWORK,     CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("XSL_SECPREF_WRITE_NETWORK",    XSL_SECPREF_WRITE_NETWORK,    CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("XSL_SECPREF_DEFAULT",          XSL_SECPREF_DEFAULT,          CONST_CS | CONST_PERSISTENT);

       REGISTER_LONG_CONSTANT("LIBXSLT_VERSION",           LIBXSLT_VERSION,            CONST_CS | CONST_PERSISTENT);
       REGISTER_STRING_CONSTANT("LIBXSLT_DOTTED_VERSION",  LIBXSLT_DOTTED_VERSION,     CONST_CS | CONST_PERSISTENT);

#if HAVE_XSL_EXSLT
       REGISTER_LONG_CONSTANT("LIBEXSLT_VERSION",           LIBEXSLT_VERSION,            CONST_CS | CONST_PERSISTENT);
       REGISTER_STRING_CONSTANT("LIBEXSLT_DOTTED_VERSION",  LIBEXSLT_DOTTED_VERSION,     CONST_CS | CONST_PERSISTENT);
#endif

    REGISTER_INI_ENTRIES();

       return SUCCESS;
}

Here is the call graph for this function:

Definition at line 269 of file php_xsl.c.

{
       xsltUnregisterExtModuleFunction ((const xmlChar *) "functionString",
                               (const xmlChar *) "http://php.net/xsl");
       xsltUnregisterExtModuleFunction ((const xmlChar *) "function",
                               (const xmlChar *) "http://php.net/xsl");

       xsltCleanupGlobals();

       UNREGISTER_INI_ENTRIES();

       return SUCCESS;
}
PHP_RINIT_FUNCTION ( xsl  )

Definition at line 286 of file php_xsl.c.

{
       xsltSetGenericErrorFunc(NULL, php_libxml_error_handler);
       return SUCCESS;
}

Definition at line 295 of file php_xsl.c.

{
       xsltSetGenericErrorFunc(NULL, NULL);
       return SUCCESS;
}
zval* php_xsl_create_object ( xsltStylesheetPtr  obj,
int found,
zval *  wrapper_in,
zval *return_value  TSRMLS_DC 
)

Definition at line 227 of file php_xsl.c.

{
       zval *wrapper;
       zend_class_entry *ce;

       *found = 0;

       if (!obj) {
              if(!wrapper_in) {
                     ALLOC_ZVAL(wrapper);
              } else {
                     wrapper = wrapper_in;
              }
              ZVAL_NULL(wrapper);
              return wrapper;
       }

       if ((wrapper = (zval *) xsl_object_get_data((void *) obj))) {
              zval_add_ref(&wrapper);
              *found = 1;
              return wrapper;
       }

       if(!wrapper_in) {
              wrapper = return_value;
       } else {
              wrapper = wrapper_in;
       }

       
       ce = xsl_xsltprocessor_class_entry;

       if(!wrapper_in) {
              object_init_ex(wrapper, ce);
       }
       php_xsl_set_object(wrapper, (void *) obj TSRMLS_CC);
       return (wrapper);
}

Here is the call graph for this function:

void php_xsl_set_object ( zval *  wrapper,
void *obj  TSRMLS_DC 
)

Definition at line 216 of file php_xsl.c.

{
       xsl_object *object;

       object = (xsl_object *)zend_objects_get_address(wrapper TSRMLS_CC);
       object->ptr = obj;
       xsl_object_set_data(obj, wrapper TSRMLS_CC);
}

Here is the call graph for this function:

Here is the caller graph for this function:

zval* xsl_object_get_data ( void *  obj)

Definition at line 200 of file php_xsl.c.

{
       zval *dom_wrapper;
       dom_wrapper = ((xsltStylesheetPtr) obj)->_private;
       return dom_wrapper;
}

Here is the caller graph for this function:

static void xsl_object_set_data ( void *  obj,
zval *wrapper  TSRMLS_DC 
) [static]

Definition at line 209 of file php_xsl.c.

{
       ((xsltStylesheetPtr) obj)->_private = wrapper;
}

Here is the caller graph for this function:

void xsl_objects_free_storage ( void *object  TSRMLS_DC)

Definition at line 75 of file php_xsl.c.

{
       xsl_object *intern = (xsl_object *)object;

       zend_object_std_dtor(&intern->std TSRMLS_CC);

       zend_hash_destroy(intern->parameter);
       FREE_HASHTABLE(intern->parameter);
       
       zend_hash_destroy(intern->registered_phpfunctions);
       FREE_HASHTABLE(intern->registered_phpfunctions);
       
       if (intern->node_list) {
              zend_hash_destroy(intern->node_list);
              FREE_HASHTABLE(intern->node_list);
       }

       if (intern->doc) {
              php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC);
              efree(intern->doc);
       }

       if (intern->ptr) {
              /* free wrapper */
              if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) {
                     ((xsltStylesheetPtr) intern->ptr)->_private = NULL;   
              }

              xsltFreeStylesheet((xsltStylesheetPtr) intern->ptr);
              intern->ptr = NULL;
       }
       if (intern->profiling) {
              efree(intern->profiling);
       }
       efree(object);
}

Here is the call graph for this function:

Here is the caller graph for this function:

zend_object_value xsl_objects_new ( zend_class_entry *class_type  TSRMLS_DC)

Definition at line 114 of file php_xsl.c.

{
       zend_object_value retval;
       xsl_object *intern;
       zval *tmp;

       intern = emalloc(sizeof(xsl_object));
       intern->ptr = NULL;
       intern->prop_handler = NULL;
       intern->parameter = NULL;
       intern->hasKeys = 0;
       intern->registerPhpFunctions = 0;
       intern->registered_phpfunctions = NULL;
       intern->node_list = NULL;
       intern->doc = NULL;
       intern->profiling = NULL;

       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
       zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
       ALLOC_HASHTABLE(intern->parameter);
       zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0);
       ALLOC_HASHTABLE(intern->registered_phpfunctions);
       zend_hash_init(intern->registered_phpfunctions, 0, NULL, ZVAL_PTR_DTOR, 0);
       retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) xsl_objects_free_storage, NULL TSRMLS_CC);
       intern->handle = retval.handle;
       retval.handlers = &xsl_object_handlers;
       return retval;
}

Here is the call graph for this function:


Variable Documentation

const zend_module_dep xsl_deps[] [static]
Initial value:

Definition at line 42 of file php_xsl.c.

Initial value:

Definition at line 37 of file php_xsl.c.

zend_module_entry xsl_module_entry
Initial value:

Definition at line 49 of file php_xsl.c.

zend_object_handlers xsl_object_handlers [static]

Definition at line 31 of file php_xsl.c.

zend_class_entry* xsl_xsltprocessor_class_entry

Definition at line 30 of file php_xsl.c.