php-general Digest 16 Oct 2009 15:46:12 -0000 Issue 6393

2009-10-16 Thread php-general-digest-help

php-general Digest 16 Oct 2009 15:46:12 - Issue 6393

Topics (messages 298903 through 298918):

Re: Need unrounded precision
298903 by: Kim Madsen

Re: security/deployment issue
298904 by: hessiess.hessiess.com

Re: Header problem - solved
298905 by: Kim Madsen

Re: Built-in Debugging
298906 by: Andrea Giammarchi
298908 by: Al
298909 by: Bob McConnell
298910 by: Al
298911 by: Ashley Sheridan
298912 by: Al
298913 by: Bob McConnell
298914 by: Robert Cummings
298915 by: David Murphy

XSLTProcessor: need interface to libxslt´s xsltDocLoaderFunc
298907 by: Felix Siglreithmaier

How to Delete the parent node, and child nodes/leafs for a db/tbl in php
298916 by: bruce
298917 by: Ashley Sheridan

How to pronounce PHP code over the phone?
298918 by: Dotan Cohen

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---

Hello

Andre Dubuc wrote on 2010-01-02 02:20:

Hi,

I need to extract the first digit after the decimal point from a number such 
as 28.56018, which should be '5'.


Since no one came up with the simple solution:

$num = 28.56018;
ereg(^[0-9]+\.([0-9]){1}, trim($num), $regs);
if($regs[1])
  $digit = $regs[1];
else
  print no digit found;

--
Kind regards
Kim Emax

---End Message---
---BeginMessage---
 Rsync should work fine, but personally I like to see exactly which
 changes are being deployed especially when deploying to production.
 While I realise this recommendation is not Open Source software, I
 have found it to be an excellent piece of software for this task. I
 use Beyond Compare which has the ability to connect over SFTP or SCP
 as well as regular FTP. It allows you to 'diff' the files as you go
 and view exact changes and you can transfer only the changes you want
 or whole files if you choose to. I would not be surprised if an Open
 Source equivalent exists.

 What about SVN? you can do a svn export. Or you can have a working
 copy for production too.
 Just dont forget to deny access to .svn in your webserver.
 Here are directives for Apache:

 Directory ~ ^(.*/)?\.svn/?
 Order allow,deny
 Deny from all
 /Directory


I do exactly this, its handy to be able to check out the latest version of
a website, make some changes and commit it again, while having acsess to
the complete revision history, from absolutely anywhere.

SVN works over HTTPS, so can go straight through most firewalls without
anyone noticing and it also does data transmissions (like RSync) which can
be a LOT faster than re uploading the whole file with SFTP etc.

There are some security issues in a shared hosting environment though, if
you use a commit hook to update the web root on commit using a file:///
URL anyone on the server could check out / commit files from the
repository. As of right now the only work around that I can think of for
this would be to run two apches at the same time, one for SVN, and one for
the main HTTP server which is chrooted to block access to the SVN repos
and have the non chrooted server revere proxy connections to the chrooted
one.

---End Message---
---BeginMessage---

Andrea Giammarchi wrote on 2009-10-05 18:26:


  There's a useful function called headers_sent() which checks to see if
  the headers have already been sent to the browser. This might be a good
  place to throw into your code at various points to check and see if
  something is being written which you don't expect.

true, check that as well, moreover, you talked about utf-8, well, if the 
BOM is automatically added, it can cause lots of problems ... still, 
only if you sent whatever to the output before the download.


I've tried a bunch of things, including link to index.php and as first 
thing check if the request is a zipfile, then throw a zip header, 
readfile the file then exit the code. Nothing helped. So I figured it 
could be a latin-1 / utf-8 problem and tried to post to a fresh new page 
(donwload_zip.php) instead, where I was sure the terminal and Vi was set 
to use latin-1, then it worked.


It's still not the ultimate solution as we wanted the zipfile to be 
created on the fly in memory in order not to have to delete files 
afterwards and to be sure that only allowed users can fetch the files 
(of course you can always put the zipfiles outside webscope, but still...)


--
Kind regards
Kim Emax
---End Message---
---BeginMessage---

Specially suited for Ajax interaction, you may be interested into Formaldehyde:
http://code.google.com/p/formaldehyde/

Regards

 Date: Thu, 15 Oct 2009 17:39:14 -0700
 From: xwis...@yahoo.com
 To: php-gene...@lists.php.net
 Subject: [PHP] Built-in Debugging
 

Re: [PHP] Need unrounded precision

2009-10-16 Thread Kim Madsen

Hello

Andre Dubuc wrote on 2010-01-02 02:20:

Hi,

I need to extract the first digit after the decimal point from a number such 
as 28.56018, which should be '5'.


Since no one came up with the simple solution:

$num = 28.56018;
ereg(^[0-9]+\.([0-9]){1}, trim($num), $regs);
if($regs[1])
  $digit = $regs[1];
else
  print no digit found;

--
Kind regards
Kim Emax


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



Re: [PHP] security/deployment issue

2009-10-16 Thread hessiess
 Rsync should work fine, but personally I like to see exactly which
 changes are being deployed especially when deploying to production.
 While I realise this recommendation is not Open Source software, I
 have found it to be an excellent piece of software for this task. I
 use Beyond Compare which has the ability to connect over SFTP or SCP
 as well as regular FTP. It allows you to 'diff' the files as you go
 and view exact changes and you can transfer only the changes you want
 or whole files if you choose to. I would not be surprised if an Open
 Source equivalent exists.

 What about SVN? you can do a svn export. Or you can have a working
 copy for production too.
 Just dont forget to deny access to .svn in your webserver.
 Here are directives for Apache:

 Directory ~ ^(.*/)?\.svn/?
 Order allow,deny
 Deny from all
 /Directory


I do exactly this, its handy to be able to check out the latest version of
a website, make some changes and commit it again, while having acsess to
the complete revision history, from absolutely anywhere.

SVN works over HTTPS, so can go straight through most firewalls without
anyone noticing and it also does data transmissions (like RSync) which can
be a LOT faster than re uploading the whole file with SFTP etc.

There are some security issues in a shared hosting environment though, if
you use a commit hook to update the web root on commit using a file:///
URL anyone on the server could check out / commit files from the
repository. As of right now the only work around that I can think of for
this would be to run two apches at the same time, one for SVN, and one for
the main HTTP server which is chrooted to block access to the SVN repos
and have the non chrooted server revere proxy connections to the chrooted
one.


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



Re: [PHP] Header problem - solved

2009-10-16 Thread Kim Madsen

Andrea Giammarchi wrote on 2009-10-05 18:26:


  There's a useful function called headers_sent() which checks to see if
  the headers have already been sent to the browser. This might be a good
  place to throw into your code at various points to check and see if
  something is being written which you don't expect.

true, check that as well, moreover, you talked about utf-8, well, if the 
BOM is automatically added, it can cause lots of problems ... still, 
only if you sent whatever to the output before the download.


I've tried a bunch of things, including link to index.php and as first 
thing check if the request is a zipfile, then throw a zip header, 
readfile the file then exit the code. Nothing helped. So I figured it 
could be a latin-1 / utf-8 problem and tried to post to a fresh new page 
(donwload_zip.php) instead, where I was sure the terminal and Vi was set 
to use latin-1, then it worked.


It's still not the ultimate solution as we wanted the zipfile to be 
created on the fly in memory in order not to have to delete files 
afterwards and to be sure that only allowed users can fetch the files 
(of course you can always put the zipfiles outside webscope, but still...)


--
Kind regards
Kim Emax

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



[PHP] XSLTProcessor: need interface to libxslt´s xsltDocL oaderFunc

2009-10-16 Thread Felix Siglreithmaier
Hi,

in the Java Xalan XSLT processor there is an URIResolver object to
resolve URIs used in xsl:include, xsl:import, etc.
http://xml.apache.org/xalan-j/apidocs/javax/xml/transform/class-use/URIResolver.html

With this URIResolver you can comfortably implement your own logic to
load external resources.

A small example how it works in Java, so maybe my problem is easier to
understand:

TransformerFactory.newInstance().setURIResolver(
new URIResolver() {
 public Source resolve(String href, String base) {
// all included files are relative to c:\temp
return new StreamSource(
  new File (c:\\temp\\+href));
}
});

and so statements like:
xsl:include href=include.xsl/
will include c:\temp\include.xsl



Now my problem is, that i need this functionality in PHP´s XSLTProcessor.

Generally I think libxslt already supports the same functionality with
the xsltDocLoaderFunc:
http://xmlsoft.org/XSLT/html/libxslt-documents.html#XSLTDOCLOADERFUNC

anyone have an idea how to handle that problem?

thanks a lot

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



RE: [PHP] Built-in Debugging

2009-10-16 Thread Andrea Giammarchi

Specially suited for Ajax interaction, you may be interested into Formaldehyde:
http://code.google.com/p/formaldehyde/

Regards

 Date: Thu, 15 Oct 2009 17:39:14 -0700
 From: xwis...@yahoo.com
 To: php-general@lists.php.net
 Subject: [PHP] Built-in Debugging
 
 Hello,
 
 Will be ever see built-in debugging features for PHP?
 
 I know there's xdebug but it's sometimes difficult to get it working. I'm 
 hoping that PHP will one day have integrated debugging features that can be 
 easily enabled or disabled:
 
 ?php
 
 enable_debug(true);
 debug_console(Hello world!'); // sends an output to the console of the 
 debugger.
 
 
 ?
 
  
_
Keep your friends updated—even when you’re not signed in.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_5:092010

[PHP] Re: Built-in Debugging

2009-10-16 Thread Al



Raymond Irving wrote:

Hello,


Will be ever see built-in debugging features for PHP?

I kjnow there's xdebug but it's sometimes difficult to get it working. I'm 
hopoing that PHP will one day have intgrated debuging features that can be 
easily enabled or disabled:

?php

enable_debug(true);

debug_console(Hello world!'); // sends an output to the console of the 
debugger.


?



Personally, I've found that turning on error_reporting(E_ALL), 
debug_backtrace() and debug_print_backtrace() quite adequate for most situations.


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



RE: [PHP] Built-in Debugging

2009-10-16 Thread Bob McConnell
From: Raymond Irving

 Will be ever see built-in debugging features for PHP?

I do not expect there would be. Debuggers are more likely to be provided
by the IDE. For example, in MS-Windows, Visual Studio is the IDE and can
include any of several compilers. It also includes the debugger, and
uses the same front end for all languages. Of course, Microsoft has it
much easier since they only support one hardware platform (x86) and one
OS. Unlike the rest of the world where tools are more likely to be
portable.

For an IDE with debug capabilities, try NetBeans. I am sure there are
others, but that is the only one I have actually looked at.

Bob McConnell

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



Re: [PHP] Built-in Debugging

2009-10-16 Thread Al



Bob McConnell wrote:

From: Raymond Irving


Will be ever see built-in debugging features for PHP?


I do not expect there would be. Debuggers are more likely to be provided
by the IDE. For example, in MS-Windows, Visual Studio is the IDE and can
include any of several compilers. It also includes the debugger, and
uses the same front end for all languages. Of course, Microsoft has it
much easier since they only support one hardware platform (x86) and one
OS. Unlike the rest of the world where tools are more likely to be
portable.

For an IDE with debug capabilities, try NetBeans. I am sure there are
others, but that is the only one I have actually looked at.

Bob McConnell


phpEdit, a super IDE, has an extensive suite of integrated debug tools.

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



Re: [PHP] Built-in Debugging

2009-10-16 Thread Ashley Sheridan
On Fri, 2009-10-16 at 09:04 -0400, Al wrote:

 
 Bob McConnell wrote:
  From: Raymond Irving
  
  Will be ever see built-in debugging features for PHP?
  
  I do not expect there would be. Debuggers are more likely to be provided
  by the IDE. For example, in MS-Windows, Visual Studio is the IDE and can
  include any of several compilers. It also includes the debugger, and
  uses the same front end for all languages. Of course, Microsoft has it
  much easier since they only support one hardware platform (x86) and one
  OS. Unlike the rest of the world where tools are more likely to be
  portable.
  
  For an IDE with debug capabilities, try NetBeans. I am sure there are
  others, but that is the only one I have actually looked at.
  
  Bob McConnell
 
 phpEdit, a super IDE, has an extensive suite of integrated debug tools.
 


Real coders don't use debugging tools, comments and output statements
are all you need ;)

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Built-in Debugging

2009-10-16 Thread Al



Ashley Sheridan wrote:

On Fri, 2009-10-16 at 09:04 -0400, Al wrote:


Bob McConnell wrote:

From: Raymond Irving


Will be ever see built-in debugging features for PHP?

I do not expect there would be. Debuggers are more likely to be provided
by the IDE. For example, in MS-Windows, Visual Studio is the IDE and can
include any of several compilers. It also includes the debugger, and
uses the same front end for all languages. Of course, Microsoft has it
much easier since they only support one hardware platform (x86) and one
OS. Unlike the rest of the world where tools are more likely to be
portable.

For an IDE with debug capabilities, try NetBeans. I am sure there are
others, but that is the only one I have actually looked at.

Bob McConnell

phpEdit, a super IDE, has an extensive suite of integrated debug tools.




Real coders don't use debugging tools, comments and output statements
are all you need ;)

Thanks,
Ash
http://www.ashleysheridan.co.uk





I agree with you and that's why I said in my first message Personally, I've 
found that turning on error_reporting(E_ALL), debug_backtrace() and 
debug_print_backtrace() quite adequate for most situations.


In fact, I don't recall even using debug_backtrace() and debug_print_backtrace() 
in the last couple of years.


I script very robust code and it catches damn near all errors itself.

Al...

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



RE: [PHP] Built-in Debugging

2009-10-16 Thread Bob McConnell
From: Ashley Sheridan

 On Fri, 2009-10-16 at 09:04 -0400, Al wrote:
 Bob McConnell wrote:
  From: Raymond Irving
  
  Will be ever see built-in debugging features for PHP?
  
  I do not expect there would be. Debuggers are more likely to be
provided
  by the IDE. For example, in MS-Windows, Visual Studio is the IDE
and can
  include any of several compilers. It also includes the debugger,
and
  uses the same front end for all languages. Of course, Microsoft has
it
  much easier since they only support one hardware platform (x86) and
one
  OS. Unlike the rest of the world where tools are more likely to be
  portable.
  
  For an IDE with debug capabilities, try NetBeans. I am sure there
are
  others, but that is the only one I have actually looked at.
  
  Bob McConnell
 
 phpEdit, a super IDE, has an extensive suite of integrated debug
tools.
 
 
 Real coders don't use debugging tools, comments and output statements
 are all you need ;)
 
 Thanks,
 Ash

No, we simply use debug or ddt to insert machine code directly into
memory. But that tends to get tedious very quickly, so experimenting
with other options is one way to relieve the boredom.

Bob McConnell

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



Re: [PHP] Built-in Debugging

2009-10-16 Thread Robert Cummings

Al wrote:


Ashley Sheridan wrote:

On Fri, 2009-10-16 at 09:04 -0400, Al wrote:


Bob McConnell wrote:

From: Raymond Irving


Will be ever see built-in debugging features for PHP?

I do not expect there would be. Debuggers are more likely to be provided
by the IDE. For example, in MS-Windows, Visual Studio is the IDE and can
include any of several compilers. It also includes the debugger, and
uses the same front end for all languages. Of course, Microsoft has it
much easier since they only support one hardware platform (x86) and one
OS. Unlike the rest of the world where tools are more likely to be
portable.

For an IDE with debug capabilities, try NetBeans. I am sure there are
others, but that is the only one I have actually looked at.

Bob McConnell

phpEdit, a super IDE, has an extensive suite of integrated debug tools.



Real coders don't use debugging tools, comments and output statements
are all you need ;)

Thanks,
Ash
http://www.ashleysheridan.co.uk





I agree with you and that's why I said in my first message Personally, I've 
found that turning on error_reporting(E_ALL), debug_backtrace() and 
debug_print_backtrace() quite adequate for most situations.


In fact, I don't recall even using debug_backtrace() and debug_print_backtrace() 
in the last couple of years.


I script very robust code and it catches damn near all errors itself.


I find having a custom error handler that uses debug_backtrace() to 
produce a limited stack trace very useful for finding errors sometimes.


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



RE: [PHP] Built-in Debugging

2009-10-16 Thread David Murphy
I have to disagree, while   Exception handling and  the like have their
place. Sometimes when you develop you want to stop execution and  look at
your memory stack to make sure you didn't over look something.

Especially if you are relying on someone  else code  and it's not a project
owned 100% by you.


Just my thoughts, they have their place I use  PhpEd, because it facilitates
this nicely and it VERY customizable from a short hand perspective.

-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
Sent: Friday, October 16, 2009 8:05 AM
To: Al
Cc: php-general@lists.php.net
Subject: Re: [PHP] Built-in Debugging

On Fri, 2009-10-16 at 09:04 -0400, Al wrote:

 
 Bob McConnell wrote:
  From: Raymond Irving
  
  Will be ever see built-in debugging features for PHP?
  
  I do not expect there would be. Debuggers are more likely to be 
  provided by the IDE. For example, in MS-Windows, Visual Studio is 
  the IDE and can include any of several compilers. It also includes 
  the debugger, and uses the same front end for all languages. Of 
  course, Microsoft has it much easier since they only support one 
  hardware platform (x86) and one OS. Unlike the rest of the world 
  where tools are more likely to be portable.
  
  For an IDE with debug capabilities, try NetBeans. I am sure there 
  are others, but that is the only one I have actually looked at.
  
  Bob McConnell
 
 phpEdit, a super IDE, has an extensive suite of integrated debug tools.
 


Real coders don't use debugging tools, comments and output statements are
all you need ;)

Thanks,
Ash
http://www.ashleysheridan.co.uk



No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.421 / Virus Database: 270.14.20/2440 - Release Date: 10/16/09 
06:32:00
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] How to Delete the parent node, and child nodes/leafs for a db/tbl in php

2009-10-16 Thread bruce
Hi.

I've got a situation where I have a couple of tables. The relationship
between the tables is one of parent/child. I'm trying to figure out the best
approach to being able to delete the associated children in the child tbls,
of a given parentID in the parentTBL...

I've checked into various sites/articles on the 'net.. but i'm not sure how
best to accomplish this...

I'm using php as the interface language to the test tbls..

Any pointers/articles/test code (code/schema) would be helpful...

Thanks



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



Re: [PHP] How to Delete the parent node, and child nodes/leafs for a db/tbl in php

2009-10-16 Thread Ashley Sheridan
On Fri, 2009-10-16 at 08:34 -0700, bruce wrote:

 Hi.
 
 I've got a situation where I have a couple of tables. The relationship
 between the tables is one of parent/child. I'm trying to figure out the best
 approach to being able to delete the associated children in the child tbls,
 of a given parentID in the parentTBL...
 
 I've checked into various sites/articles on the 'net.. but i'm not sure how
 best to accomplish this...
 
 I'm using php as the interface language to the test tbls..
 
 Any pointers/articles/test code (code/schema) would be helpful...
 
 Thanks
 
 
 


Well if the tables truly have a relationship, then no PHP is necessary.

I assume that to connect the 'parent' row with the 'children' rows of
the secondary table you've used an identifying field. For example:

users table:
user_id
forename
surname

emails table:
email_id
user_id
email_address

So in the above example, a user on the users table could have several
entries in the emails table for each email address they have.
emails.user_id will match up users.user_id so you can run a query like

DELETE FROM emails WHERE user_id=id

Is this any help?


Thanks,
Ash
http://www.ashleysheridan.co.uk




RE: [PHP] How to Delete the parent node, and child nodes/leafs for a db/tbl in php

2009-10-16 Thread bruce
hi ash...

thanks for getting back to me.

my situation isn't that complex, but i'm looking for an efficient method.

i've got a start tbl
 universityTBL

the universityTBL can have either
 schoolTBL, or
 deptTBL
as the next child tbl

 the schoolTBL will have
 deptTBL
 as the child tbl

 the deptTBL wil have
 classTBL
 as the childTBL...

to get around some of the headaches of this approach, i maintain
 a mapTBL where i have the parent_uuid,child_uuid as entries
mapTBL
-parent_uuid
-child_uuid

so my issue is that if i have a given parent_uuid, that i want to
 delete, as well as the associated leaf/nodes of the parent..
 how can this be accomplished?

you can't just start to delete the parent_uuid, as you completely miss
 the underlying/associated nodes/leafs for the parent_uuid...

thoughts/comments/etc...


-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
Sent: Friday, October 16, 2009 8:38 AM
To: bruce
Cc: php-general@lists.php.net
Subject: Re: [PHP] How to Delete the parent node, and child nodes/leafs
for a db/tbl in php


On Fri, 2009-10-16 at 08:34 -0700, bruce wrote:

 Hi.

 I've got a situation where I have a couple of tables. The relationship
 between the tables is one of parent/child. I'm trying to figure out the
best
 approach to being able to delete the associated children in the child
tbls,
 of a given parentID in the parentTBL...

 I've checked into various sites/articles on the 'net.. but i'm not sure
how
 best to accomplish this...

 I'm using php as the interface language to the test tbls..

 Any pointers/articles/test code (code/schema) would be helpful...

 Thanks





Well if the tables truly have a relationship, then no PHP is necessary.

I assume that to connect the 'parent' row with the 'children' rows of
the secondary table you've used an identifying field. For example:

users table:
user_id
forename
surname

emails table:
email_id
user_id
email_address

So in the above example, a user on the users table could have several
entries in the emails table for each email address they have.
emails.user_id will match up users.user_id so you can run a query like

DELETE FROM emails WHERE user_id=id

Is this any help?


Thanks,
Ash
http://www.ashleysheridan.co.uk




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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Ashley Sheridan
On Fri, 2009-10-16 at 17:46 +0200, Dotan Cohen wrote:

 How would you read this out loud if you were to read it to someone
 over  the phone?
 
 ($item-getServiceId() ? $item-getServiceId() : $item-getId(;
 
 Thanks!
 
 -- 
 Dotan Cohen
 
 http://what-is-what.com
 http://gibberish.co.il
 


Wow! Here goes:

Open-bracket, dollar item hypen greater-than, get service id, no all one
word but with a capital S and I. Open and close brackets, question mark,
dollar item again, then a hyphen and greater-than, that get service id
and brackets bit again, exactly the same as last time; yes, capital S
and I again. Colon, no the colon is the one with two dots, not dot and
comma. Dollar item again, then hypen, greater-than, get id, with a
capital I. Nope, no service bit this time. Now, open bracket and two
closing brackets (I assumed the final two on your example were typos?!).
now a semi-colon, yes the one with the comma.

That's pretty much how I could foresee me telling someone this on the
phone, but to be honest, I'd really prefer an email ;)

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] How to Delete the parent node, and child nodes/leafs for a db/tbl in php

2009-10-16 Thread David Otton
2009/10/16 bruce bedoug...@earthlink.net:

 I've got a situation where I have a couple of tables. The relationship
 between the tables is one of parent/child. I'm trying to figure out the best
 approach to being able to delete the associated children in the child tbls,
 of a given parentID in the parentTBL...

 I've checked into various sites/articles on the 'net.. but i'm not sure how
 best to accomplish this...

 I'm using php as the interface language to the test tbls..

 Any pointers/articles/test code (code/schema) would be helpful...

This is a DB question not a PHP question, plus you haven't told us
what database and table type you're using.

However, you can either delete the relationship yourself (using PHP
code), write a trigger to do it semi-manually, or set your database up
properly with a foreign key constraint.

Assuming you're using MySQL and your table type supports foreign keys,
see http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html

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



Re: [PHP] How to Delete the parent node, and child nodes/leafs for a db/tbl in php

2009-10-16 Thread Jim Lucas
Ashley Sheridan wrote:
 On Fri, 2009-10-16 at 08:34 -0700, bruce wrote:
 
 Hi.

 I've got a situation where I have a couple of tables. The relationship
 between the tables is one of parent/child. I'm trying to figure out the best
 approach to being able to delete the associated children in the child tbls,
 of a given parentID in the parentTBL...

 I've checked into various sites/articles on the 'net.. but i'm not sure how
 best to accomplish this...

 I'm using php as the interface language to the test tbls..

 Any pointers/articles/test code (code/schema) would be helpful...

 Thanks



 
 
 Well if the tables truly have a relationship, then no PHP is necessary.
 
 I assume that to connect the 'parent' row with the 'children' rows of
 the secondary table you've used an identifying field. For example:
 
 users table:
 user_id
 forename
 surname
 
 emails table:
 email_id
 user_id
 email_address
 
 So in the above example, a user on the users table could have several
 entries in the emails table for each email address they have.
 emails.user_id will match up users.user_id so you can run a query like
 
 DELETE FROM emails WHERE user_id=id
 
 Is this any help?
 
 
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk
 
 
 


Or, if you want to be a little trickier...


users table:
user_id
forename
surname

DELETE FROM
emails_table
WHERE
user_id = (
SELECT
user_id
FROM
users_table
WHERE
forename = '$forename'
AND surname = '$surname'
)


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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 Wow! Here goes:

 Open-bracket, dollar item hypen greater-than, get service id, no all one word 
 but with a capital S and I. Open and close brackets, question mark, dollar 
 item again, then a hyphen and greater-than, that get service id and brackets 
 bit again, exactly the same as last time; yes, capital S and I again. Colon, 
 no the colon is the one with two dots, not dot and comma. Dollar item again, 
 then hypen, greater-than, get id, with a capital I. Nope, no service bit this 
 time. Now, open bracket and two closing brackets (I assumed the final two on 
 your example were typos?!). now a semi-colon, yes the one with the comma.

 That's pretty much how I could foresee me telling someone this on the phone, 
 but to be honest, I'd really prefer an email ;)


So it really involves mentioning each character. I was hoping that
there would be a shared language for constructs such as - and the
like.

Thanks.

--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 open parenthesis
 $item getServiceId
 question symbol
 $item getServiceId
 colon
 $item getId
 close parenthesis



How would you mention the - constructs? Certainly they are not assumed?


-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Ashley Sheridan
On Fri, 2009-10-16 at 18:01 +0200, Dotan Cohen wrote:

  Wow! Here goes:
 
  Open-bracket, dollar item hypen greater-than, get service id, no all one 
  word but with a capital S and I. Open and close brackets, question mark, 
  dollar item again, then a hyphen and greater-than, that get service id and 
  brackets bit again, exactly the same as last time; yes, capital S and I 
  again. Colon, no the colon is the one with two dots, not dot and comma. 
  Dollar item again, then hypen, greater-than, get id, with a capital I. 
  Nope, no service bit this time. Now, open bracket and two closing brackets 
  (I assumed the final two on your example were typos?!). now a semi-colon, 
  yes the one with the comma.
 
  That's pretty much how I could foresee me telling someone this on the 
  phone, but to be honest, I'd really prefer an email ;)
 
 
 So it really involves mentioning each character. I was hoping that
 there would be a shared language for constructs such as - and the
 like.
 
 Thanks.
 
 --
 Dotan Cohen
 
 http://what-is-what.com
 http://gibberish.co.il


Not that I know of, and trying to explain any sort of code over the
phone is just going to lead to a disaster down the line!

Thanks,
Ash
http://www.ashleysheridan.co.uk




[PHP] Wrong Date

2009-10-16 Thread Darvin Denmian
Hello,

My currently timezone is set to : America/Sao_Paulo
My currently date/time is ok: Fri Oct 16 13:04:45 BRT 2009
But when I execute echo date(d/m/Y H:i:s); the output presented
have +1 hour

Bellow [date] of php.ini:

date

date/time support = enabled
Olson Timezone Database Version = 2008.2
Timezone Database = internal
Default timezone = America/Sao_Paulo

Directive = Local Value = Master Value
date.default_latitude = 31.7667 = 31.7667
date.default_longitude = 35.2333 = 35.2333
date.sunrise_zenith = 90.58 = 90.58
date.sunset_zenith = 90.58 = 90.58
date.timezone = no value = no value


Thanks

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Martin Scotta
First ask him/her for an email address, and then while you are over the
phone send the text by email.
This way the other can *instantaneously* read and both of you can talk about
the code.

On Fri, Oct 16, 2009 at 1:01 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:

 On Fri, 2009-10-16 at 18:01 +0200, Dotan Cohen wrote:

   Wow! Here goes:
  
   Open-bracket, dollar item hypen greater-than, get service id, no all
 one word but with a capital S and I. Open and close brackets, question mark,
 dollar item again, then a hyphen and greater-than, that get service id and
 brackets bit again, exactly the same as last time; yes, capital S and I
 again. Colon, no the colon is the one with two dots, not dot and comma.
 Dollar item again, then hypen, greater-than, get id, with a capital I. Nope,
 no service bit this time. Now, open bracket and two closing brackets (I
 assumed the final two on your example were typos?!). now a semi-colon, yes
 the one with the comma.
  
   That's pretty much how I could foresee me telling someone this on the
 phone, but to be honest, I'd really prefer an email ;)
  
 
  So it really involves mentioning each character. I was hoping that
  there would be a shared language for constructs such as - and the
  like.
 
  Thanks.
 
  --
  Dotan Cohen
 
  http://what-is-what.com
  http://gibberish.co.il


 Not that I know of, and trying to explain any sort of code over the
 phone is just going to lead to a disaster down the line!

 Thanks,
 Ash
 http://www.ashleysheridan.co.uk





-- 
Martin Scotta


Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Bipin Upadhyay

On 10/16/2009 9:31 PM, Dotan Cohen wrote:

Wow! Here goes:

Open-bracket, dollar item hypen greater-than, get service id, no all one word 
but with a capital S and I. Open and close brackets, question mark, dollar item 
again, then a hyphen and greater-than, that get service id and brackets bit 
again, exactly the same as last time; yes, capital S and I again. Colon, no the 
colon is the one with two dots, not dot and comma. Dollar item again, then 
hypen, greater-than, get id, with a capital I. Nope, no service bit this time. 
Now, open bracket and two closing brackets (I assumed the final two on your 
example were typos?!). now a semi-colon, yes the one with the comma.

That's pretty much how I could foresee me telling someone this on the phone, 
but to be honest, I'd really prefer an email ;)

 

So it really involves mentioning each character. I was hoping that
there would be a shared language for constructs such as -  and the
like.

   

There are, what you'd call, technical jargon for them.
However, it'd pretty obviously depend on the extent of knowledge of the 
person on other side of phone line. If she understands PHP objects, 
difference between OOP in PHP4  PHP5, and ternary operator, things 
would be fairly simple.


In any case, Ashley's nailed the foolproof technique for sure :)

Thanks.

--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

   


--Bipin Upadhyay.
http://projectbee.org/

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Jim Lucas
Dotan Cohen wrote:
 How would you read this out loud if you were to read it to someone
 over  the phone?
 
 ($item-getServiceId() ? $item-getServiceId() : $item-getId(;
 
 Thanks!
 

FATAL ERROR: Non matching parenthesis.


Ok, but really, I would say something along these lines:


Open Conditional statement

Test Condition
Using object variable item call object member method get service id

if condition results are true issue following command
Using object variable item call object member method get service id

if condition results are false issue following command
Using object variable item call object member method get id


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



RE: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Bob McConnell
From: Ashley Sheridan
 On Fri, 2009-10-16 at 18:01 +0200, Dotan Cohen wrote:
  Wow! Here goes:
 
  Open-bracket, dollar item hypen greater-than, get service id, no
all one word but with a capital S and I. Open and close brackets,
question mark, dollar item again, then a hyphen and greater-than, that
get service id and brackets bit again, exactly the same as last time;
yes, capital S and I again. Colon, no the colon is the one with two
dots, not dot and comma. Dollar item again, then hypen, greater-than,
get id, with a capital I. Nope, no service bit this time. Now, open
bracket and two closing brackets (I assumed the final two on your
example were typos?!). now a semi-colon, yes the one with the comma.
 
  That's pretty much how I could foresee me telling someone this on
the phone, but to be honest, I'd really prefer an email ;)
 
 
 So it really involves mentioning each character. I was hoping that
 there would be a shared language for constructs such as - and the
 like.


 Not that I know of, and trying to explain any sort of code over the
 phone is just going to lead to a disaster down the line!

The only time I would even consider doing that would be when I am using
a TTD connection to communicate with a hearing impaired individual.

Bob McConnell

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



[PHP] Wrong Date

2009-10-16 Thread Darvin Denmian
Hello,

My currently timezone is set to : America/Sao_Paulo
My currently date/time is ok: Fri Oct 16 13:04:45 BRT 2009
But when I execute echo date(d/m/Y H:i:s); the output presented
have +1 hour

Bellow [date] of php.ini:

date

date/time support = enabled
Olson Timezone Database Version = 2008.2
Timezone Database = internal
Default timezone = America/Sao_Paulo

Directive = Local Value = Master Value
date.default_latitude = 31.7667 = 31.7667
date.default_longitude = 35.2333 = 35.2333
date.sunrise_zenith = 90.58 = 90.58
date.sunset_zenith = 90.58 = 90.58
date.timezone = no value = no value


Thanks

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread tedd

At 4:51 PM +0100 10/16/09, Ashley Sheridan wrote:

On Fri, 2009-10-16 at 17:46 +0200, Dotan Cohen wrote:


 How would you read this out loud if you were to read it to someone
 over  the phone?

 ($item-getServiceId() ? $item-getServiceId() : $item-getId(;

 Thanks!

 --
 Dotan Cohen

 http://what-is-what.com
 http://gibberish.co.il




Wow! Here goes:

Open-bracket,


No, that's not an open bracket -- that's an open parenthesis or 
paren for short.


An open bracket is [

An open curly brace is {

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Robert Cummings

Dotan Cohen wrote:

How would you read this out loud if you were to read it to someone
over  the phone?

($item-getServiceId() ? $item-getServiceId() : $item-getId(;


It depends... is the person familiar with PHP or not? If they are not 
then the process is more cumbersome since I can't say things like 
variable item calling camel-case method getServiceId without parameters.


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread tedd

So it really involves mentioning each character. I was hoping that
there would be a shared language for constructs such as - and the
like.


I like pointy-thingie, but it's called an operator.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Ashley Sheridan
On Fri, 2009-10-16 at 12:47 -0400, tedd wrote:

 At 4:51 PM +0100 10/16/09, Ashley Sheridan wrote:
 On Fri, 2009-10-16 at 17:46 +0200, Dotan Cohen wrote:
 
   How would you read this out loud if you were to read it to someone
   over  the phone?
 
   ($item-getServiceId() ? $item-getServiceId() : $item-getId(;
 
   Thanks!
 
   --
   Dotan Cohen
 
   http://what-is-what.com
   http://gibberish.co.il
 
 
 
 Wow! Here goes:
 
 Open-bracket,
 
 No, that's not an open bracket -- that's an open parenthesis or 
 paren for short.
 
 An open bracket is [
 
 An open curly brace is {
 
 Cheers,
 
 tedd
 -- 
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com
 


You say potato, I say chips! (and this is the good ol' English chips,
the nice greasy sort you traditionally eat down the beach while you're
walking along pebbled British beaches as it's bucketing down with rain;
Seasoned with a handful of salt and swimming in vinegar!)

Thanks,
Ash
http://www.ashleysheridan.co.uk




RE: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Bob McConnell
From: tedd

 At 4:51 PM +0100 10/16/09, Ashley Sheridan wrote:
On Fri, 2009-10-16 at 17:46 +0200, Dotan Cohen wrote:

  How would you read this out loud if you were to read it to someone
  over  the phone?

  ($item-getServiceId() ? $item-getServiceId() : $item-getId(;



Wow! Here goes:

Open-bracket,
 
 No, that's not an open bracket -- that's an open parenthesis or 
 paren for short.
 
 An open bracket is [
 
 An open curly brace is {
 

That depends on which edition of English you use. Take a look at the
definition of bracket in Wikipedia. What you call a parenthesis is
called a bracket in England and parts of Canada, as well as elsewhere.
They specify square bracket for the second one. I stumbled on this one
in another mailing list a few years ago.

Bob McConnell

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Robert Cummings

Ashley Sheridan wrote:

On Fri, 2009-10-16 at 12:47 -0400, tedd wrote:


At 4:51 PM +0100 10/16/09, Ashley Sheridan wrote:

On Fri, 2009-10-16 at 17:46 +0200, Dotan Cohen wrote:


 How would you read this out loud if you were to read it to someone
 over  the phone?

 ($item-getServiceId() ? $item-getServiceId() : $item-getId(;

 Thanks!

 --
 Dotan Cohen

 http://what-is-what.com
 http://gibberish.co.il



Wow! Here goes:

Open-bracket,
No, that's not an open bracket -- that's an open parenthesis or 
paren for short.


An open bracket is [

An open curly brace is {

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com




You say potato, I say chips! (and this is the good ol' English chips,
the nice greasy sort you traditionally eat down the beach while you're
walking along pebbled British beaches as it's bucketing down with rain;
Seasoned with a handful of salt and swimming in vinegar!)


Tasty malt vinegar... not that clear crappy type ubiquitous here in 
North America.


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread LinuxManMikeC
On Fri, Oct 16, 2009 at 10:07 AM, Bob McConnell r...@cbord.com wrote:
 From: Ashley Sheridan
 On Fri, 2009-10-16 at 18:01 +0200, Dotan Cohen wrote:
  Wow! Here goes:
 
  Open-bracket, dollar item hypen greater-than, get service id, no
 all one word but with a capital S and I. Open and close brackets,
 question mark, dollar item again, then a hyphen and greater-than, that
 get service id and brackets bit again, exactly the same as last time;
 yes, capital S and I again. Colon, no the colon is the one with two
 dots, not dot and comma. Dollar item again, then hypen, greater-than,
 get id, with a capital I. Nope, no service bit this time. Now, open
 bracket and two closing brackets (I assumed the final two on your
 example were typos?!). now a semi-colon, yes the one with the comma.
 
  That's pretty much how I could foresee me telling someone this on
 the phone, but to be honest, I'd really prefer an email ;)
 

 So it really involves mentioning each character. I was hoping that
 there would be a shared language for constructs such as - and the
 like.


 Not that I know of, and trying to explain any sort of code over the
 phone is just going to lead to a disaster down the line!

 The only time I would even consider doing that would be when I am using
 a TTD connection to communicate with a hearing impaired individual.

 Bob McConnell


Basically, use a modem.

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Robert Cummings

Bob McConnell wrote:

From: tedd


At 4:51 PM +0100 10/16/09, Ashley Sheridan wrote:

On Fri, 2009-10-16 at 17:46 +0200, Dotan Cohen wrote:


 How would you read this out loud if you were to read it to someone
 over  the phone?

 ($item-getServiceId() ? $item-getServiceId() : $item-getId(;



Wow! Here goes:

Open-bracket,
No, that's not an open bracket -- that's an open parenthesis or 
paren for short.


An open bracket is [

An open curly brace is {



That depends on which edition of English you use. Take a look at the
definition of bracket in Wikipedia. What you call a parenthesis is
called a bracket in England and parts of Canada, as well as elsewhere.
They specify square bracket for the second one. I stumbled on this one
in another mailing list a few years ago.


Bracket... two syllables and ambiguous.

Round Brace... two syllables and not ambiguous.

For terse clarity use the following:

- round brace
- square brace
- curly brace
- angle brace

:)

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] Wrong Date

2009-10-16 Thread Thodoris



Hello,

My currently timezone is set to : America/Sao_Paulo
My currently date/time is ok: Fri Oct 16 13:04:45 BRT 2009
But when I execute echo date(d/m/Y H:i:s); the output presented
have +1 hour

Bellow [date] of php.ini:

date

date/time support = enabled
Olson Timezone Database Version = 2008.2
Timezone Database = internal
Default timezone = America/Sao_Paulo

Directive = Local Value = Master Value
date.default_latitude = 31.7667 = 31.7667
date.default_longitude = 35.2333 = 35.2333
date.sunrise_zenith = 90.58 = 90.58
date.sunset_zenith = 90.58 = 90.58
date.timezone = no value = no value


Thanks

  


Assuming you have a unix-like OS and the timezone you mention is set to 
the system clock I will have to guess that PHP uses different zone from 
the system.


Try setting the date.timezone setting in your php.ini and see what 
happens (don't forget to restart the web server to make changes take 
effect) or use the ini_set().


--
Thodoris


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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Joseph Masoud

Robert Cummings wrote:

Bob McConnell wrote:

From: tedd


At 4:51 PM +0100 10/16/09, Ashley Sheridan wrote:

On Fri, 2009-10-16 at 17:46 +0200, Dotan Cohen wrote:


 How would you read this out loud if you were to read it to someone
 over  the phone?

 ($item-getServiceId() ? $item-getServiceId() : $item-getId(;



Wow! Here goes:

Open-bracket,
No, that's not an open bracket -- that's an open parenthesis or 
paren for short.


An open bracket is [

An open curly brace is {



That depends on which edition of English you use. Take a look at the
definition of bracket in Wikipedia. What you call a parenthesis is
called a bracket in England and parts of Canada, as well as elsewhere.
They specify square bracket for the second one. I stumbled on this one
in another mailing list a few years ago.


Bracket... two syllables and ambiguous.

Round Brace... two syllables and not ambiguous.

For terse clarity use the following:

- round brace
- square brace
- curly brace
- angle brace

:)

Cheers,
Rob.
Have you thought about using instant messaging?  How about sending the 
code to him via text message?  Putting it on a pastie or on code pad? 
IRC, sFTP, SSH, you see, in the 21st century, there exists a plethora of 
solutions to circumvent this particular issue.


I would be interested in finding out how the OP ended up having 
absolutely no option but to pass code to another Homo Sapien verbally?  
Unless you managed to cripple your system and disconnect your company 
from the internet, surely, it would have been faster (and easier) using 
the methods above rather than trying to spell it out over the phone.


In any case, I would say:

Call the getServiceId method of the $item object and make that the 
condition of a ternary opertor, if true, call the method again, 
otherwise call the getId method of the $item object


I'm guessing the reason you were on the phone to him/her was because 
your parentheses don't match ... but that's a different story I guess.


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



Re: [PHP] Wrong Date

2009-10-16 Thread Darvin Denmian
Thanks for your reply

- I'm running Red Hat Linux (5.3)
- The system timezone is set to America/Sao_Paulo

I'm running a stand-alone php script (crontab) , and I don't know how PHP
output this wrong hour.

The output of command php -i  shows:

Default timezone = America/Sao_Paulo

I don't know what to do  :(

Thanks !




On Fri, Oct 16, 2009 at 2:14 PM, Thodoris t...@kinetix.gr wrote:

 Hello,

 My currently timezone is set to : America/Sao_Paulo
 My currently date/time is ok: Fri Oct 16 13:04:45 BRT 2009
 But when I execute echo date(d/m/Y H:i:s); the output presented
 have +1 hour

 Bellow [date] of php.ini:

 date

 date/time support = enabled
 Olson Timezone Database Version = 2008.2
 Timezone Database = internal
 Default timezone = America/Sao_Paulo

 Directive = Local Value = Master Value
 date.default_latitude = 31.7667 = 31.7667
 date.default_longitude = 35.2333 = 35.2333
 date.sunrise_zenith = 90.58 = 90.58
 date.sunset_zenith = 90.58 = 90.58
 date.timezone = no value = no value


 Thanks



 Assuming you have a unix-like OS and the timezone you mention is set to the
 system clock I will have to guess that PHP uses different zone from the
 system.

 Try setting the date.timezone setting in your php.ini and see what happens
 (don't forget to restart the web server to make changes take effect) or use
 the ini_set().

 --
 Thodoris



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



[PHP] Plotting a Line Graph It seems that the google charts work from a url - so 500 points would be way to long for any url - so I guess that option is out.

2009-10-16 Thread c...@hosting4days.com
I have a data file that stores about 500 numbers in a record - meant  
to plot a basic line graph (left to right). The numbers can be  
imported into a record with 500 fields or just stored in a text field  
- which ever is better.


The user might want to pick a few random records and plot them  
together - so the line graph may compare the few records together.


It seems that the google charts work from a url - so 500 points would  
be way to long for any url - so I guess that option is out.


Q: what is the best way to create / display line graphs in with PHP?

Thanks in advance for your help - dave




Thanks,
c...@hosting4days.com






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



Re: [PHP] Wrong Date

2009-10-16 Thread Joseph Masoud

Darvin Denmian wrote:

Thanks for your reply

- I'm running Red Hat Linux (5.3)
- The system timezone is set to America/Sao_Paulo

I'm running a stand-alone php script (crontab) , and I don't know how PHP
output this wrong hour.

The output of command php -i  shows:

Default timezone = America/Sao_Paulo

I don't know what to do  :(

Thanks !




On Fri, Oct 16, 2009 at 2:14 PM, Thodoris t...@kinetix.gr wrote:
  

Hello,

My currently timezone is set to : America/Sao_Paulo
My currently date/time is ok: Fri Oct 16 13:04:45 BRT 2009
But when I execute echo date(d/m/Y H:i:s); the output presented
have +1 hour

Bellow [date] of php.ini:

date

date/time support = enabled
Olson Timezone Database Version = 2008.2
Timezone Database = internal
Default timezone = America/Sao_Paulo

Directive = Local Value = Master Value
date.default_latitude = 31.7667 = 31.7667
date.default_longitude = 35.2333 = 35.2333
date.sunrise_zenith = 90.58 = 90.58
date.sunset_zenith = 90.58 = 90.58
date.timezone = no value = no value


Thanks


  

Assuming you have a unix-like OS and the timezone you mention is set to the
system clock I will have to guess that PHP uses different zone from the
system.

Try setting the date.timezone setting in your php.ini and see what happens
(don't forget to restart the web server to make changes take effect) or use
the ini_set().

--
Thodoris





  

1. It is possible that the php.ini files are different.
2. Run phpinfo() to check where the php.ini file your web server uses is 
located.

3. Check that the timezone settings are correct.

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



[PHP] Plotting a Line Graph

2009-10-16 Thread cool

(sorry about the long Subject line typo - resending)

I have a data file that stores about 500 numbers in a record - meant  
to plot a basic line graph (left to right). The numbers can be  
imported into a record with 500 fields or just stored in a text field  
- which ever is better.


The user might want to pick a few random records and plot them  
together - so the line graph may compare the few records together.


It seems that the google charts work from a url - so 500 points would  
be way to long for any url - so I guess that option is out.


Q: what is the best way to create / display line graphs in with PHP?

Thanks in advance for your help - dave




Thanks,
c...@hosting4days.com






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



Re: [PHP] Wrong Date

2009-10-16 Thread Darvin Denmian
Could this issue be caused by outdated version of timezonedb
(http://pecl.php.net/package/timezonedb) ?

Thanks.

On Fri, Oct 16, 2009 at 2:31 PM, Joseph Masoud yousif.mas...@gmail.com wrote:
 Darvin Denmian wrote:

 Thanks for your reply

 - I'm running Red Hat Linux (5.3)
 - The system timezone is set to America/Sao_Paulo

 I'm running a stand-alone php script (crontab) , and I don't know how PHP
 output this wrong hour.

 The output of command php -i  shows:

 Default timezone = America/Sao_Paulo

 I don't know what to do  :(

 Thanks !




 On Fri, Oct 16, 2009 at 2:14 PM, Thodoris t...@kinetix.gr wrote:


 Hello,

 My currently timezone is set to : America/Sao_Paulo
 My currently date/time is ok: Fri Oct 16 13:04:45 BRT 2009
 But when I execute echo date(d/m/Y H:i:s); the output presented
 have +1 hour

 Bellow [date] of php.ini:

 date

 date/time support = enabled
 Olson Timezone Database Version = 2008.2
 Timezone Database = internal
 Default timezone = America/Sao_Paulo

 Directive = Local Value = Master Value
 date.default_latitude = 31.7667 = 31.7667
 date.default_longitude = 35.2333 = 35.2333
 date.sunrise_zenith = 90.58 = 90.58
 date.sunset_zenith = 90.58 = 90.58
 date.timezone = no value = no value


 Thanks




 Assuming you have a unix-like OS and the timezone you mention is set to
 the
 system clock I will have to guess that PHP uses different zone from the
 system.

 Try setting the date.timezone setting in your php.ini and see what
 happens
 (don't forget to restart the web server to make changes take effect) or
 use
 the ini_set().

 --
 Thodoris






 1. It is possible that the php.ini files are different.
 2. Run phpinfo() to check where the php.ini file your web server uses is
 located.
 3. Check that the timezone settings are correct.


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



Re: [PHP] Plotting a Line Graph

2009-10-16 Thread Ashley Sheridan
On Fri, 2009-10-16 at 10:32 -0700, c...@hosting4days.com wrote:

 (sorry about the long Subject line typo - resending)
 
 I have a data file that stores about 500 numbers in a record - meant  
 to plot a basic line graph (left to right). The numbers can be  
 imported into a record with 500 fields or just stored in a text field  
 - which ever is better.
 
 The user might want to pick a few random records and plot them  
 together - so the line graph may compare the few records together.
 
 It seems that the google charts work from a url - so 500 points would  
 be way to long for any url - so I guess that option is out.
 
 Q: what is the best way to create / display line graphs in with PHP?
 
 Thanks in advance for your help - dave
 
 
 
 
 Thanks,
 c...@hosting4days.com
 
 
 
 
 
 


There are some pre-built classes for plotting graphs, Pear Graph looks
good:

http://www.phpbuilder.com/columns/ian_gilfillan20060503.php3

and the screenshots look impressive if you Google it.

You could also roll your own, which wouldn't be too difficult

Thanks,
Ash
http://www.ashleysheridan.co.uk




RE: [PHP] Wrong Date

2009-10-16 Thread Bob McConnell
From: Joseph Masoud
 Darvin Denmian wrote:

 - I'm running Red Hat Linux (5.3)
 - The system timezone is set to America/Sao_Paulo

 I'm running a stand-alone php script (crontab) , and I don't know how
PHP
 output this wrong hour.

 The output of command php -i  shows:

 Default timezone = America/Sao_Paulo

 I don't know what to do  :(

 On Fri, Oct 16, 2009 at 2:14 PM, Thodoris t...@kinetix.gr wrote:
  
 Hello,

 My currently timezone is set to : America/Sao_Paulo
 My currently date/time is ok: Fri Oct 16 13:04:45 BRT 2009
 But when I execute echo date(d/m/Y H:i:s); the output presented
 have +1 hour

 Bellow [date] of php.ini:

 date

 date/time support = enabled
 Olson Timezone Database Version = 2008.2
 Timezone Database = internal
 Default timezone = America/Sao_Paulo

 Directive = Local Value = Master Value
 date.default_latitude = 31.7667 = 31.7667
 date.default_longitude = 35.2333 = 35.2333
 date.sunrise_zenith = 90.58 = 90.58
 date.sunset_zenith = 90.58 = 90.58
 date.timezone = no value = no value
   
 Assuming you have a unix-like OS and the timezone you mention is set
to the
 system clock I will have to guess that PHP uses different zone from
the
 system.

 Try setting the date.timezone setting in your php.ini and see what
happens
 (don't forget to restart the web server to make changes take effect)
or use
 the ini_set().


   
 1. It is possible that the php.ini files are different.
 2. Run phpinfo() to check where the php.ini file your web server uses
is 
 located.
 3. Check that the timezone settings are correct.
 

The switch dates for some DST zones changed a couple of years ago. There
were patches available for many systems to update them. Here in the
Eastern USA we are now between the old and new end dates. Any chance you
missed a patch?

Bob McConnell

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



Re: [PHP] Wrong Date

2009-10-16 Thread Darvin Denmian
Bob,

unfortunately I don't know to answer your question.

Are you refering to upgrade the tzdata package?

The only thing I know is that time changed from 12:00 to 13:00 automaticaly 

Thanks for all replies!


On Fri, Oct 16, 2009 at 2:39 PM, Bob McConnell r...@cbord.com wrote:
 From: Joseph Masoud
 Darvin Denmian wrote:

 - I'm running Red Hat Linux (5.3)
 - The system timezone is set to America/Sao_Paulo

 I'm running a stand-alone php script (crontab) , and I don't know how
 PHP
 output this wrong hour.

 The output of command php -i  shows:

 Default timezone = America/Sao_Paulo

 I don't know what to do  :(

 On Fri, Oct 16, 2009 at 2:14 PM, Thodoris t...@kinetix.gr wrote:

 Hello,

 My currently timezone is set to : America/Sao_Paulo
 My currently date/time is ok: Fri Oct 16 13:04:45 BRT 2009
 But when I execute echo date(d/m/Y H:i:s); the output presented
 have +1 hour

 Bellow [date] of php.ini:

 date

 date/time support = enabled
 Olson Timezone Database Version = 2008.2
 Timezone Database = internal
 Default timezone = America/Sao_Paulo

 Directive = Local Value = Master Value
 date.default_latitude = 31.7667 = 31.7667
 date.default_longitude = 35.2333 = 35.2333
 date.sunrise_zenith = 90.58 = 90.58
 date.sunset_zenith = 90.58 = 90.58
 date.timezone = no value = no value

 Assuming you have a unix-like OS and the timezone you mention is set
 to the
 system clock I will have to guess that PHP uses different zone from
 the
 system.

 Try setting the date.timezone setting in your php.ini and see what
 happens
 (don't forget to restart the web server to make changes take effect)
 or use
 the ini_set().



 1. It is possible that the php.ini files are different.
 2. Run phpinfo() to check where the php.ini file your web server uses
 is
 located.
 3. Check that the timezone settings are correct.


 The switch dates for some DST zones changed a couple of years ago. There
 were patches available for many systems to update them. Here in the
 Eastern USA we are now between the old and new end dates. Any chance you
 missed a patch?

 Bob McConnell


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



Re: [PHP] Plotting a Line Graph

2009-10-16 Thread Jim Lucas
c...@hosting4days.com wrote:
 (sorry about the long Subject line typo - resending)
 
 I have a data file that stores about 500 numbers in a record - meant to
 plot a basic line graph (left to right). The numbers can be imported
 into a record with 500 fields or just stored in a text field - which
 ever is better.
 
 The user might want to pick a few random records and plot them together
 - so the line graph may compare the few records together.
 
 It seems that the google charts work from a url - so 500 points would be
 way to long for any url - so I guess that option is out.
 
 Q: what is the best way to create / display line graphs in with PHP?
 
 Thanks in advance for your help - dave
 
 
 
 
 Thanks,
 c...@hosting4days.com
 
 
 
 
 
 

I would recommend http://www.rgraph.net/

It was written and is currently maintained by a member of this list.

Jim Lucas

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



RE: [PHP] Wrong Date

2009-10-16 Thread Bob McConnell
When you enter date on the bash command line, what do you get back?

When you run a php file with 'echo date('T').\n;' does it show the same time 
zone and DST flag?

Which one is wrong?

Bob McConnell

-Original Message-
From: Darvin Denmian [mailto:darvin.denm...@gmail.com] 
Sent: Friday, October 16, 2009 1:47 PM
Cc: php-general@lists.php.net
Subject: Re: [PHP] Wrong Date

Bob,

unfortunately I don't know to answer your question.

Are you refering to upgrade the tzdata package?

The only thing I know is that time changed from 12:00 to 13:00 automaticaly 

Thanks for all replies!


On Fri, Oct 16, 2009 at 2:39 PM, Bob McConnell r...@cbord.com wrote:
 From: Joseph Masoud
 Darvin Denmian wrote:

 - I'm running Red Hat Linux (5.3)
 - The system timezone is set to America/Sao_Paulo

 I'm running a stand-alone php script (crontab) , and I don't know how
 PHP
 output this wrong hour.

 The output of command php -i  shows:

 Default timezone = America/Sao_Paulo

 I don't know what to do  :(

 On Fri, Oct 16, 2009 at 2:14 PM, Thodoris t...@kinetix.gr wrote:

 Hello,

 My currently timezone is set to : America/Sao_Paulo
 My currently date/time is ok: Fri Oct 16 13:04:45 BRT 2009
 But when I execute echo date(d/m/Y H:i:s); the output presented
 have +1 hour

 Bellow [date] of php.ini:

 date

 date/time support = enabled
 Olson Timezone Database Version = 2008.2
 Timezone Database = internal
 Default timezone = America/Sao_Paulo

 Directive = Local Value = Master Value
 date.default_latitude = 31.7667 = 31.7667
 date.default_longitude = 35.2333 = 35.2333
 date.sunrise_zenith = 90.58 = 90.58
 date.sunset_zenith = 90.58 = 90.58
 date.timezone = no value = no value

 Assuming you have a unix-like OS and the timezone you mention is set
 to the
 system clock I will have to guess that PHP uses different zone from
 the
 system.

 Try setting the date.timezone setting in your php.ini and see what
 happens
 (don't forget to restart the web server to make changes take effect)
 or use
 the ini_set().



 1. It is possible that the php.ini files are different.
 2. Run phpinfo() to check where the php.ini file your web server uses
 is
 located.
 3. Check that the timezone settings are correct.


 The switch dates for some DST zones changed a couple of years ago. There
 were patches available for many systems to update them. Here in the
 Eastern USA we are now between the old and new end dates. Any chance you
 missed a patch?

 Bob McConnell


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


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



Re: [PHP] Wrong Date

2009-10-16 Thread Darvin Denmian
Bob,

bash:
Fri Oct 16 15:14:54 BRT 2009

php output:

BRST

Thanks

On Fri, Oct 16, 2009 at 3:09 PM, Bob McConnell r...@cbord.com wrote:
 When you enter date on the bash command line, what do you get back?

 When you run a php file with 'echo date('T').\n;' does it show the same 
 time zone and DST flag?

 Which one is wrong?

 Bob McConnell

 -Original Message-
 From: Darvin Denmian [mailto:darvin.denm...@gmail.com]
 Sent: Friday, October 16, 2009 1:47 PM
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Wrong Date

 Bob,

 unfortunately I don't know to answer your question.

 Are you refering to upgrade the tzdata package?

 The only thing I know is that time changed from 12:00 to 13:00 automaticaly 
 

 Thanks for all replies!


 On Fri, Oct 16, 2009 at 2:39 PM, Bob McConnell r...@cbord.com wrote:
 From: Joseph Masoud
 Darvin Denmian wrote:

 - I'm running Red Hat Linux (5.3)
 - The system timezone is set to America/Sao_Paulo

 I'm running a stand-alone php script (crontab) , and I don't know how
 PHP
 output this wrong hour.

 The output of command php -i  shows:

 Default timezone = America/Sao_Paulo

 I don't know what to do  :(

 On Fri, Oct 16, 2009 at 2:14 PM, Thodoris t...@kinetix.gr wrote:

 Hello,

 My currently timezone is set to : America/Sao_Paulo
 My currently date/time is ok: Fri Oct 16 13:04:45 BRT 2009
 But when I execute echo date(d/m/Y H:i:s); the output presented
 have +1 hour

 Bellow [date] of php.ini:

 date

 date/time support = enabled
 Olson Timezone Database Version = 2008.2
 Timezone Database = internal
 Default timezone = America/Sao_Paulo

 Directive = Local Value = Master Value
 date.default_latitude = 31.7667 = 31.7667
 date.default_longitude = 35.2333 = 35.2333
 date.sunrise_zenith = 90.58 = 90.58
 date.sunset_zenith = 90.58 = 90.58
 date.timezone = no value = no value

 Assuming you have a unix-like OS and the timezone you mention is set
 to the
 system clock I will have to guess that PHP uses different zone from
 the
 system.

 Try setting the date.timezone setting in your php.ini and see what
 happens
 (don't forget to restart the web server to make changes take effect)
 or use
 the ini_set().



 1. It is possible that the php.ini files are different.
 2. Run phpinfo() to check where the php.ini file your web server uses
 is
 located.
 3. Check that the timezone settings are correct.


 The switch dates for some DST zones changed a couple of years ago. There
 were patches available for many systems to update them. Here in the
 Eastern USA we are now between the old and new end dates. Any chance you
 missed a patch?

 Bob McConnell


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



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



RE: [PHP] Wrong Date

2009-10-16 Thread Bob McConnell
So it looks like RedHat is on standard time, while PHP is still DST. Which one 
is correct? You need to update the time zone database on the other.

Bob McConnell

-Original Message-
From: Darvin Denmian [mailto:darvin.denm...@gmail.com] 
Sent: Friday, October 16, 2009 2:17 PM
Cc: php-general@lists.php.net
Subject: Re: [PHP] Wrong Date

Bob,

bash:
Fri Oct 16 15:14:54 BRT 2009

php output:

BRST

Thanks

On Fri, Oct 16, 2009 at 3:09 PM, Bob McConnell r...@cbord.com wrote:
 When you enter date on the bash command line, what do you get back?

 When you run a php file with 'echo date('T').\n;' does it show the same 
 time zone and DST flag?

 Which one is wrong?

 Bob McConnell

 -Original Message-
 From: Darvin Denmian [mailto:darvin.denm...@gmail.com]
 Sent: Friday, October 16, 2009 1:47 PM
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Wrong Date

 Bob,

 unfortunately I don't know to answer your question.

 Are you refering to upgrade the tzdata package?

 The only thing I know is that time changed from 12:00 to 13:00 automaticaly 
 

 Thanks for all replies!


 On Fri, Oct 16, 2009 at 2:39 PM, Bob McConnell r...@cbord.com wrote:
 From: Joseph Masoud
 Darvin Denmian wrote:

 - I'm running Red Hat Linux (5.3)
 - The system timezone is set to America/Sao_Paulo

 I'm running a stand-alone php script (crontab) , and I don't know how
 PHP
 output this wrong hour.

 The output of command php -i  shows:

 Default timezone = America/Sao_Paulo

 I don't know what to do  :(

 On Fri, Oct 16, 2009 at 2:14 PM, Thodoris t...@kinetix.gr wrote:

 Hello,

 My currently timezone is set to : America/Sao_Paulo
 My currently date/time is ok: Fri Oct 16 13:04:45 BRT 2009
 But when I execute echo date(d/m/Y H:i:s); the output presented
 have +1 hour

 Bellow [date] of php.ini:

 date

 date/time support = enabled
 Olson Timezone Database Version = 2008.2
 Timezone Database = internal
 Default timezone = America/Sao_Paulo

 Directive = Local Value = Master Value
 date.default_latitude = 31.7667 = 31.7667
 date.default_longitude = 35.2333 = 35.2333
 date.sunrise_zenith = 90.58 = 90.58
 date.sunset_zenith = 90.58 = 90.58
 date.timezone = no value = no value

 Assuming you have a unix-like OS and the timezone you mention is set
 to the
 system clock I will have to guess that PHP uses different zone from
 the
 system.

 Try setting the date.timezone setting in your php.ini and see what
 happens
 (don't forget to restart the web server to make changes take effect)
 or use
 the ini_set().



 1. It is possible that the php.ini files are different.
 2. Run phpinfo() to check where the php.ini file your web server uses
 is
 located.
 3. Check that the timezone settings are correct.


 The switch dates for some DST zones changed a couple of years ago. There
 were patches available for many systems to update them. Here in the
 Eastern USA we are now between the old and new end dates. Any chance you
 missed a patch?

 Bob McConnell


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



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


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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 First ask him/her for an email address, and then while you are over the
 phone send the text by email.
 This way the other can *instantaneously* read and both of you can talk about
 the code.


That is how it is usually done. But we have found ourselves twice in
the position where one had to talk over the phone when a computer or
other internet-enabled device was not accessible. Therefore, we would
prefer to formulate a shared language now for use in such situations.

Surely when coding, people say what they are typing in their heads.
I do, but not in English.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 There are, what you'd call, technical jargon for them.
 However, it'd pretty obviously depend on the extent of knowledge of the
 person on other side of phone line. If she understands PHP objects,
 difference between OOP in PHP4  PHP5, and ternary operator, things would be
 fairly simple.


Yes, the other end of the phone is an experienced PHP developer.


 In any case, Ashley's nailed the foolproof technique for sure :)

But I am the fool to prove it! No internet access!

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 Ok, but really, I would say something along these lines:


 Open Conditional statement

 Test Condition
        Using object variable item call object member method get service id

 if condition results are true issue following command
        Using object variable item call object member method get service id

 if condition results are false issue following command
        Using object variable item call object member method get id



Thanks, that is probably best. Leave the code to the coder, but
transmit the intention.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 It depends... is the person familiar with PHP or not? If they are not then
 the process is more cumbersome since I can't say things like variable item
 calling camel-case method getServiceId without parameters.


Yes, I should have mentioned that the other party is an experienced
PHP developer.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 Have you thought about using instant messaging?  How about sending the code
 to him via text message?  Putting it on a pastie or on code pad? IRC, sFTP,
 SSH, you see, in the 21st century, there exists a plethora of solutions to
 circumvent this particular issue.

 I would be interested in finding out how the OP ended up having absolutely
 no option but to pass code to another Homo Sapien verbally?  Unless you
 managed to cripple your system and disconnect your company from the
 internet, surely, it would have been faster (and easier) using the methods
 above rather than trying to spell it out over the phone.


It's called vacation away from the 'net but there is an emergency.
I'm certain that a fair portion of the list is familiar with that!


 In any case, I would say:

 Call the getServiceId method of the $item object and make that the
 condition of a ternary opertor, if true, call the method again, otherwise
 call the getId method of the $item object


Thanks!


 I'm guessing the reason you were on the phone to him/her was because your
 parentheses don't match ... but that's a different story I guess.


That actually sounds like a subplot of a good movie.


-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



RE: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Bob McConnell
From: Dotan Cohen

 I would be interested in finding out how the OP ended up having absolutely
 no option but to pass code to another Homo Sapien verbally?  Unless you
 managed to cripple your system and disconnect your company from the
 internet, surely, it would have been faster (and easier) using the methods
 above rather than trying to spell it out over the phone.

 
 It's called vacation away from the 'net but there is an emergency.
 I'm certain that a fair portion of the list is familiar with that!

If they can reach you by phone you are not on vacation. You are still attached 
to their leash.

Bob McConnell

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



Re: [PHP] Plotting a Line Graph

2009-10-16 Thread c...@hosting4days.com

Jim Lucas wrote:



I would recommend http://www.rgraph.net/

It was written and is currently maintained by a member of this list.

Jim Lucas



Hi Jim,

rgraph looks cool... most demos I see show just a few points - do you 
think this could display 500 points? (I'm looking through their docs now...)


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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 If they can reach you by phone you are not on vacation. You are still 
 attached to their leash.


And they still throw me bones :) It's worth it!

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread O. Lavell
Dotan Cohen wrote:

 It's called vacation away from the 'net but there is an emergency. I'm
 certain that a fair portion of the list is familiar with that!

I haven't the slightest idea what you are talking about. Vacation? Away 
from the net? We must be from different planets...



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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 I haven't the slightest idea what you are talking about. Vacation? Away
 from the net? We must be from different planets...


Very likely, as us Saturnians inhabit the moons, not the planet. Only
rocky planet-dwellers talk like that!

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Robert Cummings

O. Lavell wrote:

Dotan Cohen wrote:


It's called vacation away from the 'net but there is an emergency. I'm
certain that a fair portion of the list is familiar with that!


I haven't the slightest idea what you are talking about. Vacation? Away 
from the net? We must be from different planets...


How to do you vacation from something implanted into your brain?

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 It's called vacation away from the 'net but there is an emergency. I'm
 certain that a fair portion of the list is familiar with that!

 I haven't the slightest idea what you are talking about. Vacation? Away
 from the net? We must be from different planets...

 How to do you vacation from something implanted into your brain?


http://www.imdb.com/title/tt0100802/

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: [PHP] security/deployment issue

2009-10-16 Thread Augusto Flavio
Humm.. thanks for the replies. But i have another problem about rsync again.



When i deploy a project using the rsync the permissions of all home
directory is changed. i tried to use the parameter -p -o -g (preserve
permissions, owner and group):


I dont know but the rsync doesnt preserve the permissions and group/owner.


Then always after a deploy i need to execute the cmd chmod 755 user:group
/home/project . Have someone this problem?


Thanks


Augusto Morais


Re: [PHP] security/deployment issue

2009-10-16 Thread Adam Randall
Rsync preserves the UID and GID, not the visible username or visible
group name. This means that if the UIDs and GIDs do not match your
expected users and groups on the destination server they will match
whatever is setup there according to the /etc/passwd or /etc/group
files. If there's no match for the UID and GID then it will just
display the UID or GID number.

Adam.

On Fri, Oct 16, 2009 at 1:13 PM, Augusto Flavio afla...@gmail.com wrote:
 Humm.. thanks for the replies. But i have another problem about rsync again.



 When i deploy a project using the rsync the permissions of all home
 directory is changed. i tried to use the parameter -p -o -g (preserve
 permissions, owner and group):


 I dont know but the rsync doesnt preserve the permissions and group/owner.


 Then always after a deploy i need to execute the cmd chmod 755 user:group
 /home/project . Have someone this problem?


 Thanks


 Augusto Morais




-- 
Adam Randall
http://www.xaren.net
AIM: blitz574

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Tommy Pham
- Original Message 
 From: Dotan Cohen dotanco...@gmail.com
 To: Bipin Upadhyay muxical.g...@gmail.com
 Cc: a...@ashleysheridan.co.uk; php-general. php-general@lists.php.net
 Sent: Fri, October 16, 2009 11:29:09 AM
 Subject: Re: [PHP] How to pronounce PHP code over the phone?
 
  There are, what you'd call, technical jargon for them.
  However, it'd pretty obviously depend on the extent of knowledge of the
  person on other side of phone line. If she understands PHP objects,
  difference between OOP in PHP4  PHP5, and ternary operator, things would be
  fairly simple.
 
 
 Yes, the other end of the phone is an experienced PHP developer.
 

IMO, if you have to explain this code over the phone or any medium:

($item-getServiceId() ? $item-getServiceId() : $item-getId(;

The other person you're talking to is definitely not experienced.  ;)

Regards,
Tommy

 
  In any case, Ashley's nailed the foolproof technique for sure :)
 
 But I am the fool to prove it! No internet access!
 
 -- 
 Dotan Cohen
 
 http://what-is-what.com
 http://gibberish.co.il
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


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



Re: [PHP] Plotting a Line Graph

2009-10-16 Thread James Ausmus
jpgraph:

http://www.aditus.nu/jpgraph/

On Fri, Oct 16, 2009 at 10:32 AM,  c...@hosting4days.com wrote:
 (sorry about the long Subject line typo - resending)

 I have a data file that stores about 500 numbers in a record - meant to plot
 a basic line graph (left to right). The numbers can be imported into a
 record with 500 fields or just stored in a text field - which ever is
 better.

 The user might want to pick a few random records and plot them together - so
 the line graph may compare the few records together.

 It seems that the google charts work from a url - so 500 points would be way
 to long for any url - so I guess that option is out.

 Q: what is the best way to create / display line graphs in with PHP?

 Thanks in advance for your help - dave




 Thanks,
 c...@hosting4days.com






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



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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 Yes, the other end of the phone is an experienced PHP developer.


 IMO, if you have to explain this code over the phone or any medium:

 ($item-getServiceId() ? $item-getServiceId() : $item-getId(;

 The other person you're talking to is definitely not experienced.  ;)


I do not need to explain it, I need to say it.


-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: [PHP] Plotting a Line Graph

2009-10-16 Thread Jim Lucas
c...@hosting4days.com wrote:
 Jim Lucas wrote:
 

 I would recommend http://www.rgraph.net/

 It was written and is currently maintained by a member of this list.

 Jim Lucas

 
 Hi Jim,
 
 rgraph looks cool... most demos I see show just a few points - do you
 think this could display 500 points? (I'm looking through their docs
 now...)
 

Here is a demo that has 2000 different points.

http://www.cmsws.com/examples/applications/rgraph/RGraph_20091010/max_line_chart.html

I stripped his demo and altered the number points entered in the demo line
chart.  Seems to work just fine.

Jim Lucas

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



[PHP] Access violation error

2009-10-16 Thread Marshall Burns
I am developing a crawler. It has worked fine throughout testing until this
morning, when suddenly it started yielding an access violation error. I have
not been able to find any explanation of this. I've reduced the script to
the following test code:

 

 

==

html

 head

  titleTest crawler/title

 /head

 body

?php

 

$sURL = $_GET['URL'];

 

echo('pGetting ' . $sURL . 'p');

$sFileCont = file_get_contents('http://' . $sURL);

echo('brDump:' . $sFileCont);

 

?

/body

/html

==

 

 

Running this with various inputs, I get:

 

==

www.ennex.com/util/php/test.php?URL=www.Google.com

 

Getting www.Google.com

 

PHP has encountered an Access Violation at 0A0591E4

==

www.ennex.com/util/php/test.php?URL=www.BadURL.com

 

Getting www.BadURL.com

 

Warning: file_get_contents() [function.file-get-contents]:
php_network_getaddresses: getaddrinfo failed: No such host is known. in
D:\WWWRoot\ennex.com\www\util\php\test.php on line 11

 

PHP has encountered an Access Violation at 0A11B8D6

==

 

The second result shows that it doesn't have to successfully open a stream
to yield the error. 

 

The file_get_contents() function was working just fine throughout
development of the script. Now it yields an access violation. Anybody have
any idea what is going on?

 

Thanks for your help.

 

Marshall Burns, PhD

www.MBurns.com http://www.mburns.com/ 

 

 



Re: [PHP] security/deployment issue

2009-10-16 Thread hessiess
 Humm.. thanks for the replies. But i have another problem about rsync
 again.



 When i deploy a project using the rsync the permissions of all home
 directory is changed. i tried to use the parameter -p -o -g (preserve
 permissions, owner and group):


 I dont know but the rsync doesnt preserve the permissions and group/owner.


 Then always after a deploy i need to execute the cmd chmod 755 user:group
 /home/project . Have someone this problem?


 Thanks


 Augusto Morais


That would sugest that you are running PHP as the same user as Apache,
instead running it as the user which owns the files (the same user you are
using with rsync) would solve this problem. This can be done by running
php as a fastcgi application with suexec or using mpm-itk.


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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Bastien Koert
This is a lot of posts to say either read it off character by
character or just email the damn line.

On 10/16/09, Dotan Cohen dotanco...@gmail.com wrote:
 Yes, the other end of the phone is an experienced PHP developer.


 IMO, if you have to explain this code over the phone or any medium:

 ($item-getServiceId() ? $item-getServiceId() : $item-getId(;

 The other person you're talking to is definitely not experienced.  ;)


 I do not need to explain it, I need to say it.


 --
 Dotan Cohen

 http://what-is-what.com
 http://gibberish.co.il

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



-- 
Sent from my mobile device


Bastien

Cat, the other other white meat

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



Re: [PHP] Access violation error

2009-10-16 Thread Jim Lucas
Marshall Burns wrote:
 I am developing a crawler. It has worked fine throughout testing until this
 morning, when suddenly it started yielding an access violation error. I have
 not been able to find any explanation of this. I've reduced the script to
 the following test code:
 
 ==
 
 html
 
  head
 
   titleTest crawler/title
 
  /head
 
  body
 
 ?php
 
  
 
 $sURL = $_GET['URL'];
 
  
 
 echo('pGetting ' . $sURL . 'p');
 
 $sFileCont = file_get_contents('http://' . $sURL);
 

Is allow_url_fopen enabled?

http://us.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen

 echo('brDump:' . $sFileCont);
 
  
 
 ?
 
 /body
 
 /html
 
 ==
 
 Running this with various inputs, I get:
 
 ==
 
 www.ennex.com/util/php/test.php?URL=www.Google.com
 
 Getting www.Google.com
 
 PHP has encountered an Access Violation at 0A0591E4

Not sure.  Review above suggestion.

 
 ==
 
 www.ennex.com/util/php/test.php?URL=www.BadURL.com
 
 Getting www.BadURL.com
 
 Warning: file_get_contents() [function.file-get-contents]:
 php_network_getaddresses: getaddrinfo failed: No such host is known. in
 D:\WWWRoot\ennex.com\www\util\php\test.php on line 11
 

This should:

When I do this...
# host www.badurl.com

I get this...
Host www.badurl.com not found: 3(NXDOMAIN)

 PHP has encountered an Access Violation at 0A11B8D6
 
 ==
 
 The second result shows that it doesn't have to successfully open a stream
 to yield the error. 
 
 The file_get_contents() function was working just fine throughout
 development of the script. Now it yields an access violation. Anybody have
 any idea what is going on?
 
 Thanks for your help.


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



Re: [PHP] Access violation error

2009-10-16 Thread Ashley Sheridan
On Fri, 2009-10-16 at 15:52 -0700, Jim Lucas wrote:

 Marshall Burns wrote:
  I am developing a crawler. It has worked fine throughout testing until this
  morning, when suddenly it started yielding an access violation error. I have
  not been able to find any explanation of this. I've reduced the script to
  the following test code:
  
  ==
  
  html
  
   head
  
titleTest crawler/title
  
   /head
  
   body
  
  ?php
  
   
  
  $sURL = $_GET['URL'];
  
   
  
  echo('pGetting ' . $sURL . 'p');
  
  $sFileCont = file_get_contents('http://' . $sURL);
  
 
 Is allow_url_fopen enabled?
 
 http://us.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen
 
  echo('brDump:' . $sFileCont);
  
   
  
  ?
  
  /body
  
  /html
  
  ==
  
  Running this with various inputs, I get:
  
  ==
  
  www.ennex.com/util/php/test.php?URL=www.Google.com
  
  Getting www.Google.com
  
  PHP has encountered an Access Violation at 0A0591E4
 
 Not sure.  Review above suggestion.
 
  
  ==
  
  www.ennex.com/util/php/test.php?URL=www.BadURL.com
  
  Getting www.BadURL.com
  
  Warning: file_get_contents() [function.file-get-contents]:
  php_network_getaddresses: getaddrinfo failed: No such host is known. in
  D:\WWWRoot\ennex.com\www\util\php\test.php on line 11
  
 
 This should:
 
 When I do this...
 # host www.badurl.com
 
 I get this...
 Host www.badurl.com not found: 3(NXDOMAIN)
 
  PHP has encountered an Access Violation at 0A11B8D6
  
  ==
  
  The second result shows that it doesn't have to successfully open a stream
  to yield the error. 
  
  The file_get_contents() function was working just fine throughout
  development of the script. Now it yields an access violation. Anybody have
  any idea what is going on?
  
  Thanks for your help.
 
 


Have you move servers at all, or has the server you're running the
script on now been updated recently?

Thanks,
Ash
http://www.ashleysheridan.co.uk




RE: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread tedd

At 12:59 PM -0400 10/16/09, Bob McConnell wrote:

From: tedd

 At 4:51 PM +0100 10/16/09, Ashley Sheridan wrote:


 Open-bracket,


 No, that's not an open bracket -- that's an open parenthesis or
 paren for short.

 An open bracket is [

 An open curly brace is {



That depends on which edition of English you use. Take a look at the
definition of bracket in Wikipedia. What you call a parenthesis is
called a bracket in England and parts of Canada, as well as elsewhere.
They specify square bracket for the second one. I stumbled on this one
in another mailing list a few years ago.

Bob McConnell


I just follow the books published on the subject.

Cheers,


tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread tedd

At 8:31 PM +0200 10/16/09, Dotan Cohen wrote:

  It depends... is the person familiar with PHP or not? If they are not then

 the process is more cumbersome since I can't say things like variable item
 calling camel-case method getServiceId without parameters.



Yes, I should have mentioned that the other party is an experienced
PHP developer.


Well then you're really in trouble because experienced PHP developers 
can't agree on anything. :-)


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Robert Cummings

Dotan Cohen wrote:

It's called vacation away from the 'net but there is an emergency. I'm
certain that a fair portion of the list is familiar with that!

I haven't the slightest idea what you are talking about. Vacation? Away
from the net? We must be from different planets...

How to do you vacation from something implanted into your brain?



http://www.imdb.com/title/tt0100802/


My internet was out earlier... but when I saw IMDB in the link I just 
new it was going to be Total Recall ;)


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Robert Cummings



tedd wrote:

At 8:31 PM +0200 10/16/09, Dotan Cohen wrote:

  It depends... is the person familiar with PHP or not? If they are not then

 the process is more cumbersome since I can't say things like variable item
 calling camel-case method getServiceId without parameters.


Yes, I should have mentioned that the other party is an experienced
PHP developer.


Well then you're really in trouble because experienced PHP developers 
can't agree on anything. :-)


Yeah, I totally agree with tedd.

:|

;)

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



[PHP] Sanitizing potential MySQL strings with no database connection

2009-10-16 Thread Dotan Cohen
How can I configure mysql_real_escape_string() to _not_ need a
database connection in order to do it's work on a string. I understand
that the function wants a database connection to determine which
charset / encoding is in use, but in my case it will always be UTF-8.

I have a file of reusable functions that I include in several scripts,
one of them is a MySQL sanitation function, like this:
function clean_mysql ($dirty) {
$dirty=trim($dirty);
$clean=mysql_real_escape_string($dirty);
return $clean;
}

As different scripts reuse this code but connect to different
databases, I need the function to work independently of the database
connection. In other words, the include file cannot connect to the
database but it still must perform the mysql_real_escape_string()
function on UTF-8 data.

Thanks in advance for any ideas.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Dotan Cohen
 This is a lot of posts to say either read it off character by
 character

If there is a jargon for operators such as - I'd like to know them.

 or just email the damn line.


Not possible for whatever reason, otherwise I wouldn't be bothering the list!

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



[PHP] PHP broadcast mailer

2009-10-16 Thread Brian Hazelton
I am in charge of an email newsletter list and making sure it gets sent 
out in time. My problem is I have never done broadcast emailing and 
right now we have 400 subscribers but want to build a system that can 
scale well regardless of the number of subscribers. Right now I use 
mysql to store the email and use phpmailer in a loop to send an email to 
each of the emails in the db, it is already slow with just 400(takes 
around 10 min (i think that's slow isnt it?). Has anyone built a 
broadcast email script and willing to help me?


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



Re: [PHP] PHP broadcast mailer

2009-10-16 Thread George Langley
	Hi there. At what point would it be beneficial to subscribe to a mass  
mail service such as Constant Contact or iContact, to avoid being  
blacklisted for sending too many e-mails?


George

On 16-Oct-09, at 11:41 PM, Brian Hazelton wrote:

I am in charge of an email newsletter list and making sure it gets  
sent out in time. My problem is I have never done broadcast emailing  
and right now we have 400 subscribers but want to build a system  
that can scale well regardless of the number of subscribers. Right  
now I use mysql to store the email and use phpmailer in a loop to  
send an email to each of the emails in the db, it is already slow  
with just 400(takes around 10 min (i think that's slow isnt it?).  
Has anyone built a broadcast email script and willing to help me?


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




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