Re: [PHP-DEV] md5sum() patch
Stig S. Bakken wrote: +1 on md5_file(). Who is the mantainer of the standard extension? I have the corrected patch. -- Alessandro 'Asterix75' Astarita [EMAIL PROTECTED] Web site: http://asterix75.capri.it E-commerce software: http://www.alfacomm.it/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
Hello Alessandro, just mail it to me, I'll apply it for you. Derick On Sun, 18 Nov 2001, Alessandro Astarita wrote: Stig S. Bakken wrote: +1 on md5_file(). Who is the mantainer of the standard extension? I have the corrected patch. -- Alessandro 'Asterix75' Astarita [EMAIL PROTECTED] Web site: http://asterix75.capri.it E-commerce software: http://www.alfacomm.it/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
shouldnt it be file_md5 if we are sticking with out namespace convention. - James - Original Message - From: Chris Newbill [EMAIL PROTECTED] To: PHP DEV [EMAIL PROTECTED] Sent: Friday, November 16, 2001 5:57 AM Subject: RE: [PHP-DEV] md5sum() patch Nahh I think md5_file() isn't very good. However, overloading md5() doesn't really seem like a good idea either. md5sum() is pretty appropriate, anybody who is going to use this function is probably going to be familiar with the md5sum program. Plus md5sum() is fewer keystrokes. ;) -Chris -Original Message- From: Markus Fischer [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 15, 2001 1:10 PM To: Hartmut Holzgraefe Cc: Lenar Lõhmus; [EMAIL PROTECTED] Subject: Re: [PHP-DEV] md5sum() patch On Thu, Nov 15, 2001 at 09:37:22PM +0100, Hartmut Holzgraefe wrote : Lenar Lõhmus wrote: Alessandro Astarita wrote: Il 17:25, giovedì 15 novembre 2001, [EMAIL PROTECTED] ha scritto: Then this will do the same: $sum = `md5sum filename`; Do I have to depends on the external executable? ...in my opinion is not the right way. +1 to the function hm, what about just overloading the current md5 function? if given a string - current behavior if given a file handle resource - read file and return sum -1 on that (+1 on md5_file() ) You want your code look like $f = fopen('filename'); $md5sum = md5($f); fclose($f); than $m45sum = md5_file($f); ? No seriously I hope ;) - Markus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
On Fri, Nov 16, 2001 at 11:00:02AM -, James Moore wrote: shouldnt it be file_md5 if we are sticking with out namespace convention. i think james is right: +1 on file_md5 -1 on overloading tc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
[EMAIL PROTECTED] wrote: On Thu, 15 Nov 2001, Alessandro Astarita wrote: In this way you load in memory all the file contents and then you hash it. It's not the same. My function is the php version of the md5sum utility that you can find at example in Linux (textutils package). Then this will do the same: $sum = `md5sum filename`; This is as good as never an argument for not including a new function. We want PHP to remain portable, don't we? +1 on md5_file(). - Stig -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
Hello, we already have md5() as a function. md5sum() will then be the same as: echo md5(join (, file (filename))); do you really think this new function is needed? And I think that the name is not very well chosen either... regards, Derick On Thu, 15 Nov 2001, Alessandro Astarita wrote: I have added md5sum() function to the standard extension. It returns the md5 hash of given filename. I think this is useful. Can you merge it in the main distribution? -- Alessandro 'Asterix75' Astarita [EMAIL PROTECTED] Web site: http://asterix75.capri.it E-commerce software: http://www.alfacomm.it/ Derick Rethans - PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED] SRM: Site Resource Manager - www.vl-srm.net - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
Il 16:28, giovedì 15 novembre 2001, Derick Rethans ha scritto: we already have md5() as a function. md5sum() will then be the same as: echo md5(join (, file (filename))); In this way you load in memory all the file contents and then you hash it. It's not the same. My function is the php version of the md5sum utility that you can find at example in Linux (textutils package). -- Alessandro 'Asterix75' Astarita [EMAIL PROTECTED] Web site: http://asterix75.capri.it E-commerce software: http://www.alfacomm.it/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
On Thu, 15 Nov 2001, Alessandro Astarita wrote: In this way you load in memory all the file contents and then you hash it. It's not the same. My function is the php version of the md5sum utility that you can find at example in Linux (textutils package). Then this will do the same: $sum = `md5sum filename`; Derick -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
Il 17:25, giovedì 15 novembre 2001, [EMAIL PROTECTED] ha scritto: Then this will do the same: $sum = `md5sum filename`; Do I have to depends on the external executable? ...in my opinion is not the right way. -- Alessandro 'Asterix75' Astarita [EMAIL PROTECTED] Web Site: http://asterix75.capri.it Unix IS user friendly. It's just selective about who its friends are -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
On Thu, 15 Nov 2001 17:25:24 +0100 (CET), [EMAIL PROTECTED] wrote: On Thu, 15 Nov 2001, Alessandro Astarita wrote: In this way you load in memory all the file contents and then you hash it. It's not the same. My function is the php version of the md5sum utility that you can find at example in Linux (textutils package). Then this will do the same: $sum = `md5sum filename`; I think it would be much nicer to have such a function in the PHP core, than always executing an external program. - Martin -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
Then this will do the same: $sum = `md5sum filename`; Yes it will, but only if you have safe-mode disabled, and you're running Unix or Linux. +1 for adding this function. Sander -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
Alessandro Astarita wrote: Il 17:25, giovedì 15 novembre 2001, [EMAIL PROTECTED] ha scritto: Then this will do the same: $sum = `md5sum filename`; Do I have to depends on the external executable? ...in my opinion is not the right way. +1 to the function -- Lenar Lõhmus Vision Group -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
Lenar Lõhmus wrote: Alessandro Astarita wrote: Il 17:25, giovedì 15 novembre 2001, [EMAIL PROTECTED] ha scritto: Then this will do the same: $sum = `md5sum filename`; Do I have to depends on the external executable? ...in my opinion is not the right way. +1 to the function hm, what about just overloading the current md5 function? if given a string - current behavior if given a file handle resource - read file and return sum ? -- Hartmut Holzgraefe [EMAIL PROTECTED] http://www.six.de +49-711-99091-77 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
On Thu, 15 Nov 2001, Hartmut Holzgraefe wrote: Lenar Lõhmus wrote: hm, what about just overloading the current md5 function? if given a string - current behavior if given a file handle resource - read file and return sum That is a possibility, better then having a new function. Although it makes it a bit obscure IMO. But I can live with it :) Derick -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
On Thu, 15 Nov 2001, [EMAIL PROTECTED] wrote: That is a possibility, better then having a new function. Although it makes it a bit obscure IMO. But I can live with it :) Why is it better than having a new function? What's wrong with having a new function? Name it md5_file() and it's pretty clear what it does. -Andrei * Programming is an art form that fights back. * -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
Andrei Zmievski wrote: Why is it better than having a new function? because i realy like function overloading ;) -- Hartmut Holzgraefe [EMAIL PROTECTED] http://www.six.de +49-711-99091-77 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
On Thu, 15 Nov 2001, Hartmut Holzgraefe wrote: because i realy like function overloading ;) I need to use some holy water on you. -Andrei A room without books is like a body without a soul. -- Marcus Tullius Cicero (106-43 B.C.) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
On Thu, Nov 15, 2001 at 09:37:22PM +0100, Hartmut Holzgraefe wrote : Lenar Lõhmus wrote: Alessandro Astarita wrote: Il 17:25, giovedì 15 novembre 2001, [EMAIL PROTECTED] ha scritto: Then this will do the same: $sum = `md5sum filename`; Do I have to depends on the external executable? ...in my opinion is not the right way. +1 to the function hm, what about just overloading the current md5 function? if given a string - current behavior if given a file handle resource - read file and return sum -1 on that (+1 on md5_file() ) You want your code look like $f = fopen('filename'); $md5sum = md5($f); fclose($f); than $m45sum = md5_file($f); ? No seriously I hope ;) - Markus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
On Thu, 15 Nov 2001, Markus Fischer wrote: $m45sum = md5_file($f); I guess you probably meant this: $md5sum = md5_file('filename'); Joao -- João Prado Maia [EMAIL PROTECTED] http://phpbrasil.com - php com um jeitinho brasileiro -- Precisando de consultoria em desenvolvimento para a Internet ? Impleo.net - http://impleo.net/?lang=br -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
On Thu, Nov 15, 2001 at 03:08:00PM -0500, Joao Prado Maia wrote : On Thu, 15 Nov 2001, Markus Fischer wrote: $m45sum = md5_file($f); I guess you probably meant this: $md5sum = md5_file('filename'); No. I refered to Hartmut who suggested: H if given a string - current behavior H if given a file handle resource - read file and return sum So $f = fopen('filename'); $md5sum = md5($f); fclose($f); actually would be what he wanted. Looks .. odd to me ;) - Markus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] md5sum() patch
Forget the message, finally managed to confuse myself ^_^ Joao, you were of course right. - Markus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DEV] md5sum() patch
Nahh I think md5_file() isn't very good. However, overloading md5() doesn't really seem like a good idea either. md5sum() is pretty appropriate, anybody who is going to use this function is probably going to be familiar with the md5sum program. Plus md5sum() is fewer keystrokes. ;) -Chris -Original Message- From: Markus Fischer [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 15, 2001 1:10 PM To: Hartmut Holzgraefe Cc: Lenar Lõhmus; [EMAIL PROTECTED] Subject: Re: [PHP-DEV] md5sum() patch On Thu, Nov 15, 2001 at 09:37:22PM +0100, Hartmut Holzgraefe wrote : Lenar Lõhmus wrote: Alessandro Astarita wrote: Il 17:25, giovedì 15 novembre 2001, [EMAIL PROTECTED] ha scritto: Then this will do the same: $sum = `md5sum filename`; Do I have to depends on the external executable? ...in my opinion is not the right way. +1 to the function hm, what about just overloading the current md5 function? if given a string - current behavior if given a file handle resource - read file and return sum -1 on that (+1 on md5_file() ) You want your code look like $f = fopen('filename'); $md5sum = md5($f); fclose($f); than $m45sum = md5_file($f); ? No seriously I hope ;) - Markus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]