php-general Digest 3 Mar 2010 17:54:26 -0000 Issue 6619

2010-03-03 Thread php-general-digest-help
php-general Digest 3 Mar 2010 17:54:26 - Issue 6619 Topics (messages 302495 through 302514): Re: When to use namespaces 302495 by: Adam Richardson Re: inexplicable behaviour of pre- and post-increment operators 302496 by: Adam Richardson 302511 by: haliphax Re:

[PHP] svg 2 gif/png

2010-03-03 Thread Michael A. Peters
I'm moving all of my dynamic image generation to svg. Not only does it look better, but it is less resource intensive on my server allowing me to generate the svg on demand instead of pre-generating (via cron) twice a month like I had to do with gd dynamic generation. However, some browsers

Re: [PHP] svg 2 gif/png

2010-03-03 Thread Michael A. Peters
Michael A. Peters wrote: *snip* Is there an easy way around this? IE a php class/function that understands SVG w/ xlink and can replace the use tags with the polygons they refer to? If not, I'll have to try to write one, but I'd rather not ... I just did, haven't tested yet, but this may

Re: [PHP] session.entropy_file and hostname

2010-03-03 Thread Daniel Egeberg
On Wed, Mar 3, 2010 at 07:28, Sascha Wojewsky sascha.wojew...@heinze.de wrote: thank you for your answer, If you want server-unique session ids, use session_name() before session_start()..? i cannot use session_name, because i've to regenarete a session id by permanent login. i'm using

Re: [PHP] svg 2 gif/png

2010-03-03 Thread Michael A. Peters
Michael A. Peters wrote: Michael A. Peters wrote: *snip* Is there an easy way around this? IE a php class/function that understands SVG w/ xlink and can replace the use tags with the polygons they refer to? If not, I'll have to try to write one, but I'd rather not ... I just did, haven't

[PHP] Re: Memory investigation

2010-03-03 Thread user
ON Linux I have kcacheGrind setup with Xdebug and I find it is a nice little thing to have. It won't tell you the memory consumed but it will find cycles and display object maps. if you have Kcachegrind it is likely you have valgrind installed. http://www2.mandriva.com/ http://valgrind.org/

Re: [PHP] svg 2 gif/png

2010-03-03 Thread Michael A. Peters
Michael A. Peters wrote: Michael A. Peters wrote: Michael A. Peters wrote: *snip* Is there an easy way around this? IE a php class/function that understands SVG w/ xlink and can replace the use tags with the polygons they refer to? If not, I'll have to try to write one, but I'd rather not

[PHP] Help with exec.

2010-03-03 Thread Paul Halliday
I need to pipe some data to an external application. I have this: while ($row = mysql_fetch_array($theData[0])) { $src_ip[] = $row[0]; $dst_ip[] = $row[1]; $sig_desc[] = $row[2]; $rec ++; if ( $rec == $recCount ) { break; } } for ($i = 0; $i

Re: [PHP] Help with exec.

2010-03-03 Thread Richard Quadling
On 3 March 2010 13:01, Paul Halliday paul.halli...@gmail.com wrote: I need to pipe some data to an external application. I have this: while ($row = mysql_fetch_array($theData[0])) {    $src_ip[] = $row[0];    $dst_ip[] = $row[1];    $sig_desc[] = $row[2];    $rec ++;    if ( $rec ==

Re: [PHP] Help with exec.

2010-03-03 Thread Teus Benschop
On Wed, 2010-03-03 at 13:04 +, Richard Quadling wrote: On 3 March 2010 13:01, Paul Halliday paul.halli...@gmail.com wrote: I need to pipe some data to an external application. I have this: while ($row = mysql_fetch_array($theData[0])) { $src_ip[] = $row[0]; $dst_ip[] =

Re: [PHP] Help with exec.

2010-03-03 Thread Paul Halliday
I work by example :) I can't find enough of an example to get me going with this. I have this: $glow = popen('afterglow.pl -c color.properties -s -e 3 -p 1 -l 2000 | neato -Tpng -o /usr/local/www/test.png','r'); how do I feed my array to that? Thanks. On Wed, Mar 3, 2010 at 9:04 AM, Richard

[PHP] Re: Help with exec.

2010-03-03 Thread Ian
On 03/03/2010 13:01, Paul Halliday wrote: I need to pipe some data to an external application. I have this: while ($row = mysql_fetch_array($theData[0])) { $src_ip[] = $row[0]; $dst_ip[] = $row[1]; $sig_desc[] = $row[2]; $rec ++; if ( $rec == $recCount ) {

Re: [PHP] PHP: inexplicable behaviour of pre- and post-increment operators

2010-03-03 Thread haliphax
On Fri, Feb 26, 2010 at 11:01 PM, clanc...@cybec.com.au wrote: while ($i $j) { $b[$i] = $a[$i++]; } B. You get $b[0] = $a[1], and so on (as you would expect). Wouldn't that be $b[0] = $a[0], with the value of $i being 1 *after* the statement was finished executing? You used a

Re: [PHP] Re: Help with exec.

2010-03-03 Thread Paul Halliday
and its that easy! it took me a minute to figure out; but all I had to do was: if (is_resource($process)) { for ($i = 0; $i sizeof($src_ip); $i++) { fwrite($pipes[0], $sig_desc[$i],$src_ip[$i],$dst_ip[$i]\n); } fclose($pipes[0]); fclose($pipes[1]);

Re: [PHP] Re: Memory investigation

2010-03-03 Thread la...@garfieldtech.com
Yep, I'm familiar with XDebug and KCacheGrind. As you say, though, it doens't (as far as I am aware) offer the particular data that I'm after. We've already got cachegrind gurus working on the code who know how to use it better than I do. :-) What I'm looking for is see this big cache

Re: [PHP] Re: Memory investigation

2010-03-03 Thread David Otton
On 3 March 2010 15:49, la...@garfieldtech.com la...@garfieldtech.com wrote: Yep, I'm familiar with XDebug and KCacheGrind.  As you say, though, it doens't (as far as I am aware) offer the particular data that I'm after.  We've already got cachegrind gurus working on the code who know how to

Re: [PHP] Re: Memory investigation

2010-03-03 Thread dsiembab01
function check_memory_usage($memory) { $memory[] = memory_get_usage(); return $memory; } something like this? you can put it wherever you like and returns an array for further processing. You could optionally add a second argument to set the index to a name and check if the name exists

Re: [PHP] Re: Memory investigation

2010-03-03 Thread la...@garfieldtech.com
That's not really what I'm after. Let me try an example: function foo($id) { static $foos = array(); if (empty($foos[$id]) { $foos[$id] = load_foo($id); } return $foos[$id]; } When load_foo() is slow (e.g., lots of DB traffic or remote-server calls or whatever), such caching can

[PHP] Re: Database design

2010-03-03 Thread dsiembab01
a good tool for mapping mysql databases is mysql-workbench. the real question is how much normalization is normal? http://wb.mysql.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] basic authentication and redirection

2010-03-03 Thread Bill Rausch
Hi there, In certain circumstances controlled by my users, I'd like to redirect my users to another site, a third party whom we have contracted with. The second site uses basic authentication with a simple username and password. Can I write my PHP code so my users do not have to login (or

[PHP] Best os shopping cart

2010-03-03 Thread Haig Davis
Hi, I apologise if this is not strictly php related. What Open Source Shopping cart system do you recommend between osCommerce and Zen-Cart for ease of use and a php guy with dangerously little javascript knowledge? This is not for a massive shopping site, simply a cart to power a subscription

Re: [PHP] Best os shopping cart

2010-03-03 Thread Robert Cummings
Haig Davis wrote: Hi, I apologise if this is not strictly php related. What Open Source Shopping cart system do you recommend between osCommerce and Zen-Cart for ease of use and a php guy with dangerously little javascript knowledge? This is not for a massive shopping site, simply a cart to

Re: [PHP] basic authentication and redirection

2010-03-03 Thread Rene Veerman
depends on how that site does its authentication... if it's a form, it may need an extra setting to allow you to go to a specific page on that site after authentication. On Wed, Mar 3, 2010 at 8:25 PM, Bill Rausch brau...@owt.com wrote: Hi there, In certain circumstances controlled by my

Re: [PHP] Re: Memory investigation

2010-03-03 Thread Rene Veerman
global $fooSize = 0; function foo($id) { global $fooSize; if (empty($foos($id)) { $b = get_memory_usage(true); $foos[$id] = load_foo($id); $fooSize+= $b - get_memory_usage(true); } ... } On Wed, Mar 3, 2010 at 8:16 PM, la...@garfieldtech.com la...@garfieldtech.com wrote: That's not

RE: [PHP] basic authentication and redirection

2010-03-03 Thread Jay Blanchard
[snip] In certain circumstances controlled by my users, I'd like to redirect my users to another site, a third party whom we have contracted with. The second site uses basic authentication with a simple username and password. Can I write my PHP code so my users do not have to login (or even

Re: [PHP] basic authentication and redirection

2010-03-03 Thread Robert Cummings
Jay Blanchard wrote: [snip] In certain circumstances controlled by my users, I'd like to redirect my users to another site, a third party whom we have contracted with. The second site uses basic authentication with a simple username and password. Can I write my PHP code so my users do not

Re: [PHP] Re: Memory investigation

2010-03-03 Thread dsiembab01
couple questions Larry is this application composed of classes or straight up no holes barred procedural code? la...@garfieldtech.com wrote: That's not really what I'm after. Let me try an example: function foo($id) { static $foos = array(); if (empty($foos[$id]) { $foos[$id] =

Re: [PHP] Re: Memory investigation

2010-03-03 Thread la...@garfieldtech.com
Currently it's mostly procedural with some components that are OO. I suspect most of the memory sinks are large arrays (we have a lot of them), but I am not certain of that. Hence my interest in more accurate investigation tools. --Larry Garfield dsiemba...@gmail.com wrote: couple

Re: [PHP] Best os shopping cart

2010-03-03 Thread Ashley Sheridan
On Wed, 2010-03-03 at 14:46 -0500, Robert Cummings wrote: Haig Davis wrote: Hi, I apologise if this is not strictly php related. What Open Source Shopping cart system do you recommend between osCommerce and Zen-Cart for ease of use and a php guy with dangerously little javascript

Re: [PHP] Best os shopping cart

2010-03-03 Thread tedd
At 11:29 AM -0800 3/3/10, Haig Davis wrote: Hi, I apologise if this is not strictly php related. What Open Source Shopping cart system do you recommend between osCommerce and Zen-Cart for ease of use and a php guy with dangerously little javascript knowledge? This is not for a massive shopping

[PHP] Re: Best os shopping cart

2010-03-03 Thread Shawn McKenzie
Haig Davis wrote: Hi, I apologise if this is not strictly php related. What Open Source Shopping cart system do you recommend between osCommerce and Zen-Cart for ease of use and a php guy with dangerously little javascript knowledge? This is not for a massive shopping site, simply a cart

Re: [PHP] PHP: inexplicable behaviour of pre- and post-increment operators

2010-03-03 Thread clancy_1
On Wed, 3 Mar 2010 08:21:06 -0600, halip...@gmail.com (haliphax) wrote: On Fri, Feb 26, 2010 at 11:01 PM, clanc...@cybec.com.au wrote: while ($i $j) { $b[$i] = $a[$i++]; } B. You get $b[0] = $a[1], and so on (as you would expect). Wouldn't that be $b[0] = $a[0], with the value

[PHP] XMLRPC issue

2010-03-03 Thread Dmitry Ruban
Hi all, I was upgrading php from 5.6 to 5.11 and came across one odd issue. Hope someone could point out what is the problem. Following code demonstrates it: $xml = '?xml version=1.0 encoding=UTF-8?methodResponseparamsparamvaluelt;Test/gt;/value/param/params/methodResponse'; echo