Index: trunk/zoo-project/zoo-kernel/service_internal_php.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_php.c	(revision 348)
+++ trunk/zoo-project/zoo-kernel/service_internal_php.c	(revision 508)
@@ -56,11 +56,7 @@
 
   php_embed_init(0,NULL,&tsrm_ls);
-
-  fprintf(stderr,"PHP EMBEDED\n");
   
   zend_try {
-    fprintf(stderr,"PHP EMBEDED include script %s\n",tmp->value);
     php_execute_script(&iscript TSRMLS_CC);
-    fprintf(stderr,"PHP EMBEDED include script done\n");
 
     zval *iargs[3];
@@ -68,11 +64,7 @@
       
     ZVAL_STRING(&ifunc, s->name, 0);
-    fprintf(stderr,"PHP EMBEDED include script done\n");
     iargs[0] = php_Array_from_maps(*main_conf);
-    fprintf(stderr,"PHP EMBEDED include script done\n");
     iargs[1] = php_Array_from_maps(*real_inputs);
-    fprintf(stderr,"PHP EMBEDED include script done\n");
     iargs[2] = php_Array_from_maps(*real_outputs);
-    fprintf(stderr,"PHP EMBEDED include script done\n");
     
     call_user_function(EG(function_table), NULL, &ifunc, &iret, 3, iargs TSRMLS_CC);
@@ -81,9 +73,5 @@
     *real_outputs=php_maps_from_Array(t);
     
-    dumpMaps(*real_outputs);
-
     char tmp1[1024];
-
-    sprintf(tmp1,"PHP EMBEDED ran function successfully and return %d !?",Z_STRVAL(iret));
 
     res=SERVICE_SUCCEEDED;
@@ -106,8 +94,6 @@
   maps* tmp=t;
   int tres=0;
-  fprintf(stderr,"arra_init\n");
   MAKE_STD_ZVAL(mapArray);
   tres=array_init(mapArray);
-  fprintf(stderr,"arra_init %d\n",tres);
   while(tmp!=NULL){
     add_assoc_zval(mapArray,tmp->name,php_Array_from_map(tmp->content));
@@ -122,11 +108,12 @@
   map* tmp=t;
   int tres=0;
-  fprintf(stderr,"arra_init\n");
   MAKE_STD_ZVAL(mapArray);
   tres=array_init(mapArray);
-  fprintf(stderr,"arra_init\n");
   while(tmp!=NULL){
-    fprintf(stderr,"=> %s %d %s %d \n",tmp->name,strlen(tmp->name),tmp->value,strlen(tmp->value));
-    tres=add_assoc_string(mapArray,tmp->name,tmp->value,1);
+    map* sMap=getMapArray(tmp,"size",i);
+    if(strncmp(tmp->name,"value",5)==0 && sMap!=NULL){
+      tres=add_assoc_stringl(mapArray,tmp->name,tmp->value,atoi(sMap->value),1);
+    }else
+      tres=add_assoc_string(mapArray,tmp->name,tmp->value,1);
     tmp=tmp->next;
   }
@@ -135,7 +122,4 @@
 
 maps* php_maps_from_Array(HashTable *t){
-  //#ifdef DEBUG
-  fprintf(stderr,"mapsFromPHPArray start\n");
-  //#endif
   maps* final_res=NULL;
   maps* cursor=final_res;
@@ -150,5 +134,4 @@
     zval **ppzval, tmpcopy; 
     type = zend_hash_get_current_key_ex(t, &key, &keylen, &idx, 0, NULL); 
-    fprintf(stderr,"key : %s\n",key);
     if (zend_hash_get_current_data(t, (void**)&ppzval) == FAILURE) { 
       /**
@@ -161,7 +144,11 @@
      */
     tmpcopy = **ppzval;
-    fprintf(stderr,"key : %s\n",key);
+#ifdef DEBUG
+    fprintf(stderr,"key : %s\n",key);
+#endif
     zval_copy_ctor(&tmpcopy); 
-    fprintf(stderr,"key : %s\n",key);
+#ifdef DEBUG
+    fprintf(stderr,"key : %s\n",key);
+#endif
     /**
      * Reset refcount & Convert
@@ -178,5 +165,7 @@
     fprintf(stderr,"key : %s\n",key);
     HashTable* t=HASH_OF(*ppzval);
-    fprintf(stderr,"key : %s\n",key);
+#ifdef DEBUG
+    fprintf(stderr,"key : %s\n",key);
+#endif
     cursor->content=php_map_from_HasTable(t);
     cursor->next=NULL;
@@ -185,5 +174,7 @@
     else
       addMapsToMaps(&final_res,cursor);
-    fprintf(stderr,"key : %s\n",key);
+#ifdef DEBUG
+    fprintf(stderr,"key : %s\n",key);
+#endif
     /**
      * Toss out old copy
@@ -201,12 +192,13 @@
   final_res=NULL;
   char key[1024];
-  for(zend_hash_internal_pointer_reset(t); 
-      zend_hash_has_more_elements(t) == SUCCESS; 
-      zend_hash_move_forward(t)) { 
-    char *key; 
-    uint keylen; 
-    ulong idx; 
-    int type; 
-    zval **ppzval, tmpcopy; 
+  for(zend_hash_internal_pointer_reset(t);
+      zend_hash_has_more_elements(t) == SUCCESS;
+      zend_hash_move_forward(t)) {
+    char *key;
+    uint keylen;
+    ulong idx;
+    int type;
+    int len;
+    zval **ppzval, tmpcopy;
     type = zend_hash_get_current_key_ex(t, &key, &keylen, &idx, 0, NULL); 
     if (zend_hash_get_current_data(t, (void**)&ppzval) == FAILURE) { 
@@ -223,12 +215,22 @@
      */ 
     INIT_PZVAL(&tmpcopy); 
-    convert_to_string(&tmpcopy); 
-    if(final_res==NULL){
-      fprintf(stderr,"%s => %s\n",key,Z_STRVAL(tmpcopy));
-      final_res=createMap(key,Z_STRVAL(tmpcopy));
+    convert_to_string(&tmpcopy);
+    if(strncmp(key,"value")==0){
+      len=Z_STRLEN_P(varcopy);
+      addToMapWithSize(final_res,key,Z_STRVAL_P(tmpcopy),len);
     }
     else{
-      fprintf(stderr,"%s => %s\n",key,Z_STRVAL(tmpcopy));
-      addMapToMap(&final_res,createMap(key,Z_STRVAL(tmpcopy)));
+      if(final_res==NULL){
+#ifdef DEBUG
+	fprintf(stderr,"%s => %s\n",key,Z_STRVAL(tmpcopy));
+#endif
+	final_res=createMap(key,Z_STRVAL(tmpcopy));
+      }
+      else{
+#ifdef DEBUG
+	fprintf(stderr,"%s => %s\n",key,Z_STRVAL(tmpcopy));
+#endif
+	addToMap(&final_res,key,Z_STRVAL(tmpcopy));
+      }
     }
     /* Toss out old copy */ 
