php-general Digest 9 Jul 2008 13:45:53 -0000 Issue 5559
php-general Digest 9 Jul 2008 13:45:53 - Issue 5559 Topics (messages 276476 through 276498): Re: What font/size do you use for programming? 276476 by: Robert Cummings 276480 by: Shawn McKenzie 276481 by: Sancar Saran 276482 by: Per Jessen 276483 by: Aschwin Wesselius 276490 by: Robin Vickery 276491 by: Jason Pruim PDOStatement - dump params to log after binding 276477 by: Radek Zajkowski Re: Question before I end up writing alot of extra code... 276478 by: VamVan 276479 by: VamVan Re: Creating zip files 276484 by: Pavel mount 276485 by: Mário Gamito 276489 by: Maxim Antonov test 276486 by: willyam pax 276497 by: Thiago Melo de Paula to get time 276487 by: willyam pax 276495 by: Per Jessen 276496 by: Shelley Need help with regular expression 276488 by: Maxim Antonov checking if URL's exist 276492 by: cr.vegelin.gmail.com 276493 by: Børge Holen 276494 by: Maxim Antonov Re: PHP code will not work 276498 by: Mike V Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- On Tue, 2008-07-08 at 21:35 -0400, Robert Cummings wrote: On Tue, 2008-07-08 at 16:28 -0700, Jim Lucas wrote: tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd Courier New 10pt w/ClearType Enabled @ 1680x1050 with a 22in wide screen aterm - -adobe-courier-medium-r-normal-*-*-140-*-*-m-*-iso8859-1 gnome-terminal - Courier New 14 rxvt-unicode - xft:Luxi Mono:pixelsize=16 I should probably mention I usually have terminal background transparency enabled with shading set to 20 (80% black), and gray default text colour. Additionally, I do custom set my ls colours and syntax highlighting :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message--- ---BeginMessage--- tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd Font: Agent Orange Size: 64pt 19 Westinghouse flatscreen. My wife bought it for me 2 Christmases ago, this weekend she got a widescreen Samsung :-( -Shawn ---End Message--- ---BeginMessage--- On Wednesday 09 July 2008 02:23:49 tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd Monospace 9 regular 22inch wide screen 1680x1050 on linux. ---End Message--- ---BeginMessage--- Sancar Saran wrote: On Wednesday 09 July 2008 02:23:49 tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd Monospace 9 regular 22inch wide screen 1680x1050 on linux. Same here, except 10pt monospace. /Per Jessen, Zürich ---End Message--- ---BeginMessage--- tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd 6pt Terminal font on Windows, using UltraEdit on a 22 Dell flatscreen. I'd rather use Linux and probably monospace as small as possible. In PuTTY I use 6pt Proggy's OptiSmall to hack away in Nano on the commandline. -- Aschwin Wesselius /'What you would like to be done to you, do that to the other'/ ---End Message--- ---BeginMessage--- 2008/7/9 Aschwin Wesselius [EMAIL PROTECTED]: tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd 6pt Terminal font on Windows, using UltraEdit on a 22 Dell flatscreen. I'd rather use Linux and probably monospace as small as possible. In PuTTY I use 6pt Proggy's OptiSmall to hack away in Nano on the commandline. Wow! I know a Windows 6pt is bigger than the rest of the world's 6pt, but still... I use 14pt Terminus on Linux. I use the same font in terminals (xfce4-terminal), editors (vim and emacs)
Re: [PHP] What font/size do you use for programming?
On Wednesday 09 July 2008 02:23:49 tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd Monospace 9 regular 22inch wide screen 1680x1050 on linux. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
Sancar Saran wrote: On Wednesday 09 July 2008 02:23:49 tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd Monospace 9 regular 22inch wide screen 1680x1050 on linux. Same here, except 10pt monospace. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd 6pt Terminal font on Windows, using UltraEdit on a 22 Dell flatscreen. I'd rather use Linux and probably monospace as small as possible. In PuTTY I use 6pt Proggy's OptiSmall to hack away in Nano on the commandline. -- Aschwin Wesselius /'What you would like to be done to you, do that to the other'/
Re: [PHP] Creating zip files
В сообщении от Wednesday 09 July 2008 01:22:32 Eric Butera написал(а): [1] http://us2.php.net/manual/en/ref.zip.php Thank you for this link! -- === С уважением, Манылов Павел aka [R-k] icq: 949-388-0 mailto:[EMAIL PROTECTED] === А ещё говорят так: Родился сам - помоги другому. -- Неизвестный автор [fortune]
[PHP] mount
Hi, I need to perform a mount and a umount from PHP. I've searched the manual, but didn't find anything useful. Any ideas ? Any help would be appreciated. Warm Regards, Mário Gamito -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] test
test -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] to get time
hello im still new to php i just want to know how can u get the only the time of ur local server -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mount
Hello, Mário You may use function system! system('mount -t vfat -o rw /dev/hdb1 /home/www/upload',$err); if($err){ echo We have error with number {$err}; } Mário Gamito : Hi, I need to perform a mount and a umount from PHP. I've searched the manual, but didn't find anything useful. Any ideas ? Any help would be appreciated. Warm Regards, Mário Gamito -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
2008/7/9 Aschwin Wesselius [EMAIL PROTECTED]: tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd 6pt Terminal font on Windows, using UltraEdit on a 22 Dell flatscreen. I'd rather use Linux and probably monospace as small as possible. In PuTTY I use 6pt Proggy's OptiSmall to hack away in Nano on the commandline. Wow! I know a Windows 6pt is bigger than the rest of the world's 6pt, but still... I use 14pt Terminus on Linux. I use the same font in terminals (xfce4-terminal), editors (vim and emacs) and non-work email (gmail with the aid of firefox's 'stylish' extension). -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
On Jul 9, 2008, at 5:25 AM, Robin Vickery wrote: 2008/7/9 Aschwin Wesselius [EMAIL PROTECTED]: tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd I use Monaco 10 PT always served me well in Xcode :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 11287 James St Holland, MI 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] checking if URL's exist
Hi All, I have a Directory table with hundreds of URL's to sites and want to check periodically if all the URL's still exist. Does anyone know of a utility to check this ? Or a pointer to a piece of code ... TIA, Cor
Re: [PHP] checking if URL's exist
On Wednesday 09 July 2008 12:18:27 [EMAIL PROTECTED] wrote: Hi All, I have a Directory table with hundreds of URL's to sites and want to check periodically if all the URL's still exist. Does anyone know of a utility to check this ? Or a pointer to a piece of code ... TIA, Cor ping whois traceroute ... and a lot more -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] checking if URL's exist
You need $s= fsockopen('host.com',80); fwrite($s,GET .$URL. HTTP/1.1 \r\n); fwrite($s,Host: host.com \r\n\r\n); and you must read first string - if url exists string begining with 200 or 304 if url not exists string begin - is 404 Børge Holen пишет: On Wednesday 09 July 2008 12:18:27 [EMAIL PROTECTED] wrote: Hi All, I have a Directory table with hundreds of URL's to sites and want to check periodically if all the URL's still exist. Does anyone know of a utility to check this ? Or a pointer to a piece of code ... TIA, Cor ping whois traceroute ... and a lot more -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] to get time
willyam pax wrote: hello im still new to php i just want to know how can u get the only the time of ur local server Take a look at date() and time(). /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] to get time
Or date(), such as date('Y-m-d H:i:s'); On Wed, Jul 9, 2008 at 6:29 PM, Per Jessen [EMAIL PROTECTED] wrote: willyam pax wrote: hello im still new to php i just want to know how can u get the only the time of ur local server Take a look at date() and time(). /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Regards, Shelley http://phparch.cn Shelley
[PHP] test
test -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP code will not work
I had this problem and just figured it out. I was copying and pasting the code snippet from the tutorials page to my test editor and in the process picked up an invisible ctrl char. Doh!! Joseph Subida wrote: The error I get when I try ?php echo $_SERVER['HTTP_USER_AGENT']; ? is Parse error: syntax error, unexpected T_VARIABLE in /Library/WebServer/Documents/test.php on line 106 I tried Googling T_VARIABLE and haven't found any useful solutions. Any ideas? Thanks! -J.C. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- View this message in context: http://www.nabble.com/PHP-code-will-not-work-tp17811807p18362005.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Running mount from PHP
Hi, I'm trying to run /bin/mount and /sbin/mount.cifs from a PHP page. So, I´ve added this to /etc/sudoers: - Cmnd_AliasCMD_MOUNT = /bin/mount Cmnd_AliasCMD_CIFS ) = /sbin/mount.cifs nobody ALL = NOPASSWD: CMD_MOUNT nobody ALL = NOPASSWD: CMD_CIFS - Problem is that I need to run it from PHP and in this way, it doesn't mount. I'm using PHP's exec function: exec(sudo mount -t cifs ...) I have the ownership and permissions of the mount point set correctly. As it is a dynamic application, the mount point always changes (/mnt/user1, /mnt/user2, etc.), so, /etc/fstab is not an option :( Any ideas ? Warm Regards, Mário Gamito -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Running mount from PHP
Mário Gamito wrote: Hi, I'm trying to run /bin/mount and /sbin/mount.cifs from a PHP page. So, I´ve added this to /etc/sudoers: - Cmnd_AliasCMD_MOUNT = /bin/mount Cmnd_AliasCMD_CIFS ) = /sbin/mount.cifs nobody ALL = NOPASSWD: CMD_MOUNT nobody ALL = NOPASSWD: CMD_CIFS - Problem is that I need to run it from PHP and in this way, it doesn't mount. I'm using PHP's exec function: exec(sudo mount -t cifs ...) I have the ownership and permissions of the mount point set correctly. As it is a dynamic application, the mount point always changes (/mnt/user1, /mnt/user2, etc.), so, /etc/fstab is not an option :( Any ideas ? Which user are you running your script with? wwwrun? /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
On Jul 8, 2008, at 6:23 PM, tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd 15 MacBook Pro, 1440 x 900. TextMate, black bg, Monaco 12pt, anti-aliased. tedd, if you want a really great text editor, consider TextMate. Read more at their site - http://macromates.com/. ~Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Running mount from PHP
Try to do folowing write shell script #!/bin/sh mount /dev/hdb /home/mountpoint then write C code int main(){ system (mount.sh); return 0; } then compile C code gcc main.c -o wrapper then chmod : # chmod a+s wrapper and do from php: system ('wrapper'); Per Jessen пишет: Mário Gamito wrote: Hi, I'm trying to run /bin/mount and /sbin/mount.cifs from a PHP page. So, I´ve added this to /etc/sudoers: - Cmnd_AliasCMD_MOUNT = /bin/mount Cmnd_AliasCMD_CIFS ) = /sbin/mount.cifs nobody ALL = NOPASSWD: CMD_MOUNT nobody ALL = NOPASSWD: CMD_CIFS - Problem is that I need to run it from PHP and in this way, it doesn't mount. I'm using PHP's exec function: exec(sudo mount -t cifs ...) I have the ownership and permissions of the mount point set correctly. As it is a dynamic application, the mount point always changes (/mnt/user1, /mnt/user2, etc.), so, /etc/fstab is not an option :( Any ideas ? Which user are you running your script with? wwwrun? /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
On Tue, Jul 8, 2008 at 7:23 PM, tedd [EMAIL PROTECTED] wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? It had no name before, but now it's commonly called 8pt FIXEDSYS (in this case, on a triple-headed display running 1600x1280x1 + 1024x768x2). Standard Vim on CLI with XTerm enabled, *NIX systems all the way. When I'm forced to use Winblows, I use PuTTY and tunnel to a *NIX CLI or drop to a Cygwin shell or live install from my little 2GB flash, but still use FIXEDSYS. I'm one of those weird old-schoolers who prefers to do everything from the command line rather than the GUI. Many times, I even use a self-written CLI program to read and write email --- including to this list --- so that I don't have to touch the mouse. Because I'm afraid it's going to bite me. -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CURL and ASP
On Wed, Jul 9, 2008 at 9:35 AM, ioannes [EMAIL PROTECTED] wrote: Has anyone here experience of CURLing .asp pages which use session cookies as I am having difficulty doing so on two different sites, both asp. Forwarded to PHP-General, John. If you're not already subscribed there, please subscribe to continue to follow this thread. If you're referring to using cURL from PHP to grab or spider pages written in ASP on a remote server, no, I've had no problems at all. In fact, once the content is served on the web, server-side language matters nil. It all comes out in the standard HTML/JavaScript/etc. format, and all HTTP policies and procedures (such as session handling) are [pretty-much] universal. -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
On Tue, Jul 8, 2008 at 7:23 PM, tedd [EMAIL PROTECTED] wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? 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 Courier New, 9pt with PhpEd -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life.
Re: [PHP] checking if URL's exist
On Wed, Jul 9, 2008 at 6:18 AM, [EMAIL PROTECTED] wrote: Hi All, I have a Directory table with hundreds of URL's to sites and want to check periodically if all the URL's still exist. Does anyone know of a utility to check this ? Or a pointer to a piece of code ... TIA, Cor ?php // $urls = Your array of URLs foreach($urls as $u) { if(file_get_contents($u)) { echo $u. appears to exist.\n; } else { echo $u. does not appear to exist.\n; } } ? -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need help with regular expression
On Wed, Jul 9, 2008 at 5:21 AM, Maxim Antonov [EMAIL PROTECTED] wrote: Hi, all! I try to use folowing regular expression: $out = preg_replace('#\{%%%.*?\{%bigfoto%\}.*?%%%\}#is','==REPLACEMENT==',$str); [snip!] I need result as: trtdNAME:/tdtdinput type=text name=name value= size=80//td/tr trtdFoto:/tdtdinput type=file name=foto value={%foto%} / {%%%br/img alt={%name%} src={%foto%}/%%%} /td/tr ==REPLACEMENT== [snip!] To get it *exactly* as you've mentioned here, use this instead: ?php $out = preg_replace('/trtdBig.*\{%%%.*\{%bigfoto%\}.*%%%\}.*\/tr/Uis','==REPLACEMENT==',$str); ? -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
triple-headed display That's just greedy. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Check if var content was exceeded (float).
-- Powered by Outblaze -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
On Tue, Jul 08, 2008 at 07:23:49PM -0400, tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Monospace 9pt in Eclipse+PDT. Greetings Mario -- -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS/CM d- s++: a+ C$ UBL*$ P++ L+++ E--- W+++ N+ o-- K- w O- M- V-- PS++ PE++ Y PGP+++ t--- 5 X R++ tv- b+++ DI D G++ e* h r+++ y --END GEEK CODE BLOCK-- signature.asc Description: Digital signature
Re: [PHP] What font/size do you use for programming?
At 5:13 PM +0100 7/9/08, Richard Heyes wrote: triple-headed display That's just greedy. -- Richard Heyes I use a triple display as well. My desktop is 3840 x 1024 -- and I use every inch of it. 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] Check if var content was exceeded (float).
No, it wasn't but whew! That was a close one! -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
I use a triple display as well. My desktop is 3840 x 1024 -- and I use every inch of it. And here I am with one paltry monitor. :-( -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] C Bindings?
Hi there, I want to make a set of PHP bindings for the libvirt(.org) C API. Can anyone point me to how tos, information or software that would help me along the way? Thanks, Henri -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
On Wed, Jul 9, 2008 at 1:19 PM, Richard Heyes [EMAIL PROTECTED] wrote: And here I am with one paltry monitor. :-( I now view you as less of a man, Heyes. ;-P -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: What font/size do you use for programming?
At 11:54 PM -0500 7/8/08, Shawn McKenzie wrote: Font: Agent Orange Size: 64pt 64pt! And I thought I my eyesight was poor at 14pt. 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] What font/size do you use for programming?
On Wed, 2008-07-09 at 18:19 +0100, Richard Heyes wrote: I use a triple display as well. My desktop is 3840 x 1024 -- and I use every inch of it. And here I am with one paltry monitor. :-( Those greedy bastids make me sick!!! I'll be back later, I hafta go spend my kids' college funds on 4 new monitors and some video cards. ;) 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] What font/size do you use for programming?
At 6:19 PM +0100 7/9/08, Richard Heyes wrote: I use a triple display as well. My desktop is 3840 x 1024 -- and I use every inch of it. And here I am with one paltry monitor. :-( As you get older, your monitors get larger. However, this is not necessarily a good thing. 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] What font/size do you use for programming?
At 1:27 PM -0400 7/9/08, Robert Cummings wrote: On Wed, 2008-07-09 at 18:19 +0100, Richard Heyes wrote: I use a triple display as well. My desktop is 3840 x 1024 -- and I use every inch of it. And here I am with one paltry monitor. :-( Those greedy bastids make me sick!!! I'll be back later, I hafta go spend my kids' college funds on 4 new monitors and some video cards. ;) Cheers, Rob. What I lack in programming skills, I make up in monitor size. I've found, if you can't wow clients with intellect, then distract them. :-) 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] What font/size do you use for programming?
I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? I prefer Monaco to Verdana - easier to distinguish 0 and O, etc. The font that came with Eudora, Mishawaka (or something like that) is also good, as is something called ProFont http://www.tobias-jung.de/seekingprofont/. -Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] C Bindings?
Hi there, I want to make a set of PHP bindings for the libvirt(.org) C API. Can anyone point me to how tos, information or software that would help me along the way? Thanks, Henri -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: What font/size do you use for programming?
tedd wrote: At 11:54 PM -0500 7/8/08, Shawn McKenzie wrote: Font: Agent Orange Size: 64pt 64pt! And I thought I my eyesight was poor at 14pt. Cheers, tedd Just kidding... Seriously, I just use what ever is default for the app I'm using. I used to use zend, now I use Aptana or kate for single files. -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] C Bindings?
On Wed, Jul 9, 2008 at 12:50 PM, Henri Cook [EMAIL PROTECTED] wrote: Hi there, I want to make a set of PHP bindings for the libvirt(.org) C API. Can anyone point me to how tos, information or software that would help me along the way?\ maybe scope out this book, http://www.amazon.com/Extending-Embedding-PHP-Developers-Library/dp/067232704X -nathan
Re: [PHP] What font/size do you use for programming?
On Jul 9, 2008, at 1:32 PM, tedd wrote: At 6:19 PM +0100 7/9/08, Richard Heyes wrote: I use a triple display as well. My desktop is 3840 x 1024 -- and I use every inch of it. And here I am with one paltry monitor. :-( As you get older, your monitors get larger. However, this is not necessarily a good thing. I may only have 1 monitor... But I have 12 Spaces (google apple spaces for more info) I used to have 2 monitors... I miss my other 19... Darn new boss! I need another new one... Who wants to hire me? :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 11287 James St Holland, MI 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] zippidity do duh!
Hi gang: I'm trying to do some zip stuff, but on server [1] my script hangs on: $zip = new ZipArchive(); No errors, no anything, it just hangs -- I assuming that ZipArchive is not available. --- However, on server [2] (Daniel Brown's most excellent service, btw), everything works great -- as is usual (every time I say something like this he gives me another month of free service). :-) I've done phpinfo's on both servers, but don't see any obvious differences. Outside of running my script on different servers to see if it works, is there anyway I can tell beforehand if ZipArchive is available or not? 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] zippidity do duh!
On 7/9/08, tedd [EMAIL PROTECTED] wrote: Hi gang: I'm trying to do some zip stuff, but on server [1] my script hangs on: $zip = new ZipArchive(); No errors, no anything, it just hangs -- I assuming that ZipArchive is not available. --- However, on server [2] (Daniel Brown's most excellent service, btw), everything works great -- as is usual (every time I say something like this he gives me another month of free service). :-) I've done phpinfo's on both servers, but don't see any obvious differences. Outside of running my script on different servers to see if it works, is there anyway I can tell beforehand if ZipArchive is available or not? Maybe something like http://us2.php.net/manual/en/function.get-loaded-extensions.php or http://us2.php.net/manual/en/function.extension-loaded.php ? David
Re: [PHP] zippidity do duh!
On Wed, Jul 9, 2008 at 1:43 PM, tedd [EMAIL PROTECTED] wrote: Hi gang: I'm trying to do some zip stuff, but on server [1] my script hangs on: $zip = new ZipArchive(); No errors, no anything, it just hangs -- I assuming that ZipArchive is not available. --- However, on server [2] (Daniel Brown's most excellent service, btw), everything works great -- as is usual (every time I say something like this he gives me another month of free service). :-) I've done phpinfo's on both servers, but don't see any obvious differences. Outside of running my script on different servers to see if it works, is there anyway I can tell beforehand if ZipArchive is available or not? if(class_exists('ZipArchive', false)) $zip = new ZipArchive(); else trigger_error('class ZipArchive does not exist!', E_USER_NOTICE); -nathan
Re: [PHP] What font/size do you use for programming?
On Wed, Jul 9, 2008 at 3:40 PM, Jason Pruim [EMAIL PROTECTED] wrote: I may only have 1 monitor... But I have 12 Spaces (google apple spaces for more info) Well, if you want to get *technical* on it, then I have 12 screens: 4 virtual desktops (KDE pager was around before Mac's Spaces) across three monitors. I just wish KDE+Compiz-Fusion worked on multi-headed displays. Not that it's necessary, but it's fun. -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
At 3:40 PM -0400 7/9/08, Jason Pruim wrote: On Jul 9, 2008, at 1:32 PM, tedd wrote: At 6:19 PM +0100 7/9/08, Richard Heyes wrote: I use a triple display as well. My desktop is 3840 x 1024 -- and I use every inch of it. And here I am with one paltry monitor. :-( As you get older, your monitors get larger. However, this is not necessarily a good thing. I may only have 1 monitor... But I have 12 Spaces (google apple spaces for more info) I used to have 2 monitors... I miss my other 19... Darn new boss! I need another new one... Who wants to hire me? :) Considering how much employers pay employees, it would make good sense to give employees the tools that would make them more productive. I claim that a programmers productivity would go up another 10% (or more), if they were allowed to have whatever size monitors they wanted. When you compare the cost of additional equipment against the cost for the employee, it becomes obvious where one should spend money in a company to increase productivity. Unfortunately, I worked with many a company (as a consultant) who's decision as to work environments depend upon some bean-counter who's vision/need for larger monitor(s) doesn't extend beyond his own spreadsheet. Oh well, those things are not obvious to everyone. :-) 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] zippidity do duh!
On Wed, Jul 9, 2008 at 3:43 PM, tedd [EMAIL PROTECTED] wrote: However, on server [2] (Daniel Brown's most excellent service, btw), everything works great -- as is usual (every time I say something like this he gives me another month of free service). :-) Yeah, and we're somewhere in 2011 or so now, I believe. I appreciate the compliments, but I can't afford to feed my wife and dog! P.S. - Dogs like food. P.P.S. - Debs likes food, too. -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
At 4:01 PM -0400 7/9/08, Daniel Brown wrote: On Wed, Jul 9, 2008 at 3:40 PM, Jason Pruim [EMAIL PROTECTED] wrote: I may only have 1 monitor... But I have 12 Spaces (google apple spaces for more info) Well, if you want to get *technical* on it, then I have 12 screens: 4 virtual desktops (KDE pager was around before Mac's Spaces) across three monitors. Well.. if this is one of those My monitor is bigger than yours! discussions, then when I programmed with rocks, I had all of the outdoors as my monitor -- beat that! 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] What font/size do you use for programming?
On Wed, Jul 9, 2008 at 4:19 PM, tedd [EMAIL PROTECTED] wrote: Well.. if this is one of those My monitor is bigger than yours! discussions, then when I programmed with rocks, I had all of the outdoors as my monitor -- beat that! /me forfeits. -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
On Wed, 2008-07-09 at 16:28 -0400, Daniel Brown wrote: On Wed, Jul 9, 2008 at 4:19 PM, tedd [EMAIL PROTECTED] wrote: Well.. if this is one of those My monitor is bigger than yours! discussions, then when I programmed with rocks, I had all of the outdoors as my monitor -- beat that! /me forfeits. As the master of my own reality, I'll let you guess what I use for my canvas ;) 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] What font/size do you use for programming?
On Wednesday 09 July 2008 19:32:10 tedd wrote: At 6:19 PM +0100 7/9/08, Richard Heyes wrote: I use a triple display as well. My desktop is 3840 x 1024 -- and I use every inch of it. And here I am with one paltry monitor. :-( As you get older, your monitors get larger. However, this is not necessarily a good thing. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Suckers... I got Powerbook 17 with the infamous 1px blue streak vertical line. Shit never even tried to use an external monitor on this one. ah for font size.. Whatever default Quanta got -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Action on 'Require' Fatal Error
Hello, is there a way to call a function or do a header(Location: page.php) when a fatal error is detected from using a the require statement Thanks Joe Harman
Re: [PHP] zippidity do duh!
On Wed, Jul 9, 2008 at 4:00 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: On Wed, Jul 9, 2008 at 1:43 PM, tedd [EMAIL PROTECTED] wrote: Hi gang: I'm trying to do some zip stuff, but on server [1] my script hangs on: $zip = new ZipArchive(); No errors, no anything, it just hangs -- I assuming that ZipArchive is not available. --- However, on server [2] (Daniel Brown's most excellent service, btw), everything works great -- as is usual (every time I say something like this he gives me another month of free service). :-) I've done phpinfo's on both servers, but don't see any obvious differences. Outside of running my script on different servers to see if it works, is there anyway I can tell beforehand if ZipArchive is available or not? if(class_exists('ZipArchive', false)) $zip = new ZipArchive(); else trigger_error('class ZipArchive does not exist!', E_USER_NOTICE); -nathan But it deals with classes therefore it must thrown an exception, right? ;D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What font/size do you use for programming?
At 4:32 PM -0400 7/9/08, Robert Cummings wrote: On Wed, 2008-07-09 at 16:28 -0400, Daniel Brown wrote: On Wed, Jul 9, 2008 at 4:19 PM, tedd [EMAIL PROTECTED] wrote: Well.. if this is one of those My monitor is bigger than yours! discussions, then when I programmed with rocks, I had all of the outdoors as my monitor -- beat that! /me forfeits. As the master of my own reality, I'll let you guess what I use for my canvas ;) Cheers, Rob. I would rather not. :-) 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] Action on 'Require' Fatal Error
On Wed, Jul 9, 2008 at 4:49 PM, Joe Harman [EMAIL PROTECTED] wrote: Hello, is there a way to call a function or do a header(Location: page.php) when a fatal error is detected from using a the require statement Thanks Joe Harman You can set up a custom error handler. This will intercept every single error and pass it to your function allowing you to do whatever you want. One thing to keep in mind though is that if there is a fatal error you're kinda in a hard spot since memory limits could have been hit, etc. I use this technique sometimes to include an error page (not header redirect to it). It won't help you on a parse error though. Luckily I use the PDT editor which has real-time parse error checking so I don't ever have that issue anyways. Another solution that I've seen Rasmus say is that you can start your script off with an error header and content and then if your script logic/whatever completes okay, set the header back to 200 and replace the error content with the real generated stuff. Good luck! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] zippidity do duh!
At 2:00 PM -0600 7/9/08, Nathan Nobbe wrote: if(class_exists('ZipArchive', false)) $zip = new ZipArchive(); else trigger_error('class ZipArchive does not exist!', E_USER_NOTICE); -nathan It works, (thanks) but no error is thrown if it's not there. 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
[PHP] Re: What font/size do you use for programming?
On Tue, 8 Jul 2008 19:23:49 -0400, tedd wrote: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? I've always found that my bash and php scripts run fastest when written in Nimbu Mono at 10 pt. Jonesy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] zippidity do duh!
On Wed, Jul 9, 2008 at 3:10 PM, Eric Butera [EMAIL PROTECTED] wrote: On Wed, Jul 9, 2008 at 4:00 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: On Wed, Jul 9, 2008 at 1:43 PM, tedd [EMAIL PROTECTED] wrote: Hi gang: I'm trying to do some zip stuff, but on server [1] my script hangs on: $zip = new ZipArchive(); No errors, no anything, it just hangs -- I assuming that ZipArchive is not available. --- However, on server [2] (Daniel Brown's most excellent service, btw), everything works great -- as is usual (every time I say something like this he gives me another month of free service). :-) I've done phpinfo's on both servers, but don't see any obvious differences. Outside of running my script on different servers to see if it works, is there anyway I can tell beforehand if ZipArchive is available or not? if(class_exists('ZipArchive', false)) $zip = new ZipArchive(); else trigger_error('class ZipArchive does not exist!', E_USER_NOTICE); -nathan But it deals with classes therefore it must thrown an exception, right? ;D only if you want to be able to detect the error from the calling code and do something as a result. i just put this there, mainly as an example :)
Re: [PHP] zippidity do duh!
On Wed, Jul 9, 2008 at 3:19 PM, tedd [EMAIL PROTECTED] wrote: At 2:00 PM -0600 7/9/08, Nathan Nobbe wrote: if(class_exists('ZipArchive', false)) $zip = new ZipArchive(); else trigger_error('class ZipArchive does not exist!', E_USER_NOTICE); -nathan It works, (thanks) but no error is thrown if it's not there. are you saying the trigger_error() isnt getting hit? could be an ini / .htaccess etc. issue. give die('class ZipArchive does not exist!'); a try or check the error_reporting configuration value in your php environment. -nathan
Re: [PHP] zippidity do duh!
At 4:37 PM -0600 7/9/08, Nathan Nobbe wrote: On Wed, Jul 9, 2008 at 3:19 PM, tedd mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: At 2:00 PM -0600 7/9/08, Nathan Nobbe wrote: if(class_exists('ZipArchive', false)) $zip = new ZipArchive(); else trigger_error('class ZipArchive does not exist!', E_USER_NOTICE); -nathan It works, (thanks) but no error is thrown if it's not there. are you saying the trigger_error() isnt getting hit? could be an ini / .htaccess etc. issue. give die('class ZipArchive does not exist!'); a try or check the error_reporting configuration value in your php environment. -nathan Yep, while the trigger_error() is being hit, nothing is being shown. The program goes right past it without failing and without anything happening. In other words, it acts the same as a //comment. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com
Re: [PHP] zippidity do duh!
On Wed, Jul 9, 2008 at 6:53 PM, tedd [EMAIL PROTECTED] wrote: At 4:37 PM -0600 7/9/08, Nathan Nobbe wrote: On Wed, Jul 9, 2008 at 3:19 PM, tedd mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: At 2:00 PM -0600 7/9/08, Nathan Nobbe wrote: if(class_exists('ZipArchive', false)) $zip = new ZipArchive(); else trigger_error('class ZipArchive does not exist!', E_USER_NOTICE); -nathan It works, (thanks) but no error is thrown if it's not there. are you saying the trigger_error() isnt getting hit? could be an ini / .htaccess etc. issue. give die('class ZipArchive does not exist!'); a try or check the error_reporting configuration value in your php environment. -nathan Yep, while the trigger_error() is being hit, nothing is being shown. The program goes right past it without failing and without anything happening. In other words, it acts the same as a //comment. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Well if display_errors is off, then that should be expected. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] zippidity do duh!
On Wed, Jul 9, 2008 at 4:56 PM, Eric Butera [EMAIL PROTECTED] wrote: On Wed, Jul 9, 2008 at 6:53 PM, tedd [EMAIL PROTECTED] wrote: At 4:37 PM -0600 7/9/08, Nathan Nobbe wrote: On Wed, Jul 9, 2008 at 3:19 PM, tedd mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: At 2:00 PM -0600 7/9/08, Nathan Nobbe wrote: if(class_exists('ZipArchive', false)) $zip = new ZipArchive(); else trigger_error('class ZipArchive does not exist!', E_USER_NOTICE); -nathan It works, (thanks) but no error is thrown if it's not there. are you saying the trigger_error() isnt getting hit? could be an ini / .htaccess etc. issue. give die('class ZipArchive does not exist!'); a try or check the error_reporting configuration value in your php environment. -nathan Yep, while the trigger_error() is being hit, nothing is being shown. The program goes right past it without failing and without anything happening. In other words, it acts the same as a //comment. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Well if display_errors is off, then that should be expected. right, if you want to alter the flow of the control there, you use an exception as Eric suggested earlier. -nathan
[PHP] Logic sought
Hi gang: Here's the logic problem. First the site: http://php1.net/b/zip-files/ Now, the site works well enough. The user selects what they want, clicks Submit, the order is assembled in zip file and presented to the user for downloading. However, as it stands now, before the script assembles the test.zip, it deletes (unlinks) the previous test.zip and therein lies the problem. If two, or more, users hit the site at the same time then a RACE condition may have one user getting something they didn't ask for or not getting anything at all. The complicated way I figure I could solve this would be to: 1. Generate a random string name for the file -- instead of test.zip, it could be ax12nhg34.zip. 2. Then when the user selects the download that would trigger a javascript routine that would send the name of the file to be deleted to a slave php script that would unlinks the file. I know this will work, but if the user never downloads the file, then the files accumulate on the server. Does anyone have a better idea? Thanks, 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] Logic sought
Write a script that cron runs that checks dates of files and removes 1 month old ones? On Wed, Jul 9, 2008 at 4:45 PM, tedd [EMAIL PROTECTED] wrote: Hi gang: Here's the logic problem. First the site: http://php1.net/b/zip-files/ Now, the site works well enough. The user selects what they want, clicks Submit, the order is assembled in zip file and presented to the user for downloading. However, as it stands now, before the script assembles the test.zip, it deletes (unlinks) the previous test.zip and therein lies the problem. If two, or more, users hit the site at the same time then a RACE condition may have one user getting something they didn't ask for or not getting anything at all. The complicated way I figure I could solve this would be to: 1. Generate a random string name for the file -- instead of test.zip, it could be ax12nhg34.zip. 2. Then when the user selects the download that would trigger a javascript routine that would send the name of the file to be deleted to a slave php script that would unlinks the file. I know this will work, but if the user never downloads the file, then the files accumulate on the server. Does anyone have a better idea? Thanks, 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] Logic sought
On Wed, Jul 9, 2008 at 7:45 PM, tedd [EMAIL PROTECTED] wrote: Hi gang: Here's the logic problem. First the site: http://php1.net/b/zip-files/ Now, the site works well enough. The user selects what they want, clicks Submit, the order is assembled in zip file and presented to the user for downloading. However, as it stands now, before the script assembles the test.zip, it deletes (unlinks) the previous test.zip and therein lies the problem. If two, or more, users hit the site at the same time then a RACE condition may have one user getting something they didn't ask for or not getting anything at all. The complicated way I figure I could solve this would be to: 1. Generate a random string name for the file -- instead of test.zip, it could be ax12nhg34.zip. 2. Then when the user selects the download that would trigger a javascript routine that would send the name of the file to be deleted to a slave php script that would unlinks the file. I know this will work, but if the user never downloads the file, then the files accumulate on the server. Does anyone have a better idea? Thanks, 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 Well this is sort of a question that can only be answered based on some answers such as, what will the request load be on this, how many theoretical files will this generate, just stuff like that. If you aren't worried about cpu load, you can probably use the streams api to make a zip file in memory and spit that out to the user without ever creating a file on demand. If you want this to be fast, then you need to cache zip files or pre-generate them to users and store them in some sort of sane filename based on selected options. This way there isn't randomly generated files being re-created for no reason. The other option is to just generate a random filename and cron-delete them after so long. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Logic sought
generate a unique hash as the name based on the contents of the zip, then if 2 people happen to want exactly the same selection you won't have to build/zip it twice ... just check if the zip happens to exist before trying to build it. have the script do garbage collection on old zip files ... in a script specific 'tmp' dir that stores the created zipfiles ... the GC can kick in on 1% of every requests (and maybe limits itself the ammount of time spent GCing) to elliminate race conditions completely you'll have to use a lock file, which the script needs to exclusively lock before attempting to create the zip ... a failure to get an exclusive lock means having to recheck the zip's existence (chances are some other script just created it). in addition a shared lock should be obtained before trying to read a zip, to avoid reading half written files. Kyle Browning schreef: Write a script that cron runs that checks dates of files and removes 1 month old ones? On Wed, Jul 9, 2008 at 4:45 PM, tedd [EMAIL PROTECTED] wrote: Hi gang: Here's the logic problem. First the site: http://php1.net/b/zip-files/ Now, the site works well enough. The user selects what they want, clicks Submit, the order is assembled in zip file and presented to the user for downloading. However, as it stands now, before the script assembles the test.zip, it deletes (unlinks) the previous test.zip and therein lies the problem. If two, or more, users hit the site at the same time then a RACE condition may have one user getting something they didn't ask for or not getting anything at all. The complicated way I figure I could solve this would be to: 1. Generate a random string name for the file -- instead of test.zip, it could be ax12nhg34.zip. 2. Then when the user selects the download that would trigger a javascript routine that would send the name of the file to be deleted to a slave php script that would unlinks the file. I know this will work, but if the user never downloads the file, then the files accumulate on the server. Does anyone have a better idea? Thanks, 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Logic sought
On Wed, Jul 9, 2008 at 6:11 PM, Jochem Maas [EMAIL PROTECTED] wrote: generate a unique hash as the name based on the contents of the zip, then if 2 people happen to want exactly the same selection you won't have to build/zip it twice ... just check if the zip happens to exist before trying to build it. have the script do garbage collection on old zip files ... in a script specific 'tmp' dir that stores the created zipfiles ... the GC can kick in on 1% of every requests (and maybe limits itself the ammount of time spent GCing) to elliminate race conditions completely you'll have to use a lock file, which the script needs to exclusively lock before attempting to create the zip ... a failure to get an exclusive lock means having to recheck the zip's existence (chances are some other script just created it). in addition a shared lock should be obtained before trying to read a zip, to avoid reading half written files. if it is a high traffic site, on a *nix host, i recommend the sem* functions from the sysv extension. theyre a lot faster than file locks. -nathan
Re: [PHP] zippidity do duh!
Daniel Brown schreef: On Wed, Jul 9, 2008 at 3:43 PM, tedd [EMAIL PROTECTED] wrote: However, on server [2] (Daniel Brown's most excellent service, btw), everything works great -- as is usual (every time I say something like this he gives me another month of free service). :-) Dan box isn't displaying errors and or not logging NOTICEs, which is correct for production boxes. try triggering an E_FATAL instead of E_NOTICE and you'll see there is no need to use Exceptions in this case (albeit that it's an acceptable alternative). Yeah, and we're somewhere in 2011 or so now, I believe. I appreciate the compliments, but I can't afford to feed my wife and dog! P.S. - Dogs like food. P.P.S. - Debs likes food, too. there is a solution in there somewhere. puts a whole new meaning on the phrase, eat your own dogfood. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] zippidity do duh!
On Wed, Jul 9, 2008 at 8:52 PM, Jochem Maas [EMAIL PROTECTED] wrote: Daniel Brown schreef: On Wed, Jul 9, 2008 at 3:43 PM, tedd [EMAIL PROTECTED] wrote: However, on server [2] (Daniel Brown's most excellent service, btw), everything works great -- as is usual (every time I say something like this he gives me another month of free service). :-) Dan box isn't displaying errors and or not logging NOTICEs, which is correct for production boxes. try triggering an E_FATAL instead of E_NOTICE and you'll see there is no need to use Exceptions in this case (albeit that it's an acceptable alternative). Yeah, and we're somewhere in 2011 or so now, I believe. I appreciate the compliments, but I can't afford to feed my wife and dog! P.S. - Dogs like food. P.P.S. - Debs likes food, too. there is a solution in there somewhere. puts a whole new meaning on the phrase, eat your own dogfood. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I wasn't really serious about the exception thing. If you already know the extension isn't loaded that is your error condition that you've caught. So show an error saying can't do it at that point. I was just poking fun. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Logic sought
tedd wrote: Hi gang: Here's the logic problem. First the site: http://php1.net/b/zip-files/ Now, the site works well enough. The user selects what they want, clicks Submit, the order is assembled in zip file and presented to the user for downloading. However, as it stands now, before the script assembles the test.zip, it deletes (unlinks) the previous test.zip and therein lies the problem. If two, or more, users hit the site at the same time then a RACE condition may have one user getting something they didn't ask for or not getting anything at all. The complicated way I figure I could solve this would be to: 1. Generate a random string name for the file -- instead of test.zip, it could be ax12nhg34.zip. 2. Then when the user selects the download that would trigger a javascript routine that would send the name of the file to be deleted to a slave php script that would unlinks the file. I know this will work, but if the user never downloads the file, then the files accumulate on the server. Does anyone have a better idea? Thanks, tedd Everybody so far has had excellent descriptions of what to do. I would do almost everything they recommend. Except, if I had the hard drive space to make all the possible permutation and allow them to down load the file that someone else had created, I would do that. Rather then possibly rebuilding an identical file over and over again. So, I guess I need to ask this question. Are their to many files in your download selection too make the number of possible zip archives out of the question to be cached? If that is the case, then I would delete old ones using a cron/task schedule type program. But I would do it much quicker, say every three to seven days. if you are limited on space, you will need to protect yourself against bots that might try, accidentally of course, to to make you run out of HD space. At this point, you might have to build something into your php script to manage the file space consumption. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] can any one help me on this
Warning:session_start():Canot send session cache limiter - headers already sent help me i dont understand this warning... but the program still works... thanks in advance... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] can any one help me on this
It's probably some white space above your session_start function. Make sure that there is no white space before your ?php start tag and try again. -Original Message- From: willyam pax Sent: 10 July 2008 13:13 To: php-general@lists.php.net Subject: [PHP] can any one help me on this Warning:session_start():Canot send session cache limiter - headers already sent help me i dont understand this warning... but the program still works... thanks in advance... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can any one help me on this
On Thu, 2008-07-10 at 11:13 +0800, willyam pax wrote: Warning:session_start():Canot send session cache limiter - headers already It means you have output going to the browser before you begin your session with session_start(). This usually means you have trailing whitespace in an included file where you've used the closing PHP tag. 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] zippidity do duh!
On Wed, Jul 9, 2008 at 6:52 PM, Jochem Maas [EMAIL PROTECTED] wrote: try triggering an E_FATAL instead of E_NOTICE and you'll see there is no need to use Exceptions in this case (albeit that it's an acceptable alternative). minor but, it would have to be E_USER_ERROR, because you can only trigger E_USER_* errors from trigger_error(). anyway, that will halt script execution, unless there is a handler specified with set_error_handler(), which i would consider undesirable. it seems to me it would be better to acknowledge the issue and move on to other things during the request processing, which is why in this case, and with most trigger_error() cases, i typically use E_USER_NOTICE, unless i really intend to have the script execution terminated, or i know for sure there is an error handler in place. the reason i recommended an exception is because tedd was making it sound like he wanted to alter the flow of control. well, in that case, you dont need exceptions, the alternate logic could obviously be placed in the body of the else block, along with, or instead of, the trigger_error() call. as well, this could be turned into a function which would return a boolean value, or accept a callback, or make me breakfast... yes, there are many ways to skin the cat here :) and no, i likely wouldnt use an exception here, unless this was part of a class (which in my code it likely would be :D). -nathan