Re: [PHP-DEV] Graphs and Charts

2003-10-31 Thread Eric COLINET
Hi !

I had the same problem, and i solve it by the use of the 'embed' sapi for PHP.

Just link you application with it and you will be able to call (not tested 
but should be near ok):

int run_php_script( const char *script_file ) {
zend_file_handle file_handle;;
int argc= 1
char * argv[]= { "php_embed" };
int ret;
file_handle.filename = estrdup(script_file);
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.opened_path = NULL;
file_handle.free_filename = 0;
PHP_EMBED_START_BLOCK( argc, argv );
ret= php_execute_script( file_handle TSRMLS_CC);
PHP_EMBED_END_BLOCK();
return ret;
}
and then call anywhere in your code:
run_php_script( "myJpGraphCode.php" );
Just a problem: all outputs are on stdout !
But you can buffer the outputs in the php script and write them to a file.
I hope this will be helpful !

Eric

At 20:44 30/10/2003, you wrote:
Hi all,

It may does not make sense, but I'm writing a web based script in C++
and now I need to build 3D pie/bar charts. The best solution and quality
I have found was JpGraph that uses PHP Gd Library / Functions.
I was thinking about using the PHP source code in my C++ program to
generate the charts insted of using the main GD code from Boutell -
because the two versions are different, Boutell's GD doesnt have native
functions to build 3D images.
Is it possible to use the PHP Header in my C++ program to use the
features of GD that exits into PHP ?
Thanks in advance and sorry if it does not make sense.

Regards.
MENDES, Guilherme
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] BUG #18630

2003-10-31 Thread Andi Gutmans
At 11:07 PM 10/30/2003 -0400, Ilia Alshanetsky wrote:
On October 30, 2003 05:48 pm, Andi Gutmans wrote:
> Yeah, I also thought of that but I don't really want to do run-time checks.
> It is a possibility though.
If it is done once during startup, the 'harm' should be minimal and in vast
majority of cases performance on win32 is not really that much of an issue.
In persistent environment it won't even be felt.
Yeah, we'd obviously do it once and save a flag. I just meant it's ugly but 
I can live with it.

On the other hand do we really wish to continue supporting an operating 
system
that has been abandoned by it's developer?
Its customers haven't abandoned it because its developers want muchos $$$ 
for upgrades :)

Andi

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


[PHP-DEV] Scheme handlers for XSLT in progress.

2003-10-31 Thread Adam Dickmeiss
Hi,

we miss the scheme facility from PHP4's XSLT extension. So, we are 
making a new one for PHP5's XSL extension, i.e. interfacing libXSLT's 
xsltRegisterExtModuleFunction. If nobody else have done it/is doing it 
we'd like to contribute.

-- Adam

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


Re: [PHP-DEV] BUG #18630

2003-10-31 Thread Uwe Schindler
At 10:27 31.10.2003, Andi Gutmans wrote:
At 11:07 PM 10/30/2003 -0400, Ilia Alshanetsky wrote:
On October 30, 2003 05:48 pm, Andi Gutmans wrote:
> Yeah, I also thought of that but I don't really want to do run-time 
checks.
> It is a possibility though.

If it is done once during startup, the 'harm' should be minimal and in vast
majority of cases performance on win32 is not really that much of an issue.
In persistent environment it won't even be felt.
Yeah, we'd obviously do it once and save a flag. I just meant it's ugly 
but I can live with it.
Some runtime checks for "undocumented" functions in SunONE webserver are 
also in /sapi/nsapi.c at module startup. The function pointer is then in a 
global variable: http://lxr.php.net/source/php-src/sapi/nsapi/nsapi.c#218

On the other hand do we really wish to continue supporting an operating 
system
that has been abandoned by it's developer?
Its customers haven't abandoned it because its developers want muchos $$$ 
for upgrades :)

Andi

-
Uwe Schindler
[EMAIL PROTECTED] - http://www.php.net
NSAPI SAPI developer
Erlangen, Germany
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] Scheme handlers for XSLT in progress.

2003-10-31 Thread Christian Stocker


On 10/31/03 11:23 AM, Adam Dickmeiss wrote:

Hi,

we miss the scheme facility from PHP4's XSLT extension. So, we are 
making a new one for PHP5's XSL extension, i.e. interfacing libXSLT's 
xsltRegisterExtModuleFunction. If nobody else have done it/is doing it 
we'd like to contribute.
Can't you just use the stream-wrappers provided by PHP5? These are very 
well supported even in xslt. What's the difference between them and the 
sablotron way? Besides the different API in PHP userland?

chregu

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


Re: [PHP-DEV] Scheme handlers for XSLT in progress.

2003-10-31 Thread Adam Dickmeiss
Christian Stocker wrote:



On 10/31/03 11:23 AM, Adam Dickmeiss wrote:

Hi,

we miss the scheme facility from PHP4's XSLT extension. So, we are 
making a new one for PHP5's XSL extension, i.e. interfacing libXSLT's 
xsltRegisterExtModuleFunction. If nobody else have done it/is doing 
it we'd like to contribute.


Can't you just use the stream-wrappers provided by PHP5? These are 
very well supported even in xslt. What's the difference between them 
and the sablotron way? Besides the different API in PHP userland?

chregu
Don't know the stream-wrappers, but from what I can see it doesn't do 
what we need. We want to be called by XSLT (with args etc) when XSLT 
meets registered elements&NS. So if you want a stylesheet with side 
effects, say that search in a database, just chaning the stream of XML 
doesn't help. XSLT must be in control - must have processed the args to 
the handler A stream approach is "separate" pass. Again, I may have 
misunderstood something, so we'd really like to know if it can be 
achived already..

-- Adam



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


Re: [PHP-DEV] Graphs and Charts

2003-10-31 Thread Guilherme A. Mendes
Eric,

Thats a good idea. I will try to use your code !
Thanks.

---
MENDES, Guilherme

Em Sex, 2003-10-31 às 07:15, Eric COLINET escreveu:
> Hi !
> 
> I had the same problem, and i solve it by the use of the 'embed' sapi for PHP.
> 
> Just link you application with it and you will be able to call (not tested 
> but should be near ok):
> 
> int run_php_script( const char *script_file ) {
>  zend_file_handle file_handle;;
>  int argc= 1
>  char * argv[]= { "php_embed" };
>  int ret;
> 
>  file_handle.filename = estrdup(script_file);
>  file_handle.type = ZEND_HANDLE_FILENAME;
>  file_handle.opened_path = NULL;
>  file_handle.free_filename = 0;
> 
>  PHP_EMBED_START_BLOCK( argc, argv );
>  ret= php_execute_script( file_handle TSRMLS_CC);
>  PHP_EMBED_END_BLOCK();
> 
>  return ret;
> }
> 
> and then call anywhere in your code:
> run_php_script( "myJpGraphCode.php" );
> 
> Just a problem: all outputs are on stdout !
> But you can buffer the outputs in the php script and write them to a file.
> 
> I hope this will be helpful !
> 
> Eric
> 
> 
> At 20:44 30/10/2003, you wrote:
> >Hi all,
> >
> >It may does not make sense, but I'm writing a web based script in C++
> >and now I need to build 3D pie/bar charts. The best solution and quality
> >I have found was JpGraph that uses PHP Gd Library / Functions.
> >
> >I was thinking about using the PHP source code in my C++ program to
> >generate the charts insted of using the main GD code from Boutell -
> >because the two versions are different, Boutell's GD doesnt have native
> >functions to build 3D images.
> >
> >Is it possible to use the PHP Header in my C++ program to use the
> >features of GD that exits into PHP ?
> >
> >Thanks in advance and sorry if it does not make sense.
> >
> >Regards.
> >MENDES, Guilherme
> >
> >--
> >PHP Internals - PHP Runtime Development Mailing List
> >To unsubscribe, visit: http://www.php.net/unsub.php

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



[PHP-DEV] CVS Account Request: aleigh

2003-10-31 Thread Alex Leigh
I develop a webserver that is freely available for people to use. For the past several 
years it has supported PHP, but, I have required people to download the SAPI extension 
and compile PHP themselves. I would like my SAPI extension to be bundled with PHP so 
my users do not have to rebuild the PHP configuration to get it to work. I only 
require access for this particular thing, but, I'm not sure how you work it.

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



Re: [PHP-DEV] Scheme handlers for XSLT in progress.

2003-10-31 Thread Christian Stocker
Just as an update to this question

According to Adam, the stream-wrapper support in ext/xsl seems to have 
the same possibilities as the schemes support in the former sablotron 
extension. But he will further look into it and keep us/me updated about 
the outcome ;)


I will talk about stream-wrapper support in ext/dom and ext/xsl in my 
talk next week at the php conference (and in the slides/examples 
published afterwards) ;)


chregu

On 10/31/03 12:20 PM, Adam Dickmeiss wrote:
Christian Stocker wrote:



On 10/31/03 11:23 AM, Adam Dickmeiss wrote:

Hi,

we miss the scheme facility from PHP4's XSLT extension. So, we are 
making a new one for PHP5's XSL extension, i.e. interfacing libXSLT's 
xsltRegisterExtModuleFunction. If nobody else have done it/is doing 
it we'd like to contribute.


Can't you just use the stream-wrappers provided by PHP5? These are 
very well supported even in xslt. What's the difference between them 
and the sablotron way? Besides the different API in PHP userland?

chregu


Don't know the stream-wrappers, but from what I can see it doesn't do 
what we need. We want to be called by XSLT (with args etc) when XSLT 
meets registered elements&NS. So if you want a stylesheet with side 
effects, say that search in a database, just chaning the stream of XML 
doesn't help. XSLT must be in control - must have processed the args to 
the handler A stream approach is "separate" pass. Again, I may have 
misunderstood something, so we'd really like to know if it can be 
achived already..

-- Adam




--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [EMAIL PROTECTED]  |  gnupg-keyid 0x5CE1DECB
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DEV] Re: [PATCH][ZE2] zend_highlight.c change

2003-10-31 Thread Lisa Seelye
On Wed, 2003-10-29 at 22:31, Greg Beaver wrote:
> Lisa,
> 
> With my testing, \n causes a double line break in Netscape Mail 
> and Internet Explorer 6 on windows.  However, using \n inside  
> instead of  works in both browsers.  For my test, I took the page 
> at http://pear.php.net/manual/en/core.pear.pear.seterrorhandling.php and
> 
> replaced the  with \n.  I've uploaded a copy to:
> 
> http://www.chiaraquartet.net/test_br.html
> 
> I would appreciate it if people with older versions of Netscape/IE, any 
> version of Mozilla, Opera, Konqueror, etc. would take a look and speak 
> up if the example doesn't work correctly.

The purpose of the \n (and \t) was to break up the outputted html
source.  During my browser testing, Opera 7.21, Netscape 4.76, Mozilla
1.5, and IE 6 all behaved normally:  Within the pre-formatted 
blocks, all of the test browsers did not display any problems.  That is
to say, the existing  put page breaks, and the new \n introduced a
carriage return in the html source.

I would dare say the behavior of Netscape Mail (double line break) is
exclusive to it.  I could not reproduce any double line break in IE 6
(with the requisite service packs and security patches).

With regards to your test page, it looks fine (rendered and source) with
Opera 7.21.

-- 
Regards,
-Lisa



signature.asc
Description: This is a digitally signed message part


[PHP-DEV] CVS Account Request: mcgyver5

2003-10-31 Thread Tim McGuire
To add new documentation to PEAR project

I got this email from Martin Jansen as part of the pear-doc mailing list:  
I guess adding new documentation is the most important task at the
moment. We are maintaining our documentation in Docbook XML, which is
available via CVS. Because of that you will need a CVS account for
cvs.php.net, which you can apply for at http://php.net/cvs-php.php.

Once you've got that account, please get back to the list, so we can
communicate the next steps to you.

-- 
- Martin   Martin Jansen

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



[PHP-DEV] file_exists() bug with windows?

2003-10-31 Thread Matthias Nothhaft
Hi List,

I noticed that

file_exists(""); // or null instead of ""

under my Windows machine
with php 4.2.2 returns true!?
My Debian machine with php 4.3.3 works fine
and returns false!
Am I alone with that problem or is it a bug?

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


Re: [PHP-DEV] file_exists() bug with windows?

2003-10-31 Thread Frank M. Kromann
Hi Matthias,

Not sure if this has changed but with the current developmnet versions of
both php4 and php5 this function returns false for both null and empty
string.

- Frank

> Hi List,
> 
> I noticed that
> 
> file_exists(""); // or null instead of ""
> 
> under my Windows machine
> with php 4.2.2 returns true!?
> 
> My Debian machine with php 4.3.3 works fine
> and returns false!
> 
> Am I alone with that problem or is it a bug?
> 
> Regards,
> Matthias
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



Re: [PHP-DEV] file_exists() bug with windows?

2003-10-31 Thread Matthias Nothhaft
Did you check this under Windows?

Frank M. Kromann wrote:
Hi Matthias,

Not sure if this has changed but with the current developmnet versions of
both php4 and php5 this function returns false for both null and empty
string.
- Frank


Hi List,

I noticed that

file_exists(""); // or null instead of ""

under my Windows machine
with php 4.2.2 returns true!?
My Debian machine with php 4.3.3 works fine
and returns false!
Am I alone with that problem or is it a bug?

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


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


[PHP-DEV] Re: file_exists() bug with windows?

2003-10-31 Thread Thomas Seifert
On Fri, 31 Oct 2003 23:35:08 +0100 [EMAIL PROTECTED] (Matthias Nothhaft) wrote:

> Hi List,
> 
> I noticed that
> 
> file_exists(""); // or null instead of ""
> 
> under my Windows machine
> with php 4.2.2 returns true!?
> 
> My Debian machine with php 4.3.3 works fine
> and returns false!
> 
> Am I alone with that problem or is it a bug?
> 
> Regards,
> Matthias


Hmm,

I would say "no file" will always exist. 
Therefore I would call that behaviour undefined.



thomas

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