[PHP] Example of good PHP namespace usage?

2010-03-19 Thread D. Dante Lorenso

All,

I want to start using PHP namespaces for my projects.  Currently, I name 
my classes similar to how Zend Framework names theirs and I end up with 
classes like:


  LS_Util_String

I'm thinking that if I converted this to namespaces, the classes would 
be named like:


  LS\Util\String

I'd like to look at an example of an open source project that has 
already adopted namespaces as "the way to do it" and would be a good 
best practices case for how I should go about setting up my library 
namespaces.


I have been playing with concepts of using a Java-like naming convention 
for classes and have created my own namespace like:


com\larkspark\util\String

And here I was thinking that packages would be lowercase and classes 
would be camelcase with initial caps.


I'm getting ready to build a new project and wanted to do it in the 
future-forward style while removing legacy classes and refactoring 
everything to use namespaces.


Any examples out there?  Everything I find from searching Google is 
novice intro to PHP namespaces blogs, but nothing concrete.  Also since 
namespaces are relatively new, I see a lot of misleading guides where 
they are using "::" instead of "\" to separate class name parts.  What 
does this list recommend?


Dante

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



Re: [PHP] web sniffer

2010-03-19 Thread Jochen Schultz
Btw., when you use file_get_contets, is there a good way to tell the 
script to stop recieving the file after let's say 2 seconds - just in 
case the server is not reachable - to avoid using fsockopen?


regards
Jochen

madunix schrieb:

okay ..it works now i use
http://www.my.com";);
echo $data;
?>

On Fri, Mar 19, 2010 at 12:32 AM, Adam Richardson  wrote:

On Thu, Mar 18, 2010 at 6:08 PM, Ashley Sheridan 
wrote:

On Fri, 2010-03-19 at 00:11 +0200, madunix wrote:

trying http://us3.php.net/manual/en/function.fsockopen.php
do you a piece of code that  read parts  pages.


On Fri, Mar 19, 2010 at 12:00 AM, Ashley Sheridan
 wrote:


On Fri, 2010-03-19 at 00:03 +0200, madunix wrote:

> I've been trying to read the contents from a particular URL
into a
> string in PHP, and can't get it to work.  any help.
>
> Thanks
>
> --
> If there is a way, I will find one...***
> If there is none, I will make one..."***
>  madunix  **
>




How have you been trying to do it so far?

There are a couple of ways. file_get_contents() and fopen()
will work on URL's if the right ports are open.

Most usually though cURL is used for this sort of thing.

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







--
If there is a way, I will find one...***
If there is none, I will make one..."***
 madunix  **



I think you're over-complicating things by using fsockopen(). Try one of
the functions I mentioned in my last email

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



I agree with Ashley, use one of the other options and then parse the
response to get the part of the page you'd like to work with.

--
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com







--
 Sport Import GmbH   - Amtsgericht Oldenburg  - Tel:   +49-4405-9280-63
 Industriestrasse 39 - HRB 1202900-
 26188 Edewecht  - GF: Michael Müllmann

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



Re: [PHP] web sniffer

2010-03-19 Thread Peter Lind
You should be able to do that by setting context options:
http://www.php.net/manual/en/context.http.php

On 19 March 2010 08:53, Jochen Schultz  wrote:
> Btw., when you use file_get_contets, is there a good way to tell the script
> to stop recieving the file after let's say 2 seconds - just in case the
> server is not reachable - to avoid using fsockopen?
>
> regards
> Jochen
>
> madunix schrieb:
>>
>> okay ..it works now i use
>> > $data=file_get_contents("http://www.my.com";);
>> echo $data;
>> ?>
>>
>> On Fri, Mar 19, 2010 at 12:32 AM, Adam Richardson 
>> wrote:
>>>
>>> On Thu, Mar 18, 2010 at 6:08 PM, Ashley Sheridan
>>> 
>>> wrote:

 On Fri, 2010-03-19 at 00:11 +0200, madunix wrote:
>
> trying http://us3.php.net/manual/en/function.fsockopen.php
> do you a piece of code that  read parts  pages.
>
>
> On Fri, Mar 19, 2010 at 12:00 AM, Ashley Sheridan
>  wrote:
>
>
>        On Fri, 2010-03-19 at 00:03 +0200, madunix wrote:
>
>        > I've been trying to read the contents from a particular URL
> into a
>        > string in PHP, and can't get it to work.  any help.
>        >
>        > Thanks
>        >
>        > --
>        > If there is a way, I will find one...***
>        > If there is none, I will make one..."***
>        >  madunix  **
>        >
>
>
>
>
>        How have you been trying to do it so far?
>
>        There are a couple of ways. file_get_contents() and fopen()
>        will work on URL's if the right ports are open.
>
>        Most usually though cURL is used for this sort of thing.
>
>        Thanks,
>        Ash
>        http://www.ashleysheridan.co.uk
>
>
>
>
>
>
>
> --
> If there is a way, I will find one...***
> If there is none, I will make one..."***
>  madunix  **
>
>
 I think you're over-complicating things by using fsockopen(). Try one of
 the functions I mentioned in my last email

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


>>> I agree with Ashley, use one of the other options and then parse the
>>> response to get the part of the page you'd like to work with.
>>>
>>> --
>>> Nephtali:  PHP web framework that functions beautifully
>>> http://nephtaliproject.com
>>>
>>
>>
>>
>
> --
>  Sport Import GmbH   - Amtsgericht Oldenburg  - Tel:   +49-4405-9280-63
>  Industriestrasse 39 - HRB 1202900            -
>  26188 Edewecht      - GF: Michael Müllmann
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 

WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51


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



Re: [PHP] web sniffer

2010-03-19 Thread madunix
can any one give a complete sample script how to retrieve data content
from web (jpg, pdf, field).

Thanks

On Fri, Mar 19, 2010 at 9:53 AM, Jochen Schultz  wrote:
> Btw., when you use file_get_contets, is there a good way to tell the script
> to stop recieving the file after let's say 2 seconds - just in case the
> server is not reachable - to avoid using fsockopen?
>
> regards
> Jochen
>
> madunix schrieb:
>>
>> okay ..it works now i use
>> > $data=file_get_contents("http://www.my.com";);
>> echo $data;
>> ?>
>>
>> On Fri, Mar 19, 2010 at 12:32 AM, Adam Richardson 
>> wrote:
>>>
>>> On Thu, Mar 18, 2010 at 6:08 PM, Ashley Sheridan
>>> 
>>> wrote:

 On Fri, 2010-03-19 at 00:11 +0200, madunix wrote:
>
> trying http://us3.php.net/manual/en/function.fsockopen.php
> do you a piece of code that  read parts  pages.
>
>
> On Fri, Mar 19, 2010 at 12:00 AM, Ashley Sheridan
>  wrote:
>
>
>        On Fri, 2010-03-19 at 00:03 +0200, madunix wrote:
>
>        > I've been trying to read the contents from a particular URL
> into a
>        > string in PHP, and can't get it to work.  any help.
>        >
>        > Thanks
>        >
>        > --
>        > If there is a way, I will find one...***
>        > If there is none, I will make one..."***
>        >  madunix  **
>        >
>
>
>
>
>        How have you been trying to do it so far?
>
>        There are a couple of ways. file_get_contents() and fopen()
>        will work on URL's if the right ports are open.
>
>        Most usually though cURL is used for this sort of thing.
>
>        Thanks,
>        Ash
>        http://www.ashleysheridan.co.uk
>
>
>
>
>
>
>
> --
> If there is a way, I will find one...***
> If there is none, I will make one..."***
>  madunix  **
>
>
 I think you're over-complicating things by using fsockopen(). Try one of
 the functions I mentioned in my last email

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


>>> I agree with Ashley, use one of the other options and then parse the
>>> response to get the part of the page you'd like to work with.
>>>
>>> --
>>> Nephtali:  PHP web framework that functions beautifully
>>> http://nephtaliproject.com
>>>
>>
>>
>>
>
> --
>  Sport Import GmbH   - Amtsgericht Oldenburg  - Tel:   +49-4405-9280-63
>  Industriestrasse 39 - HRB 1202900            -
>  26188 Edewecht      - GF: Michael Müllmann
>



-- 
If there is a way, I will find one...***
If there is none, I will make one..."***
 madunix  **

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



Re: [PHP] Re: PHP in HTML code

2010-03-19 Thread Michael A. Peters

Jan G.B. wrote:

2010/3/18 tedd :

Calling it "ranting" or "religious" unjustly demeans the discussion and is
inflammatory.
In all of this, I've simply said it's your choice.


What I said was:
*persons ranting about short open tags* *are just like some religious people
*


I don't care what people do in their code.
I do not like released code with short tags, it has caused me problems 
when trying to run php webapps that use short tags, I have to go through 
the code and change them.


So what people do with their private code, I could care less about.
But if releasing php code for public consumption, I guess I'm a preacher 
asking people to get religion, because short tags do not belong in 
projects that are released to the public. Just like addslashes and magic 
quotes and most html entities should not be used in php code released 
for public consumption.


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



Re: [PHP] Re: PHP in HTML code

2010-03-19 Thread Peter Lind
On 19 March 2010 10:17, Michael A. Peters  wrote:
>
> I don't care what people do in their code.
> I do not like released code with short tags, it has caused me problems when
> trying to run php webapps that use short tags, I have to go through the code
> and change them.
>
> So what people do with their private code, I could care less about.
> But if releasing php code for public consumption, I guess I'm a preacher
> asking people to get religion, because short tags do not belong in projects
> that are released to the public. Just like addslashes and magic quotes and
> most html entities should not be used in php code released for public
> consumption.
>

What he said. Now, could we get over this discussion? It's not exactly
going anywhere.

-- 

WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51


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



RE: [PHP] web sniffer

2010-03-19 Thread Jay Blanchard
[snip]
can any one give a complete sample script how to retrieve data content
from web (jpg, pdf, field).
[/snip]

Your question is a little too far reaching. You can use string functions
match portions of strings including tried and true regular expressions.

What do you want to do, specifically?

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



RE: [PHP] web sniffer

2010-03-19 Thread Ashley Sheridan
On Fri, 2010-03-19 at 06:25 -0500, Jay Blanchard wrote:

> [snip]
> can any one give a complete sample script how to retrieve data content
> from web (jpg, pdf, field).
> [/snip]
> 
> Your question is a little too far reaching. You can use string functions
> match portions of strings including tried and true regular expressions.
> 
> What do you want to do, specifically?


I assume he wants to retrieve the files for a page as well.

I'd recommend having PHP call wget on the shell, as that tool was built
for this sort of thing.

If you don't have access to wget, then you could use some sort of DOM or
string manipulation to find out what files are used in a web page and
then make separate requests via cURL to grab those, as
file_get_contents() might not be totally reliable for this sort of
thing.

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




Re: [PHP] web sniffer

2010-03-19 Thread Jochen Schultz

Maybe this code may help you getting into it?

  public function 
sendHttpRequest($host,$filename,$port=80,$timeout=1,$x=0,$result=array()) {

$header  = 'GET /'.$filename.' HTTP/1.1'.PHP_EOL;
$header .= 'Host: '.$host.PHP_EOL;
$header .= 'Connection: close'.PHP_EOL;
$header .= 'User-Agent: Simple(php-general@lists.php.net)'.PHP_EOL;
$header .= "Referer: http://test-server.tld/".PHP_EOL.PHP_EOL;
$sock...@fsockopen($host, $port, &$errno, &$errstr, $timeout);
$result[-1]='';
if (!$socket){
  trigger_error('Connection timeout',E_USER_NOTICE);
  $result["errno"]  = $errno;
  $result["errstr"] = $errstr;
  return $result;
}
fputs($socket, $header);
while (!feof($socket)) {
  $result[$x++] = fgets($socket, 128);
  if (preg_match('/^Location:/',$result[$x-1])) {
return $result[$x-1];
  }
  flush();
}
return $result;
  }
}

$post = new simpleHttpSocket;
$host = 'www.example.com';
$filename = '';  // leave empty for index file or else:
// $filename = 'image.jpg';
$file = $post->sendHttpRequest($host,$header,80,2);

// Output
while(list($k,$v)=each($file)) {
  echo $v.'';
}

?>

regards
Jochen

madunix schrieb:

can any one give a complete sample script how to retrieve data content
from web (jpg, pdf, field).

Thanks

On Fri, Mar 19, 2010 at 9:53 AM, Jochen Schultz  wrote:

Btw., when you use file_get_contets, is there a good way to tell the script
to stop recieving the file after let's say 2 seconds - just in case the
server is not reachable - to avoid using fsockopen?

regards
Jochen

madunix schrieb:

okay ..it works now i use
http://www.my.com";);
echo $data;
?>

On Fri, Mar 19, 2010 at 12:32 AM, Adam Richardson 
wrote:

On Thu, Mar 18, 2010 at 6:08 PM, Ashley Sheridan

wrote:

On Fri, 2010-03-19 at 00:11 +0200, madunix wrote:

trying http://us3.php.net/manual/en/function.fsockopen.php
do you a piece of code that  read parts  pages.


On Fri, Mar 19, 2010 at 12:00 AM, Ashley Sheridan
 wrote:


   On Fri, 2010-03-19 at 00:03 +0200, madunix wrote:

   > I've been trying to read the contents from a particular URL
into a
   > string in PHP, and can't get it to work.  any help.
   >
   > Thanks
   >
   > --
   > If there is a way, I will find one...***
   > If there is none, I will make one..."***
   >  madunix  **
   >




   How have you been trying to do it so far?

   There are a couple of ways. file_get_contents() and fopen()
   will work on URL's if the right ports are open.

   Most usually though cURL is used for this sort of thing.

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







--
If there is a way, I will find one...***
If there is none, I will make one..."***
 madunix  **



I think you're over-complicating things by using fsockopen(). Try one of
the functions I mentioned in my last email

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



I agree with Ashley, use one of the other options and then parse the
response to get the part of the page you'd like to work with.

--
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com





--
 Sport Import GmbH   - Amtsgericht Oldenburg  - Tel:   +49-4405-9280-63
 Industriestrasse 39 - HRB 1202900-
 26188 Edewecht  - GF: Michael Müllmann







--
 Sport Import GmbH   - Amtsgericht Oldenburg  - Tel:   +49-4405-9280-63
 Industriestrasse 39 - HRB 1202900-
 26188 Edewecht  - GF: Michael Müllmann

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



Re: [PHP] web sniffer

2010-03-19 Thread Jochen Schultz

Thanks alot!

regards
Jochen

Peter Lind schrieb:

You should be able to do that by setting context options:
http://www.php.net/manual/en/context.http.php

On 19 March 2010 08:53, Jochen Schultz  wrote:

Btw., when you use file_get_contets, is there a good way to tell the script
to stop recieving the file after let's say 2 seconds - just in case the
server is not reachable - to avoid using fsockopen?

regards
Jochen

madunix schrieb:

okay ..it works now i use
http://www.my.com";);
echo $data;
?>

On Fri, Mar 19, 2010 at 12:32 AM, Adam Richardson 
wrote:

On Thu, Mar 18, 2010 at 6:08 PM, Ashley Sheridan

wrote:

On Fri, 2010-03-19 at 00:11 +0200, madunix wrote:

trying http://us3.php.net/manual/en/function.fsockopen.php
do you a piece of code that  read parts  pages.


On Fri, Mar 19, 2010 at 12:00 AM, Ashley Sheridan
 wrote:


   On Fri, 2010-03-19 at 00:03 +0200, madunix wrote:

   > I've been trying to read the contents from a particular URL
into a
   > string in PHP, and can't get it to work.  any help.
   >
   > Thanks
   >
   > --
   > If there is a way, I will find one...***
   > If there is none, I will make one..."***
   >  madunix  **
   >




   How have you been trying to do it so far?

   There are a couple of ways. file_get_contents() and fopen()
   will work on URL's if the right ports are open.

   Most usually though cURL is used for this sort of thing.

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







--
If there is a way, I will find one...***
If there is none, I will make one..."***
 madunix  **



I think you're over-complicating things by using fsockopen(). Try one of
the functions I mentioned in my last email

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



I agree with Ashley, use one of the other options and then parse the
response to get the part of the page you'd like to work with.

--
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com





--
 Sport Import GmbH   - Amtsgericht Oldenburg  - Tel:   +49-4405-9280-63
 Industriestrasse 39 - HRB 1202900-
 26188 Edewecht  - GF: Michael Müllmann

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








--
 Sport Import GmbH   - Amtsgericht Oldenburg  - Tel:   +49-4405-9280-63
 Industriestrasse 39 - HRB 1202900-
 26188 Edewecht  - GF: Michael Müllmann

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



Re: [PHP] web sniffer

2010-03-19 Thread Rene Veerman
"field"?

On Fri, Mar 19, 2010 at 9:46 AM, madunix  wrote:
> can any one give a complete sample script how to retrieve data content
> from web (jpg, pdf, field).
>

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



[PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Robert P. J. Day

  (just a warning -- as a relative newbie to PHP, i'll probably have
the occasional dumb question.  just humour me.)

  i'm looking at some existing PHP code that accesses a mysql 5.0 db,
and it's coded using the mysql-specific calls:  mysql_connect,
mysql_select_db, etc, etc.

  is there any reason i *wouldn't* want to rewrite that code using the
more general PEAR DB module, and use mysqli?  certainly, as i read it,
using the PEAR DB module would make it easier down the road if i
suddenly decide to change the DB backend.

  anyway, any compelling arguments for or against?

rday
--



Robert P. J. Day   Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday


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



[PHP] need a free sql table layout diagram app for linux, not phpmyadmin coz it has a bug with >7 tables opened in its designer.

2010-03-19 Thread Rene Veerman
https://bugs.launchpad.net/ubuntu/+source/phpmyadmin/+bug/541922

phpmyadmin is on strike :(

can anyone recommend a good alternative? auto-scaling print function preferred.

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



Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Ashley Sheridan
On Fri, 2010-03-19 at 10:17 -0400, Robert P. J. Day wrote:

> (just a warning -- as a relative newbie to PHP, i'll probably have
> the occasional dumb question.  just humour me.)
> 
>   i'm looking at some existing PHP code that accesses a mysql 5.0 db,
> and it's coded using the mysql-specific calls:  mysql_connect,
> mysql_select_db, etc, etc.
> 
>   is there any reason i *wouldn't* want to rewrite that code using the
> more general PEAR DB module, and use mysqli?  certainly, as i read it,
> using the PEAR DB module would make it easier down the road if i
> suddenly decide to change the DB backend.
> 
>   anyway, any compelling arguments for or against?
> 
> rday
> --
> 
> 
> 
> Robert P. J. Day   Waterloo, Ontario, CANADA
> 
> Linux Consulting, Training and Kernel Pedantry.
> 
> Web page:  http://crashcourse.ca
> Twitter:   http://twitter.com/rpjday
> 
> 


The only problem I can foresee is if the system you're looking to
replace the mysql calls in uses any specific mysql-only features and
functions. So, for example, not all database types support grabbing the
last inserted id (and grabbing the MAX(id) is just asking for trouble)

Have a look through the code to see if there any database calls that you
think might throw up any issues. I believe the Pear module supports all
the mysql functions, but there might be issues if you want to change the
back end at some point in the future.

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




Re: [PHP] need a free sql table layout diagram app for linux, not phpmyadmin coz it has a bug with >7 tables opened in its designer.

2010-03-19 Thread Ashley Sheridan
On Fri, 2010-03-19 at 15:25 +0100, Rene Veerman wrote:

> https://bugs.launchpad.net/ubuntu/+source/phpmyadmin/+bug/541922
> 
> phpmyadmin is on strike :(
> 
> can anyone recommend a good alternative? auto-scaling print function 
> preferred.
> 


I needed software to do this a while ago, and the majority of the
responses on the list were to use MySQL Workbench.

The thread was called 'Linux ERD Software' if you want to have a look at
some of the other suggestions.

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




Re: [PHP] Example of good PHP namespace usage?

2010-03-19 Thread Adam Richardson
On Fri, Mar 19, 2010 at 3:05 AM, D. Dante Lorenso  wrote:

> All,
>
> I want to start using PHP namespaces for my projects.  Currently, I name my
> classes similar to how Zend Framework names theirs and I end up with classes
> like:
>
>  LS_Util_String
>
> I'm thinking that if I converted this to namespaces, the classes would be
> named like:
>
>  LS\Util\String
>
> I'd like to look at an example of an open source project that has already
> adopted namespaces as "the way to do it" and would be a good best practices
> case for how I should go about setting up my library namespaces.
>
> I have been playing with concepts of using a Java-like naming convention
> for classes and have created my own namespace like:
>
>com\larkspark\util\String
>
> And here I was thinking that packages would be lowercase and classes would
> be camelcase with initial caps.
>
> I'm getting ready to build a new project and wanted to do it in the
> future-forward style while removing legacy classes and refactoring
> everything to use namespaces.
>
> Any examples out there?  Everything I find from searching Google is novice
> intro to PHP namespaces blogs, but nothing concrete.  Also since namespaces
> are relatively new, I see a lot of misleading guides where they are using
> "::" instead of "\" to separate class name parts.  What does this list
> recommend?
>
> Dante
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I'm certainly not advocating my framework's conventions as "the way to do
it", but you can certainly look at my code just to see how I'm using
namespaces for my project.  The framework takes a largely functional
approach, so some of the Object-naming conventions aren't present, but you
still might see some things you like (or hate.)  It seems to work well with
Netbeans (I haven't tried other IDE's.)

http://code.google.com/p/nephtali/

Documentation and other stuff can be found at the website in my signature,
if it would help to sift through the functions.

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Paul M Foster
On Fri, Mar 19, 2010 at 02:23:30PM +, Ashley Sheridan wrote:

> On Fri, 2010-03-19 at 10:17 -0400, Robert P. J. Day wrote:
> 
> > (just a warning -- as a relative newbie to PHP, i'll probably have
> > the occasional dumb question.  just humour me.)
> >
> >   i'm looking at some existing PHP code that accesses a mysql 5.0 db,
> > and it's coded using the mysql-specific calls:  mysql_connect,
> > mysql_select_db, etc, etc.
> >
> >   is there any reason i *wouldn't* want to rewrite that code using the
> > more general PEAR DB module, and use mysqli?  certainly, as i read it,
> > using the PEAR DB module would make it easier down the road if i
> > suddenly decide to change the DB backend.
> >
> >   anyway, any compelling arguments for or against?
> >
> > rday
> 
> 
> The only problem I can foresee is if the system you're looking to
> replace the mysql calls in uses any specific mysql-only features and
> functions. So, for example, not all database types support grabbing the
> last inserted id (and grabbing the MAX(id) is just asking for trouble)
> 
> Have a look through the code to see if there any database calls that you
> think might throw up any issues. I believe the Pear module supports all
> the mysql functions, but there might be issues if you want to change the
> back end at some point in the future.
> 
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 
> 

I would suggest instead the built-in PDO module for PHP. This is
generic, and suitable for several DBMS back-ends. But any direct queries
using features unique to a specific DBMS (like Ash's "last inserted id")
will have to be coded specifically for your back-end.

Paul

-- 
Paul M. Foster

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



Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Adam Richardson
On Fri, Mar 19, 2010 at 10:23 AM, Ashley Sheridan
wrote:

> On Fri, 2010-03-19 at 10:17 -0400, Robert P. J. Day wrote:
>
> > (just a warning -- as a relative newbie to PHP, i'll probably have
> > the occasional dumb question.  just humour me.)
> >
> >   i'm looking at some existing PHP code that accesses a mysql 5.0 db,
> > and it's coded using the mysql-specific calls:  mysql_connect,
> > mysql_select_db, etc, etc.
> >
> >   is there any reason i *wouldn't* want to rewrite that code using the
> > more general PEAR DB module, and use mysqli?  certainly, as i read it,
> > using the PEAR DB module would make it easier down the road if i
> > suddenly decide to change the DB backend.
> >
> >   anyway, any compelling arguments for or against?
> >
> > rday
> > --
> >
> >
> > 
> > Robert P. J. Day   Waterloo, Ontario, CANADA
> >
> > Linux Consulting, Training and Kernel Pedantry.
> >
> > Web page:  http://crashcourse.ca
> > Twitter:   http://twitter.com/rpjday
> > 
> >
>
>
> The only problem I can foresee is if the system you're looking to
> replace the mysql calls in uses any specific mysql-only features and
> functions. So, for example, not all database types support grabbing the
> last inserted id (and grabbing the MAX(id) is just asking for trouble)
>
> Have a look through the code to see if there any database calls that you
> think might throw up any issues. I believe the Pear module supports all
> the mysql functions, but there might be issues if you want to change the
> back end at some point in the future.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
You also might prefer the level of abstraction and simplicity provided by
PDO (note that it's a data access abstraction layer, not a database
abstraction layer, http://www.php.net/manual/en/intro.pdo.php.)

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Rene Veerman
another option: adodb.sf.net.

and yep, i'm fully for using a db abstraction layer.


On Fri, Mar 19, 2010 at 3:17 PM, Robert P. J. Day  wrote:
>
>  (just a warning -- as a relative newbie to PHP, i'll probably have
> the occasional dumb question.  just humour me.)
>
>  i'm looking at some existing PHP code that accesses a mysql 5.0 db,
> and it's coded using the mysql-specific calls:  mysql_connect,
> mysql_select_db, etc, etc.
>
>  is there any reason i *wouldn't* want to rewrite that code using the
> more general PEAR DB module, and use mysqli?  certainly, as i read it,
> using the PEAR DB module would make it easier down the road if i
> suddenly decide to change the DB backend.
>
>  anyway, any compelling arguments for or against?
>
> rday
> --
>
>
> 
> Robert P. J. Day                               Waterloo, Ontario, CANADA
>
>            Linux Consulting, Training and Kernel Pedantry.
>
> Web page:                                          http://crashcourse.ca
> Twitter:                                       http://twitter.com/rpjday
> 
>
> --
> 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] need a free sql table layout diagram app for linux, not phpmyadmin coz it has a bug with >7 tables opened in its designer.

2010-03-19 Thread Rene Veerman
thanks.

On Fri, Mar 19, 2010 at 3:35 PM, Ashley Sheridan
wrote:

>  On Fri, 2010-03-19 at 15:25 +0100, Rene Veerman wrote:
>
> https://bugs.launchpad.net/ubuntu/+source/phpmyadmin/+bug/541922
>
> phpmyadmin is on strike :(
>
> can anyone recommend a good alternative? auto-scaling print function 
> preferred.
>
>
>
> I needed software to do this a while ago, and the majority of the responses
> on the list were to use MySQL Workbench.
>
> The thread was called 'Linux ERD Software' if you want to have a look at
> some of the other suggestions.
>
>   Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Nilesh Govindarajan

On 03/19/2010 08:51 PM, Rene Veerman wrote:

another option: adodb.sf.net.

and yep, i'm fully for using a db abstraction layer.


On Fri, Mar 19, 2010 at 3:17 PM, Robert P. J. Day  wrote:


  (just a warning -- as a relative newbie to PHP, i'll probably have
the occasional dumb question.  just humour me.)

  i'm looking at some existing PHP code that accesses a mysql 5.0 db,
and it's coded using the mysql-specific calls:  mysql_connect,
mysql_select_db, etc, etc.

  is there any reason i *wouldn't* want to rewrite that code using the
more general PEAR DB module, and use mysqli?  certainly, as i read it,
using the PEAR DB module would make it easier down the road if i
suddenly decide to change the DB backend.

  anyway, any compelling arguments for or against?

rday
--



Robert P. J. Day   Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday


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






Adodb is the same one that is available in Visual Basic.

I suggest PDO. Easy to use and portable.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com

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



Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread la...@garfieldtech.com
Add me to the list of people recommending PDO.  It's much nicer to work 
with than the ext/mysql API, and frankly more secure since you get 
prepared statements.  It won't get you complete database independence 
for a number of reasons (mostly due to databases being too 
unstandardized because they all suck in different ways; I say this as 
someone who has written an abstraction layer atop PDO and it wasn't 
easy), but it will get you part way there and even if you only ever use 
MySQL is a nicer API to work with.


--Larry Garfield

On 3/19/10 9:17 AM, Robert P. J. Day wrote:


   (just a warning -- as a relative newbie to PHP, i'll probably have
the occasional dumb question.  just humour me.)

   i'm looking at some existing PHP code that accesses a mysql 5.0 db,
and it's coded using the mysql-specific calls:  mysql_connect,
mysql_select_db, etc, etc.

   is there any reason i *wouldn't* want to rewrite that code using the
more general PEAR DB module, and use mysqli?  certainly, as i read it,
using the PEAR DB module would make it easier down the road if i
suddenly decide to change the DB backend.

   anyway, any compelling arguments for or against?

rday
--



Robert P. J. Day   Waterloo, Ontario, CANADA

 Linux Consulting, Training and Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday




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



Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Mattias Thorslund

Robert P. J. Day wrote:

  (just a warning -- as a relative newbie to PHP, i'll probably have
the occasional dumb question.  just humour me.)

  i'm looking at some existing PHP code that accesses a mysql 5.0 db,
and it's coded using the mysql-specific calls:  mysql_connect,
mysql_select_db, etc, etc.

  is there any reason i *wouldn't* want to rewrite that code using the
more general PEAR DB module, and use mysqli?  certainly, as i read it,
using the PEAR DB module would make it easier down the road if i
suddenly decide to change the DB backend.

  anyway, any compelling arguments for or against?

rday
--
  


Well, the reason you shouldn't use PEAR DB in a new project is that it's 
being deprecated. MDB2 is the PEAR successor, and does provide emulation 
for some features that don't exist on all database platforms, such as 
LastInsertID. It can also help you convert your database from one 
platform to another, since it also provides methods for detecting and 
managing the database structure itself (the Manager and Reverse modules).


That said, if I were to start a new project at this time, I would look 
closer at whether PDO fits my needs.


Cheers,

Mattias

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



Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Lester Caine

la...@garfieldtech.com wrote:

Add me to the list of people recommending PDO.  It's much nicer to work
with than the ext/mysql API, and frankly more secure since you get
prepared statements. It won't get you complete database independence for
a number of reasons (mostly due to databases being too unstandardized
because they all suck in different ways; I say this as someone who has
written an abstraction layer atop PDO and it wasn't easy), but it will
get you part way there and even if you only ever use MySQL is a nicer
API to work with.


Of cause ADODB will actually use PDO for those databases that are currently 
available in it, and the generic drivers for those which are not currently 
supported by PDO ;) One can also check performance by switching between PDO 
driver and generic if you want to ...


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Robert P. J. Day
On Fri, 19 Mar 2010, Mattias Thorslund wrote:

> Robert P. J. Day wrote:
> >   (just a warning -- as a relative newbie to PHP, i'll probably have
> > the occasional dumb question.  just humour me.)
> >
> >   i'm looking at some existing PHP code that accesses a mysql 5.0 db,
> > and it's coded using the mysql-specific calls:  mysql_connect,
> > mysql_select_db, etc, etc.
> >
> >   is there any reason i *wouldn't* want to rewrite that code using the
> > more general PEAR DB module, and use mysqli?  certainly, as i read it,
> > using the PEAR DB module would make it easier down the road if i
> > suddenly decide to change the DB backend.
> >
> >   anyway, any compelling arguments for or against?
> >
> > rday
> > --
> >
>
> Well, the reason you shouldn't use PEAR DB in a new project is that
> it's being deprecated. MDB2 is the PEAR successor, ...

  you're right and, in fact, i knew that, i just forgot.  i'm also
taking seriously the recommendations for PDO and adodb.

rday
--



Robert P. J. Day   Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday


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



[PHP] Event/Exhibition Organizers Management Software

2010-03-19 Thread Jochem Maas
hi gang[tm],

I've been STFW for some kind of CRM package specifically geared at
event/exhibition organizers. I'm not having any luck, there *seems* to
be stuff out there but most of it's geared at single exhibitor/corporate
entity event management as opposed to the organization of events
where 100s of exhibitors need be approached, sold stand space to and
manage - of those that do seem to what I'd like they are a bit vague on
their website and don't give any pricing info (as usual price is a big issue :).

I've looked at the possibilities of using Salesforce or SugarCRM but neither
seem to have plugins/modules aimed at the specific requirements I have.

Basically I want something to manage:

1. multiple expos/exhibitions
2. selling standspace
3. manage tickets/ticket campaigns
4. floorplan management/creation/etc
5. speaker/debate-panel management
6. exhibitor pack/documentation management
5. the usual invoicing/lead/crm stuff

does anyone know of anything that comes remotely close?

rgds,
Jochem

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



[PHP] where to make observations about current PHP manual?

2010-03-19 Thread Robert P. J. Day

 i don't see a separate mailing list for documentation so is this
where i would point at oddities in the manual?  as in, here:

http://www.php.net/manual/en/language.variables.external.php

we read:

"// Unavailable since PHP 6."

that just looks weird, no?

rday
--


Robert P. J. Day   Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday


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



Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Michael A. Peters

Mattias Thorslund wrote:

Robert P. J. Day wrote:

  (just a warning -- as a relative newbie to PHP, i'll probably have
the occasional dumb question.  just humour me.)

  i'm looking at some existing PHP code that accesses a mysql 5.0 db,
and it's coded using the mysql-specific calls:  mysql_connect,
mysql_select_db, etc, etc.

  is there any reason i *wouldn't* want to rewrite that code using the
more general PEAR DB module, and use mysqli?  certainly, as i read it,
using the PEAR DB module would make it easier down the road if i
suddenly decide to change the DB backend.

  anyway, any compelling arguments for or against?

rday
--
  


Well, the reason you shouldn't use PEAR DB in a new project is that it's 
being deprecated. MDB2 is the PEAR successor, and does provide emulation 
for some features that don't exist on all database platforms, such as 
LastInsertID. It can also help you convert your database from one 
platform to another, since it also provides methods for detecting and 
managing the database structure itself (the Manager and Reverse modules).


That said, if I were to start a new project at this time, I would look 
closer at whether PDO fits my needs.


I use MDB2.
I hear PDO hyped a lot, what does it really give me that MDB2 does not, 
other than making the application dependent upon a binary module?


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



[PHP] php compile / configure options

2010-03-19 Thread Gregory Machin
Hi
I'm setting up a development environment that runs multiple versions of php.
I'm looking a list of the compile option options for each php release
other than "./configure --help" with more detail on what each option
does.
Any suggestions welcome .

Thank you.

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



Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Jason Pruim


On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote:


On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan
 wrote:
[snip]
And I believe that when MS Office saves a CSV out with a character  
other
than a comma as the delimiter, it still saves it as a .csv by  
default.


Nope. If you save as CSV, it is comma-separated with double-quotes as
the text qualifier. There is also an option to save in tab-delimited
format, but the default extension for that is .txt.

The only issue I have with Excel handling text files is with columns
like ZIP code that should be treated as text (they are string
sequences that happen to contain only numeric digits where leading
zeros are significant) but are interpreted as numbers.

Andrew



Hi Andrew,

As a fellow mailing list processor I can feel your pain... One thing I  
have found is when you are importing the data, you can select the zip  
column and change the format from "general" to "text" and it will  
maintain the leading zero's. Or a simple filter applied to it  
afterwards will help to.


But if you have a decent CASS software then it should add the zip back  
in hehe :)



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



Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Ashley Sheridan
On Fri, 2010-03-19 at 18:01 -0400, Jason Pruim wrote:

> On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote:
> 
> > On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan
> >  wrote:
> > [snip]
> >> And I believe that when MS Office saves a CSV out with a character  
> >> other
> >> than a comma as the delimiter, it still saves it as a .csv by  
> >> default.
> >
> > Nope. If you save as CSV, it is comma-separated with double-quotes as
> > the text qualifier. There is also an option to save in tab-delimited
> > format, but the default extension for that is .txt.
> >
> > The only issue I have with Excel handling text files is with columns
> > like ZIP code that should be treated as text (they are string
> > sequences that happen to contain only numeric digits where leading
> > zeros are significant) but are interpreted as numbers.
> >
> > Andrew
> 
> 
> Hi Andrew,
> 
> As a fellow mailing list processor I can feel your pain... One thing I  
> have found is when you are importing the data, you can select the zip  
> column and change the format from "general" to "text" and it will  
> maintain the leading zero's. Or a simple filter applied to it  
> afterwards will help to.
> 
> But if you have a decent CASS software then it should add the zip back  
> in hehe :)
> 
> 


It's not really just that. In the csv format, a field value of 00123 (I
don't really know what zip code formats are) is perfectly valid.
Unfortunately, Excel (and Calc) tries to be clever and strips out
leading zeros on a field it recognises as all numbers. This is annoying
for things like zip codes and phone numbers (which in the UK mostly all
start with a 0)

I think short of enclosing the field in quote marks to signify it's a
string and not something that the software should guess at is the only
way to ensure it works effectively.

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




[PHP] Re: where to make observations about current PHP manual?

2010-03-19 Thread Shawn McKenzie
Robert P. J. Day wrote:
>  i don't see a separate mailing list for documentation so is this
> where i would point at oddities in the manual?  as in, here:
> 
> http://www.php.net/manual/en/language.variables.external.php
> 
> we read:
> 
> "// Unavailable since PHP 6."
> 
> that just looks weird, no?
> 
> rday
> --
> 
> 
> Robert P. J. Day   Waterloo, Ontario, CANADA
> 
> Linux Consulting, Training and Kernel Pedantry.
> 
> Web page:  http://crashcourse.ca
> Twitter:   http://twitter.com/rpjday
> 

$HTTP_POST_VARS was the way to access post vars in PHP before 4.1. Since
then it is $_POST, and $HTTP_POST_VARS is only available if you set
register_long_arrays = On in php.ini.  As of PHP 6 $HTTP_POST_VARS will
not be available, you must use $_POST.

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Andrew Ballard
On Fri, Mar 19, 2010 at 6:01 PM, Jason Pruim  wrote:
>
> On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote:
>
>> On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan
>>  wrote:
>> [snip]
>>>
>>> And I believe that when MS Office saves a CSV out with a character other
>>> than a comma as the delimiter, it still saves it as a .csv by default.
>>
>> Nope. If you save as CSV, it is comma-separated with double-quotes as
>> the text qualifier. There is also an option to save in tab-delimited
>> format, but the default extension for that is .txt.
>>
>> The only issue I have with Excel handling text files is with columns
>> like ZIP code that should be treated as text (they are string
>> sequences that happen to contain only numeric digits where leading
>> zeros are significant) but are interpreted as numbers.
>>
>> Andrew
>
>
> Hi Andrew,
>
> As a fellow mailing list processor I can feel your pain... One thing I have
> found is when you are importing the data, you can select the zip column and
> change the format from "general" to "text" and it will maintain the leading
> zero's. Or a simple filter applied to it afterwards will help to.
>
> But if you have a decent CASS software then it should add the zip back in
> hehe :)
>
>

That works - if I'm the first one to open the file. Often I get files
that someone else opened in Excel to "fix" some things then saved back
to CSV and sent merrily along.  :-)

Andrew

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



Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Andrew Ballard
On Fri, Mar 19, 2010 at 6:13 PM, Ashley Sheridan
 wrote:
>
> On Fri, 2010-03-19 at 18:01 -0400, Jason Pruim wrote:
>
> On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote:
>
> > On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan
> >  wrote:
> > [snip]
> >> And I believe that when MS Office saves a CSV out with a character
> >> other
> >> than a comma as the delimiter, it still saves it as a .csv by
> >> default.
> >
> > Nope. If you save as CSV, it is comma-separated with double-quotes as
> > the text qualifier. There is also an option to save in tab-delimited
> > format, but the default extension for that is .txt.
> >
> > The only issue I have with Excel handling text files is with columns
> > like ZIP code that should be treated as text (they are string
> > sequences that happen to contain only numeric digits where leading
> > zeros are significant) but are interpreted as numbers.
> >
> > Andrew
>
>
> Hi Andrew,
>
> As a fellow mailing list processor I can feel your pain... One thing I
> have found is when you are importing the data, you can select the zip
> column and change the format from "general" to "text" and it will
> maintain the leading zero's. Or a simple filter applied to it
> afterwards will help to.
>
> But if you have a decent CASS software then it should add the zip back
> in hehe :)
>
>
>
> It's not really just that. In the csv format, a field value of 00123 (I don't 
> really know what zip code formats are) is perfectly valid. Unfortunately, 
> Excel (and Calc) tries to be clever and strips out leading zeros on a field 
> it recognises as all numbers. This is annoying for things like zip codes and 
> phone numbers (which in the UK mostly all start with a 0)
>
> I think short of enclosing the field in quote marks to signify it's a string 
> and not something that the software should guess at is the only way to ensure 
> it works effectively.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>

I don't think even that works. I think what Jason suggested (going
through the text import wizard -- which does not always launch if you
just open the CSV file since Excel thinks it knows how to handle it --
and specifying to treat the column as text) is the only way to be
sure.

Andrew

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



[PHP] Re: where to make observations about current PHP manual?

2010-03-19 Thread Robert P. J. Day
On Fri, 19 Mar 2010, Shawn McKenzie wrote:

> Robert P. J. Day wrote:
> >  i don't see a separate mailing list for documentation so is this
> > where i would point at oddities in the manual?  as in, here:
> >
> > http://www.php.net/manual/en/language.variables.external.php
> >
> > we read:
> >
> > "// Unavailable since PHP 6."
> >
> > that just looks weird, no?
> >
> > rday
>
> $HTTP_POST_VARS was the way to access post vars in PHP before 4.1.
> Since then it is $_POST, and $HTTP_POST_VARS is only available if
> you set register_long_arrays = On in php.ini.  As of PHP 6
> $HTTP_POST_VARS will not be available, you must use $_POST.

  i'm not sure that addresses my post -- it doesn't make grammatical
sense to state that something is unavailable "since" something that is
yet to be officially released.

rday
--



Robert P. J. Day   Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday


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



Re: [PHP] where to make observations about current PHP manual?

2010-03-19 Thread Daniel Brown
On Fri, Mar 19, 2010 at 16:59, Robert P. J. Day  wrote:
>
>  i don't see a separate mailing list for documentation so is this
> where i would point at oddities in the manual?  as in, here:
>
> http://www.php.net/manual/en/language.variables.external.php
>
> we read:
>
> "// Unavailable since PHP 6."
>
> that just looks weird, no?

Indeed.  It would probably be better to read, "Unavailable as of
PHP 6."  I'll patch that in the XML sources now, and the next time the
manual rebuilds, the changes will take effect.

For the future, please report such things as Documentation
Problems at http://bugs.php.net/.

Thanks for the report, Rob!

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Looking for hosting or dedicated servers?  Ask me how we can fit your budget!

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



Re: [PHP] Re: where to make observations about current PHP manual?

2010-03-19 Thread Daniel Brown
On Fri, Mar 19, 2010 at 20:57, Robert P. J. Day  wrote:
>
>  i'm not sure that addresses my post -- it doesn't make grammatical
> sense to state that something is unavailable "since" something that is
> yet to be officially released.

In most cases, you'd be absolutely correct but PHP is a
developer-focused open source project, so some folks in the community
do use PHP 6.  If you'd like to be one of them, we'd certainly welcome
the extra help in finding and reporting bugs!  You can always download
the latest snapshot builds at:

http://snaps.php.net/

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Looking for hosting or dedicated servers?  Ask me how we can fit your budget!

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



Re: [PHP] where to make observations about current PHP manual?

2010-03-19 Thread Daniel Brown
On Fri, Mar 19, 2010 at 21:04, Daniel Brown  wrote:
>
>    Indeed.  It would probably be better to read, "Unavailable as of
> PHP 6."  I'll patch that in the XML sources now, and the next time the
> manual rebuilds, the changes will take effect.

Future builds will appear as hinted in the following SVN commit log:

http://news.php.net/php.doc.cvs/6235

Thanks again for the suggestion, Rob.

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Looking for hosting or dedicated servers?  Ask me how we can fit your budget!

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



Fwd: Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Nilesh Govindarajan

On 03/20/2010 02:31 AM, Michael A. Peters wrote:

Mattias Thorslund wrote:

Robert P. J. Day wrote:

(just a warning -- as a relative newbie to PHP, i'll probably have
the occasional dumb question. just humour me.)

i'm looking at some existing PHP code that accesses a mysql 5.0 db,
and it's coded using the mysql-specific calls: mysql_connect,
mysql_select_db, etc, etc.

is there any reason i *wouldn't* want to rewrite that code using the
more general PEAR DB module, and use mysqli? certainly, as i read it,
using the PEAR DB module would make it easier down the road if i
suddenly decide to change the DB backend.

anyway, any compelling arguments for or against?

rday
--


Well, the reason you shouldn't use PEAR DB in a new project is that
it's being deprecated. MDB2 is the PEAR successor, and does provide
emulation for some features that don't exist on all database
platforms, such as LastInsertID. It can also help you convert your
database from one platform to another, since it also provides methods
for detecting and managing the database structure itself (the Manager
and Reverse modules).

That said, if I were to start a new project at this time, I would look
closer at whether PDO fits my needs.


I use MDB2.
I hear PDO hyped a lot, what does it really give me that MDB2 does not,
other than making the application dependent upon a binary module?



binary module makes a lot of difference. If you use MDB2, the
interpreter has to compile MDB2's code along with your program logic.
Whereas PDO is already compiled one, so it will do the job much much faster.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com

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



Fwd: Re: [PHP] php compile / configure options

2010-03-19 Thread Nilesh Govindarajan

On 03/20/2010 03:16 AM, Gregory Machin wrote:

Hi
I'm setting up a development environment that runs multiple versions of php.
I'm looking a list of the compile option options for each php release
other than "./configure --help" with more detail on what each option
does.
Any suggestions welcome .

Thank you.



Its unclear what you want. This mailing list is not get ready made
things, but to get already made things fixed so that they do not produce
errors.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com

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



Re: Fwd: Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Michael A. Peters

Nilesh Govindarajan wrote:

On 03/20/2010 02:31 AM, Michael A. Peters wrote:

Mattias Thorslund wrote:

Robert P. J. Day wrote:

(just a warning -- as a relative newbie to PHP, i'll probably have
the occasional dumb question. just humour me.)

i'm looking at some existing PHP code that accesses a mysql 5.0 db,
and it's coded using the mysql-specific calls: mysql_connect,
mysql_select_db, etc, etc.

is there any reason i *wouldn't* want to rewrite that code using the
more general PEAR DB module, and use mysqli? certainly, as i read it,
using the PEAR DB module would make it easier down the road if i
suddenly decide to change the DB backend.

anyway, any compelling arguments for or against?

rday
--


Well, the reason you shouldn't use PEAR DB in a new project is that
it's being deprecated. MDB2 is the PEAR successor, and does provide
emulation for some features that don't exist on all database
platforms, such as LastInsertID. It can also help you convert your
database from one platform to another, since it also provides methods
for detecting and managing the database structure itself (the Manager
and Reverse modules).

That said, if I were to start a new project at this time, I would look
closer at whether PDO fits my needs.


I use MDB2.
I hear PDO hyped a lot, what does it really give me that MDB2 does not,
other than making the application dependent upon a binary module?



binary module makes a lot of difference. If you use MDB2, the
interpreter has to compile MDB2's code along with your program logic.
Whereas PDO is already compiled one, so it will do the job much much 
faster.




So since I already cash my db requests via APC the benefits to me would 
be small.


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



Re: Fwd: Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Nilesh Govindarajan

On 03/20/2010 07:50 AM, Michael A. Peters wrote:

Nilesh Govindarajan wrote:

On 03/20/2010 02:31 AM, Michael A. Peters wrote:

Mattias Thorslund wrote:

Robert P. J. Day wrote:

(just a warning -- as a relative newbie to PHP, i'll probably have
the occasional dumb question. just humour me.)

i'm looking at some existing PHP code that accesses a mysql 5.0 db,
and it's coded using the mysql-specific calls: mysql_connect,
mysql_select_db, etc, etc.

is there any reason i *wouldn't* want to rewrite that code using the
more general PEAR DB module, and use mysqli? certainly, as i read it,
using the PEAR DB module would make it easier down the road if i
suddenly decide to change the DB backend.

anyway, any compelling arguments for or against?

rday
--


Well, the reason you shouldn't use PEAR DB in a new project is that
it's being deprecated. MDB2 is the PEAR successor, and does provide
emulation for some features that don't exist on all database
platforms, such as LastInsertID. It can also help you convert your
database from one platform to another, since it also provides methods
for detecting and managing the database structure itself (the Manager
and Reverse modules).

That said, if I were to start a new project at this time, I would look
closer at whether PDO fits my needs.


I use MDB2.
I hear PDO hyped a lot, what does it really give me that MDB2 does not,
other than making the application dependent upon a binary module?



binary module makes a lot of difference. If you use MDB2, the
interpreter has to compile MDB2's code along with your program logic.
Whereas PDO is already compiled one, so it will do the job much much
faster.



So since I already cash my db requests via APC the benefits to me would
be small.


Yeah the use of APC or Xcache, etc. would not make any difference 
between PDO and MDB2 in terms of performance.


--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com

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



Re: [PHP] php compile / configure options

2010-03-19 Thread Simon J Welsh
On 20/03/2010, at 10:46 AM, Gregory Machin wrote:

> Hi
> I'm setting up a development environment that runs multiple versions of php.
> I'm looking a list of the compile option options for each php release
> other than "./configure --help" with more detail on what each option
> does.
> Any suggestions welcome .
> 
> Thank you.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

From http://php.net/install.unix:

"The initial PHP setup and configuration process is controlled by the use of 
the command line options of the configure script. You could get a list of all 
available options along with short explanations running ./configure --help. Our 
manual documents the different options separately. You will find the core 
options in the appendix , while the different 
extension specific options are descibed on the reference pages."

---
Simon Welsh
Admin of http://simon.geek.nz/

Who said Microsoft never created a bug-free program? The blue screen never, 
ever crashes!

http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e





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



Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Paul M Foster
On Fri, Mar 19, 2010 at 10:13:54PM +, Ashley Sheridan wrote:



> 
> It's not really just that. In the csv format, a field value of 00123 (I don't
> really know what zip code formats are) is perfectly valid. 

ZIP codes are simply five digits. The starting digit (0-9) identifies a
broad region of the country. The beginning 3-digit sequence identifies a
major processing center. A full 5-digit ZIP code can encompass a few
blocks or hundreds of square kilometers, depending on the density of
addresses (population). ZIPs ending in 98 or 99 are often reserved for
the Post Office itself.

Fascinating, huh? ;-}

Paul

-- 
Paul M. Foster

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



Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Paul M Foster
On Fri, Mar 19, 2010 at 06:01:38PM -0400, Jason Pruim wrote:



>
> But if you have a decent CASS software then it should add the zip back
> in hehe :)

For the sake of those in Europe and elsewhere, CASS software is software
certified by the US Postal Service which cleans up addresses to conform
to what the Post Office wants them to look like, including adding
correct ZIP codes where possible. There is an additional kind of
software, called PAVE software, which sorts mailing lists into proper
groupings for simple delivery by the Post Office.

Paul

-- 
Paul M. Foster

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