Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions | Variables
php_xsl.h File Reference
#include <libxslt/xsltconfig.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/xsltutils.h>
#include <libxslt/transform.h>
#include <libxslt/security.h>
#include "../dom/xml_common.h"
#include "xsl_fe.h"
#include <libxslt/extensions.h>
#include <libxml/xpathInternals.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _xsl_object

Defines

#define phpext_xsl_ptr   &xsl_module_entry
#define XSL_SECPREF_NONE   0
#define XSL_SECPREF_READ_FILE   2
#define XSL_SECPREF_WRITE_FILE   4
#define XSL_SECPREF_CREATE_DIRECTORY   8
#define XSL_SECPREF_READ_NETWORK   16
#define XSL_SECPREF_WRITE_NETWORK   32
#define XSL_SECPREF_DEFAULT   44
#define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry)
#define XSL_DOMOBJ_NEW(zval, obj, ret)
#define XSL_G(v)   (xsl_globals.v)

Typedefs

typedef struct _xsl_object xsl_object

Functions

void php_xsl_set_object (zval *wrapper, void *obj TSRMLS_DC)
void xsl_objects_free_storage (void *object TSRMLS_DC)
zval * php_xsl_create_object (xsltStylesheetPtr obj, int *found, zval *wrapper_in, zval *return_value TSRMLS_DC)
void xsl_ext_function_string_php (xmlXPathParserContextPtr ctxt, int nargs)
void xsl_ext_function_object_php (xmlXPathParserContextPtr ctxt, int nargs)
 PHP_MINIT_FUNCTION (xsl)
 PHP_MSHUTDOWN_FUNCTION (xsl)
 PHP_RINIT_FUNCTION (xsl)
 PHP_RSHUTDOWN_FUNCTION (xsl)
 PHP_MINFO_FUNCTION (xsl)

Variables

zend_module_entry xsl_module_entry

Class Documentation

struct _xsl_object

Definition at line 56 of file php_xsl.h.

Collaboration diagram for _xsl_object:
Class Members
php_libxml_node_object * doc
zend_object_handle handle
int hasKeys
HashTable * node_list
HashTable * parameter
char * profiling
HashTable * prop_handler
void * ptr
HashTable * registered_phpfunctions
int registerPhpFunctions
zend_object std

Define Documentation

Definition at line 25 of file php_xsl.h.

#define REGISTER_XSL_CLASS (   ce,
  name,
  parent_ce,
  funcs,
  entry 
)
Value:
INIT_CLASS_ENTRY(ce, name, funcs); \
ce.create_object = xsl_objects_new; \
entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC);

Definition at line 77 of file php_xsl.h.

#define XSL_DOMOBJ_NEW (   zval,
  obj,
  ret 
)
Value:
if (NULL == (zval = php_xsl_create_object(obj, ret, zval, return_value TSRMLS_CC))) { \
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \
              RETURN_FALSE; \
       }

Definition at line 82 of file php_xsl.h.

#define XSL_G (   v)    (xsl_globals.v)

Definition at line 120 of file php_xsl.h.

Definition at line 50 of file php_xsl.h.

#define XSL_SECPREF_DEFAULT   44

Definition at line 54 of file php_xsl.h.

#define XSL_SECPREF_NONE   0

Definition at line 47 of file php_xsl.h.

#define XSL_SECPREF_READ_FILE   2

Definition at line 48 of file php_xsl.h.

#define XSL_SECPREF_READ_NETWORK   16

Definition at line 51 of file php_xsl.h.

#define XSL_SECPREF_WRITE_FILE   4

Definition at line 49 of file php_xsl.h.

#define XSL_SECPREF_WRITE_NETWORK   32

Definition at line 52 of file php_xsl.h.


Typedef Documentation

typedef struct _xsl_object xsl_object

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:

void xsl_ext_function_object_php ( xmlXPathParserContextPtr  ctxt,
int  nargs 
)

Definition at line 373 of file xsltprocessor.c.

{
       xsl_ext_function_php(ctxt, nargs, 2);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void xsl_ext_function_string_php ( xmlXPathParserContextPtr  ctxt,
int  nargs 
)

Definition at line 367 of file xsltprocessor.c.

{
       xsl_ext_function_php(ctxt, nargs, 1);
}

Here is the call graph for this function:

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:


Variable Documentation

zend_module_entry xsl_module_entry

Definition at line 49 of file php_xsl.c.