[PHP-DEV] __call for the namespaces

2003-03-17 Thread Brad LaFountain
This idea spawned from playing with ext/rpc and the ability to declare
class types on the fly

Since zend_namespaces is really _zend_class_entry I think it would
be cool to implement __call at the namespace level.

namespace java {
 function __call($classname) {
   // this will be called every time a new java::$classname() is called
   // and $classname isn't defined
   eval("
class $classname {
}
   ");
   // and it can return the new class
   return new $classname();
 }
}

This doesn't seem like it would be too hard to implement and it will allow me
to do stuff like...

http://server/some.wsdl";);
 // $s could be the namespace defined in the wsdl and of class myObject
?>

ps:
doSomething();
?>
results in...
Fatal error:  Internal Zend error - Missing class information for  in

c:\php\php5\Release_TSDbg\name.php(7) : eval()'d code on line 2


 - Brad



__
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

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



[PHP-DEV] curl multi

2003-03-17 Thread Wico de Leeuw
Hiya,

If someone has some spare time could he look at curl_multi_info_read() i'd 
like to use (test) the curl_multi functions, but without the 
curl_multi_info_read it isn't really usefull (and when i look at the source 
i thing it's almost finished)

P.S. when i test them i'll report back to you guys when i find things

Greetz and tnx in advance

Wico 

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


[PHP-DEV] Re: [PHP-CVS] curl multi

2003-03-17 Thread Sterling Hughes
On Mon, 2003-03-17 at 10:29, Wico de Leeuw wrote:
> sorry for writing to the wrong list should have been phpdev offcourse
> At 16:28 17-3-03 +0100, Wico de Leeuw wrote:
> >Hiya,
> >
> >If someone has some spare time could he look at curl_multi_info_read() i'd 
> >like to use (test) the curl_multi functions, but without the 
> >curl_multi_info_read it isn't really usefull (and when i look at the 
> >source i thing it's almost finished)
> >
> >P.S. when i test them i'll report back to you guys when i find things
> >
> >Greetz and tnx in advance
> >

It is still very useful, what would give you the idea it isn't?

-Sterling


> >Wico
> >
> >
> >--
> >PHP CVS Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
-- 
"People can have the Model T in any colour -- so long as it's black." 
- Henry Ford


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



[PHP-DEV] Pb : access control

2003-03-17 Thread Fabrice Le Coz
Hi,

I'm playing with PHP5 and have some trouble wtith access control, here's the
code I run with last php5 from snaps.php.net under windows XP :

var1 = "public";
$this->var2 = "protected";
$this->var3 = "private";
}

function show() {
echo "pere::show() \n";
echo "var1 : $this->var1\n";
echo "var2 : $this->var2\n";
echo "var3 : $this->var3\n";
echo "\n";
}
}

class fils extends pere {
protected $var = "fils";
private   $var4 = "test";

function __construct() {
parent::__construct();
}

function show_fils() {
echo "fils::show() \n";
echo "var1 : $this->var1\n";
echo "var2 : $this->var2\n";
echo "var3 : $this->var3\n";
echo "var  : $this->var\n";
echo "\n";
}
}

function show_var($obj) {
$obj_vars = get_object_vars($obj);
foreach ($obj_vars as $name => $value) {
if($name != "") echo "$name : $value\n";
}
echo "\n";
}

$test1 = new pere();
$test1->show();
echo "Affichage des variables visibles de test1 :\n";
show_var($test1);

$test2 = new fils();
$test2->show_fils();
echo "Affichage des variables visibles de test2 :\n";
show_var($test2);
$test2->show();
echo "var3 : ".$test2->var3."\n";
echo "var4 : ".$test2->var4."\n";
?>

and I've the following result :

pere::show()
var1 : public
var2 : protected
var3 : private

Affichage des variables visibles de test1 :
var1 : public

fils::show()
var1 : public
var2 : protected
var3 : private
var  : fils

Affichage des variables visibles de test2 :
var1 : public
var2 :
var3 : private

pere::show()
var1 : public
var2 : protected
var3 : private

var3 : private

Fatal error: Cannot access private property fils::$var4 in
D:\www\test\heritier.php on line 59

Normally in the instance of "fils" object ($test2), I mustn't see
$this->var3 which is private variable of the parent. if I comment the line
'echo "var3 : $this->var3\n";' in the show_fils method, $test2->var3 is
empty but do not generate an error !
The show_var($test2) function expose a var2 variable which normally must
send an Fatal error.

Fabrice Le Coz
[EMAIL PROTECTED]



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



[PHP-DEV] Re: [PHP-CVS] curl multi

2003-03-17 Thread Wico de Leeuw
At 11:15 17-3-03 -0500, Sterling Hughes wrote:
On Mon, 2003-03-17 at 10:29, Wico de Leeuw wrote:
> sorry for writing to the wrong list should have been phpdev offcourse
> At 16:28 17-3-03 +0100, Wico de Leeuw wrote:
> >Hiya,
> >
> >If someone has some spare time could he look at curl_multi_info_read() 
i'd
> >like to use (test) the curl_multi functions, but without the
> >curl_multi_info_read it isn't really usefull (and when i look at the
> >source i thing it's almost finished)
> >
> >P.S. when i test them i'll report back to you guys when i find things
> >
> >Greetz and tnx in advance
> >

It is still very useful, what would give you the idea it isn't?

-Sterling
Hiya

I want to use  to get some webpages parallel, and start processing a page 
when the it has arrived. (while the other ones are still loading)
At the moment i can't find which page is ready and which one not. Even when 
you use a different writer function for each page, because you can't see if 
the page is complete yet. With curl_multi_info you're supposed to get such 
info.

Ok i agree it's nog complete useless, you can still get many urls at the 
same time but you have to wait until there all loaded.

Gr,

Wico

P.S. sorry for the bad english :)


> >Wico
> >
> >
> >--
> >PHP CVS Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
--
"People can have the Model T in any colour -- so long as it's black."
- Henry Ford


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


Re: [PHP-DEV] Pb : access control

2003-03-17 Thread Andi Gutmans
Can you cut down the script to like 10 lines and say what your result is 
and what you'd expect?

At 05:37 PM 3/17/2003 +0100, Fabrice Le Coz wrote:
Hi,

I'm playing with PHP5 and have some trouble wtith access control, here's the
code I run with last php5 from snaps.php.net under windows XP :

function __construct() {
$this->var1 = "public";
$this->var2 = "protected";
$this->var3 = "private";
}
function show() {
echo "pere::show() \n";
echo "var1 : $this->var1\n";
echo "var2 : $this->var2\n";
echo "var3 : $this->var3\n";
echo "\n";
}
}
class fils extends pere {
protected $var = "fils";
private   $var4 = "test";
function __construct() {
parent::__construct();
}
function show_fils() {
echo "fils::show() \n";
echo "var1 : $this->var1\n";
echo "var2 : $this->var2\n";
echo "var3 : $this->var3\n";
echo "var  : $this->var\n";
echo "\n";
}
}
function show_var($obj) {
$obj_vars = get_object_vars($obj);
foreach ($obj_vars as $name => $value) {
if($name != "") echo "$name : $value\n";
}
echo "\n";
}
$test1 = new pere();
$test1->show();
echo "Affichage des variables visibles de test1 :\n";
show_var($test1);
$test2 = new fils();
$test2->show_fils();
echo "Affichage des variables visibles de test2 :\n";
show_var($test2);
$test2->show();
echo "var3 : ".$test2->var3."\n";
echo "var4 : ".$test2->var4."\n";
?>
and I've the following result :

pere::show()
var1 : public
var2 : protected
var3 : private
Affichage des variables visibles de test1 :
var1 : public
fils::show()
var1 : public
var2 : protected
var3 : private
var  : fils
Affichage des variables visibles de test2 :
var1 : public
var2 :
var3 : private
pere::show()
var1 : public
var2 : protected
var3 : private
var3 : private

Fatal error: Cannot access private property fils::$var4 in
D:\www\test\heritier.php on line 59
Normally in the instance of "fils" object ($test2), I mustn't see
$this->var3 which is private variable of the parent. if I comment the line
'echo "var3 : $this->var3\n";' in the show_fils method, $test2->var3 is
empty but do not generate an error !
The show_var($test2) function expose a var2 variable which normally must
send an Fatal error.
Fabrice Le Coz
[EMAIL PROTECTED]


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


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


Re: [PHP-DEV] 4.3.2RC1: patch to compile with libgd < 2

2003-03-17 Thread Jani Taskinen

Please try the latest STABLE cvs snapshot
from http://snaps.php.net as this seems to be fixed
already.

--Jani


On Sat, 15 Mar 2003, Roberto Biancardi wrote:

>--- ext/gd/gdttf.c.orig Sat Mar 15 22:38:28 2003
>+++ ext/gd/gdttf.c  Sat Mar 15 22:42:42 2003
>@@ -744,9 +744,13 @@
>if (tweencolorkey.pixel > 0) {
>x3 = x2 + col;
>if (x3 >= im->sx || x3 < 0) continue;
>+#if HAVE_LIBGD20
>if (im->trueColor) {
>pixel = &im->tpixels[y3][x3];
>} else {
>+#else
>+   {
>+#endif
> #if HAVE_LIBGD13
>pixel = &im->pixels[y3][x3];
> #else
>
>

-- 
<- For Sale! ->


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



Re: [PHP-DEV] 4.3.2RC1: patch to compile with libgd < 2

2003-03-17 Thread Roberto Biancardi
nope. Was introduced by this late fix: 
http://cvs.php.net/diff.php/php4/ext/gd/gdttf.c?login=2&r1=1.17&r2=1.18&ty=h
and merged into 4.3.2RC1.

Jani Taskinen wrote:

   Please try the latest STABLE cvs snapshot
   from http://snaps.php.net as this seems to be fixed
   already.
--
--  Roberto Biancardi  -- 
--



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