Changeset 15393

Show
Ignore:
Timestamp:
03/06/08 10:14:25 (9 months ago)
Author:
piotras
Message:

make_midgard_global: add argv values only if value found is not NULL
list and list_children: get base class pointer ( instead of pointer's pointer in ZE2 )

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/branch-1-8/src/apis/php4/midgard.c

    r15390 r15393  
    13281328PHP_FUNCTION(_midgard_php_object_list) 
    13291329{ 
    1330 #if  (PHP_MAJOR_VERSION < 5) 
    13311330        zend_class_entry *ce; 
    1332 #else 
    1333         zend_class_entry **ce; 
    1334 #endif 
    13351331        RETVAL_FALSE; 
    13361332        CHECK_MGD; 
     
    13391335                WRONG_PARAM_COUNT; 
    13401336         
    1341 #if  (PHP_MAJOR_VERSION < 5) 
    13421337        ce = php_midgard_get_baseclass_ptr(Z_OBJCE_P(getThis())); 
    1343 #else  
    1344         *ce = php_midgard_get_baseclass_ptr(Z_OBJCE_P(getThis())); 
    1345 #endif 
     1338 
    13461339        array_init(return_value); 
    13471340         
     
    13651358                                                g_type_name(G_TYPE_FROM_INSTANCE(objects[i])), -1); 
    13661359#if  (PHP_MAJOR_VERSION < 5) 
    1367                                 zend_class_entry *ce; 
     1360                                zend_class_entry *f_ce; 
    13681361                                zend_hash_find(CG(class_table),  
    13691362                                                class_name, strlen(class_name)+1, (void **) &ce); 
    1370                                 object_init_ex(zobject, ce); 
    1371 #else 
    1372                                 zend_class_entry **ce; 
     1363                                object_init_ex(zobject, f_ce); 
     1364#else   
     1365                                zend_class_entry **f_ce; 
    13731366                                zend_hash_find(CG(class_table),  
    1374                                                 class_name, strlen(class_name)+1, (void **) &ce); 
    1375                                 object_init_ex(zobject, *ce); 
     1367                                                class_name, strlen(class_name)+1, (void **) &f_ce); 
     1368                                object_init_ex(zobject, *f_ce); 
    13761369#endif /* (PHP_MAJOR_VERSION < 5) */ 
    13771370                                g_free(class_name); 
     
    13901383PHP_FUNCTION(_midgard_php_object_list_children) 
    13911384{ 
    1392 #if  (PHP_MAJOR_VERSION < 5) 
    13931385        zend_class_entry *ce; 
    1394 #else  
    1395         zend_class_entry **ce; 
    1396 #endif 
    13971386        gchar *childcname; 
    13981387        guint ccnl; 
     
    14051394        } 
    14061395         
    1407 #if  (PHP_MAJOR_VERSION < 5) 
    14081396        ce = php_midgard_get_baseclass_ptr(Z_OBJCE_P(getThis())); 
    1409 #else 
    1410         *ce = php_midgard_get_baseclass_ptr(Z_OBJCE_P(getThis())); 
    1411 #endif 
    1412  
     1397         
    14131398        array_init(return_value); 
    14141399         
     
    14341419                                                g_type_name(G_TYPE_FROM_INSTANCE(objects[i])), -1); 
    14351420#if  (PHP_MAJOR_VERSION < 5) 
    1436                                 zend_class_entry *ce; 
     1421                                zend_class_entry *f_ce; 
    14371422                                zend_hash_find(CG(class_table), 
    14381423                                                class_name, strlen(class_name)+1, (void **) &ce); 
    14391424                                object_init_ex(zobject, ce); 
    14401425#else 
    1441                                 zend_class_entry **ce; 
     1426                                zend_class_entry **f_ce; 
    14421427                                zend_hash_find(CG(class_table), 
    1443                                                 class_name, strlen(class_name)+1, (void **) &ce); 
    1444                                 object_init_ex(zobject, *ce); 
     1428                                                class_name, strlen(class_name)+1, (void **) &f_ce); 
     1429                                object_init_ex(zobject, *f_ce); 
    14451430#endif /* (PHP_MAJOR_VERSION < 5) */ 
    14461431                                g_free(class_name); 
     
    28042789                add_assoc_long(mgd_php_globals, "argc", mm_argc); 
    28052790     
    2806                 for (i = 0; i < mm_argc; i++) 
    2807                         add_index_string(argv, i, mm_argv[i], 1); 
     2791                for (i = 0; i < mm_argc; i++) { 
     2792                        if(mm_argv[i] != NULL) 
     2793                                add_index_string(argv, i, mm_argv[i], 1); 
     2794                        else  
     2795                                add_index_string(argv, i, "", 1); 
     2796                } 
    28082797        } 
    28092798