Property proxy API
A facility to manage extension object properties tied to C-struct members
php_propro_api.c File Reference
#include <php.h>
#include <ext/standard/info.h>
#include "php_propro_api.h"
Include dependency graph for php_propro_api.c:

Macros

#define DEBUG_PROPRO   0
 
#define object_properties_init(o, ce)
 
#define debug_propro(l, f, obj, off, val)
 

Enumerations

enum  ZEND_RESULT_CODE { SUCCESS = 0, FAILURE = -1 }
 

Functions

php_property_proxy_tphp_property_proxy_init (zval *container, const char *member_str, size_t member_len)
 Create a property proxy. More...
 
void php_property_proxy_free (php_property_proxy_t **proxy)
 Destroy and free a property proxy. More...
 
zend_class_entry * php_property_proxy_get_class_entry (void)
 Get the zend_class_entry of php\PropertyProxy. More...
 
zend_object_value php_property_proxy_object_new (zend_class_entry *ce)
 Instantiate a new php\PropertyProxy. More...
 
zend_object_value php_property_proxy_object_new_ex (zend_class_entry *ce, php_property_proxy_t *proxy, php_property_proxy_object_t **ptr)
 Instantiate a new php\PropertyProxy with proxy. More...
 
 ZEND_END_ARG_INFO ()
 
 PHP_MINFO_FUNCTION (propro)
 

Variables

zend_module_entry propro_module_entry
 

Macro Definition Documentation

#define DEBUG_PROPRO   0
#define debug_propro (   l,
  f,
  obj,
  off,
  val 
)
#define object_properties_init (   o,
  ce 
)
Value:
zend_hash_copy(((zend_object *) o)->properties, &(ce->default_properties), \
(copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval*))

Referenced by php_property_proxy_object_new_ex().

Enumeration Type Documentation

Enumerator
SUCCESS 
FAILURE 

Function Documentation

PHP_MINFO_FUNCTION ( propro  )
void php_property_proxy_free ( php_property_proxy_t **  proxy)

Destroy and free a property proxy.

The destruction of the property proxy object calls this.

Parameters
proxya pointer to the allocated property proxy
zend_class_entry* php_property_proxy_get_class_entry ( void  )

Get the zend_class_entry of php\PropertyProxy.

Returns
the class entry pointer
php_property_proxy_t* php_property_proxy_init ( zval *  container,
const char *  member_str,
size_t  member_len 
)

Create a property proxy.

The property proxy will forward reads and writes to itself to the proxied property with name member_str of container.

Parameters
containerthe container holding the property
member_strthe name of the proxied property
member_lenthe length of the name
Returns
a new property proxy
zend_object_value php_property_proxy_object_new ( zend_class_entry *  ce)

Instantiate a new php\PropertyProxy.

Parameters
cethe property proxy or derived class entry
Returns
the zval object value

Here is the call graph for this function:

zend_object_value php_property_proxy_object_new_ex ( zend_class_entry *  ce,
php_property_proxy_t proxy,
php_property_proxy_object_t **  ptr 
)

Instantiate a new php\PropertyProxy with proxy.

Parameters
cethe property proxy or derived class entry
proxythe internal property proxy
ptra pointer to store the resulting property proxy object
Returns
the zval object value

Referenced by php_property_proxy_object_new().

Here is the caller graph for this function:

ZEND_END_ARG_INFO ( )

Variable Documentation

zend_module_entry propro_module_entry
Initial value:
= {
STANDARD_MODULE_HEADER,
"propro",
propro_functions,
PHP_MINIT(propro),
NULL,
NULL,
NULL,
PHP_MINFO(propro),
"1.0.1" ,
STANDARD_MODULE_PROPERTIES
}