[PHP-DEV] Re: new database extension

2003-01-04 Thread Leon Mergen

"Jacob R Chandler" <[EMAIL PROTECTED]> wrote
using ODBC. However, I'm not exactly sure where to start and wanted to
look at those specific extensions. Can someone tell me where I might
find this within the PHP source?

Hello Jacob,

I recommend you to do 3 things: check the php manual on the "Extending PHP"
part, check the ext/ dir to look at how other modules are written, and check
then Zend/ dir for available macros.

Hope this helps.

Regards,

Leon Mergen



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Re: PHP5/ZE2: variables definition, constant variables

2003-01-03 Thread Leon Mergen

"Victor Toni" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What I do not like about PHP variables, is that they do not have to be
> defined before use.

Well, this definately is plainly a choice. One of PHP's "goals" is to be
very easy to learn. Many people programming PHP have never ever programmed
before. For them, it is VERY easy to learn, because these kind of things
(variable declaration) are not dealt with.

Regards,

Leon Mergen



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Quick array question

2002-12-29 Thread Leon Mergen

"Derick Rethans" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > A quick question - is there some sort of macro available where I can
convert
> > a PHP array with numeric elements (array ("foo","bar","wombat"); for
> > example) to the standard C type of array (which you can access with
var[10]) ?
>
> Nope, there is no macro for this.

Okay, thank you for your quick reply!

Regards,

Leon Mergen



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Quick array question

2002-12-29 Thread Leon Mergen
Hello there,

A quick question - is there some sort of macro available where I can convert
a PHP array with numeric elements (array ("foo","bar","wombat"); for
example) to the standard C type of array (which you can access with var[10])
?

Thanks in advance.

Regards,

Leon Mergen



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php




Re: Fwd: Re: [PHP-DEV] ext_skel

2002-12-25 Thread Leon Mergen
Hello,

"David Gillies" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> OK, how about a much-expanded version for 4.3.1, say?
> I'm a big fan of self-documenting code (use the
> source, Luke). Perhaps a default function with all the
> bells and whistles (checking for references, grabbing
> a resource, etc, all documented up the wazoo).

Being a complete newbie at extending PHP (I started yesterday as we speak) ,
I must say that that first function helped me a lot. It gave me a general
idea how the things worked, and also how argument passing works.

And, like you stated, I think it would be a great idea to demonstrate all
major functions that people use...

Just my $0.02 worth

Regards,

Leon Mergen
http://www.antrophia.com/



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] " too few arguments to function `call_user_function_ex'"

2002-12-25 Thread Leon Mergen

"Derick Rethans" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Tought this was the best newsgroup to post to, since I'm developing an
> > in-house only additional PHP module.
> >
> > Anyway, I want to call a user function from a function in my module...
so I
> > should use call_user_function_ex . Well, I tried the example on the
website,
>
> The website is outdated, just find an example in the normal extensions
> that we have. There are tons of examples there.

Okay, many thanks for the fast response!

So I am not crazy... :-x

Grtz,

Leon



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] " too few arguments to function `call_user_function_ex'"

2002-12-25 Thread Leon Mergen
Hello,

Tought this was the best newsgroup to post to, since I'm developing an
in-house only additional PHP module.

Anyway, I want to call a user function from a function in my module... so I
should use call_user_function_ex . Well, I tried the example on the website,
and it gives me the error:

antrophia.c: In function `zif_antrophia_msgincrease':
antrophia.c:147: too few arguments to function `call_user_function_ex'


I have pasted the source of that function below... anyone has any idea what
I am doing wrong? (and again, I am sorry if this is the wrong group)

Thanks in advance.

Regards,

Leon Mergen



--- source


PHP_FUNCTION(antrophia_msgincrease)
{
 zval *rtrn;
 zval **function_name;

 if((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &function_name) !=
SUCCESS))
 {
 WRONG_PARAM_COUNT;
 }

 if((*function_name)->type != IS_STRING)
 {
 zend_error(E_ERROR, "Function requires string argument");
 }

 // Introduce compiler globals (CG) to this function
 TSRMLS_FETCH();

 if(call_user_function_ex(CG(function_table), NULL, *function_name, &rtrn,
0, NULL, 0) != SUCCESS)
 {
 zend_error(E_ERROR, "Function call failed");
 }

 zend_printf("We have %i as type", rtrn->type);

 *return_value = *rtrn;
 zval_copy_ctor(return_value);
 zval_ptr_dtor(&rtrn);
}



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php