Changeset 271

Show
Ignore:
Timestamp:
09/15/06 17:01:01 (2 years ago)
Author:
bart
Message:

Only put the function that has the same name as the class as contructor

if there isn't a construct function. This fixes ticket #172

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/branches/0.9.5/ChangeLog

    r270 r271  
    55        * Some fixes to make eAccelerator compile with php 5.2, this fixes bug #150 
    66        * Restore __toString methods correctly with php 5.2 
     7        * only put the function that has the same name as the class as contructor  
     8          if there isn't a __construct function. This fixes ticket #172 
    79 
    8102006-08-29  Hans Rakers <hans at parse dot nl> 
  • eaccelerator/branches/0.9.5/ea_restore.c

    r270 r271  
    759759        Bucket *p = to->function_table.pListHead; 
    760760 
     761    to->constructor = NULL; 
     762 
    761763        while (p != NULL) { 
    762764                f = p->pData; 
     
    764766                fname_lc = zend_str_tolower_dup(f->common.function_name, fname_len); 
    765767                 
    766                 if (fname_len == cname_len && !memcmp(fname_lc, cname_lc, fname_len) && f->common.scope != to->parent) { 
     768        /* only put the function that has the same name as the class as contructor if there isn't a __construct function */ 
     769                if (fname_len == cname_len && !memcmp(fname_lc, cname_lc, fname_len) && f->common.scope != to->parent 
     770                && to->constructor == NULL) { 
    767771                        to->constructor = f; 
    768772                } else if (fname_lc[0] == '_' && fname_lc[1] == '_' && f->common.scope != to->parent) { 
  • eaccelerator/trunk/ChangeLog

    r269 r271  
    33        * Reverse changeset 205 (doc-comment exclusion) from Tom Regner  
    44          <t.regner at librics.de>.  
     5        * only put the function that has the same name as the class as contructor  
     6          if there isn't a __construct function. This fixes ticket #172 
    57 
    682006-08-29  Hans Rakers <hans at parse dot nl> 
  • eaccelerator/trunk/ea_restore.c

    r269 r271  
    722722        Bucket *p = to->function_table.pListHead; 
    723723 
     724    to->constructor = NULL; 
     725 
    724726        while (p != NULL) { 
    725727                f = p->pData; 
     
    727729                fname_lc = zend_str_tolower_dup(f->common.function_name, fname_len); 
    728730                 
    729                 if (fname_len == cname_len && !memcmp(fname_lc, cname_lc, fname_len) && f->common.scope != to->parent) { 
     731        /* only put the function that has the same name as the class as contructor if there isn't a __construct function */ 
     732                if (fname_len == cname_len && !memcmp(fname_lc, cname_lc, fname_len) && f->common.scope != to->parent 
     733                && to->constructor == NULL) { 
    730734                        to->constructor = f; 
    731735                } else if (fname_lc[0] == '_' && fname_lc[1] == '_' && f->common.scope != to->parent) {