[PHP-DEV] JFYI: domxml memory leak

2002-05-18 Thread Christian Stocker

Hi

For all of those, who don't read the bug-list:

domxml had a pretty big memory leak in 4.2.0 and 4.2.1 if you use
append_child/add_child/append_sibling. If you create big XML-Documents
with those functions, you are really urged to try the new version from
CVS, which should fix the problem.

Windows is not tested yet, AFAIK ...

Anyway, is there ever going to be a 4.2.2 release, or will the next
release be 4.3 (and i can stop MFHing :) )?

chregu



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




Re: [PHP-DEV] JFYI: domxml memory leak

2002-05-18 Thread derick

On Sat, 18 May 2002, Christian Stocker wrote:

[...]

> Anyway, is there ever going to be a 4.2.2 release, or will the next
> release be 4.3 (and i can stop MFHing :) )?

It's still unsure if there will be a 4.2.2, so please continue merging.

Derick

---
 Did I help you?   http://www.jdimedia.nl/derick/link.php?url=giftlist
 Frequent ranting: http://www.jdimedia.nl/derick/
---
 PHP: Scripting the Web - [EMAIL PROTECTED]
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---


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




[PHP-DEV] domxml questions

2002-05-18 Thread Rob Richards

I have been going through the latest domxml extension and have a few
questions about it.

Looking at the docs, it is indicated that set_content and get_content are
depreciated.
The new functions from the docs, however, do not really make sense.

set_content - Create a new node with e.g. DomDocument_create_text_node() und
add it with DomNode_append_child().
get_content - Content is just a text node and can be accessed with
DomNode_child_nodes().

Would get_content really be replace with node_value? All the child_nodes
would give you is the child nodes.
I am not sure if this was the intended function of the get/set content
functions, but this seems to be the general use people are using these
functions for.

On that note, if you are trying to set the value of an existing node, using
the replacement (as indicated from the docs) you would should be creating a
new node and appending it, which means you then should remove the old node.
Shouldnt there be a set_node_value or similar function to just replace the
content of an existing node? A set_node_value function would be DOM
compliant as the nodeValue property is read/write according to the specs.

Rob


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




Re: [PHP-DEV] domxml questions

2002-05-18 Thread Lukas Schroeder

On Sat, May 18, 2002 at 10:05:32AM -0400, Rob Richards wrote:
> I have been going through the latest domxml extension and have a few
> questions about it.  Looking at the docs, it is indicated that
> set_content and get_content are depreciated.
> 
> set_content - Create a new node with e.g. DomDocument_create_text_node() und
>  add it with DomNode_append_child().
> get_content - Content is just a text node and can be accessed with
>  DomNode_child_nodes().
> 
> Would get_content really be replace with node_value? All the child_nodes
> would give you is the child nodes.

the contents of an element-node are contained in a child-node of that
element-node with the special node-name "#text". using child_nodes would
give you these contents. but, without a get_content() (get_node_value())
function there is no way to get the nodeValue (content) of the "#text"
node. hehe.

i hope, that deprecating or even removing a get_content() function (or
an equivalent) wont happen, because i definately dont want to replace
entity-references in contents manually.
the purpose of get_content() was and is to do that for me.


> On that note, if you are trying to set the value of an existing node, using
> the replacement (as indicated from the docs) you would should be creating a
> new node and appending it, which means you then should remove the old node.
> Shouldnt there be a set_node_value or similar function to just replace the
> content of an existing node? A set_node_value function would be DOM
> compliant as the nodeValue property is read/write according to the specs.

heh, that is what set_content() is (was? i hope not) for.



regards,
  -lukas
 

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




[PHP-DEV] PHP as an ActiveScript Engine

2002-05-18 Thread Wez Furlong

Hey,

I've been doing some tinkering over the last 24 hours and I've implemented
IActiveScript (and friends) as a SAPI for win32/IE.

What does that mean??  Well, it means that you can do things like this:
(in IE)


   ...
   
function clickit() {
   $GLOBALS["window"]->open("http://www.php.net";);
}
   
   
   


Yes, that's PHP on the client side!

You can also invoke the engine for Windows Script Hosts (or any other
IActiveScriptSite implementation), and in theory you can even run scripts
with a mixture of JScript, VBScript, Perl, Ruby and PHP in them, with
methods calling in between the engines :-)

Oh yeah - you can probably use it for ASP and ASP.NET too (haven't tried
that yet!).

What I have at the moment is still very experimental; the features that
are missing are:
- no event sinking (apart from declaring handlers in attributes)
- error handler is not yet tied into the script host error/exception
  mechanism.
- other engines cannot call into PHP yet.  That's because we don't have
  a standard method of exporting PHP objects as IDispatch-able COM objects.

Unfortunately, because PHP is so powerful, it's really not a good idea
to author web pages for public consumption using client-side PHP.
IE will warn you that viewing such a page is unsafe.
I'm not bothered by that: my intention is to use it embedded in a win32
host application.

The IActiveScript architecture is not too bad, so implementing this wasn't
such a hardship.  However, since the host may have multiple engines on
the same thread, the php4activescript implementation creates a thread for
each instance of a scripting engine.  That lead to some "interesting" code
to ensure that the right things were called in the right threads...

Performance-wise, there are two things that would be really beneficial
for php4activescript - although I dont expect to have these any time
soon, I'm highlighting them in case someone has alternative solutions:

- Delayed bindings for globals.  The scripting hosts register a good dozen
  or so COM objects in the global namespace.  PHP has to activate and make
  a couple of calls for each object imported in that way so that it can
  create a COM wrapper object (from the COM extension) for each object,
  even if it is not used.  It would be nice to activate the object the first
  time the global symbol is used.

- Scripting engine persistance mechanism.  Being able to make a persistent
  (as in pmalloc) copy of zend_op_array's would do just fine.
  I know this is not easy because of all the emalloc'd data in there.
  Alternatively, it would be nice to be able to convert a zend_op_array
  back into a string representation of the code.  The reason for this is
  that script hosts will create an instance of the engine, parse the script,
  clone the engine and then run the cloned instance.  Because of the PHP
  architecture, we need to re-compile the code on the newly cloned thread :-/

Right, I'm going to delve back into it - I just wanted to sound things out,
and see if anyone has any ideas about these things.

--Wez.


-- 
Wez Furlong
The Brain Room Ltd.


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




[PHP-DEV] Re: PHP as an ActiveScript Engine

2002-05-18 Thread Harald Radi

the more code i see the more ideas i have ;)

harald.

"Wez Furlong" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hey,
>
> I've been doing some tinkering over the last 24 hours and I've implemented
> IActiveScript (and friends) as a SAPI for win32/IE.
>
> What does that mean??  Well, it means that you can do things like this:
> (in IE)
>
> 
>...
>
> function clickit() {
>$GLOBALS["window"]->open("http://www.php.net";);
> }
>
>
>
> 
>
> Yes, that's PHP on the client side!
>
> You can also invoke the engine for Windows Script Hosts (or any other
> IActiveScriptSite implementation), and in theory you can even run scripts
> with a mixture of JScript, VBScript, Perl, Ruby and PHP in them, with
> methods calling in between the engines :-)
>
> Oh yeah - you can probably use it for ASP and ASP.NET too (haven't tried
> that yet!).
>
> What I have at the moment is still very experimental; the features that
> are missing are:
> - no event sinking (apart from declaring handlers in attributes)
> - error handler is not yet tied into the script host error/exception
>   mechanism.
> - other engines cannot call into PHP yet.  That's because we don't have
>   a standard method of exporting PHP objects as IDispatch-able COM objects.
>
> Unfortunately, because PHP is so powerful, it's really not a good idea
> to author web pages for public consumption using client-side PHP.
> IE will warn you that viewing such a page is unsafe.
> I'm not bothered by that: my intention is to use it embedded in a win32
> host application.
>
> The IActiveScript architecture is not too bad, so implementing this wasn't
> such a hardship.  However, since the host may have multiple engines on
> the same thread, the php4activescript implementation creates a thread for
> each instance of a scripting engine.  That lead to some "interesting" code
> to ensure that the right things were called in the right threads...
>
> Performance-wise, there are two things that would be really beneficial
> for php4activescript - although I dont expect to have these any time
> soon, I'm highlighting them in case someone has alternative solutions:
>
> - Delayed bindings for globals.  The scripting hosts register a good dozen
>   or so COM objects in the global namespace.  PHP has to activate and make
>   a couple of calls for each object imported in that way so that it can
>   create a COM wrapper object (from the COM extension) for each object,
>   even if it is not used.  It would be nice to activate the object the first
>   time the global symbol is used.
>
> - Scripting engine persistance mechanism.  Being able to make a persistent
>   (as in pmalloc) copy of zend_op_array's would do just fine.
>   I know this is not easy because of all the emalloc'd data in there.
>   Alternatively, it would be nice to be able to convert a zend_op_array
>   back into a string representation of the code.  The reason for this is
>   that script hosts will create an instance of the engine, parse the script,
>   clone the engine and then run the cloned instance.  Because of the PHP
>   architecture, we need to re-compile the code on the newly cloned thread :-/
>
> Right, I'm going to delve back into it - I just wanted to sound things out,
> and see if anyone has any ideas about these things.
>
> --Wez.
>
>
> --
> Wez Furlong
> The Brain Room Ltd.
>



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




Re: [PHP-DEV] domxml questions

2002-05-18 Thread Christian Stocker

On Sat, 18 May 2002, Lukas Schroeder wrote:

> On Sat, May 18, 2002 at 10:05:32AM -0400, Rob Richards wrote:
> > I have been going through the latest domxml extension and have a few
> > questions about it.  Looking at the docs, it is indicated that
> > set_content and get_content are depreciated.
> >
> > set_content - Create a new node with e.g. DomDocument_create_text_node() und
> >  add it with DomNode_append_child().
> > get_content - Content is just a text node and can be accessed with
> >  DomNode_child_nodes().
> >
> > Would get_content really be replace with node_value? All the child_nodes
> > would give you is the child nodes.
>
> the contents of an element-node are contained in a child-node of that
> element-node with the special node-name "#text". using child_nodes would
> give you these contents. but, without a get_content() (get_node_value())
> function there is no way to get the nodeValue (content) of the "#text"
> node. hehe.
>
> i hope, that deprecating or even removing a get_content() function (or
> an equivalent) wont happen, because i definately dont want to replace
> entity-references in contents manually.
> the purpose of get_content() was and is to do that for me.

yep. i agree. Making domxml w3c-compliant doesn't mean for me removing all
the other not-w3c-compliant functions. I don't see any sense in removing
this sometimes very handy functions. I'm not sure, why these functions are
markes as deprecated in the manual...

> > On that note, if you are trying to set the value of an existing node, using
> > the replacement (as indicated from the docs) you would should be creating a
> > new node and appending it, which means you then should remove the old node.
> > Shouldnt there be a set_node_value or similar function to just replace the
> > content of an existing node? A set_node_value function would be DOM
> > compliant as the nodeValue property is read/write according to the specs.

but that doesn't help you anything. nodeValue of an element node does not
carry the content of this element (IIRC). nodeValue of a textnode does on
the other side..


chregu


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




Re: [PHP-DEV] Safe Mode

2002-05-18 Thread Kristian Koehntopp

On Fri, May 17, 2002 at 03:46:42AM +0300, Zeev Suraski wrote:
> In a perfect world, ISPs would have used chroot'd environments always, 
> running either CGI's

We do. On earth.

Kristian

-- 
Kristian Köhntopp, NetUSE AG, Dr.-Hell-Straße, D-24107 Kiel
Tel: +49 431 386 435 00, Fax: +49 431 386 435 99

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




Re: [PHP-DEV] domxml questions

2002-05-18 Thread Rob Richards

So then can I safely assume that the functions arent really depreciated then?

If the functions were to be depreciated there really isn't a replacement for 
them implemented yet. As far as the set_node_value, I had just mentioned that 
as according to the docs the functions were being depreciated due to being 
non-compliant. If that was/is the case, then there would be the need for this 
to at least be able to set the content on text, cdata, comment, etc.. nodes.

Rob

On Saturday 18 May 2002 11:37 am, Christian Stocker wrote:
> On Sat, 18 May 2002, Lukas Schroeder wrote:
> > On Sat, May 18, 2002 at 10:05:32AM -0400, Rob Richards wrote:
> > > I have been going through the latest domxml extension and have a few
> > > questions about it.  Looking at the docs, it is indicated that
> > > set_content and get_content are depreciated.
> > >
> > > set_content - Create a new node with e.g.
> > > DomDocument_create_text_node() und add it with DomNode_append_child().
> > > get_content - Content is just a text node and can be accessed with
> > >  DomNode_child_nodes().
> > >
> > > Would get_content really be replace with node_value? All the
> > > child_nodes would give you is the child nodes.
> >
> > the contents of an element-node are contained in a child-node of that
> > element-node with the special node-name "#text". using child_nodes would
> > give you these contents. but, without a get_content() (get_node_value())
> > function there is no way to get the nodeValue (content) of the "#text"
> > node. hehe.
> >
> > i hope, that deprecating or even removing a get_content() function (or
> > an equivalent) wont happen, because i definately dont want to replace
> > entity-references in contents manually.
> > the purpose of get_content() was and is to do that for me.
>
> yep. i agree. Making domxml w3c-compliant doesn't mean for me removing all
> the other not-w3c-compliant functions. I don't see any sense in removing
> this sometimes very handy functions. I'm not sure, why these functions are
> markes as deprecated in the manual...
>
> > > On that note, if you are trying to set the value of an existing node,
> > > using the replacement (as indicated from the docs) you would should be
> > > creating a new node and appending it, which means you then should
> > > remove the old node. Shouldnt there be a set_node_value or similar
> > > function to just replace the content of an existing node? A
> > > set_node_value function would be DOM compliant as the nodeValue
> > > property is read/write according to the specs.
>
> but that doesn't help you anything. nodeValue of an element node does not
> carry the content of this element (IIRC). nodeValue of a textnode does on
> the other side..
>
>
> chregu


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




[PHP-DEV] one of the php.net machines is down

2002-05-18 Thread Jim Winstead

one of the php.net machines (the one that handles @php.net mail,
bugs.php.net, hosts.php.net, and various other services) is currently
down. we're waiting on word from the folks hosting the machine to find
out what's up. hopefully things will be back up and running soon, but it
could take until monday to get things sorted out, so please be patient.

jim

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