php-general Digest 23 Jul 2009 07:54:18 -0000 Issue 6245

2009-07-23 Thread php-general-digest-help
php-general Digest 23 Jul 2009 07:54:18 - Issue 6245 Topics (messages 295708 through 295731): Re: Client Side PHP 295708 by: Lenin 295710 by: Eddie Drapkin unsetting a referenced parameter in a function 295709 by: Tom Worster 295719 by: Shawn McKenzie

Re: [PHP] How to build an FF extension

2009-07-23 Thread Ashley Sheridan
On Wed, 2009-07-22 at 23:49 -0400, Paul M Foster wrote: On Wed, Jul 22, 2009 at 08:31:10PM -0700, Javed Khan wrote: How to build an FF extension and how to install it. I'm using Fedora 10 operating system. Can someone please provide me with the steps Thanks J.K Let me substitute

[PHP] Re: newbie question - php parsing

2009-07-23 Thread Peter Ford
João Cândido de Souza Neto wrote: You made a mistake in your code: ?php the_title(); ? must be: ?php echo the_title(); ? Not necessarily: what if you have function the_title() { echo Title; } for example... In response to Sebastiano: There would be not much point in using

Re: [PHP] Re: newbie question - php parsing

2009-07-23 Thread Sebastiano Pomata
Thanks, it's now much more clear. I thought that html parts outside php tags were just dumped to output, no matter of if-else statements and other conditions. I was *definitely* wrong 2009/7/23 Peter Ford p...@justcroft.com: In response to Sebastiano: There would be not much point in using

[PHP] Structure of PHP files

2009-07-23 Thread HostWare Kft.
Hi, It isn't really a programming question, but rather a structural. Let's suppose I have a PHP page, which is built by other PHP files' includes. Which is the better approach: in a switch-like statement I include the required PHP files, which contain all the functions, and the HTML code to

Re: [PHP] Structure of PHP files

2009-07-23 Thread Dengxule
2009/7/23 Sándor Tamás (HostWare Kft.) sandorta...@hostware.hu Hi, It isn't really a programming question, but rather a structural. Let's suppose I have a PHP page, which is built by other PHP files' includes. Which is the better approach: in a switch-like statement I include the

RE: [PHP] Structure of PHP files

2009-07-23 Thread Ford, Mike
-Original Message- From: Dengxule [mailto:dengx...@gmail.com] Sent: 23 July 2009 10:53 Hoping for the coming of the concept of PACKAGE. Seems that NAMESPACE will be introduced in PHP6. Already present in 5.3, actually. Cheers! Mike -- Mike Ford, Electronic Information

RE: [PHP] Mediawiki's url confusion

2009-07-23 Thread Ford, Mike
-Original Message- From: Paul M Foster [mailto:pa...@quillandmouse.com] Sent: 23 July 2009 06:13 On Thu, Jul 23, 2009 at 11:57:51AM +0800, ?? wrote: But I cannot help myself with the url pattern : /somepath_to_mediawiki/index.php/pagetitle. How can this kind of url be

Re: [PHP] How to build an FF extension

2009-07-23 Thread Bastien Koert
Go to the ff site and read the docs bastien On Wednesday, July 22, 2009, Javed Khan iankha...@yahoo.com wrote: How to build an FF extension and how to install it. I'm using Fedora 10 operating system. Can someone please provide me with the steps Thanks J.K -- Bastien Cat, the other

Re: [PHP] Re: unsetting a referenced parameter in a function

2009-07-23 Thread Shawn McKenzie
Tom Worster wrote: On 7/22/09 6:09 PM, Shawn McKenzie nos...@mckenzies.net wrote: Tom Worster wrote: though the manual is perfectly clear that this should be expected, i was a bit surprised that the result of the following is 42 ?php function foo($a) { $a = 42; unset($a); $a =

Re: [PHP] Structure of PHP files

2009-07-23 Thread Floyd Resler
When I first started programming in PHP I used the second method you mentioned. I had a single file I called utils.php and it contained all the functions I could possibly need throughout my site. Unfortunately, this file grew to be over 10,000 lines and most of the time I only needed a

Re: [PHP] EXEC and SYSTEM delay

2009-07-23 Thread Sam Stelfox
Well if the server your running on is linux based (and I haven't tried this) you could try adding a nohup and background the task for example rather than doing: system('updatedb'); try system('nohup updatedb '); It should background the task and let it continue running even when the php

Re: [PHP] Structure of PHP files

2009-07-23 Thread Robert Cummings
Floyd Resler wrote: When I first started programming in PHP I used the second method you mentioned. I had a single file I called utils.php and it contained all the functions I could possibly need throughout my site. Unfortunately, this file grew to be over 10,000 lines and most of the

Re: [PHP] Re: unsetting a referenced parameter in a function

2009-07-23 Thread Martin Scotta
I think he is confusing the unset semantic. Unset just destroy a variable, but not the content of it. Take a look at the output of this simple script: function avoid_global_scope() { $a = 'foo'; var_dump( get_defined_vars() ); $b = $a; var_dump( get_defined_vars() ); unset( $a

Re: [PHP] Structure of PHP files

2009-07-23 Thread Floyd Resler
'Tis true. I just find dealing with the smaller files much easier. At the time I was using Komodo IDE and it would get very sluggish with the larger files. Take care, Floyd On Jul 23, 2009, at 9:34 AM, Robert Cummings wrote: Floyd Resler wrote: When I first started programming in PHP I

Re: [PHP] How to build an FF extension

2009-07-23 Thread Luke
2009/7/23 Ashley Sheridan a...@ashleysheridan.co.uk On Wed, 2009-07-22 at 23:49 -0400, Paul M Foster wrote: On Wed, Jul 22, 2009 at 08:31:10PM -0700, Javed Khan wrote: How to build an FF extension and how to install it. I'm using Fedora 10 operating system. Can someone please

Re: [PHP] How to build an FF extension

2009-07-23 Thread Ashley Sheridan
On Thu, 2009-07-23 at 14:39 +0100, Luke wrote: 2009/7/23 Ashley Sheridan a...@ashleysheridan.co.uk On Wed, 2009-07-22 at 23:49 -0400, Paul M Foster wrote: On Wed, Jul 22, 2009 at 08:31:10PM -0700, Javed Khan wrote: How to build an FF extension and how to install it. I'm using Fedora

[PHP] Undefined Index ...confusion

2009-07-23 Thread Miller, Terion
I keep getting this error while trying to use the field 'ID' to pass in a url.. And it's odd because the query is pulling everything BUT the ID which is the first field... code: a href=view.php?ID=?php echo $_SESSION['fullRestaurantList']['ID']??php echo

Re: [PHP] How to build an FF extension

2009-07-23 Thread Robert Cummings
Ashley Sheridan wrote: Wikipedia can hardly be accounted an official source of anything, especially considering how it gets the content! If you want official, then http://www.mozilla.com/en-US/firefox/releases/1.5.html is a good link. Wikipedia is the official source of Wikipedia information

Re: [PHP] How to build an FF extension

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 10:15 AM, Robert Cummingsrob...@interjinn.com wrote: Ashley Sheridan wrote: Wikipedia can hardly be accounted an official source of anything, especially considering how it gets the content! If you want official, then

Re: [PHP] How to build an FF extension

2009-07-23 Thread Kyle Smith
Ashley Sheridan wrote: On Thu, 2009-07-23 at 14:39 +0100, Luke wrote: 2009/7/23 Ashley Sheridan a...@ashleysheridan.co.uk On Wed, 2009-07-22 at 23:49 -0400, Paul M Foster wrote: On Wed, Jul 22, 2009 at 08:31:10PM -0700, Javed Khan wrote: How to build an FF

Re: [PHP] How to build an FF extension

2009-07-23 Thread Kyle Smith
Robert Cummings wrote: Ashley Sheridan wrote: Wikipedia can hardly be accounted an official source of anything, especially considering how it gets the content! If you want official, then http://www.mozilla.com/en-US/firefox/releases/1.5.html is a good link. Wikipedia is the official source

Re: [PHP] Undefined Index ...confusion

2009-07-23 Thread Kyle Smith
Miller, Terion wrote: I keep getting this error while trying to use the field 'ID' to pass in a url.. And it's odd because the query is pulling everything BUT the ID which is the first field... code: a href=view.php?ID=?php echo $_SESSION['fullRestaurantList']['ID']??php echo

[PHP] Re: Undefined Index ...confusion

2009-07-23 Thread Peter Ford
Miller, Terion wrote: I keep getting this error while trying to use the field 'ID' to pass in a url.. And it's odd because the query is pulling everything BUT the ID which is the first field... code: a href=view.php?ID=?php echo $_SESSION['fullRestaurantList']['ID']??php echo

Re: [PHP] Undefined Index ...confusion

2009-07-23 Thread Miller, Terion
On 7/23/09 9:24 AM, Kyle Smith kyle.sm...@inforonics.com wrote: Miller, Terion wrote: I keep getting this error while trying to use the field 'ID' to pass in a url.. And it's odd because the query is pulling everything BUT the ID which is the first field... code: a href=view.php?ID=?php

Re: [PHP] Structure of PHP files

2009-07-23 Thread Paul M Foster
On Thu, Jul 23, 2009 at 09:34:37AM -0400, Robert Cummings wrote: snip Not that I disagree with your methodology at this time, but you could have just made that single big file, include all those little files and still had a single load statement in each of your consumer source files. With

Re: [PHP] Undefined Index ...confusion

2009-07-23 Thread Kyle Smith
Miller, Terion wrote: On 7/23/09 9:24 AM, Kyle Smith kyle.sm...@inforonics.com wrote: Miller, Terion wrote: I keep getting this error while trying to use the field 'ID' to pass in a url.. And it's odd because the query is pulling everything BUT the ID which is the first field... code: a

Re: [PHP] Structure of PHP files

2009-07-23 Thread Robert Cummings
Paul M Foster wrote: On Thu, Jul 23, 2009 at 09:34:37AM -0400, Robert Cummings wrote: snip Not that I disagree with your methodology at this time, but you could have just made that single big file, include all those little files and still had a single load statement in each of your consumer

[Fwd: Re: [PHP] Undefined Index ...confusion]

2009-07-23 Thread Kyle Smith
Sorry, list, I did a reply instead of a reply-to-all. This is what I sent to Miller, Terion Miller, Terion wrote: Thanks for the link Kyle!! Great thing there...(seriously I didn't know...I learn something everyday) Anyways the link to my script is: http://pastebin.ca/1504393 Your

Re: [PHP] How to build an FF extension

2009-07-23 Thread Bastien Koert
On Thu, Jul 23, 2009 at 10:21 AM, Kyle Smithkyle.sm...@inforonics.com wrote: Robert Cummings wrote: Ashley Sheridan wrote: Wikipedia can hardly be accounted an official source of anything, especially considering how it gets the content! If you want official, then

RE: [PHP] Re: unsetting a referenced parameter in a function

2009-07-23 Thread Arno Kuhl
-Original Message- From: Shawn McKenzie [mailto:nos...@mckenzies.net] Sent: 23 July 2009 02:36 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: unsetting a referenced parameter in a function Tom Worster wrote: On 7/22/09 6:09 PM, Shawn McKenzie nos...@mckenzies.net wrote: Tom

[PHP] Renaming all variables in a repository

2009-07-23 Thread Eddie Drapkin
Hey all, we've got a repository here at work, with something like 55,000 files in it. For the last few years, we've been naming $variables_like_this and functions_the_same($way_too). And now we've decided to switch to camelCasing everything and I've been tasked with somehow determining if it's

Re: [PHP] Renaming all variables in a repository

2009-07-23 Thread Robert Cummings
Eddie Drapkin wrote: Hey all, we've got a repository here at work, with something like 55,000 files in it. For the last few years, we've been naming $variables_like_this and functions_the_same($way_too). And now we've decided to switch to camelCasing everything and I've been tasked with

[PHP] Compare PHP settings of two different servers

2009-07-23 Thread Dave M G
PHP Gurus, I'm currently having a problem with PHP writing text to a PNG image on one server. I have various web sites hosted on various servers, and on most of them, the script that generates the image is writing text properly. I have ensured that the same fonts are available on all the

Re: [PHP] Renaming all variables in a repository

2009-07-23 Thread Martin Scotta
function toCamelCase( $string ) { return str_replace( ' ' , '', ucwords( strtolower( strtr($string, '_', ' ') ) )); } echo toCamelCase( 'this_is_not_properly_written' ); You can use this simplest function to translate a string to camelCase. The process could be... 1) parse by PHP 2)

RE: [PHP] Renaming all variables in a repository

2009-07-23 Thread Yuri Yarlei
In a project with this large number of files, is better if you let the way it is, doing this now you can crash the project and lost much much time. Yuri Yarlei. Programmer PHP, CSS, Java, PostregreSQL; Today PHP, tomorrow Java, after the world. Kyou wa PHP, ashita wa Java, sono ato sekai desu.

Re: [PHP] Compare PHP settings of two different servers

2009-07-23 Thread Robert Cummings
Dave M G wrote: PHP Gurus, I'm currently having a problem with PHP writing text to a PNG image on one server. I have various web sites hosted on various servers, and on most of them, the script that generates the image is writing text properly. I have ensured that the same fonts are

Re: [PHP] Compare PHP settings of two different servers

2009-07-23 Thread David Otton
2009/7/23 Dave M G mar...@autotelic.com: Is there a way I can take the output of phpinfo() from both servers and do a compare that will tell me what the differences are? Just diff the HTML. WinMerge, Kompare, etc etc. Or probably built into your favourite IDE. -- PHP General Mailing List

[PHP] Re: Renaming all variables in a repository

2009-07-23 Thread Greg Beaver
Eddie Drapkin wrote: Hey all, we've got a repository here at work, with something like 55,000 files in it. For the last few years, we've been naming $variables_like_this and functions_the_same($way_too). And now we've decided to switch to camelCasing everything and I've been tasked with

Re: [PHP] Compare PHP settings of two different servers

2009-07-23 Thread Dave M G
David, Robert, Thank you for replying. Just diff the HTML. Unfortunately it is not that easy. Even if the same PHP modules are present, if they are written into the page in a different place, they show up as differences. The same goes for all the HTML tags and everything else, so what I

RE: [PHP] Compare PHP settings of two different servers

2009-07-23 Thread Bob McConnell
From: Dave M G Thank you for replying. Just diff the HTML. Unfortunately it is not that easy. Even if the same PHP modules are present, if they are written into the page in a different place, they show up as differences. The same goes for all the HTML tags and everything else, so what

RE: [PHP] Compare PHP settings of two different servers

2009-07-23 Thread Bob McConnell
From: Dave M G I'm currently having a problem with PHP writing text to a PNG image on one server. I have various web sites hosted on various servers, and on most of them, the script that generates the image is writing text properly. I have ensured that the same fonts are available on

[PHP] Re: Renaming all variables in a repository

2009-07-23 Thread Eddie Drapkin
On Thu, Jul 23, 2009 at 1:50 PM, Greg Beaverg...@chiaraquartet.net wrote: Eddie Drapkin wrote: Hey all, we've got a repository here at work, with something like 55,000 files in it. For the last few years, we've been naming $variables_like_this and functions_the_same($way_too).  And now we've

Re: [PHP] Converting SQL Dialects

2009-07-23 Thread Matt Neimeyer
You might even be able to convert EMPTY(X) to COALESCE(X, '') = ''. MySQL seems to be pretty forgiving with its implicit type-casting. Hmm... The new system I've written properly handles the datatype and EMPTY... So this would be a hack to much around with regexs to replace EMPTY in customer

Re: [PHP] Converting SQL Dialects

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 3:39 PM, Matt Neimeyerm...@neimeyer.org wrote: You might even be able to convert EMPTY(X) to COALESCE(X, '') = ''. MySQL seems to be pretty forgiving with its implicit type-casting. Hmm... The new system I've written properly handles the datatype and EMPTY... So this

Re: [Fwd: Re: [PHP] Undefined Index ...confusion] (RESOLVED)

2009-07-23 Thread Miller, Terion
Thanks On 7/23/09 9:52 AM, Kyle Smith kyle.sm...@inforonics.com wrote: Sorry, list, I did a reply instead of a reply-to-all. This is what I sent to Miller, Terion Miller, Terion wrote: Thanks for the link Kyle!! Great thing there...(seriously I didn't know...I learn something everyday)

Re: [PHP] Renaming all variables in a repository

2009-07-23 Thread Stuart
2009/7/23 Eddie Drapkin oorza...@gmail.com: Hey all, we've got a repository here at work, with something like 55,000 files in it. For the last few years, we've been naming $variables_like_this and functions_the_same($way_too).  And now we've decided to switch to camelCasing everything and

[PHP] Question on code profiling

2009-07-23 Thread Andrew Ballard
I'm trying to profile a site on our development server to see why it takes around 4 seconds to generate a pretty basic page. I installed xdebug to use for the profiling, and now I'm really confused. Even though it takes around 4 seconds to build the entire page, the profile says that the total

Re: [PHP] Question on code profiling

2009-07-23 Thread Robert Cummings
Andrew Ballard wrote: I'm trying to profile a site on our development server to see why it takes around 4 seconds to generate a pretty basic page. I installed xdebug to use for the profiling, and now I'm really confused. Even though it takes around 4 seconds to build the entire page, the profile

Re: [PHP] Compare PHP settings of two different servers

2009-07-23 Thread Ben Dunlap
Thank you for replying. Just diff the HTML. Unfortunately it is not that easy. Even if the same PHP modules are present, if they are written into the page in a different place, they show up as differences. The same goes for all the HTML tags and everything else, so what I end up with is

Re: [PHP] Question on code profiling

2009-07-23 Thread Ben Dunlap
Nope. Basically it connects to a database to load an ACL (which at [...] I thought xdebug was supposed to be a pretty good profiler. If it calculating the time correctly, where are the other ~3.6 seconds going? One night I saw a script wait indefinitely for a response from a tanked database,

Re: [PHP] Re: Question on code profiling

2009-07-23 Thread Jonathan Tapicer
Just an idea: try using the (microtime(true) - $start) approach in portions of code to try isolate the portion that is taking more time. Sometimes that helps me to find the function that is slowing everything down. Jonathan On Thu, Jul 23, 2009 at 6:18 PM, Andrew Ballardaball...@gmail.com wrote:

Re: [PHP] PHP: Writing to CD/DVD?

2009-07-23 Thread Diogo Neves
On Fri, Jul 24, 2009 at 12:20 AM, Clancy clanc...@cybec.com.au wrote: Does anyone know of an extension/utility that will enable PHP to write backup files to a CD/DVD? Ideally I would like the CD to appear as 'just another drive'. -- PHP General Mailing List (http://www.php.net/) To

[PHP] PHP: Writing to CD/DVD?

2009-07-23 Thread Clancy
Does anyone know of an extension/utility that will enable PHP to write backup files to a CD/DVD? Ideally I would like the CD to appear as 'just another drive'. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP: Writing to CD/DVD?

2009-07-23 Thread Nitsan Bin-Nun
That's what I was just about writting. If you use linux -- you can shot calls to the system and watch it's response! Then all you have to do is to install a cd burning software which have an ability to control it through the terminal! Good luck mate! On Fri, Jul 24, 2009 at 1:47 AM, Diogo

Re: [PHP] Doubt regarding session_destroy() in PHP 5

2009-07-23 Thread Lupus Michaelis
Ashley Sheridan a écrit : But *how* does it offer more security? You've not actually mentioned that! Because you need database slice access to manage the session, and not only file access in /tmp/ (where sessions belongs, by default). So now the problem is : and what about the

Re: [PHP] Mediawiki's url confusion

2009-07-23 Thread Dengxule
Thanks a lot. As far as i know, both methods dealing with urls are WEB-SERVER-TECH. While I was installing mediawiki, i did nothing with the file httpd.conf, no changes made on mod_rewrite. The mediawiki install script cannot do nothing to httpd.conf i think. So i'm confused about how the

[PHP] Re: Structure of PHP files

2009-07-23 Thread Lupus Michaelis
Sándor Tamás (HostWare Kft . ) a écrit : It isn't really a programming question, but rather a structural. It is part of our burden ;) Which is the better approach: They are no better approch, only bad ones. I'm using to organize my code in module. Each module require the needed modules.

Re: [PHP] Mediawiki's url confusion

2009-07-23 Thread sean greenslade
On Thu, Jul 23, 2009 at 10:28 PM, Dengxule dengx...@gmail.com wrote: Thanks a lot. As far as i know, both methods dealing with urls are WEB-SERVER-TECH. While I was installing mediawiki, i did nothing with the file httpd.conf, no changes made on mod_rewrite. The mediawiki install script

Re: [PHP] Question on code profiling

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 5:32 PM, Ben Dunlapbdun...@agentintellect.com wrote: I second Jonathan's suggestion; I would try calling microtime() before and after your database query, and before and after anything else that isn't strictly execution of the script. Ben I tried this where I could.

[PHP] A form and an array

2009-07-23 Thread Jason Carson
Hello everyone, Lets say I have a file called form.php with the following form on it that redirects to index.php when submitted. I would like to take the values of the text fields in the form and put them into an array, then be able to display the values in that array on index.php Does anyone

Re: [PHP] Re: A form and an array

2009-07-23 Thread David Robley
Jason Carson wrote: Jason Carson wrote: Hello everyone, Lets say I have a file called form.php with the following form on it that redirects to index.php when submitted. I would like to take the values of the text fields in the form and put them into an array, then be able to display the

Re: [PHP] Re: A form and an array

2009-07-23 Thread Jason Carson
Jason Carson wrote: Jason Carson wrote: Hello everyone, Lets say I have a file called form.php with the following form on it that redirects to index.php when submitted. I would like to take the values of the text fields in the form and put them into an array, then be able to display

RE: [PHP] Re: A form and an array

2009-07-23 Thread Warren Vail
Did you correct the missing double quote in your sending form first? Warren Vail -Original Message- From: Jason Carson [mailto:ja...@jasoncarson.ca] Sent: Thursday, July 23, 2009 9:33 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: A form and an array Jason Carson wrote:

RE: [PHP] Re: A form and an array

2009-07-23 Thread Jason Carson
Yes Did you correct the missing double quote in your sending form first? Warren Vail -Original Message- From: Jason Carson [mailto:ja...@jasoncarson.ca] Sent: Thursday, July 23, 2009 9:33 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: A form and an array Jason Carson

Re: [PHP] Mediawiki's url confusion

2009-07-23 Thread Paul M Foster
On Fri, Jul 24, 2009 at 10:28:52AM +0800, Dengxule wrote: Thanks a lot. As far as i know, both methods dealing with urls are WEB-SERVER-TECH. While I was installing mediawiki, i did nothing with the file httpd.conf, no changes made on mod_rewrite. The mediawiki install script cannot do

Re: [PHP] Re: A form and an array

2009-07-23 Thread Dengxule
In php.ini turn the display_errors to on. If any error,warn or notice shown,copy them and paste here. So you can tell us what doesn't work. good luck~ 2009/7/24 Jason Carson ja...@jasoncarson.ca Jason Carson wrote: Jason Carson wrote: Hello everyone, Lets say I have a file called

Re: [PHP] Re: A form and an array

2009-07-23 Thread Jason Carson
I have it working now. I had a comma where a semicolon should have been. Silly error on my part but thanks to everyone who tried to help me. In php.ini turn the display_errors to on. If any error,warn or notice shown,copy them and paste here. So you can tell us what doesn't work. good luck~

Re: [PHP] Mediawiki's url confusion

2009-07-23 Thread Dengxule
I think PATHINFO is probably what i'm looking for. Paul mentioned the lookback feature, i think that is or about the same thing. MediaWiki-1.15.1 use the pattern of url for common pages like this : some_path_to_mediawiki/index.php/something , and the 'something' supports even non-english