Hi, As I told in my Previous Post that I have added a feauture in PHP which is similar to AUTOLOAD feauture in Perl Modules. I had sent a unified diff output along with this.
According to that if a user tried to call a undefined function, PHP Zend Engine would search for a function named '__autoload' in current scope, if it finds one, it would set the global variable $php_undef_func_name with name of the called function and call the __autoload() function with passed arguments. Its working fine for me. If it seems to be good, we could discuss on this. <[EMAIL PROTECTED]> ------------------------------------------------------------------- We must use time wisely and forever realize that the time is always ripe to do right." -- Nelson Mandela -------------------------------------------------------------------
diff -bBr php-4.1.2/Zend/zend_execute.c ./php/php-4.1.2/Zend/zend_execute.c 1555a1556 > if (zend_hash_find(active_function_table, "__autoload", >sizeof("__autoload"), (void **) &function)==FAILURE) { 1556a1558,1566 > } else { > zval *undef_func ; > > ALLOC_ZVAL(undef_func); > convert_to_string(undef_func); > undef_func->value.str.val = (char *) >estrndup(function_name->value.str.val, function_name->value.str.len); > undef_func->value.str.len = function_name->value.str.len >; > undef_func->type = IS_STRING; > zend_hash_update(EG(active_symbol_table), >"php_undef_func_name", sizeof("php_undef_func_name"), &undef_func, sizeof(zval *), >NULL); 1557a1568,1569 > } >
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php