[PHP-DEV] Question about print_r

2002-05-29 Thread Garland foster

Hi all,

Does anyone know any problem related to print_r($foo) if $foo is a resource,
I'm developing a module where a function returns a resource, that is then
used by other functions, if I use a print_r($resource) in the middle things
change. I'm starting to think that print_r changes the resource in some
way, do you know if this might be right?

Garland.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.362 / Virus Database: 199 - Release Date: 5/16/02



[PHP-DEV] Need Some help writing a module.

2002-05-31 Thread Garland foster

Hi all,

I'm writing a PHP module for repat, a C-based RDF parser, very similar to expat, in 
fact it uses expat
but for RDF statements.

Maybe some of you with a lot of experience in writing modules can help me with my 
problem

I have a C variable, a pointer with say X and when I pass the pointer to a function it 
receives not X but
something else. 

This is a dump of a silly gdb session showing the problem (using the binary php)
See how report_start_element receies an rdf_parser and that rdf_parser->user_data is 
0x81970c

Then this code is executed:

if( rdf_parser->start_element_handler )
{
( *rdf_parser->start_element_handler )(
rdf_parser->user_data,
name,
attributes );
}

and parser_my_start_element (the function acting as start_element_handler) receives  
0x1cd (???!!)

This is the dump

Breakpoint 1, report_start_element (rdf_parser=0x81f9a58, name=0x81fa714 "html", 
attributes=0x81f9ce0) at rdfparse.c:1292
1292if( rdf_parser->start_element_handler )
(gdb) s
1294( *rdf_parser->start_element_handler )(
(gdb) p rdf_parser->user_data
$12 = (void *) 0x81f970c
(gdb) s
Breakpoint 2, parser_my_start_element_handler (user_data=0x1cd, name=0x81fa714 "html", 
attributes=0x81f9ce0) at repat.c:653

If someone can give me a tip about what may be happening then I'd get back to continue 
the module, after this problem it should be
ready next week since everything was on wheels until now.

Thanks for your help!

Garland


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.362 / Virus Database: 199 - Release Date: 5/8/02



[PHP-DEV] New extension

2002-06-05 Thread Garland foster

Hi all,

I just finished a php extension for "repat" an RDF parser in C coded by Jason 
Diammond, with this extension we are able
to parse RDF files (in any syntactical representation) from PHP and process the RDF 
statements as we want. Web based
RDF management systems written in PHP are possible now using this extension. 

The extension is based on repat and repat is based on expat so I used the expat parser 
that the xml extension uses.

The extension defines some constants (RDF_SUBJECT_TYPE_LITERAL, RDF_SUBJECT_TYPE_URI, 
etc) and the
following functions:

parser=rdf_parser_create()
rdf_parser_destroy(parser)
rdf_set_statement_handler(statement_handler_name)
rdf_set_element_handler(start_element_handler_name, end_element_handler_name)
rdf_set_character_data_handler(character_data_handler_name)
rdf_parse(parser,data,is_final)

And these functions for convenience:
rdf_dump_document(document_uri)
rdf_parse_document(parser,document_uri)

I think PECL will be suggested as the way to go for this extension so I need 
instructions to know what to do from now,
maybe someone to contact? Are there templates to write the extension documentation? 

Another thing that I really need is a volunteer to compile the extension under windows 
and produce the proper .dll to be added
to windows distros of php. I promise it is a smooth extension that won't cause 
problems, and I'd really like to test it under
windows.

Regards,
Garland.






Re: [PHP-DEV] New extension

2002-06-05 Thread Garland foster

"Resource Description Framework" a core technology for the "semantic web"
defined by the W3C
http://www.w3.org/RDF/
RDF graphs are used to represent metadata and the XML RDF syntax is widely
used as a format to
distribute, process and exchange metadata.
RSS the nice XML vocabulary that many users apply to describe piece of news
from their sites (content syndication)
is indeed derived from RDF.
So the parser can be used also to process RSS documents.


- Original Message -
From: brad lafountain <[EMAIL PROTECTED]>
To: Garland foster <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, June 05, 2002 4:06 PM
Subject: Re: [PHP-DEV] New extension


> What is RDF?
>
>   - brad
> --- Garland foster <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I just finished a php extension for "repat" an RDF parser in C coded by
Jason
> > Diammond, with this extension we are able
> > to parse RDF files (in any syntactical representation) from PHP and
process
> > the RDF statements as we want. Web based
> > RDF management systems written in PHP are possible now using this
extension.
> >
> > The extension is based on repat and repat is based on expat so I used
the
> > expat parser that the xml extension uses.
> >
> > The extension defines some constants (RDF_SUBJECT_TYPE_LITERAL,
> > RDF_SUBJECT_TYPE_URI, etc) and the
> > following functions:
> >
> > parser=rdf_parser_create()
> > rdf_parser_destroy(parser)
> > rdf_set_statement_handler(statement_handler_name)
> > rdf_set_element_handler(start_element_handler_name,
end_element_handler_name)
> > rdf_set_character_data_handler(character_data_handler_name)
> > rdf_parse(parser,data,is_final)
> >
> > And these functions for convenience:
> > rdf_dump_document(document_uri)
> > rdf_parse_document(parser,document_uri)
> >
> > I think PECL will be suggested as the way to go for this extension so I
need
> > instructions to know what to do from now,
> > maybe someone to contact? Are there templates to write the extension
> > documentation?
> >
> > Another thing that I really need is a volunteer to compile the extension
> > under windows and produce the proper .dll to be added
> > to windows distros of php. I promise it is a smooth extension that won't
> > cause problems, and I'd really like to test it under
> > windows.
> >
> > Regards,
> > Garland.
> >
> >
> >
> >
>
>
> __
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
>
>


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




Re: [PHP-DEV] DOMXML Function consistency

2002-06-07 Thread Garland foster

The DOM level 1 W3C's recommendation specifies node_name, node_type and
node_value,
I'd like the DOMextension to map the W3C spec as close as possible.
I'd even recommend not implementing the suggested functions as alises since
that would
encorage non-standard DOM applications.

- Original Message -
From: Joseph Tate <[EMAIL PROTECTED]>
To: Php-Dev List <[EMAIL PROTECTED]>
Sent: Friday, June 07, 2002 11:16 AM
Subject: [PHP-DEV] DOMXML Function consistency


> A bug report or two have been made regarding function names in attribute
> nodes.  Taking a look, nodes have the following access functions:
>
> node_name
> node_type
> node_value
>
> etc.  However attribute nodes have the following access functions:
>
> name
> value
> specified
>
> I am thinking that to make it more consistent, we should change the
> attribute functions to
> attr_name or node_name
> attr_value or node_value
> attr_specified or node_specified
>
> I'd vote for the latter series since the programmer already knows they're
> attributes.  Renaming will reduce the WTF factor.  We can leave the
aliases
> to the old functions for a while to maintain BC.
>
> WISH: I wish there was a Zend Function for marking a function alias as
> deprecated, I.e. so that a warning message is displayed if the function is
> used after being marked deprecated.  A way to display the replacement
> function in the warning message would be nice too.
>
> Joseph
>
>
> --
> 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] Re: Suggestion about native DB support.

2002-06-21 Thread Garland foster

Derick et al,

What about the native DBM support? Nobody answered that part.



- Original Message -
From: <[EMAIL PROTECTED]>
To: Yasuo Ohgaki <[EMAIL PROTECTED]>
Cc: PHP Developers Mailing List <[EMAIL PROTECTED]>; Garland Foster
<[EMAIL PROTECTED]>
Sent: Friday, June 21, 2002 5:58 AM
Subject: Re: [PHP-DEV] Re: Suggestion about native DB support.


> On Fri, 21 Jun 2002, Yasuo Ohgaki wrote:
>
> > Garland Foster wrote:
> > > I have a strong feeling that it would be a very good idea to ship PHP
(*nix and Win) with some native, BUNDLED
> > > support for some DBM-files format. It can be very nice to have a
native set of DBM-like functions available in PHP
> > > no matter the operating system or how PHP was compiled.
> > >
> >
> > I think gettext module is also a good one to be enabled by default
> > or recommend users strongly.
>
> It relies on an external library, so that won't be a good thing. gettext
> is not available for every platform, and we are not going to bundle it.
>
> >
> > Most I18N(?) aware PHP applications are not using gettext and
> > using slower approch, define messages as PHP vars or constants.
> >
> > Enabling gettext by default may change this situation in the
> > long run.
>
> Do we need to prevent everybody from shooting in their feet? I don't think
> so. Users who need it will find out about gettext.
>
> > Since we cannot bundle everything, how about have a logo program
> > for a standard php installations? If users confirm standard
> > requirements, give permission to use PHP standard logo, for
> > example.
>
> How would this help them, and what does it give us (The PHP team)?
>
> Derick
>
> --
-
>  Did I help you?   http://www.derickrethans.nl/link.php?url=giftlist
>  Frequent ranting: http://www.derickrethans.nl/
> --
-
>  PHP: Scripting the Web - [EMAIL PROTECTED]
> All your branches are belong to me!
> SRM: Script Running Machine - www.vl-srm.net
> --
-
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.368 / Virus Database: 204 - Release Date: 6/1/02


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




Re: [PHP-DEV] Re: Suggestion about native DB support.

2002-06-21 Thread Garland foster

Well,

I guess than bundling SQLite and enabling it by default is equivalent to
some native always-enabled DBM support,
what I want is an storage mechanism always available so applications can
rely at least on that to provide
examples and tests. And if they don't need anything bigger they can easily
be written to use the native Database
support and just that.

Garland

- Original Message -
From: Jedi/Sector One <[EMAIL PROTECTED]>
To: Garland foster <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; Yasuo Ohgaki <[EMAIL PROTECTED]>; PHP Developers
Mailing List <[EMAIL PROTECTED]>
Sent: Friday, June 21, 2002 10:42 AM
Subject: Re: [PHP-DEV] Re: Suggestion about native DB support.


> On Fri, Jun 21, 2002 at 10:37:15AM -0300, Garland foster wrote:
> > What about the native DBM support? Nobody answered that part.
>
>   And what about SQLite? Porting existing PHP scripts (designed for MySQL
or
> PostgreSQL) to SQLite is easy.
>
> --
>  __  /*-  Frank DENIS (Jedi/Sector One) <[EMAIL PROTECTED]> -*\
__
>  \ '/http://www.PureFTPd.Org/";> Secure FTP Server \'
/
>   \/  http://www.Jedi.Claranet.Fr/";> Misc. free software   \/
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.368 / Virus Database: 204 - Release Date: 6/1/02


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




Re: [PHP-DEV] Re: Suggestion about native DB support.

2002-06-21 Thread Garland foster

After reading Jonas analysis on SQLlite I'll have to get back to the idea of
picking a DBM
library and bundling it in all the php distros with a standard set of
functions that all PHP
developers can use from their applications.

- Original Message -
From: Christian Stocker <[EMAIL PROTECTED]>
To: 'PHP Developers Mailing List' <[EMAIL PROTECTED]>
Sent: Friday, June 21, 2002 11:08 AM
Subject: RE: [PHP-DEV] Re: Suggestion about native DB support.


> Hi
>
> Maybe Jonas' opinion about SQLlite and php is of interest in this
> discussion (was today on pear-dev)
>
> see
> http://marc.theaimsgroup.com/?l=pear-dev&m=102466375605972&w=2
>
> chregu
>
> > > From: Garland foster [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, June 21, 2002 4:02 PM
> > > To: [EMAIL PROTECTED]; Jedi/Sector One
> > > Cc: Yasuo Ohgaki; PHP Developers Mailing List
> > > Subject: Re: [PHP-DEV] Re: Suggestion about native DB support.
> > >
> > > I agree that you can't bundle everything that might be useful, I just
> > > thought that
> > > an official native form of DB support may be useful for webmasters and
> > > developers,
> > > webmasters won't need to install MySQL, Postgress, DBM and all the
> > > possible
> > > storage solutions for PHP and developers won't have to code 5
> > different
> > > options
> > > for an application that uses a simple key-value storage.
> > > May be the advantages outweight the "bundling" disadvantages...
> > >
> > > - Original Message -
> > > From: <[EMAIL PROTECTED]>
> > > To: Jedi/Sector One <[EMAIL PROTECTED]>
> > > Cc: Garland foster <[EMAIL PROTECTED]>; Yasuo Ohgaki
> > > <[EMAIL PROTECTED]>; PHP Developers Mailing List
> > <[EMAIL PROTECTED]>
> > > Sent: Friday, June 21, 2002 10:58 AM
> > > Subject: Re: [PHP-DEV] Re: Suggestion about native DB support.
> > >
> > >
> > > > On Fri, 21 Jun 2002, Jedi/Sector One wrote:
> > > >
> > > > > On Fri, Jun 21, 2002 at 10:37:15AM -0300, Garland foster wrote:
> > > > > > What about the native DBM support? Nobody answered that part.
> > > > >
> > > > >   And what about SQLite? Porting existing PHP scripts (designed
> > for
> > > MySQL or
> > > > > PostgreSQL) to SQLite is easy.
> > > >
> > > > And what about mind, or mcrypt, or curl, or... or... There is simply
> > too
> > > > much out there. I really think that bundling more is not the way to
> > go
> > > > (maybe except for some xml thing... which I still won't like to see
> > > > bundled).
> > > >
> > > > Derick
> > > >
> > > >
> > 
> > > --
> > > -
> > > >  PHP: Scripting the Web - [EMAIL PROTECTED]
> > > > All your branches are belong to me!
> > > > SRM: Script Running Machine - www.vl-srm.net
> > > >
> > 
> > > --
> > > -
> > > >
> > > >
> > >
> > >
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.368 / Virus Database: 204 - Release Date: 6/1/02
> > >
> > >
> > > --
> > > PHP Development Mailing List <http://www.php.net/>
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> > --
> > PHP Development Mailing List <http://www.php.net/>
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> --
> nam...christian stockeradr...bremgartnerstr. 66, ch-8003 zurich
> pho...+41  1 451 6021  www...http://phant.ch/chregu
> mob...+41 76 561 8860  [EMAIL PROTECTED]
> wor...+41  1 240 5670  gpg...0x5CE1DECB
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.368 / Virus Database: 204 - Release Date: 6/1/02


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




Re: [PHP-DEV] relative xpath queries

2002-07-16 Thread Garland foster

If this gets attention I'd add another request:
Please make the nodeset an array of REFERENCES to dom nodes, so we
wan use Xpath to locate a node and then we can change it using DOM
functions.
It will make a sensible difference to implement, for example, Xupdate or
modifications
based on Xpath expressions.

Garland

- Original Message -
From: Dan Allen <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 16, 2002 5:56 PM
Subject: [PHP-DEV] relative xpath queries


> XPath is crippled without the ability to do relative xpath queries.
> The interface is already provided by the libxml2 engine, it is just
> a matter of adding the option to xpath_eval().  If you are working
> recursively in an xml document (which you are always doing) and you
> need to run an xpath query from the current node, the only way to do
> it now is to write a function (which I did) to work back up the tree
> from the current node to determine the location path and then append
> that onto the beginning of the query and run it.  However, this is
> very inefficient and shows incompleteness of the domxml xpath
> implementation.  Any chance this could get attention?
>
> Dan
>
> --
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Daniel Allen, <[EMAIL PROTECTED]>
> http://www.mojavelinux.com/
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> "I used to herd dairy cows.  Now I herd linux users.  Apart
> from the isolation, I think I preferred the cows.  They were
> better in conversation, easier to milk, and if they annoyed me
> enough, I could shoot them and eat them."
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> --
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.373 / Virus Database: 208 - Release Date: 7/4/02


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