ZOO-Project
Macros | Functions | Variables
service_internal_php.c File Reference
#include <sapi/embed/php_embed.h>
#include <zend_stream.h>
#include "service_internal_php.h"
#include "response_print.h"

Macros

#define ZEND_DEBUG   0
 
#define ZOO_G(v)   (zoo_globals.v)
 
#define PHP_ZOO_VERSION   "1.0"
 
#define PHP_ZOO_EXTNAME   "ZOO"
 
#define phpext_zoo_ptr   &zoo_entry
 

Functions

zval * php_Array_from_maps (maps *t)
 Convert a maps to a php Array. More...
 
zval * php_Array_from_map (map *t)
 Convert a map to a php Array. More...
 
mapsphp_maps_from_Array (HashTable *t)
 Convert a php Array to a maps. More...
 
mapphp_map_from_HasTable (HashTable *t)
 Convert a php Array to a map. More...
 
 PHP_MINIT_FUNCTION (zoo)
 
 PHP_MSHUTDOWN_FUNCTION (zoo)
 
 PHP_RINIT_FUNCTION (zoo)
 
 PHP_FUNCTION (zoo_Translate)
 
 PHP_FUNCTION (zoo_UpdateStatus)
 
 PHP_FUNCTION (zoo_SERVICE_SUCCEEDED)
 
 PHP_FUNCTION (zoo_SERVICE_FAILED)
 
static void php_zoo_init_globals (zend_zoo_globals *zoo_globals)
 
int zoo_php_support (maps **main_conf, map *request, service *s, maps **real_inputs, maps **real_outputs)
 Load a PHP script then run the function corresponding to the service by passing the conf, inputs and outputs parameters by reference. More...
 

Variables

long _SERVICE_SUCCEEDED
 
long _SERVICE_FAILED
 
zend_module_entry zoo_module_entry
 
static zend_function_entry zoo_functions []
 

Macro Definition Documentation

#define PHP_ZOO_EXTNAME   "ZOO"
#define PHP_ZOO_VERSION   "1.0"
#define phpext_zoo_ptr   &zoo_entry
#define ZEND_DEBUG   0
#define ZOO_G (   v)    (zoo_globals.v)

Function Documentation

zval * php_Array_from_map ( map t)

Convert a map to a php Array.

Parameters
tthe map to convert
Returns
the php Array
zval * php_Array_from_maps ( maps t)

Convert a maps to a php Array.

Parameters
tthe maps to convert
Returns
the php Array
PHP_FUNCTION ( zoo_Translate  )
PHP_FUNCTION ( zoo_UpdateStatus  )
PHP_FUNCTION ( zoo_SERVICE_SUCCEEDED  )
PHP_FUNCTION ( zoo_SERVICE_FAILED  )
map * php_map_from_HasTable ( HashTable *  t)

Convert a php Array to a map.

Parameters
tthe php Array to convert
Returns
the created map

Duplicate the zval so that * the orignal’s contents are not destroyed

Reset refcount & Convert

maps * php_maps_from_Array ( HashTable *  t)

Convert a php Array to a maps.

Parameters
tthe php Array to convert
Returns
the created maps

Should never actually fail since the key is known to exist.

Duplicate the zval so that * the orignal’s contents are not destroyed

Reset refcount & Convert

String Key / Associative

Toss out old copy

PHP_MINIT_FUNCTION ( zoo  )
PHP_MSHUTDOWN_FUNCTION ( zoo  )
PHP_RINIT_FUNCTION ( zoo  )
static void php_zoo_init_globals ( zend_zoo_globals *  zoo_globals)
static
int zoo_php_support ( maps **  main_conf,
map request,
service s,
maps **  real_inputs,
maps **  real_outputs 
)

Load a PHP script then run the function corresponding to the service by passing the conf, inputs and outputs parameters by reference.

Parameters
main_confthe conf maps containing the main.cfg settings
requestthe map containing the HTTP request
sthe service structure
real_inputsthe maps containing the inputs
real_outputsthe maps containing the outputs

Variable Documentation

long _SERVICE_FAILED
long _SERVICE_SUCCEEDED
zend_function_entry zoo_functions[]
static
Initial value:
= {
PHP_FE(zoo_SERVICE_FAILED, NULL)
{NULL, NULL, NULL}
}
zend_module_entry zoo_module_entry
Initial value:
= {
PHP_MINIT(zoo),
PHP_MSHUTDOWN(zoo),
PHP_RINIT(zoo),
NULL,
NULL,
STANDARD_MODULE_PROPERTIES
}
static zend_function_entry zoo_functions[]
Definition: service_internal_php.c:76
#define PHP_ZOO_EXTNAME
Definition: service_internal_php.c:60