Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Stanislav Malyshev
MB>> the point is probably that there is no way in determinig whether a MB>>certain function is supposed to work prior to calling it. This is the case for all functions. For example, if you call mysql_query, you have no way of knowing if it would succeed prior to calling it. So __call is not m

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Derick Rethans
On Wed, 4 Jan 2006, Stanislav Malyshev wrote: > MB>> the point is probably that there is no way in determinig whether a > MB>>certain function is supposed to work prior to calling it. > > This is the case for all functions. For example, if you call mysql_query, > you have no way of knowing if

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Stanislav Malyshev
DR>>That is not fully true, as you can use function_exists() on DR>>mysql_query, where there is no such possibility for methods that are DR>>overloaded with __call(). That's correct, of course - this is the whole point of __call - it makes _any_ function exist. Now, calling these functions may

[PHP-DEV] Default charset

2006-01-04 Thread Graziano Liberati
Hi, I wrote the same mail some days ago in the general list and I asked also on the #php IRC channel on Freenode but I didn't find any answer, so I try here. I need to set the default charset for my application to UTF-8 instead of the default one of the webserver that is ISO-8859-1. I've tried

Re: [PHP-DEV] Default charset

2006-01-04 Thread Rasmus Lerdorf
Not really a question for internals. header("Content-type: text/html; charset=UTF-8"); from your application will do the trick. -Rasmus Graziano Liberati wrote: Hi, I wrote the same mail some days ago in the general list and I asked also on the #php IRC channel on Freenode but I didn't find

Re: [PHP-DEV] Default charset

2006-01-04 Thread Uwe Schindler
Hi Graziano, At 10:42 04.01.2006, you wrote: I need to set the default charset for my application to UTF-8 instead of the default one of the webserver that is ISO-8859-1. I've tried to change the value of default_charset in php.ini and all it's ok, but I need to set the value only for one applic

Re: [PHP-DEV] Default charset

2006-01-04 Thread Nuno Lopes
PHP had a bug when handling the default_charset in CGI mode. Upgrading PHP will do the trick. Nuno Hi, I wrote the same mail some days ago in the general list and I asked also on the #php IRC channel on Freenode but I didn't find any answer, so I try here. I need to set the default charset f

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Marcus Boerger
Hello Stanislav, but that is a way of having __call that obviously doesn't fit the real world. In a real world application i only implement a few things with call and dislike having all the others implemented automatically also. And the i have to care about error generation while the engine coul

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Stanislav Malyshev
MB>> but that is a way of having __call that obviously doesn't fit the real MB>>world. In a real world application i only implement a few things with call MB>>and dislike having all the others implemented automatically also. And the MB>>i have to care about error generation while the engine could

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Peter Brodersen
On Wed, 4 Jan 2006 10:19:22 +0100 (CET), in php.internals [EMAIL PROTECTED] (Derick Rethans) wrote: >That is not fully true, as you can use function_exists() on mysql_query, >where there is no such possibility for methods that are overloaded with >__call(). .. with some exceptions though (func

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Lukas Smith
Stanislav Malyshev wrote: MB>> but that is a way of having __call that obviously doesn't fit the real MB>>world. In a real world application i only implement a few things with call MB>>and dislike having all the others implemented automatically also. And the MB>>i have to care about error genera

Re: [PHP-DEV] Default charset

2006-01-04 Thread Graziano Liberati
At Wednesday 4 January 2006 11:40, Rasmus Lerdorf you wrote: > Not really a question for internals. > >header("Content-type: text/html; charset=UTF-8"); > > from your application will do the trick. > > -Rasmus In this way I set also the text/html content type, but I don't know prior the execu

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Marcus Boerger
Hello Lukas, that's right now also impossible. We would need an api change for that. Or we would need to have the interface support deeply in the engine like we have with the iterators. If that is ok for all among the engine developers i think i can easily add it. marcus Wednesday, January 4,

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Marcus Boerger
Hello Stanislav, where is the relation between __isset and __get/set/unset? marcus Wednesday, January 4, 2006, 12:32:29 PM, you wrote: MB>>> but that is a way of having __call that obviously doesn't fit the real MB>>>world. In a real world application i only implement a few things with call

Re: [PHP-DEV] Default charset

2006-01-04 Thread Graziano Liberati
At Wednesday 4 January 2006 11:45, Uwe Schindler you wrote: > create a .htaccess file in the application directory where you use > the "php_value" command to set this variable. See > http://www.php.net/php_value > > The problem is that changing the charset in the script is too late > (it is running

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Stanislav Malyshev
LS>>I think its obvious that you can implement things in userland or inside the LS>>engine. The main advantage of doing it inside the engine is that it then LS>>becomes the standard way of doing things, where as with userland its likely LS>>that several competing "standards" will emerge. Not becaus

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Lukas Smith
Stanislav Malyshev wrote: LS>>I think its obvious that you can implement things in userland or inside the LS>>engine. The main advantage of doing it inside the engine is that it then LS>>becomes the standard way of doing things, where as with userland its likely LS>>that several competing "standa

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Stanislav Malyshev
LS>>well in theory is_callable could also be called before __call() to save LS>>people from having to duplicate the logic from __callable() and to have the LS>>engine trigger the error. that is what i meant and like i said i do not That would be major slowdown - why should engine call additional m

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Lukas Smith
Stanislav Malyshev wrote: LS>>well in theory is_callable could also be called before __call() to save LS>>people from having to duplicate the logic from __callable() and to have the LS>>engine trigger the error. that is what i meant and like i said i do not That would be major slowdown - why sho

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Marcus Boerger
Hello Stanislav, how is this a major slowdown? It would add a simple pointer check at runtime and two places to set the pointer, one place will initialize it to NULL and the other will store some function pointer just like all the other __*()'s do. marcus Wednesday, January 4, 2006, 4:13:02 PM

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Stanislav Malyshev
MB>> how is this a major slowdown? It would add a simple pointer check at MB>>runtime and two places to set the pointer, one place will initialize it to MB>>NULL and the other will store some function pointer just like all the other MB>>__*()'s do. You would have two PHP functions: __callable() a

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Stanislav Malyshev
MB>> that's right now also impossible. We would need an api change for that. MB>>Or we would need to have the interface support deeply in the engine like MB>>we have with the iterators. If that is ok for all among the engine MB>>developers i think i can easily add it. What exactly is impossible t

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Marcus Boerger
Hello Stanislav, both will have a function pointer on the c side so the major slowdown you spoke of will only be there if one actually wants it. Otherwise there will be only the pointer check. marcus Wednesday, January 4, 2006, 5:28:01 PM, you wrote: MB>>> how is this a major slowdown? It wo

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Marcus Boerger
Hello Stanislav, having non supported dynamic calls behave in the same way as build in or user code methods. marcus Wednesday, January 4, 2006, 5:30:51 PM, you wrote: MB>>> that's right now also impossible. We would need an api change for that. MB>>>Or we would need to have the interface sup

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Stanislav Malyshev
MB>> both will have a function pointer on the c side so the major MB>>slowdown you spoke of will only be there if one actually wants it. MB>>Otherwise there will be only the pointer check. I think you lost me. What exactly you are describing here? I though we were talking about implementing so

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Stanislav Malyshev
MB>> having non supported dynamic calls behave in the same way as build MB>>in or user code methods. As defined code methods? Make your __call always return true and that is what you'd get, not? Or you want it to behave as undefined methods? Then make your __call to throw and error once it can

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Marcus Boerger
Hello Stanislav, the point is integration but i see no point for further dicussion unless you are willing to reread the thread and accept what we were talking about here. Wednesday, January 4, 2006, 6:02:41 PM, you wrote: MB>>> having non supported dynamic calls behave in the same way as buil

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Marcus Boerger
Hello Stanislav, just again, the point is integration so that you know whether it makes any sense to call soemthing or not without having to check for errors after the call. marcus Wednesday, January 4, 2006, 5:59:59 PM, you wrote: MB>>> both will have a function pointer on the c side so the

Re: [PHP-DEV] __call overload detection

2006-01-04 Thread Stanislav Malyshev
MB>> the point is integration but i see no point for further dicussion MB>>unless you are willing to reread the thread and accept what we were MB>>talking about here. "I won't talk to you unless you agree with me". Nice. Anyway, I don't see any point in "integration" and any place in the engin

[PHP-DEV] CVS Account Request: kfbombar

2006-01-04 Thread Kellen Bombardier
Support PHP drivers for IBM software -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: __call overload detection

2006-01-04 Thread Sara Golemon
> Currently there is no way to detect if the __call overloads a particular > method. Property overloading has __isset now in 5.1 - maybe for method > overloading the equivalent should be something like __iscallable. Maybe > method_exists should remain as is, as the method won't ever really exist

Re: [PHP-DEV] Re: __call overload detection

2006-01-04 Thread Andrew Yochum
On Wed, Jan 04, 2006 at 02:20:45PM -0800, Sara Golemon wrote: > > Currently there is no way to detect if the __call overloads a particular > > method. Property overloading has __isset now in 5.1 - maybe for method > > overloading the equivalent should be something like __iscallable. Maybe > > met

Re: [PHP-DEV] Re: __call overload detection

2006-01-04 Thread Sara Golemon
This'll do what you want: http://libssh2.org/dist/callable-1.0.tgz Thanks Sara. Nice to see that others have the need. Works like a charm. You rock. Just for clarification. I didn't have a need for this, it's just something I threw together today since it was simple... Marcus, is this

[PHP-DEV] Bonsai.php.net 302 redirects to a bad URL (http:/cvs.php.net, aka missing / on http://)

2006-01-04 Thread Jeremy Johnstone
Someone should likely check it out. telnet bonsai.php.net 80 Trying 66.163.161.116... Connected to cvs.php.net. Escape character is '^]'. GET / HTTP/1.1 Host: bonsai.php.net HTTP/1.1 302 Found Date: Thu, 05 Jan 2006 06:36:04 GMT Server: Apache/1.3.34 (Unix) PHP/5.1.2RC2-dev Location: http:/cvs.ph