From jeff.loiselle at gmail.com Fri Apr 1 01:56:08 2005 From: jeff.loiselle at gmail.com (Jeff Loiselle) Date: Fri, 1 Apr 2005 01:56:08 -0500 Subject: [nycphp-talk] PHP 5 singleton/destructor question In-Reply-To: References: <424C95D3.1040808@cain.sh> Message-ID: <4b188711050331225667f6f8fe@mail.gmail.com> Constructors and destructors are not executed when you call static methods of a class. Calling a method statically, doesn't make a class. ;-) I think I read that in George's book. Hope that helps. From dan at cain.sh Fri Apr 1 02:25:35 2005 From: dan at cain.sh (Daniel J Cain Jr.) Date: Fri, 01 Apr 2005 01:25:35 -0600 Subject: [nycphp-talk] PHP 5 singleton/destructor question In-Reply-To: <4b188711050331225667f6f8fe@mail.gmail.com> References: <424C95D3.1040808@cain.sh> <4b188711050331225667f6f8fe@mail.gmail.com> Message-ID: <424CF76F.5000202@cain.sh> Actually calling a static method will call a constructor if that method creates an object of itself. And a static call that removes the last reference to the object in the script will also call that objects destructor. Jeff Loiselle wrote: > Constructors and destructors are not executed when you call static > methods of a class. Calling a method statically, doesn't make a class. > ;-) I think I read that in George's book. Hope that helps. > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org From dan at cain.sh Fri Apr 1 02:27:36 2005 From: dan at cain.sh (Daniel J Cain Jr.) Date: Fri, 01 Apr 2005 01:27:36 -0600 Subject: [nycphp-talk] PHP 5 singleton/destructor question In-Reply-To: References: Message-ID: <424CF7E8.7070605@cain.sh> Lemme try to explain again and try and make more sense. PHP tracks the number of references to a variable, when there are no more references it can safely be destroyed by the Zend engine. So the count should be at 2. One for the instance you grab in the main script and another for the static reference inside the class definition. You need to run two unsets(one inside the class, and one outside the class) to make that variables reference count == 0. David Mintz wrote: > OK, here is the ugliest workaround you've seen all day. A pint of beer for > anyone who can explain why I am having to do this. I added to my > constructor: > > register_shutdown_function(array($this, '__destruct')); > > and it works, so to speak. > > --- > David Mintz > http://davidmintz.org/ > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org From dmintz at davidmintz.org Fri Apr 1 10:28:39 2005 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 1 Apr 2005 10:28:39 -0500 (EST) Subject: [nycphp-talk] PHP 5 singleton/destructor question In-Reply-To: <424CF7E8.7070605@cain.sh> References: <424CF7E8.7070605@cain.sh> Message-ID: >From dmintz at davidmintz.org Fri Apr 1 10:20:24 2005 Date: Fri, 1 Apr 2005 10:19:36 -0500 (EST) From: David Mintz To: Daniel J Cain Jr. Subject: Re: [nycphp-talk] PHP 5 singleton/destructor question On Fri, 1 Apr 2005, Daniel J Cain Jr. wrote: > PHP tracks the number of references to a variable, when there are no > more references it can safely be destroyed by the Zend engine. So the > count should be at 2. One for the instance you grab in the main script > and another for the static reference inside the class definition. You > need to run two unsets(one inside the class, and one outside the class) > to make that variables reference count == 0. I think I get what you're saying... or maybe not. No instantiation, no destructor runs -- I understand "static". Yet I believe an object of class MyDatabase is instantiated in the example I posted earlier, and it has a __destruct() method, so its __destruct() should run when PHP decides the reference count is zero. Does the reference count NOT reach zero when the script terminates, no matter what? If you haven't explicitly unset() or set to NULL, php cleans up the garbage for you before the process ends, no? Maybe the register_shutdown_function() hack isn't such a bad solution. Thanks, --- David Mintz http://davidmintz.org/ From dcech at phpwerx.net Fri Apr 1 12:51:50 2005 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 01 Apr 2005 12:51:50 -0500 Subject: [nycphp-talk] PHP 5 singleton/destructor question In-Reply-To: References: <424CF7E8.7070605@cain.sh> Message-ID: <424D8A36.6050006@phpwerx.net> David Mintz wrote: > I think I get what you're saying... or maybe not. No instantiation, no > destructor runs -- I understand "static". Yet I believe an object of > class MyDatabase is instantiated in the example I posted earlier, and it > has a __destruct() method, so its __destruct() should run when PHP > decides the reference count is zero. Does the reference count NOT reach > zero when the script terminates, no matter what? If you haven't explicitly > unset() or set to NULL, php cleans up the garbage for you before the > process ends, no? > > Maybe the register_shutdown_function() hack isn't such a bad solution. My guess would be that the destructor *is* called, just that unless you manually run it, via register_shutdown_function or whatever, it's called by the garbage collector *after* the page is sent to the browser...so you would't see the output. I could be totally wrong though... Dan From tgales at tgaconnect.com Fri Apr 1 13:11:35 2005 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 01 Apr 2005 13:11:35 -0500 Subject: [nycphp-talk] PHP 5 singleton/destructor question In-Reply-To: <424D8A36.6050006@phpwerx.net> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> Message-ID: <424D8ED7.50100@tgaconnect.com> Dan Cech wrote: > David Mintz wrote: > >> I think I get what you're saying... or maybe not. No instantiation, no >> destructor runs -- I understand "static". Yet I believe an object of >> class MyDatabase is instantiated in the example I posted earlier, and it >> has a __destruct() method, so its __destruct() should run when PHP >> decides the reference count is zero. Does the reference count NOT reach >> zero when the script terminates, no matter what? If you haven't >> explicitly >> unset() or set to NULL, php cleans up the garbage for you before the >> process ends, no? >> >> Maybe the register_shutdown_function() hack isn't such a bad solution. > > > My guess would be that the destructor *is* called, just that unless you > manually run it, via register_shutdown_function or whatever, it's called > by the garbage collector *after* the page is sent to the browser...so > you would't see the output. > > I could be totally wrong though... > > Dan > could you trigger an error log entry in the destructor to see for sure... -- T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From michaelj at wagner.edu Fri Apr 1 13:43:56 2005 From: michaelj at wagner.edu (Michael Johnson) Date: Fri, 01 Apr 2005 13:43:56 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <424D8ED7.50100@tgaconnect.com> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> Message-ID: <424D966C.5040401@wagner.edu> Not sure if anyone has posted this, and it's not worth searching the archive, but has anyone ran phpinfo() today? If not, I'd give it a shot: Michael Johnson Web: Systems Administrator/Programmer Wagner College michaelj at wagner.edu 718-420-4425 From codebowl at gmail.com Fri Apr 1 14:00:33 2005 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 1 Apr 2005 14:00:33 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <424D966C.5040401@wagner.edu> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> Message-ID: <8d9a4280050401110055aeb8c3@mail.gmail.com> also check out php.net :) -- Joseph Crawford Jr. Codebowl Solutions codebowl at gmail.com From matt at jobsforge.com Fri Apr 1 14:07:17 2005 From: matt at jobsforge.com (Matthew Terenzio) Date: Fri, 1 Apr 2005 14:07:17 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <8d9a4280050401110055aeb8c3@mail.gmail.com> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <8d9a4280050401110055aeb8c3@mail.gmail.com> Message-ID: On Apr 1, 2005, at 2:00 PM, Joseph Crawford wrote: > also check out php.net :) I hope that dog is getting compensated. I believe in free software, but I draw the line right there. Matt Terenzio From 1j0lkq002 at sneakemail.com Fri Apr 1 14:15:21 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Fri, 01 Apr 2005 14:15:21 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <8d9a4280050401110055aeb8c3@mail.gmail.com> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <8d9a4280050401110055aeb8c3@mail.gmail.com> Message-ID: <5516-74474@sneakemail.com> Joseph Crawford codebowl-at-gmail.com |nyphp dev/internal group use| wrote: >also check out php.net :) > > > Hey Joe. I Googled you on MSN and couldn't believe what I saw: http://www.mymsnsearch.com/results.aspx?q=Joe+Crawford&FORM=AsfFVvIIFLxI From codebowl at gmail.com Fri Apr 1 14:16:47 2005 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 1 Apr 2005 14:16:47 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <5516-74474@sneakemail.com> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <8d9a4280050401110055aeb8c3@mail.gmail.com> <5516-74474@sneakemail.com> Message-ID: <8d9a42800504011116101ec5c2@mail.gmail.com> HAH what is all that crap lol MSN got some april fools thing going on or is that a real search? -- Joseph Crawford Jr. Codebowl Solutions codebowl at gmail.com From codebowl at gmail.com Fri Apr 1 14:17:22 2005 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 1 Apr 2005 14:17:22 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <8d9a42800504011116101ec5c2@mail.gmail.com> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <8d9a4280050401110055aeb8c3@mail.gmail.com> <5516-74474@sneakemail.com> <8d9a42800504011116101ec5c2@mail.gmail.com> Message-ID: <8d9a42800504011117ff967df@mail.gmail.com> ok so i asked before i clicked a link, that's pretty cool lol -- Joseph Crawford Jr. Codebowl Solutions codebowl at gmail.com From 1j0lkq002 at sneakemail.com Fri Apr 1 14:19:46 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Fri, 01 Apr 2005 14:19:46 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <8d9a42800504011116101ec5c2@mail.gmail.com> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <8d9a4280050401110055aeb8c3@mail.gmail.com> <5516-74474@sneakemail.com> <8d9a42800504011116101ec5c2@mail.gmail.com> Message-ID: <10969-34945@sneakemail.com> Joseph Crawford codebowl-at-gmail.com |nyphp dev/internal group use| wrote: >HAH what is all that crap lol MSN got some april fools thing going on >or is that a real search? > > > Looks real to me. I checked Hans Z as well, just ot be sure http://www.mymsnsearch.com/results.aspx?q=Hans+Zaunere&FORM=E6xF7GSbJvlN From 1j0lkq002 at sneakemail.com Fri Apr 1 14:21:41 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Fri, 01 Apr 2005 14:21:41 -0500 Subject: [nycphp-talk] [OT] april fools in php? In-Reply-To: <8d9a42800504011116101ec5c2@mail.gmail.com> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <8d9a4280050401110055aeb8c3@mail.gmail.com> <5516-74474@sneakemail.com> <8d9a42800504011116101ec5c2@mail.gmail.com> Message-ID: <3995-93621@sneakemail.com> shhhhh..... | | | | | | | | | | | | | | | | | | V Have fun http://www.msnsearchspoof.com/ From dmintz at davidmintz.org Fri Apr 1 14:26:58 2005 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 1 Apr 2005 14:26:58 -0500 (EST) Subject: [nycphp-talk] PHP 5 singleton/destructor question In-Reply-To: <424D8ED7.50100@tgaconnect.com> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> Message-ID: On Fri, 1 Apr 2005, Tim Gales wrote: > Dan Cech wrote: > > > > My guess would be that the destructor *is* called, just that unless you > > manually run it, via register_shutdown_function or whatever, it's called > > by the garbage collector *after* the page is sent to the browser...so > > you would't see the output. > > > > I could be totally wrong though... > > could you trigger an error log entry in > the destructor to see for sure... > Been there and done all that, with negative results. --- David Mintz http://davidmintz.org/ From corey at domanistudios.com Fri Apr 1 14:29:50 2005 From: corey at domanistudios.com (corey szopinski) Date: Fri, 01 Apr 2005 14:29:50 -0500 Subject: [nycphp-talk] Uploaded file permissions Message-ID: I?d like to override the default uploaded file permissions, so that my backup script can read them. For example, when I upload a file it?s owned by apache, with read/write for the owner only. Ideally, I?d like to allow read by everyone, or set the group owner to backup, with read permission. Of course, I could do the chmod/chown stuff, but it seems like there?s a php setting someplace that I can tweak. Any ideas? -corey Corey Szopinski Director of Technology DOMANI STUDIOS corey at domanistudios.com 55 Washington St. Suite 822 Brooklyn, NY 11201 718-797-4470 x116 From dmintz at davidmintz.org Fri Apr 1 14:32:56 2005 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 1 Apr 2005 14:32:56 -0500 (EST) Subject: [nycphp-talk] april fools in php? In-Reply-To: References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <8d9a4280050401110055aeb8c3@mail.gmail.com> Message-ID: On Fri, 1 Apr 2005, Matthew Terenzio wrote: > > On Apr 1, 2005, at 2:00 PM, Joseph Crawford wrote: > > > also check out php.net :) > > I hope that dog is getting compensated. I believe in free software, but > I draw the line right there. Looks like a rabbit to me. Either way, I say let's use him for unit testing. --- David Mintz http://davidmintz.org/ From dmintz at davidmintz.org Fri Apr 1 14:43:27 2005 From: dmintz at davidmintz.org (David Mintz) Date: Fri, 1 Apr 2005 14:43:27 -0500 (EST) Subject: [nycphp-talk] april fools in php? In-Reply-To: References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <8d9a4280050401110055aeb8c3@mail.gmail.com> Message-ID: On Fri, 1 Apr 2005, David Mintz wrote: > On Fri, 1 Apr 2005, Matthew Terenzio wrote: > > > > > On Apr 1, 2005, at 2:00 PM, Joseph Crawford wrote: > > > > > also check out php.net :) > > > > I hope that dog is getting compensated. I believe in free software, but > > I draw the line right there. > > Looks like a rabbit to me. Either way, I say let's use him for unit > testing. Oops, I was speaking of the phpinfo() rabbit. --- David Mintz http://davidmintz.org/ From patterson at computer.org Fri Apr 1 14:48:04 2005 From: patterson at computer.org (Bill Patterson) Date: Fri, 01 Apr 2005 14:48:04 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <424D966C.5040401@wagner.edu> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> Message-ID: <424DA574.6070109@computer.org> It is cute. (But why is PHP5 a rabbit and PHP4 a dog?) The problem with this is that setting timers, even cute harmless ones like this, suggests that the code is not purged of timers that could be harmful either. Many of us think that PHP could soon be ready for prime time in enterprise work, but things like this might not help the public perception. Bill Patterson From danielc at analysisandsolutions.com Fri Apr 1 14:57:55 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 1 Apr 2005 14:57:55 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <424DA574.6070109@computer.org> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> Message-ID: <20050401195755.GA11958@panix.com> On Fri, Apr 01, 2005 at 02:48:04PM -0500, Bill Patterson wrote: > but things like this might not help the public perception. You're joking, right? --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From krook at us.ibm.com Fri Apr 1 15:00:19 2005 From: krook at us.ibm.com (Daniel Krook) Date: Fri, 1 Apr 2005 15:00:19 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <424DA574.6070109@computer.org> Message-ID: > It is cute. (But why is PHP5 a rabbit and PHP4 a dog?) The problem > with this is that setting timers, even cute harmless ones like this, > suggests that the code is not purged of timers that could be harmful > either. Many of us think that PHP could soon be ready for prime time in > enterprise work, but things like this might not help the public perception. >From the archives: http://lists.nyphp.org/pipermail/talk/2003-April/002956.html Daniel Krook, Advisory IT Specialist Application Development, Production Services - Tools, ibm.com Personal: http://info.krook.org/ BluePages: http://w3.ibm.com/bluepages?searchcnum=9A9796897 From patterson at computer.org Fri Apr 1 15:07:23 2005 From: patterson at computer.org (Bill Patterson) Date: Fri, 01 Apr 2005 15:07:23 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <20050401195755.GA11958@panix.com> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> <20050401195755.GA11958@panix.com> Message-ID: <424DA9FB.8040909@computer.org> no. Daniel Convissor wrote: >On Fri, Apr 01, 2005 at 02:48:04PM -0500, Bill Patterson wrote: > > > >>but things like this might not help the public perception. >> >> > >You're joking, right? > >--Dan > > > From danielc at analysisandsolutions.com Fri Apr 1 15:29:14 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 1 Apr 2005 15:29:14 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <424DA9FB.8040909@computer.org> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> <20050401195755.GA11958@panix.com> <424DA9FB.8040909@computer.org> Message-ID: <20050401202914.GA17420@panix.com> Hi: > no. I didn't think you were. That's unfortunate. Having an easter egg inside the phpinfo() function has nothing to do with security. First, phpinfo() is a function which is intended for use by developers, not live websites. Second, this easter egg has been in there since the end of April 2000*, so this is no surprise. Third, you can go through the entire source tree of PHP to hunt for other easter eggs that could be actually dangerous, if you want. Fourth, any programming language can have easter eggs in them. Fifth, the fact that all commits are seen by a large number of people eliminiates the possibility of dangerous easter eggs ever reaching the public. Anyone thinking PHP's phpinfo() easter egg points to a lapse in security or feels it "lowers PHP's public perception" clearly lacks a sense of humor and an accurate perspective. --Dan * http://cvs.php.net/diff.php/php-src/ext/standard/info.c?r1=1.84&r2=1.85&ty=u -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From bgerst at gmail.com Fri Apr 1 15:31:39 2005 From: bgerst at gmail.com (Ben Gerst) Date: Fri, 1 Apr 2005 15:31:39 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <424DA9FB.8040909@computer.org> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> <20050401195755.GA11958@panix.com> <424DA9FB.8040909@computer.org> Message-ID: <799d17c405040112316b4e02ac@mail.gmail.com> Some googling found this http://www.phpfreaks.com/articles/229/0.php looks like you can turn them off if you don't find them funny :) On Apr 1, 2005 3:07 PM, Bill Patterson wrote: > no. > Daniel Convissor wrote: > > >On Fri, Apr 01, 2005 at 02:48:04PM -0500, Bill Patterson wrote: > > > > > > > >>but things like this might not help the public perception. > >> > >> > > > >You're joking, right? > > > >--Dan > > > > > > > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From chsnyder at gmail.com Fri Apr 1 15:37:29 2005 From: chsnyder at gmail.com (csnyder) Date: Fri, 1 Apr 2005 15:37:29 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <799d17c405040112316b4e02ac@mail.gmail.com> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> <20050401195755.GA11958@panix.com> <424DA9FB.8040909@computer.org> <799d17c405040112316b4e02ac@mail.gmail.com> Message-ID: On Apr 1, 2005 3:31 PM, Ben Gerst wrote: > looks like you can turn them off if you don't find them funny :) At least we don't have a little devil holding a pitchfork as our mascot, like some free software projects... From alexchan.1976 at gmail.com Fri Apr 1 15:58:11 2005 From: alexchan.1976 at gmail.com (Alex C) Date: Fri, 1 Apr 2005 15:58:11 -0500 Subject: [nycphp-talk] any good wsdl building tools /documentation out there Message-ID: <8f494f76050401125870fb59a5@mail.gmail.com> Hi everybody, I would like to know of any good wsdl building tools out there . It can run on linux or OS X. Also any good docs on building SOAP services in php. Thanks in Advance, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From john at cyber-ny.com Fri Apr 1 16:20:46 2005 From: john at cyber-ny.com (John Nunez) Date: Fri, 1 Apr 2005 16:20:46 -0500 Subject: [nycphp-talk] any good wsdl building tools /documentation out there In-Reply-To: <8f494f76050401125870fb59a5@mail.gmail.com> References: <8f494f76050401125870fb59a5@mail.gmail.com> Message-ID: <497d578efb143e3b839fe2332fe21a22@cyber-ny.com> Alex, Google for "Apple PHP SOAP" and you get a cool tutorial on SOAP Server and Client services - John On Apr 1, 2005, at 3:58 PM, Alex C wrote: > Hi everybody, > > I would like to know of any good wsdl building tools out there . > > It can run on? linux or OS X. Also any good docs on building SOAP > services in php. > Thanks in Advance, > > Alex > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org From john at cyber-ny.com Fri Apr 1 16:25:09 2005 From: john at cyber-ny.com (John Nunez) Date: Fri, 1 Apr 2005 16:25:09 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <424DA574.6070109@computer.org> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> Message-ID: <07e35b8bcc84a1e8cca0451f1dad02bb@cyber-ny.com> Hey People Say Microsoft is Enterprise ready... YET a Porn image of the girl in "Who's the Boss" was found on Office XP. Hey Excel 97 had a flight simulator built in. Easter Eggs have been around for YEARS! http://www.extremetech.com/article2/0,1558,1781429,00.asp? kc=ETRSS02129TX1K0000532 - John On Apr 1, 2005, at 2:48 PM, Bill Patterson wrote: > It is cute. (But why is PHP5 a rabbit and PHP4 a dog?) The problem > with this is that setting timers, even cute harmless ones like this, > suggests that the code is not purged of timers that could be harmful > either. Many of us think that PHP could soon be ready for prime time > in enterprise work, but things like this might not help the public > perception. > > Bill Patterson > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From jkelly at sussex.edu Fri Apr 1 16:31:46 2005 From: jkelly at sussex.edu (jessica kelly) Date: Fri, 01 Apr 2005 16:31:46 -0500 Subject: [nycphp-talk] Prob. With Headers in .htaccess using PHP Message-ID: Hi All, I can set headers in .htaccess for files in a folder just fine when Apache 1.3.x serves a .htm page. However if the page is a .php page the headers are not being added. Instead I get a "X-Powered-By:?PHP/4.x.x" or something of the sort but no Cache-Control:?max-age=0,?no-store,?max-age=0 Expires:?Fri,?01?Apr?2005?21:26:58?GMT(CR) Headers that I want served. Where I work the files are cached in the server room and there is another cache farther down our pipe. The evil network admins are non-cooperative in my requests to not cache that folder/files. It is causing problems with my dynamic PHP pages and only shows the cached page the first time around. Yes I can get it to "refresh" every 5 seconds via References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> <07e35b8bcc84a1e8cca0451f1dad02bb@cyber-ny.com> Message-ID: <8d9a42800504011333340dc222@mail.gmail.com> what's this about the office XP? i'll have to search for that one lol -- Joseph Crawford Jr. Codebowl Solutions codebowl at gmail.com From jkelly at sussex.edu Fri Apr 1 17:24:17 2005 From: jkelly at sussex.edu (jessica kelly) Date: Fri, 01 Apr 2005 17:24:17 -0500 Subject: [nycphp-talk] Prob. With Headers in .htaccess using PHP Message-ID: Never mind, I got it working. Jessica <<< jkelly at sussex.edu 4/ 1 4:32p >>> Hi All, I can set headers in .htaccess for files in a folder just fine when Apache 1.3.x serves a .htm page. However if the page is a .php page the headers are not being added. Instead I get a "X-Powered-By:?PHP/4.x.x" or something of the sort but no Cache-Control:?max-age=0,?no-store,?max-age=0 Expires:?Fri,?01?Apr?2005?21:26:58?GMT(CR) Headers that I want served. Where I work the files are cached in the server room and there is another cache farther down our pipe. The evil network admins are non-cooperative in my requests to not cache that folder/files. It is causing problems with my dynamic PHP pages and only shows the cached page the first time around. Yes I can get it to "refresh" every 5 seconds via References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> <07e35b8bcc84a1e8cca0451f1dad02bb@cyber-ny.com> <8d9a42800504011333340dc222@mail.gmail.com> Message-ID: <330532b605040114291742e7f6@mail.gmail.com> On Apr 1, 2005 4:33 PM, Joseph Crawford wrote: > what's this about the office XP? i'll have to search for that one lol How about www.nyphp.org? Interesting front page, hope it changes back tomorrow... -- Mitch, deluged by people not getting the joke (hoping it is a joke too) From 1j0lkq002 at sneakemail.com Fri Apr 1 21:28:34 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Fri, 01 Apr 2005 21:28:34 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <330532b605040114291742e7f6@mail.gmail.com> References: <424CF7E8.7070605@cain.sh> <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> <07e35b8bcc84a1e8cca0451f1dad02bb@cyber-ny.com> <8d9a42800504011333340dc222@mail.gmail.com> <330532b605040114291742e7f6@mail.gmail.com> Message-ID: <32100-48152@sneakemail.com> Mitch Pirtle mitch.pirtle-at-gmail.com |nyphp dev/internal group use| wrote: >On Apr 1, 2005 4:33 PM, Joseph Crawford wrote: > > >>what's this about the office XP? i'll have to search for that one lol >> >> > >How about www.nyphp.org? Interesting front page, hope it changes back >tomorrow... > >-- Mitch, deluged by people not getting the joke (hoping it is a joke too) >_______________________________________________ > > Nothing can top DMOZ becoming Gates Open Directory (G.O.D.) in 2002. Nothing. Ever. "The Gates Open Directory is part of Microsoft's vision to simplify copyright on the Internet by buying all copyrighted material," the press release said. "Once this goal is achieved Microsoft will be the single clearinghouse for all intellectual property, in effect streamlining the current legal bureaucracy surrounding patent and copyright suits by eliminating the need for costly lawsuits." According to this text Rich Skrenta, co-founder of the Open Directory Project, believes that "the Gates Open Directory was inevitable, so why fight it?" Bill Gates, future owner of all things ownable, concurs: "Resistance is futile." http://www.pandia.com/sw-2002/11-god.html From codebowl at gmail.com Fri Apr 1 21:59:41 2005 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 1 Apr 2005 21:59:41 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <32100-48152@sneakemail.com> References: <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> <07e35b8bcc84a1e8cca0451f1dad02bb@cyber-ny.com> <8d9a42800504011333340dc222@mail.gmail.com> <330532b605040114291742e7f6@mail.gmail.com> <32100-48152@sneakemail.com> Message-ID: <8d9a428005040118594a05a493@mail.gmail.com> YEA i hope the NYPHP page changes back tomorrow ;) -- Joseph Crawford Jr. Codebowl Solutions codebowl at gmail.com From chsnyder at gmail.com Sat Apr 2 11:45:56 2005 From: chsnyder at gmail.com (csnyder) Date: Sat, 2 Apr 2005 11:45:56 -0500 Subject: [nycphp-talk] MySQL 5.0? Message-ID: Is anybody using MySQL 5.0 in anything close to a production environment, yet? I need to reinstall server OS today, and I'm thinking maybe I should just install 5 and get it over with. The old databases are 4.0. Any problems I'm likely to run into by skipping 4.1? Hans, if you're listening, give me the hard sell. :-) -- Chris Snyder http://chxo.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Sat Apr 2 12:01:36 2005 From: chsnyder at gmail.com (csnyder) Date: Sat, 2 Apr 2005 12:01:36 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: <8d9a428005040118594a05a493@mail.gmail.com> References: <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> <07e35b8bcc84a1e8cca0451f1dad02bb@cyber-ny.com> <8d9a42800504011333340dc222@mail.gmail.com> <330532b605040114291742e7f6@mail.gmail.com> <32100-48152@sneakemail.com> <8d9a428005040118594a05a493@mail.gmail.com> Message-ID: On Apr 1, 2005 9:59 PM, Joseph Crawford wrote: > > YEA i hope the NYPHP page changes back tomorrow ;) It seems like every year around this time, Hans Z gets a sudden urge to switch everything over to some weird Microsoft technology that no one has ever heard of. Sure enough, next day he's back in PHP's corner. I think he must binge on the five-year-old easter candy from Duane Reade or something, it's the only thing that would explain it. -- Chris Snyder http://chxo.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From 1j0lkq002 at sneakemail.com Sat Apr 2 12:26:19 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Sat, 02 Apr 2005 12:26:19 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: References: <424D8A36.6050006@phpwerx.net> <424D8ED7.50100@tgaconnect.com> <424D966C.5040401@wagner.edu> <424DA574.6070109@computer.org> <07e35b8bcc84a1e8cca0451f1dad02bb@cyber-ny.com> <8d9a42800504011333340dc222@mail.gmail.com> <330532b605040114291742e7f6@mail.gmail.com> <32100-48152@sneakemail.com> <8d9a428005040118594a05a493@mail.gmail.com> Message-ID: <20374-20183@sneakemail.com> csnyder chsnyder-at-gmail.com |nyphp dev/internal group use| wrote: > On Apr 1, 2005 9:59 PM, *Joseph Crawford* > wrote: > > YEA i hope the NYPHP page changes back tomorrow ;) > > > It seems like every year around this time, Hans Z gets a sudden urge > to switch everything over to some weird Microsoft technology that no > one has ever heard of. Sure enough, next day he's back in PHP's corner. > > I think he must binge on the five-year-old easter candy from Duane > Reade or something, it's the only thing that would explain it. > > > -- > Chris Snyder > http://chxo.com/ > >------------------------------------------------------------------------ > I thought it went dark to fix the css problem on the main page. I guess if all you use is IE you wouldn't know about it.... From lists at zaunere.com Sat Apr 2 13:00:57 2005 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 2 Apr 2005 13:00:57 -0500 Subject: [nycphp-talk] MySQL 5.0? In-Reply-To: Message-ID: <0MKyxe-1DHmvg34Ny-0006pj@mrelay.perfora.net> > Is anybody using MySQL 5.0 in anything close to a production environment, yet? Yeah, people are actually. Although not officially supported, people are using 5.0 in production, and in fact one company has been using it for over 8 months without a problem. > I need to reinstall server OS today, and I'm thinking maybe I should just install 5 and get it over with. > The old databases are 4.0. Any problems I'm likely to run into by skipping 4.1? Quite a bit has changed between 4.0 and 5.0. Some things that come to mind are client libraries, password handling, timestamp handling, etc. But the list goes on, and I'd recommend exporting your data to text, then reimporting to 5.0 unless there's a lot of data to deal with. You could also use CREATE TABLE SELECT... > Hans, if you're listening, give me the hard sell. :-) Haha - well, all that said above, 5.0 is feature complete and many people are developing against it, with some as I said using it in production (although unsupported). The biggest thing to be aware of will the application and interaction with the database, rather than the stability of the database itself. Of course, there are stored procedures available in 5.0, so the migration should be a snap :) --- Hans Zaunere President, Founder New York PHP http://www.nyphp.org AMP Technology Supporting Apache, MySQL and PHP --- Hans Zaunere, Sales Engineer MySQL, Inc. www.mysql.com Office: +1 212.213.1131 From lists at zaunere.com Sat Apr 2 13:04:24 2005 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 2 Apr 2005 13:04:24 -0500 Subject: [nycphp-talk] april fools in php? In-Reply-To: Message-ID: <0MKyxe-1DHmyw1W2d-0006S1@mrelay.perfora.net> > > YEA i hope the NYPHP page changes back tomorrow ;) > It seems like every year around this time, Hans Z gets a sudden > urge to switch everything over to some weird Microsoft technology > that no one has ever heard of. Sure enough, next day he's back in PHP's corner. > > I think he must binge on the five-year-old easter candy from Duane > Reade or something, it's the only thing that would explain it. Yeah, strange what happened to the site yesterday, but looks to be back to normal. :) H From fields at hedge.net Sat Apr 2 23:12:54 2005 From: fields at hedge.net (Adam Fields) Date: Sat, 2 Apr 2005 23:12:54 -0500 Subject: [nycphp-talk] Login manager? Message-ID: <20050403041254.GC17723@lola.aquick.org> I'm writing a fairly straightforward web app. I'd like to allow people to create new accounts, do password management, key settings to their account, etc... I'll need an administrative interface for managing accounts, disabling the account signups from time to time, and probably other stuff. The ability to restrict signups to referrals would be nice. I don't particularly want to write the account infrastructure from scratch - there must be a good library that one of you can recommend. Suggestions? -- - Adam ** I can fix your database problems: http://www.everylastounce.com/mysql.html ** Blog............... [ http://www.aquick.org/blog ] Links.............. [ http://del.icio.us/fields ] Photos............. [ http://www.aquick.org/photoblog ] Experience......... [ http://www.adamfields.com/resume.html ] Product Reviews: .. [ http://www.buyadam.com/blog ] From jayeshsh at ceruleansky.com Sun Apr 3 11:36:34 2005 From: jayeshsh at ceruleansky.com (Jayesh Sheth) Date: Sun, 3 Apr 2005 11:36:34 -0400 (EDT) Subject: [nycphp-talk] Login manager? Message-ID: <55237.69.86.84.233.1112542594.spork@webmail.ceruleansky.com> Hello Adam, I usually use the PEAR Auth library for authentication: http://pear.php.net/package/Auth It is not an end-to-end system with a user-interface, but it is a library that provides the core login functionality required for an authentication. It also has various 'containers' or 'drivers' for checking login credentials against a database, LDAP, POP3, IMAP, SOAP, etc. So, you could authenticate users using an existing, external system too, if so desired. Best regards, - Jay Sheth From mitch.pirtle at gmail.com Sun Apr 3 11:45:14 2005 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Sun, 3 Apr 2005 10:45:14 -0500 Subject: [nycphp-talk] Login manager? In-Reply-To: <55237.69.86.84.233.1112542594.spork@webmail.ceruleansky.com> References: <55237.69.86.84.233.1112542594.spork@webmail.ceruleansky.com> Message-ID: <330532b60504030845677d0a58@mail.gmail.com> On Apr 3, 2005 10:36 AM, Jayesh Sheth wrote: > Hello Adam, > > I usually use the PEAR Auth library for authentication: > http://pear.php.net/package/Auth One quick addition: Auth also has some very handy methods for manipulating user accounts, including create/delete actions. Very nice, as you can integrate it with your existing data model and have prebuilt methods for account management. -- Mitch From dallas.devries at gmail.com Sun Apr 3 11:46:22 2005 From: dallas.devries at gmail.com (Dallas DeVries) Date: Sun, 3 Apr 2005 11:46:22 -0400 Subject: [nycphp-talk] parsing RSS feeds using the Unserializer Message-ID: <1200dbac0504030846182a7320@mail.gmail.com> I'm using the Unserialize pear class to parse out an RSS feed. The problem I'm having is accessing the attribute with the colon in it. Does anyone know how to access this element such as this? $options = array('complexType' => 'object',"parseAttributes" => true, "attributesArray" => false); $unserializer =& new XML_Unserializer($options); $status = $unserializer->unserialize($content); $data = $unserializer->getUnserializedData(); foreach($data->channel->item as $item) { echo $item->dc:creator; stdClass Object ( [title] => Diamond Mind 2005 Predicted Standings Out [link] => http://ussmariner.com/?p=2378 [comments] => http://ussmariner.com/?p=2378#comments [pubDate] => Thu, 31 Mar 2005 05:11:34 +0000 [dc:creator] => DMZ [category] => General baseball [guid] => http://ussmariner.com/?p=2378 ............. Thanks! Dallas -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiflett at php.net Sun Apr 3 15:09:33 2005 From: shiflett at php.net (Chris Shiflett) Date: Sun, 03 Apr 2005 15:09:33 -0400 Subject: [nycphp-talk] FW: Report: P-Languages Better For Enterprise In-Reply-To: <20050331001514.GH30454@lola.aquick.org> References: <20050330234912.DF71A99E0@mailrelay.t-mobile.com> <20050331001514.GH30454@lola.aquick.org> Message-ID: <42503F6D.6080600@php.net> Adam Fields wrote: > > http://internetnews.com/dev-news/article.php/3492771 > > There's a big section in this article about security. I think the > assessment included is misleading in a number of ways (for one - not > discussing the total number of apps, just the number of exploits) Richard sent me this report before he published it, and I countered many of the misleading statements. The final report (to which this article refers) contains my counters, so it's a bit more balanced than you might think. :-) Chris From rahmin at insite-out.com Sun Apr 3 20:06:32 2005 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Sun, 03 Apr 2005 20:06:32 -0400 Subject: [nycphp-talk] caching queries In-Reply-To: <20040503211231.GB23690@ncc.edu> References: <40969361.3020502@surgam.net> <20040503211231.GB23690@ncc.edu> Message-ID: <42508508.5050601@insite-out.com> Hi all, I'd like to cache certain queries, but we're using MySQL 3.23.40, which I don't believe supports query caching (I'd love to be wrong). So I'm trying to come up other ways to cache db content for 5-10 min intervals. I have a few ideas (force header caching | cron script to write includes | write/pull new content per timestamp), but I'm not sure what's the best way to go, or there are other options, and I'm curious what the more knowledgeable peeps think. What's the best way to go? From danielc at analysisandsolutions.com Mon Apr 4 00:36:16 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 4 Apr 2005 00:36:16 -0400 Subject: [nycphp-talk] caching queries In-Reply-To: <42508508.5050601@insite-out.com> References: <40969361.3020502@surgam.net> <20040503211231.GB23690@ncc.edu> <42508508.5050601@insite-out.com> Message-ID: <20050404043615.GB7591@panix.com> On Sun, Apr 03, 2005 at 08:06:32PM -0400, Rahmin Pavlovic wrote: > > So I'm trying to come up other ways to cache db content for 5-10 min > intervals. Are you caching queries or are you caching the HTML output of scripts that are generated using information from a database? --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Mon Apr 4 02:03:04 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 4 Apr 2005 02:03:04 -0400 Subject: [nycphp-talk] Login manager? In-Reply-To: <20050403041254.GC17723@lola.aquick.org> References: <20050403041254.GC17723@lola.aquick.org> Message-ID: <20050404060304.GA11234@panix.com> Hi: Consider PEAR Auth_LiveUser: http://pear.php.net/package/LiveUser While it's a beta, it's a very interesting offering. Do note, there's a separate package for administrative tasks: http://pear.php.net/package/LiveUser_Admin --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From lists at zaunere.com Mon Apr 4 08:00:43 2005 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 4 Apr 2005 08:00:43 -0400 Subject: [nycphp-talk] Uploaded file permissions In-Reply-To: Message-ID: <200504041200.j34C0i425527@relay1.san2.attens.com> > I?d like to override the default uploaded file permissions, so that my > backup script can read them. For example, when I upload a file it?s owned by > apache, with read/write for the owner only. Ideally, I?d like to allow read > by everyone, or set the group owner to backup, with read permission. > > Of course, I could do the chmod/chown stuff, but it seems like there?s a php > setting someplace that I can tweak. > > Any ideas? This is always a sticky area. In my opinion, there is no good way to do this. Typically, system backups run as root, so permissions in this case aren't a problem. If the backup isn't running as root, then it might be best to use the correct combination of group permissions (ie, having the files group readable and the backup script being in the same group as the web server). Changing permissions and ownerships via a web server is always a scary proposition. H From lists at zaunere.com Mon Apr 4 08:02:53 2005 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 4 Apr 2005 08:02:53 -0400 Subject: [nycphp-talk] parsing RSS feeds using the Unserializer In-Reply-To: <1200dbac0504030846182a7320@mail.gmail.com> Message-ID: <200504041202.j34C2r426342@relay1.san2.attens.com> I'm using the Unserialize pear class to parse out an RSS feed. The problem I'm having is accessing the attribute with the colon in it. Does anyone know how to access this element such as this? $options = array('complexType' => 'object',"parseAttributes" => true, "attributesArray" => false); $unserializer =& new XML_Unserializer($options); $status = $unserializer->unserialize($content); $data = $unserializer->getUnserializedData(); foreach($data->channel->item as $item) { echo $item->dc:creator; stdClass Object ( [title] => Diamond Mind 2005 Predicted Standings Out [link] => http://ussmariner.com/?p=2378 [comments] => http://ussmariner.com/?p=2378#comments [pubDate] => Thu, 31 Mar 2005 05:11:34 +0000 [dc:creator] => DMZ [category] => General baseball [guid] => http://ussmariner.com/?p=2378 Variables shouldn't have a colon in their name. http://www.php.net/manual/en/language.variables.php H -------------- next part -------------- An HTML attachment was scrubbed... URL: From rahmin at insite-out.com Mon Apr 4 08:47:22 2005 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Mon, 04 Apr 2005 08:47:22 -0400 Subject: [nycphp-talk] caching queries In-Reply-To: <20050404043615.GB7591@panix.com> References: <40969361.3020502@surgam.net> <20040503211231.GB23690@ncc.edu> <42508508.5050601@insite-out.com> <20050404043615.GB7591@panix.com> Message-ID: <4251375A.7050004@insite-out.com> Daniel Convissor wrote: > On Sun, Apr 03, 2005 at 08:06:32PM -0400, Rahmin Pavlovic wrote: > >>So I'm trying to come up other ways to cache db content for 5-10 min >>intervals. > > > Are you caching queries or are you caching the HTML output of scripts that > are generated using information from a database? > I'd like to cache the database content being dressed up in HTML for any page requests within a given timeframe, say 10 minutes. So if database records are updated at minute 2, all subsequent page requests will still see the old content until minute 10. The goal is to avoid hitting the database with every page request, rather pulling new content once per interval. From amiller at criticalmedia.biz Mon Apr 4 08:57:37 2005 From: amiller at criticalmedia.biz (Alan T. Miller) Date: Mon, 4 Apr 2005 05:57:37 -0700 Subject: [nycphp-talk] caching queries References: <40969361.3020502@surgam.net><20040503211231.GB23690@ncc.edu> <42508508.5050601@insite-out.com><20050404043615.GB7591@panix.com> <4251375A.7050004@insite-out.com> Message-ID: <02db01c53915$e0bce760$0b01a8c0@webdev> It sounds like you may benefit from caching the whole page, take a look at the PEAR Cache_Lite Class, may be just what you need. At least I am using it for something very similar. Alan ----- Original Message ----- From: "Rahmin Pavlovic" To: "NYPHP Talk" Sent: Monday, April 04, 2005 5:47 AM Subject: Re: [nycphp-talk] caching queries > Daniel Convissor wrote: > >> On Sun, Apr 03, 2005 at 08:06:32PM -0400, Rahmin Pavlovic wrote: >> >>>So I'm trying to come up other ways to cache db content for 5-10 min >>>intervals. >> >> >> Are you caching queries or are you caching the HTML output of scripts >> that are generated using information from a database? >> > > I'd like to cache the database content being dressed up in HTML for any > page requests within a given timeframe, say 10 minutes. So if database > records are updated at minute 2, all subsequent page requests will still > see the old content until minute 10. > > The goal is to avoid hitting the database with every page request, rather > pulling new content once per interval. > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From dallas.devries at gmail.com Mon Apr 4 09:21:15 2005 From: dallas.devries at gmail.com (Dallas DeVries) Date: Mon, 4 Apr 2005 09:21:15 -0400 Subject: [nycphp-talk] parsing RSS feeds using the Unserializer In-Reply-To: <200504041202.j34C2r426342@relay1.san2.attens.com> References: <1200dbac0504030846182a7320@mail.gmail.com> <200504041202.j34C2r426342@relay1.san2.attens.com> Message-ID: <1200dbac050404062146c1da59@mail.gmail.com> As you can see PHP did infact set the attribute of an object to have a colon in it with a corresponding value. Matching tags and parsing out the colons before I unserialize seems like an unecessary hack to avoid this but perhaps thats all I'm left with using this Class. -Dallas On Apr 4, 2005 8:02 AM, Hans Zaunere wrote: > > I'm using the Unserialize pear class to parse out an RSS feed. > > The problem I'm having is accessing the attribute with the colon in it. > Does anyone know how to access this element such as this? > > $options = array('complexType' => 'object',"parseAttributes" => true, > "attributesArray" => false); > $unserializer =& new XML_Unserializer($options); > $status = $unserializer->unserialize($content); > $data = $unserializer->getUnserializedData(); > foreach($data->channel->item as $item) { > echo *$item->dc:creator;* > > stdClass Object > ( > [title] => Diamond Mind 2005 Predicted Standings Out > [link] => http://ussmariner.com/?p=2378 > [comments] => http://ussmariner.com/?p=2378#comments > [pubDate] => Thu, 31 Mar 2005 05:11:34 +0000 > [dc:creator] => DMZ > [category] => General baseball > [guid] => http://ussmariner.com/?p=2378 > > Variables shouldn't have a colon in their name. > > http://www.php.net/manual/en/language.variables.php > > H > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmintz at davidmintz.org Mon Apr 4 09:28:53 2005 From: dmintz at davidmintz.org (David Mintz) Date: Mon, 4 Apr 2005 09:28:53 -0400 (EDT) Subject: [nycphp-talk] caching queries In-Reply-To: <42508508.5050601@insite-out.com> References: <40969361.3020502@surgam.net> <20040503211231.GB23690@ncc.edu> <42508508.5050601@insite-out.com> Message-ID: On Sun, 3 Apr 2005, Rahmin Pavlovic wrote: > So I'm trying to come up other ways to cache db content for 5-10 min > intervals. I have a few ideas (force header caching | cron script to > write includes | write/pull new content per timestamp), but I'm not sure > what's the best way to go, or there are other options, and I'm curious > what the more knowledgeable peeps think. What's the best way to go? Cache_Lite is nice for caching stuff, whatever it is -- finished HTML, or data you pull from a database. http://pear.php.net/manual/en/package.caching.cache-lite.php --- David Mintz http://davidmintz.org/ From corey at domanistudios.com Mon Apr 4 10:44:55 2005 From: corey at domanistudios.com (corey szopinski) Date: Mon, 04 Apr 2005 10:44:55 -0400 Subject: [nycphp-talk] caching queries In-Reply-To: <42508508.5050601@insite-out.com> Message-ID: You should check out memchached: http://www.danga.com/memcached/ It could be overkill for your application, but it?s built specifically to take load off the database. -corey On 4/3/05 8:06 PM, "Rahmin Pavlovic" wrote: > I'd like to cache certain queries, but we're using MySQL 3.23.40, which > I don't believe supports query caching (I'd love to be wrong). > > So I'm trying to come up other ways to cache db content for 5-10 min > intervals. I have a few ideas (force header caching | cron script to > write includes | write/pull new content per timestamp), but I'm not sure > what's the best way to go, or there are other options, and I'm curious > what the more knowledgeable peeps think. What's the best way to go? Corey Szopinski Director of Technology DOMANI STUDIOS corey at domanistudios.com 55 Washington St. Suite 822 Brooklyn, NY 11201 718-797-4470 x116 From hans.kaspersetz at nyphp.org Mon Apr 4 12:59:15 2005 From: hans.kaspersetz at nyphp.org (Hans C. Kaspersetz) Date: Mon, 04 Apr 2005 12:59:15 -0400 Subject: [nycphp-talk] March Presentations Message-ID: <42517263.4090201@nyphp.org> For all those interested, I have posted the March presentations to the New York PHP web site. We have Power Point and PDF slides from Source Labs and an MP3 of the meeting. Enjoy. http://www.nyphp.org/content/presentations/index.php Hans Kaspersetz New York PHP & Cyber X Designs http://www.cyberxdesigns.com From adam at trachtenberg.com Mon Apr 4 13:07:37 2005 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Mon, 4 Apr 2005 13:07:37 -0400 (EDT) Subject: [nycphp-talk] parsing RSS feeds using the Unserializer In-Reply-To: <1200dbac050404062146c1da59@mail.gmail.com> References: <1200dbac0504030846182a7320@mail.gmail.com> <200504041202.j34C2r426342@relay1.san2.attens.com> <1200dbac050404062146c1da59@mail.gmail.com> Message-ID: print ${"dc:creator"}; -adam On Mon, 4 Apr 2005, Dallas DeVries wrote: > As you can see PHP did infact set the attribute of an object to have a colon > in it with a corresponding value. Matching tags and parsing out the colons > before I unserialize seems like an unecessary hack to avoid this but perhaps > thats all I'm left with using this Class. > > -Dallas > > On Apr 4, 2005 8:02 AM, Hans Zaunere wrote: > > > > I'm using the Unserialize pear class to parse out an RSS feed. > > > > The problem I'm having is accessing the attribute with the colon in it. > > Does anyone know how to access this element such as this? > > > > $options = array('complexType' => 'object',"parseAttributes" => true, > > "attributesArray" => false); > > $unserializer =& new XML_Unserializer($options); > > $status = $unserializer->unserialize($content); > > $data = $unserializer->getUnserializedData(); > > foreach($data->channel->item as $item) { > > echo *$item->dc:creator;* > > > > stdClass Object > > ( > > [title] => Diamond Mind 2005 Predicted Standings Out > > [link] => http://ussmariner.com/?p=2378 > > [comments] => http://ussmariner.com/?p=2378#comments > > [pubDate] => Thu, 31 Mar 2005 05:11:34 +0000 > > [dc:creator] => DMZ > > [category] => General baseball > > [guid] => http://ussmariner.com/?p=2378 > > > > Variables shouldn't have a colon in their name. > > > > http://www.php.net/manual/en/language.variables.php > > > > H > > > > _______________________________________________ > > New York PHP Talk Mailing List > > AMP Technology > > Supporting Apache, MySQL and PHP > > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org > > > > > -- adam at trachtenberg.com | http://www.trachtenberg.com author of o'reilly's "upgrading to php 5" and "php cookbook" avoid the holiday rush, buy your copies today! From chsnyder at gmail.com Mon Apr 4 13:09:27 2005 From: chsnyder at gmail.com (csnyder) Date: Mon, 4 Apr 2005 13:09:27 -0400 Subject: [nycphp-talk] parsing RSS feeds using the Unserializer In-Reply-To: References: <1200dbac0504030846182a7320@mail.gmail.com> <200504041202.j34C2r426342@relay1.san2.attens.com> <1200dbac050404062146c1da59@mail.gmail.com> Message-ID: On Apr 4, 2005 1:07 PM, Adam Maccabee Trachtenberg wrote: > print ${"dc:creator"}; > Excellent, I was hoping someone would try that! From adam at trachtenberg.com Mon Apr 4 13:11:32 2005 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Mon, 4 Apr 2005 13:11:32 -0400 (EDT) Subject: [nycphp-talk] parsing RSS feeds using the Unserializer In-Reply-To: References: <1200dbac0504030846182a7320@mail.gmail.com> <200504041202.j34C2r426342@relay1.san2.attens.com> <1200dbac050404062146c1da59@mail.gmail.com> Message-ID: Or in this case, $item->{"dc:creator"}; -adam On Mon, 4 Apr 2005, Adam Maccabee Trachtenberg wrote: > print ${"dc:creator"}; > > -adam > > On Mon, 4 Apr 2005, Dallas DeVries wrote: > > > As you can see PHP did infact set the attribute of an object to have a colon > > in it with a corresponding value. Matching tags and parsing out the colons > > before I unserialize seems like an unecessary hack to avoid this but perhaps > > thats all I'm left with using this Class. > > > > -Dallas > > > > On Apr 4, 2005 8:02 AM, Hans Zaunere wrote: > > > > > > I'm using the Unserialize pear class to parse out an RSS feed. > > > > > > The problem I'm having is accessing the attribute with the colon in it. > > > Does anyone know how to access this element such as this? > > > > > > $options = array('complexType' => 'object',"parseAttributes" => true, > > > "attributesArray" => false); > > > $unserializer =& new XML_Unserializer($options); > > > $status = $unserializer->unserialize($content); > > > $data = $unserializer->getUnserializedData(); > > > foreach($data->channel->item as $item) { > > > echo *$item->dc:creator;* > > > > > > stdClass Object > > > ( > > > [title] => Diamond Mind 2005 Predicted Standings Out > > > [link] => http://ussmariner.com/?p=2378 > > > [comments] => http://ussmariner.com/?p=2378#comments > > > [pubDate] => Thu, 31 Mar 2005 05:11:34 +0000 > > > [dc:creator] => DMZ > > > [category] => General baseball > > > [guid] => http://ussmariner.com/?p=2378 > > > > > > Variables shouldn't have a colon in their name. > > > > > > http://www.php.net/manual/en/language.variables.php > > > > > > H > > > > > > _______________________________________________ > > > New York PHP Talk Mailing List > > > AMP Technology > > > Supporting Apache, MySQL and PHP > > > http://lists.nyphp.org/mailman/listinfo/talk > > > http://www.nyphp.org > > > > > > > > > > -- adam at trachtenberg.com | http://www.trachtenberg.com author of o'reilly's "upgrading to php 5" and "php cookbook" avoid the holiday rush, buy your copies today! From dmintz at davidmintz.org Mon Apr 4 14:29:00 2005 From: dmintz at davidmintz.org (David Mintz) Date: Mon, 4 Apr 2005 14:29:00 -0400 (EDT) Subject: [nycphp-talk] parsing RSS feeds using the Unserializer In-Reply-To: References: <1200dbac0504030846182a7320@mail.gmail.com> <200504041202.j34C2r426342@relay1.san2.attens.com> <1200dbac050404062146c1da59@mail.gmail.com> Message-ID: On Mon, 4 Apr 2005, Adam Maccabee Trachtenberg wrote: > Or in this case, $item->{"dc:creator"}; > > -adam So what if it looks a little like Perl. --- David Mintz http://davidmintz.org/ From rahmin at insite-out.com Mon Apr 4 16:45:18 2005 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Mon, 4 Apr 2005 16:45:18 -0400 Subject: [nycphp-talk] caching pages Message-ID: <200504042045.j34KjIw1030363@webmail4.megamailservers.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From danielc at analysisandsolutions.com Mon Apr 4 17:05:43 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 4 Apr 2005 17:05:43 -0400 Subject: [nycphp-talk] securityfocus 294 summary Message-ID: <20050404210543.GA22028@panix.com> SecurityFocus Newsletter #294 PHP STUFF --------- CoolForum Cross-Site Scripting And SQL Injection Vulnerabili... http://www.securityfocus.com/bid/12852 PHP-Fusion Setuser.PHP HTML Injection Vulnerability http://www.securityfocus.com/bid/12853 Ciamos Highlight.PHP File Disclosure Vulnerability http://www.securityfocus.com/bid/12854 TRG News Script Remote File Include Vulnerability http://www.securityfocus.com/bid/12855 CzarNews Remote File Include Vulnerability http://www.securityfocus.com/bid/12857 PHPMyFamily Multiple SQL Injection Vulnerabilities http://www.securityfocus.com/bid/12860 Kayako ESupport Index.PHP Multiple Parameter Cross-Site Scri... http://www.securityfocus.com/bid/12868 Phorum HTTP Response Splitting Vulnerability http://www.securityfocus.com/bid/12869 MercuryBoard Title Field HTML Injection Vulnerability http://www.securityfocus.com/bid/12872 Vortex Portal Remote PHP File Include Vulnerability http://www.securityfocus.com/bid/12878 InterSpire ArticleLive NewComment Cross-Site Scripting Vulne... http://www.securityfocus.com/bid/12879 BirdBlog AdminCore.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/12880 DigitialHive Base.PHP Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/12883 XMB Forum Multiple Remote Cross-Site Scripting Vulnerabiliti... http://www.securityfocus.com/bid/12886 PHPSysInfo Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/12887 Invision Power Board HTML Injection Vulnerability http://www.securityfocus.com/bid/12888 Topic Calendar Calendar_Scheduler.PHP Cross-Site Scripting V... http://www.securityfocus.com/bid/12893 Double Choco Latte Multiple Vulnerabilities http://www.securityfocus.com/bid/12894 Dream4 Koobi CMS Index.PHP Cross-Site Scripting Vulnerabilit... http://www.securityfocus.com/bid/12895 Dream4 Koobi CMS Index.PHP SQL Injection Vulnerability http://www.securityfocus.com/bid/12896 PHPMyDirectory Review.PHP Multiple Parameter Cross-Site Scri... http://www.securityfocus.com/bid/12900 RELATED STUFF ------------- Apache mod_ssl ssl_io_filter_cleanup Remote Denial Of Servic... http://www.securityfocus.com/bid/12877 -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jayeshsh at ceruleansky.com Mon Apr 4 17:14:34 2005 From: jayeshsh at ceruleansky.com (Jayesh Sheth) Date: Mon, 04 Apr 2005 17:14:34 -0400 Subject: [nycphp-talk] caching queries Message-ID: <4251AE3A.60300@ceruleansky.com> Hi Rahmin, I think the Smarty templating system ( http://smarty.php.net ) lets you use selective HTML caching (not to be confused with Smarty template compilation). I googled a bit, and found this article: http://revjim.net/comments/10170/ The comments section has the following useful information: "Posted by Monte A note on Smarty caching at the template-level vs. caching at the application-level: one huge advantage of Smarty's caching is the ability to make parts of the page non-cached via {insert} tags or block functions registered as non-cachable. This way you can easily embed "live" content such as weather bugs, banner ads, user feedback, etc. Example, you can keep a page cached indefinately while allowing embedded user feedback to grow. This isn't too feasible with application-level caching without a lot of extra legwork from the application programmer." "Posted by Paul M. Jones [...] I would argue this is a feature or failure of a particular caching system, not of a template system. While not trivial, it is not a difficult exercise to add that kind of feature to an app-level caching system, e.g. Cache_Lite; I have done so myself with some my non-public tools. [...] " Btw, David Sklar's PHP Tools Book ( http://tinyurl.com/5h2e9 ) has a good overview of Smarty. Hope that helps. - Jay Sheth From rahmin at insite-out.com Mon Apr 4 17:55:41 2005 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Mon, 4 Apr 2005 17:55:41 -0400 Subject: [nycphp-talk] caching pages Message-ID: <200504042155.j34Ltfw1005483@webmail4.megamailservers.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From joel at tagword.com Mon Apr 4 20:01:59 2005 From: joel at tagword.com (Joel De Gan) Date: Mon, 04 Apr 2005 20:01:59 -0400 Subject: [nycphp-talk] caching pages In-Reply-To: <200504042155.j34Ltfw1005483@webmail4.megamailservers.com> References: <200504042155.j34Ltfw1005483@webmail4.megamailservers.com> Message-ID: <1112659319.8418.64.camel@bezel> If you really felt like going crazy and are running an ad server or something, I wrote a shared memory caching engine in php.. http://lucifer.intercosmos.net/?view=SNIP&item=120 That is the old version as all new enhancements were for my work... A modified version of this code is used on the registrar I work for and processes a few million hits per day. cheers -joel On Mon, 2005-04-04 at 17:55, Rahmin Pavlovic wrote: > On Mon, 4 Apr 2005 16:45 , Rahmin Pavlovic sent: > > >Do you know if it's possible to cache the PHP template, or do I have to save a > >flat version of it then cache that? > > > > I think I got it: > > ob_start(); > include('template.inc'); > $template_file=ob_get_contents(); > $cache_obj->save($template_file); > ob_end_flush(); > > Thanks for all the help, everybody > -R > > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From jayeshsh at ceruleansky.com Tue Apr 5 11:27:55 2005 From: jayeshsh at ceruleansky.com (Jayesh Sheth) Date: Tue, 05 Apr 2005 11:27:55 -0400 Subject: [nycphp-talk] Zip webservice 0.1 Message-ID: <4252AE7B.9000902@ceruleansky.com> Hello all, I thought this script would be of use to some of you. I just came across it. It is a script that provides a SOAP interface to a freely available list of 43191 zip codes + latitudes and longitudes by Civicspace Labs. You can download the software here: http://freshmeat.net/projects/zipwebservice/?branch_id=57410&release_id=192526 You can download the zip code database here: http://civicspacelabs.org/home/zipcodedb You can view a demo of it here: http://www.cthorn.com/zipcodes/ This is so exciting for me ... there are so many uses for this. An entered zip code can be validated against a city name, or a city name can be automatically prefilled once a zip code is entered, and so on. Also - the associated latitudes and longitudes could be used to calculate things such as 'people in your area' etc. Best regards, - Jay Sheth From jayeshsh at ceruleansky.com Tue Apr 5 12:17:40 2005 From: jayeshsh at ceruleansky.com (Jayesh Sheth) Date: Tue, 05 Apr 2005 12:17:40 -0400 Subject: [nycphp-talk] Zip webservice 0.1 Message-ID: <4252BA24.1040404@ceruleansky.com> Hello all, I have an interesting followup question. I tried importing the aforementioned zip code data into MySQL using PHPMyAdmin, but it took over 5 minutes, and the script timed out. I did the same using a PHP script run from the command line (using the CLI version of PHP) and it seemed to take but a few seconds (okay, maybe 20 seconds) to insert 43191 rows. The CLI import script follows. Does anyone know why PHPMyAdmin's import process takes so much longer? Thanks, - Jay Sheth From rolan at omnistep.com Tue Apr 5 13:06:38 2005 From: rolan at omnistep.com (Rolan Yang) Date: Tue, 05 Apr 2005 13:06:38 -0400 Subject: [nycphp-talk] Deconstructing google maps In-Reply-To: <4252AE7B.9000902@ceruleansky.com> References: <4252AE7B.9000902@ceruleansky.com> Message-ID: <4252C59E.2030004@omnistep.com> Jay, Thanks for that link! I've used zipcode databases for clients before, but none were public domain. It will come in handy and also cut down on future costs. I've been looking into the google maps interface lately. It's pretty sexy. I've decoded the scheme they use to map image blocks to lat/lon coordinates. Here's a simple interface: http://www.datawhorehouse.com/gps2/ source can be viwed at http://www.datawhorehouse.com/gps2/index.phps It's interesting to note that Google's function uses 39.50N 98.35W as the center point whereas the actual center of the continental US is at 39?50'N 98?35'W ... a conversion error! I'll have to figure out how they do that fancy dhtml/javascript scrolling next. Anyway, check it out, and if you make any improvements, shoot me back an email. ~Rolan From codebowl at gmail.com Tue Apr 5 13:37:37 2005 From: codebowl at gmail.com (Joseph Crawford) Date: Tue, 5 Apr 2005 13:37:37 -0400 Subject: [nycphp-talk] Deconstructing google maps In-Reply-To: <4252C59E.2030004@omnistep.com> References: <4252AE7B.9000902@ceruleansky.com> <4252C59E.2030004@omnistep.com> Message-ID: <8d9a42800504051037261c4590@mail.gmail.com> wow this is nice.... but question i have is to use this on your site do you have to pay google fee's -- Joseph Crawford Jr. Codebowl Solutions codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From 1j0lkq002 at sneakemail.com Tue Apr 5 14:59:04 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 05 Apr 2005 14:59:04 -0400 Subject: [nycphp-talk] Deconstructing google maps In-Reply-To: <8d9a42800504051037261c4590@mail.gmail.com> References: <4252AE7B.9000902@ceruleansky.com> <4252C59E.2030004@omnistep.com> <8d9a42800504051037261c4590@mail.gmail.com> Message-ID: <1066-13012@sneakemail.com> Joseph Crawford codebowl-at-gmail.com |nyphp dev/internal group use| wrote: > wow this is nice.... but question i have is to use this on your site > do you have to pay google fee's > > -- > Joseph Crawford Jr. > Codebowl Solutions > codebowl at gmail.com > >------------------------------------------------------------------------ > As far as I know the Google maps API isn't out yet, but when it is I think you can assume it will be like other Google APIs (require a key, limited hits, ads on top, etc). They have now added copyright watermarks to the image blocks, and if you follow the discussions on labs you'll see many references to future features; looks like a solid XML API can be expected? -=john andrews From jayeshsh at ceruleansky.com Tue Apr 5 15:30:24 2005 From: jayeshsh at ceruleansky.com (Jayesh Sheth) Date: Tue, 05 Apr 2005 15:30:24 -0400 Subject: [nycphp-talk] Deconstructing google maps Message-ID: <4252E750.6080909@ceruleansky.com> Hi Rolan, thanks for your follow-up post. Glad you found it useful ... I had been looking for a public domain zip database for some time. Companies such as Melissa Data provide similar data on demand, but that of course costs $$$. Your deconstruction looks interesting, but perhaps the math is a bit over my head. I can handle standard PHP programming, database design and heck, even funny creations such as XUL, but mentions of regressions bring up (somewhat frightening) memories of the managerial economics class I had in college with professor Erfle. (It was the 'make-or-break' course for one of my majors.) I will take a look at the stuff you posted, and try to figure out how it all works ... If I have something useful to say, I'll email you or post it here. Also - feel free to post any code snippets to the AMPeers section at Clew under 'Code Snippets': http://clew.nyphp.org/clew/education/ampeers#/education/ampeers I will posting some stuff to the code snippets section at AMPeers reg. fixing PHPMyAdmin's failure to put quotes around timestamp values in exported SQL files. (This problem can cause your export of 100,000 rows to be useless because MySQL expects quotes around values such as 2004-09-12 22:59:51 ). Best regards, - Jay Sheth From prusak at gmail.com Tue Apr 5 15:33:02 2005 From: prusak at gmail.com (Ophir Prusak) Date: Tue, 5 Apr 2005 15:33:02 -0400 Subject: [nycphp-talk] caching pages In-Reply-To: <200504042045.j34KjIw1030363@webmail4.megamailservers.com> References: <200504042045.j34KjIw1030363@webmail4.megamailservers.com> Message-ID: Here's my "secret weapon" :) http://www.jpcache.com/ I've been using this for the past three years. It's as close to plug and play page caching as I've ever come across. From phil at bearingasset.com Tue Apr 5 15:43:19 2005 From: phil at bearingasset.com (Phil Duffy) Date: Tue, 5 Apr 2005 15:43:19 -0400 Subject: [nycphp-talk] Zip webservice 0.1 In-Reply-To: <4252AE7B.9000902@ceruleansky.com> Message-ID: <20050405194356.EBDC5A85FE@virtu.nyphp.org> Jay, In an earlier system we acquired a commercial Zip Code file, which allowed us to do some cool things, but I had wanted to extend that for geographical coordinates. I am really excited about your find. Phil -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Jayesh Sheth Sent: Tuesday, April 05, 2005 10:28 AM To: talk at lists.nyphp.org Subject: [nycphp-talk] Zip webservice 0.1 Hello all, I thought this script would be of use to some of you. I just came across it. It is a script that provides a SOAP interface to a freely available list of 43191 zip codes + latitudes and longitudes by Civicspace Labs. You can download the software here: http://freshmeat.net/projects/zipwebservice/?branch_id=57410&release_id=1925 26 You can download the zip code database here: http://civicspacelabs.org/home/zipcodedb You can view a demo of it here: http://www.cthorn.com/zipcodes/ This is so exciting for me ... there are so many uses for this. An entered zip code can be validated against a city name, or a city name can be automatically prefilled once a zip code is entered, and so on. Also - the associated latitudes and longitudes could be used to calculate things such as 'people in your area' etc. Best regards, - Jay Sheth _______________________________________________ New York PHP Talk Mailing List AMP Technology Supporting Apache, MySQL and PHP http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org From chauncey.thorn at gmail.com Tue Apr 5 15:58:03 2005 From: chauncey.thorn at gmail.com (Chauncey Thorn) Date: Tue, 5 Apr 2005 15:58:03 -0400 Subject: [nycphp-talk] Zip webservice 0.1 In-Reply-To: <4252AE7B.9000902@ceruleansky.com> References: <4252AE7B.9000902@ceruleansky.com> Message-ID: <9ebd5b3c05040512587c4ea55e@mail.gmail.com> Thanks for posting my little project to this list. > calculate things such as 'people in your area' etc. good idea.... Is there a formula for calculating population based on lat/long ? Thanks again Chauncey Thorn On Apr 5, 2005 11:27 AM, Jayesh Sheth wrote: > Hello all, > > I thought this script would be of use to some of you. I just came across it. > > It is a script that provides a SOAP interface to a freely available > list of 43191 zip codes + latitudes and longitudes by Civicspace Labs. > > You can download the software here: > http://freshmeat.net/projects/zipwebservice/?branch_id=57410&release_id=192526 > > You can download the zip code database here: > http://civicspacelabs.org/home/zipcodedb > > You can view a demo of it here: > http://www.cthorn.com/zipcodes/ > > This is so exciting for me ... there are so many uses for this. An > entered zip code can be validated against a city name, or a city name > can be automatically prefilled once a zip code is entered, and so on. > Also - the associated latitudes and longitudes could be used to > calculate things such as 'people in your area' etc. > > Best regards, > > - Jay Sheth > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From agfische at email.smith.edu Tue Apr 5 16:00:13 2005 From: agfische at email.smith.edu (Aaron Fischer) Date: Tue, 5 Apr 2005 16:00:13 -0400 Subject: [nycphp-talk] MySQL UPDATE Message-ID: <2494332e16499fdc692ab38d7c7cd004@email.smith.edu> Greetings, Apologies for the obnoxious looking post, I'm really not shouting... =) I have run into a little problem with an application that I am building that will allow users to add, update and/or delete records from a mysql database. All works well except for the form that is used to edit (update) an existing record. The form page queries the database, retrieves the values, creates the form and populates the form fields with the appropriate values. The form properly updates the database record when the user adds a value to an empty field or changes the field value. However, the problem occurs when a user wants to remove a value, resulting in the field holding no value. The form will post fine, but the field that contains no value will not update the database. The database field retains it's existing data. I had thought that the value in the database record would be overwritten by the empty value coming from the form field. Clearly it isn't. Would appreciate any tips/pointers; please let me know if additional info would be helpful. Thanks, -Aaron From kenrbnsn at rbnsn.com Tue Apr 5 16:13:14 2005 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Tue, 5 Apr 2005 16:13:14 -0400 Subject: [nycphp-talk] MySQL UPDATE In-Reply-To: <2494332e16499fdc692ab38d7c7cd004@email.smith.edu> References: <2494332e16499fdc692ab38d7c7cd004@email.smith.edu> Message-ID: <20050405161314.qze58fb8vezkgoks@www.rbnsn.com> Quoting Aaron Fischer : [snip] > an empty field or changes the field value. However, the problem occurs > when a user wants to remove a value, resulting in the field holding no > value. The form will post fine, but the field that contains no value > will not update the database. The database field retains it's existing > data. > Do you have code that only updates the field if it's not blank? If so, that's your problem. > > Would appreciate any tips/pointers; please let me know if additional > info would be helpful. Posting the code that does the update would be helpful. Have you tried echoing the update query that you generate to make sure it looks right? Ken From agfische at email.smith.edu Tue Apr 5 16:51:45 2005 From: agfische at email.smith.edu (Aaron Fischer) Date: Tue, 5 Apr 2005 16:51:45 -0400 Subject: [nycphp-talk] MySQL UPDATE In-Reply-To: <20050405161314.qze58fb8vezkgoks@www.rbnsn.com> References: <2494332e16499fdc692ab38d7c7cd004@email.smith.edu> <20050405161314.qze58fb8vezkgoks@www.rbnsn.com> Message-ID: <15c55b53c89c368cdd06ebe4e74ad3a9@email.smith.edu> > Do you have code that only updates the field if it's not blank? If so, > that's > your problem. > Embarrassingly enough, upon examining my code again I saw that my update function was checking to see if the elements of the array were empty, if they were, I didn't include them in the query statement I was preparing. > Posting the code that does the update would be helpful. > Thankfully I have escaped the public shame I would have suffered had I posted my code. =) Thanks for the help Ken! -Aaron From 1j0lkq002 at sneakemail.com Tue Apr 5 17:01:18 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 05 Apr 2005 17:01:18 -0400 Subject: [nycphp-talk] Zip webservice 0.1 In-Reply-To: <9ebd5b3c05040512587c4ea55e@mail.gmail.com> References: <4252AE7B.9000902@ceruleansky.com> <9ebd5b3c05040512587c4ea55e@mail.gmail.com> Message-ID: <19959-64990@sneakemail.com> Chauncey Thorn chauncey.thorn-at-gmail.com |nyphp dev/internal group use| wrote: >Thanks for posting my little project to this list. > > > >>calculate things such as 'people in your area' etc. >> >> >good idea.... >Is there a formula for calculating population based on lat/long ? > >Thanks again > >Chauncey Thorn > > This is an excellent resource for getting census data via zip code: http://library.csun.edu/mfinley/zipcen.html and this is a great zip code reference page (same site, master page): http://library.csun.edu/mfinley/zipstats.html and this page is a "must read" as it will save you many hours of hassle http://mcdc2.missouri.edu/webrepts/geography/ZIP.resources.html andif you're into playing with Google maps check out: http://69.90.152.144/collab/GoogleMapsHacking and http://libgmail.sourceforge.net/googlemaps.html and of course for all the raw data you will need, it's Tigerline: http://www.census.gov/geo/www/tiger/ Hope this helps. There is alot of activity in this space right now, so we expect to see great things! -=john andrews From 1j0lkq002 at sneakemail.com Tue Apr 5 21:40:07 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 05 Apr 2005 21:40:07 -0400 Subject: [nycphp-talk] Deconstructing google maps In-Reply-To: <4252C59E.2030004@omnistep.com> References: <4252AE7B.9000902@ceruleansky.com> <4252C59E.2030004@omnistep.com> Message-ID: <24102-09483@sneakemail.com> Rolan Yang rolan-at-omnistep.com |nyphp dev/internal group use| wrote: > Jay, > Thanks for that link! I've used zipcode databases for clients before, > but none were public domain. It will come in handy and also cut down > on future costs. I've been looking into the google maps interface > lately. It's pretty sexy. I've decoded the scheme they use to map > image blocks to lat/lon coordinates. Here's a simple interface: > > http://www.datawhorehouse.com/gps2/ > source can be viwed at > http://www.datawhorehouse.com/gps2/index.phps > > It's interesting to note that Google's function uses 39.50N 98.35W as > the center point whereas the actual center of the continental US is at > 39?50'N 98?35'W ... a conversion error! > > I'll have to figure out how they do that fancy dhtml/javascript > scrolling next. Anyway, check it out, and if you make any > improvements, shoot me back an email. > > ~Rolan Rolan I find Google's map to be consitently "off" several hundred feet or more. I don't understand your comment about conversion error, but do you also see the display being off? -=john andrews From rolan at omnistep.com Tue Apr 5 22:50:29 2005 From: rolan at omnistep.com (Rolan Yang) Date: Tue, 05 Apr 2005 22:50:29 -0400 Subject: [nycphp-talk] Deconstructing google maps In-Reply-To: <24102-09483@sneakemail.com> References: <4252AE7B.9000902@ceruleansky.com> <4252C59E.2030004@omnistep.com> <24102-09483@sneakemail.com> Message-ID: <42534E75.4050101@omnistep.com> inforequest wrote: > > Rolan I find Google's map to be consitently "off" several hundred feet > or more. I don't understand your comment about conversion error, but > do you also see the display being off? > > -=john andrews > _______________________________________________ It doesn't seem off that much to me. Where are you looking? What I meant by conversion error is that when determining Google's scheme for converting the tile coordinates to lat/lon, the 0,0 point came out to 39.50N 98.35W decimal. The actual geograpic center of the Conterminous United States is 39?50'N 98?35'W * which would actually be 39.83N 98.58W decimal. * as noted in http://erg.usgs.gov/isb/pubs/booklets/elvadist/elvadist.html ~Rolan From 1j0lkq002 at sneakemail.com Tue Apr 5 22:58:45 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 05 Apr 2005 22:58:45 -0400 Subject: [nycphp-talk] Deconstructing google maps In-Reply-To: <42534E75.4050101@omnistep.com> References: <4252AE7B.9000902@ceruleansky.com> <4252C59E.2030004@omnistep.com> <24102-09483@sneakemail.com> <42534E75.4050101@omnistep.com> Message-ID: <10356-53420@sneakemail.com> Rolan Yang rolan-at-omnistep.com |nyphp dev/internal group use| wrote: > inforequest wrote: > >> >> Rolan I find Google's map to be consitently "off" several hundred >> feet or more. I don't understand your comment about conversion error, >> but do you also see the display being off? >> >> -=john andrews >> _______________________________________________ > > > It doesn't seem off that much to me. Where are you looking? What I > meant by conversion error is that when determining Google's scheme for > converting the tile coordinates to lat/lon, the 0,0 point came out to > 39.50N 98.35W decimal. The actual geograpic center of the Conterminous > United States is 39?50'N 98?35'W * which would actually be 39.83N > 98.58W decimal. > > * as noted in > http://erg.usgs.gov/isb/pubs/booklets/elvadist/elvadist.html > > ~Rolan Thanks for clarifying. I determined that the positioning error I am seeing is in the street address coordinates database. It looks like they are using the Census data, because the addresses are off equally in the census 2000 data and Google's map. From chauncey.thorn at gmail.com Wed Apr 6 01:34:43 2005 From: chauncey.thorn at gmail.com (Chauncey Thorn) Date: Wed, 6 Apr 2005 01:34:43 -0400 Subject: [nycphp-talk] Zip webservice 0.1 In-Reply-To: <19959-64990@sneakemail.com> References: <4252AE7B.9000902@ceruleansky.com> <9ebd5b3c05040512587c4ea55e@mail.gmail.com> <19959-64990@sneakemail.com> Message-ID: <9ebd5b3c05040522344061dc60@mail.gmail.com> Thanks... On Apr 5, 2005 5:01 PM, inforequest <1j0lkq002 at sneakemail.com> wrote: > Chauncey Thorn chauncey.thorn-at-gmail.com |nyphp dev/internal group > use| wrote: > > >Thanks for posting my little project to this list. > > > > > > > >>calculate things such as 'people in your area' etc. > >> > >> > >good idea.... > >Is there a formula for calculating population based on lat/long ? > > > >Thanks again > > > >Chauncey Thorn > > > > > > This is an excellent resource for getting census data via zip code: > http://library.csun.edu/mfinley/zipcen.html > > and this is a great zip code reference page (same site, master page): > http://library.csun.edu/mfinley/zipstats.html > > and this page is a "must read" as it will save you many hours of hassle > > http://mcdc2.missouri.edu/webrepts/geography/ZIP.resources.html > > andif you're into playing with Google maps check out: > http://69.90.152.144/collab/GoogleMapsHacking > and > http://libgmail.sourceforge.net/googlemaps.html > > and of course for all the raw data you will need, it's Tigerline: > http://www.census.gov/geo/www/tiger/ > > Hope this helps. There is alot of activity in this space right now, so > we expect to see great things! > > -=john andrews > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From sajith.ml at gmail.com Thu Apr 7 02:53:02 2005 From: sajith.ml at gmail.com (Sajith A) Date: Thu, 7 Apr 2005 12:23:02 +0530 Subject: [nycphp-talk] Well-formed Xml Message-ID: Hello, I'm trying to create an XML file using php. The file stores urls and hence might contain & in it. Now if i use htmlentities() to encode the url and store it, i have to replace & etc while reading the xml to get back the correct url.. I happened to see that if References: Message-ID: <20050407131609.GA7461@panix.com> Jay: On Thu, Apr 07, 2005 at 12:23:02PM +0530, Sajith A wrote: > I happened to see that > if But that will again make it difficult to parse the xml and get the > url... How does it make it harder? I've parsed tons of XML with CDATA and had no problems. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From cfontaine at spidmail.net Thu Apr 7 12:08:07 2005 From: cfontaine at spidmail.net (Cedric Fontaine) Date: Thu, 07 Apr 2005 12:08:07 -0400 Subject: [nycphp-talk] New from Quebec and a question about groupware Message-ID: <42555AE7.7050604@spidmail.net> Hello ! I was in phpquebec 2005 conference and was in both Chris Hendry and Hans Kaspersetz sessions...Of course, it was very interesting and they also told us that we should join this very good discussion list... That's what I've done now ! So, my first question now. I've to switch from tutos (http://www.tutos.org/homepage/index.html) to a more convenient and friendly product. Users told me that tutos is really too difficult and a too big product. So, Chris and Hans spoke a lot about Mambo and mambo modules... Is there a similar product (like Tutos) more user friendly and in which I could easily tweak or add functionnality easily ? Thanks for your help ! Cedric From tom at supertom.com Sat Apr 9 00:28:39 2005 From: tom at supertom.com (Tom) Date: Sat, 09 Apr 2005 00:28:39 -0400 Subject: [nycphp-talk] Can I do this in one query? Message-ID: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> Can I do this in one query? Suppose I have a three column table (it is really not, but I'm trying to keep it simple) table: scores name, varchar(40) category, varchar(40) points, int I would like to select the top 5 in each category with the most amount of points, and group them by category, to ultimately be displayed like this: CATEGORY1 person1 1000 person2 900 person3 800 person4 700 person5 600 CATEGORY2 person1 950 person2 800 person3 700 person4 500 person5 400 I see that I can do this in two queries and some PHP code, by driving a loop with the DISTINCT category, and saying something like SELECT name,points FROM scores WHERE category='$category' ORDER BY points DESC LIMIT 0,5 but there must be a better way Thanks, Tom http://www.liphp.org From list at harveyk.com Sat Apr 9 08:34:11 2005 From: list at harveyk.com (harvey) Date: Sat, 09 Apr 2005 08:34:11 -0400 Subject: [nycphp-talk] Can I do this in one query? In-Reply-To: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> References: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> Message-ID: <6.1.0.6.2.20050409080806.05c24b30@mail.harveyk.com> this will get you all your results in one query but unfortunately doesn't limit to 5 per category you can do that when you're printing the results (or of course maybe there's some fancier query that can do it for you) select name, points from scores group by category asc order by points desc At 12:28 AM 4/9/2005, Tom wrote: >Can I do this in one query? > >Suppose I have a three column table (it is really not, but I'm trying to >keep it simple) > >table: scores >name, varchar(40) >category, varchar(40) >points, int > > >I would like to select the top 5 in each category with the most amount of >points, and group them by category, to ultimately be displayed like this: > > >CATEGORY1 > >person1 1000 >person2 900 >person3 800 >person4 700 >person5 600 > > >CATEGORY2 > >person1 950 >person2 800 >person3 700 >person4 500 >person5 400 > > >I see that I can do this in two queries and some PHP code, by driving a loop >with the DISTINCT category, and saying something like > >SELECT name,points FROM scores WHERE category='$category' ORDER BY points >DESC LIMIT 0,5 > >but there must be a better way > > >Thanks, > > >Tom >http://www.liphp.org > > >_______________________________________________ >New York PHP Talk Mailing List >AMP Technology >Supporting Apache, MySQL and PHP >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org From ben_na at melanconent.com Sat Apr 9 12:01:27 2005 From: ben_na at melanconent.com (=?ISO-8859-1?Q?Benjamin_Melan=E7on?=) Date: Sat, 9 Apr 2005 12:01:27 -0400 Subject: [nycphp-talk] open source box office, ticketing, volunteer management project Message-ID: <5265b6149504ece30da605522519ded8@melanconent.com> Dear Patrick Fee and others in this PHP community, I came across a February thread seeking a simple on-line ticket system for a small theater. I would like to know what was found and what was done, as I plan to do an open source project that would extend on such software. I'm part of a new community-oriented non-profit arts center opening in Framingham, Massachusetts. We're trying to create a comprehensive donor-tracking and ticket system for our use and for other non-profit, small, or mid-size venues anywhere. Below is my current vision for what we're trying to do. I have a programmer I intend to lead this project and I'm hoping for a lot of help from the open source community and especially any theater groups, music venues, or other places that would like to use this software and could submit their requirements and contribute to the project. Our arts center needs a professional-quality venue ticketing system, complete with customizable seating charts, with different prices by section, advance tickets, members, and student/seniors. The system should also track ticket-buyers and attendance, and allow internet ticket sales as well as ones we process ourselves. Ultimately, we would want to build a complete system with fully integrated volunteer, member, attendee, and donor tracking. This would include such things as what volunteer groups people are in, people's membership levels, what shows they went to in what categories like jazz or folk, and what they have given to the center. I'm interested in writing it in PHP and MySQL, and storing virtually everything on-line except members' credit card numbers. I'm open to any solution, but I'd strongly like the final product to be open source and available to all arts venues. All parts on-line (and off) would need good security, which is something I'd need help with. If you have time and interest ? or just advice ? please drop me a line. Sincerely, Benjamin Melan?on Amazing Things Arts Center http://www.amazingthings.org/ Board Member & Secretary ben_na .at. melanconent .dot. com Telephone: 1-508-655-7065 Mobile: 1-508-737-0582 From mitch.pirtle at gmail.com Sat Apr 9 13:26:58 2005 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Sat, 9 Apr 2005 13:26:58 -0400 Subject: [nycphp-talk] New from Quebec and a question about groupware In-Reply-To: <42555AE7.7050604@spidmail.net> References: <42555AE7.7050604@spidmail.net> Message-ID: <330532b6050409102649fbca96@mail.gmail.com> On Apr 7, 2005 12:08 PM, Cedric Fontaine wrote: > Hello ! Greetings! > So, my first question now. > I've to switch from tutos (http://www.tutos.org/homepage/index.html) to > a more convenient and friendly product. > Users told me that tutos is really too difficult and a too big product. > > So, Chris and Hans spoke a lot about Mambo and mambo modules... Well you have one of the Mambo core developers right here, and we also have a mambo mailing list hosted at NYPHP. It is quiet at the time, because I am supposed to be on vacation ;-) There are many options for you, and the best way to make a meaninful recommendation is to get a better understanding of your requirements. In short, what exactly are you trying to do, and what does your new platform need to provide? -- Mitch From danielc at analysisandsolutions.com Sat Apr 9 16:07:22 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 9 Apr 2005 16:07:22 -0400 Subject: [nycphp-talk] Can I do this in one query? In-Reply-To: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> References: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> Message-ID: <20050409200721.GA21061@panix.com> Hi Tom: On Sat, Apr 09, 2005 at 12:28:39AM -0400, Tom wrote: > Can I do this in one query? > > Suppose I have a three column table (it is really not, but I'm trying to > keep it simple) > > table: scores > name, varchar(40) > category, varchar(40) > points, int Your question aside, you've got to normalize. Category, and possibly name, should be integers with the full text in another table. > I would like to select the top 5 in each category with the most amount of > points, and group them by category, to ultimately be displayed like this: I can't quickly think of a way to get the first five in a query. But, what I'd do is run one query: select * from scores group by category, person order by category asc, points desc Then loop through the result set. After the first five, stop displaying but continue looping until the category changes. Then print those 5, etc... Make sure to put in some logic to deal with tie scores. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From tom at supertom.com Sun Apr 10 12:05:15 2005 From: tom at supertom.com (Tom Melendez) Date: Sun, 10 Apr 2005 12:05:15 -0400 Subject: [nycphp-talk] Can I do this in one query? In-Reply-To: <20050409200721.GA21061@panix.com> Message-ID: <0IEQ00GYJMIHBY@mta6.srv.hcvlny.cv.net> Thanks Dan and Harvey, It is actually normalized, with category in its own table. I was just trying to keep it simple. I came to the same conclusion that you both did, so that's what I went with. Thanks for the help! Tom http://www.liphp.org -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Daniel Convissor Sent: Saturday, April 09, 2005 4:07 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Can I do this in one query? Hi Tom: On Sat, Apr 09, 2005 at 12:28:39AM -0400, Tom wrote: > Can I do this in one query? > > Suppose I have a three column table (it is really not, but I'm trying > to keep it simple) > > table: scores > name, varchar(40) > category, varchar(40) > points, int Your question aside, you've got to normalize. Category, and possibly name, should be integers with the full text in another table. > I would like to select the top 5 in each category with the most amount of > points, and group them by category, to ultimately be displayed like this: I can't quickly think of a way to get the first five in a query. But, what I'd do is run one query: select * from scores group by category, person order by category asc, points desc Then loop through the result set. After the first five, stop displaying but continue looping until the category changes. Then print those 5, etc... Make sure to put in some logic to deal with tie scores. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 _______________________________________________ New York PHP Talk Mailing List AMP Technology Supporting Apache, MySQL and PHP http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org From aaron at aarond.com Sun Apr 10 13:48:16 2005 From: aaron at aarond.com (Aaron Deutsch) Date: Sun, 10 Apr 2005 13:48:16 -0400 Subject: [nycphp-talk] Can I do this in one query? In-Reply-To: <0IEQ00GYJMIHBY@mta6.srv.hcvlny.cv.net> References: <0IEQ00GYJMIHBY@mta6.srv.hcvlny.cv.net> Message-ID: <425966E0.5030801@aarond.com> Can't you also use the LIMIT keyword to just grab 5? /I'm a php-mysql newbie Tom Melendez wrote: > Thanks Dan and Harvey, > > It is actually normalized, with category in its own table. I was just > trying to keep it simple. > > I came to the same conclusion that you both did, so that's what I went with. > > Thanks for the help! > > Tom > > http://www.liphp.org > > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On > Behalf Of Daniel Convissor > Sent: Saturday, April 09, 2005 4:07 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Can I do this in one query? > > Hi Tom: > > On Sat, Apr 09, 2005 at 12:28:39AM -0400, Tom wrote: > >>Can I do this in one query? >> >>Suppose I have a three column table (it is really not, but I'm trying >>to keep it simple) >> >>table: scores >>name, varchar(40) >>category, varchar(40) >>points, int > > > Your question aside, you've got to normalize. Category, and possibly name, > should be integers with the full text in another table. > > > >>I would like to select the top 5 in each category with the most amount of >>points, and group them by category, to ultimately be displayed like this: > > > I can't quickly think of a way to get the first five in a query. But, > what I'd do is run one query: > > select * from scores > group by category, person > order by category asc, points desc > > Then loop through the result set. After the first five, stop displaying > but continue looping until the category changes. Then print those 5, > etc... Make sure to put in some logic to deal with tie scores. > > --Dan > From danielc at analysisandsolutions.com Sun Apr 10 21:44:13 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sun, 10 Apr 2005 21:44:13 -0400 Subject: [nycphp-talk] securityfocus 295, inlcudes php problem Message-ID: <20050411014412.GA10140@panix.com> SecurityFocus Newsletter #295 PHP --- PHP JPEG and IFF image Remote Denial Of Service Vulnerability http://www.securityfocus.com/bid/12962 http://www.securityfocus.com/bid/12963 This impacts the getimagesize() function in versions of PHP prior to 4.3.11 and 5.0.4. PHP's developers were notified of the issue on 2005-02-23 and the fixes were committed to ext/standard/image.c on 2005-02-24. APPLICATIONS USING PHP ---------------------- ESMI PayPal Storefront SQL Injection Vulnerability http://www.securityfocus.com/bid/12903 ESMI PayPal Storefront Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/12904 Nuke Bookmarks Marks.php Path Disclosure Vulnerability http://www.securityfocus.com/bid/12906 Nuke Bookmarks Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/12907 Nuke Bookmarks Marks.php SQL Injection Vulnerability http://www.securityfocus.com/bid/12908 MagicScripts E-Store Kit-2 PayPal Edition Cross-Site Scripti... http://www.securityfocus.com/bid/12909 MagicScripts E-Store Kit-2 PayPal Edition Remote File Includ... http://www.securityfocus.com/bid/12910 PHPCoin Multiple Remote Vulnerabilities http://www.securityfocus.com/bid/12917 PhotoPost Pro Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/12920 EncapsBB File Include Vulnerability http://www.securityfocus.com/bid/12933 Smarty Template Engine Remote PHP Script Execution Vulnerability http://www.securityfocus.com/bid/12941 Horde Application Framework Parent Page Title Cross-Site Scr... http://www.securityfocus.com/bid/12943 AlstraSoft EPay Pro Remote File Include Vulnerability http://www.securityfocus.com/bid/12973 PAFileDB ID Parameter Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/12952 InterAKT Online MX Shop SQL Injection Vulnerability http://www.securityfocus.com/bid/12957 Lighthouse Development Squirrelcart SQL Injection Vulnerability http://www.securityfocus.com/bid/12944 WackoWiki Unspecified Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/12939 Chatness Message Form Field HTML Injection Vulnerability http://www.securityfocus.com/bid/12929 CPG Dragonfly Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/12930 Tkai's Shoutbox Query Parameter URI Redirection Vulnerability http://www.securityfocus.com/bid/12914 EXoops Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/12915 Valdersoft Shopping Cart Multiple Input Validation Vulnerability http://www.securityfocus.com/bid/12916 -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From prusak at gmail.com Sun Apr 10 22:00:36 2005 From: prusak at gmail.com (Ophir Prusak) Date: Sun, 10 Apr 2005 22:00:36 -0400 Subject: [nycphp-talk] Can I do this in one query? In-Reply-To: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> References: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> Message-ID: You didn't mention what database and version you're using. I'm pretty sure this is possible with oracle or MS SQL (and probably postgresql). I think it might be possible with mysql 4.1 (that supports sub queries I think). ophir On Apr 9, 2005 12:28 AM, Tom wrote: > Can I do this in one query? > > Suppose I have a three column table (it is really not, but I'm trying to > keep it simple) > > table: scores > name, varchar(40) > category, varchar(40) > points, int > > I would like to select the top 5 in each category with the most amount of > points, and group them by category, to ultimately be displayed like this: > > CATEGORY1 > > person1 1000 > person2 900 > person3 800 > person4 700 > person5 600 > > CATEGORY2 > > person1 950 > person2 800 > person3 700 > person4 500 > person5 400 > > I see that I can do this in two queries and some PHP code, by driving a loop > with the DISTINCT category, and saying something like > > SELECT name,points FROM scores WHERE category='$category' ORDER BY points > DESC LIMIT 0,5 > > but there must be a better way > > Thanks, > > Tom > http://www.liphp.org > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From fields at hedge.net Sun Apr 10 22:26:07 2005 From: fields at hedge.net (Adam Fields) Date: Sun, 10 Apr 2005 22:26:07 -0400 Subject: [nycphp-talk] Can I do this in one query? In-Reply-To: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> References: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> Message-ID: <20050411022607.GT16570@lola.aquick.org> On Sat, Apr 09, 2005 at 12:28:39AM -0400, Tom wrote: > Can I do this in one query? > > Suppose I have a three column table (it is really not, but I'm trying to > keep it simple) > > table: scores > name, varchar(40) > category, varchar(40) > points, int If you're on MySQL 4.1+, you ought to be able to do this with something like: SELECT name, points, category FROM scores s WHERE points IN (SELECT points FROM scores WHERE category = s.category ORDER BY points DESC LIMIT 0,5) ORDER BY category, points DESC; (I think that's right, I haven't actually tried it.) However, this is not guaranteed to give you exactly five results for each category if there are duplicates on points. > I would like to select the top 5 in each category with the most amount of > points, and group them by category, to ultimately be displayed like this: > > > CATEGORY1 > > person1 1000 > person2 900 > person3 800 > person4 700 > person5 600 > > > CATEGORY2 > > person1 950 > person2 800 > person3 700 > person4 500 > person5 400 > > > I see that I can do this in two queries and some PHP code, by driving a loop > with the DISTINCT category, and saying something like > > SELECT name,points FROM scores WHERE category='$category' ORDER BY points > DESC LIMIT 0,5 > > but there must be a better way > > > Thanks, > > > Tom > http://www.liphp.org > > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org -- - Adam ** I can fix your database problems: http://www.everylastounce.com/mysql.html ** Blog............... [ http://www.aquick.org/blog ] Links.............. [ http://del.icio.us/fields ] Photos............. [ http://www.aquick.org/photoblog ] Experience......... [ http://www.adamfields.com/resume.html ] Product Reviews: .. [ http://www.buyadam.com/blog ] From list at harveyk.com Mon Apr 11 09:18:48 2005 From: list at harveyk.com (harvey) Date: Mon, 11 Apr 2005 09:18:48 -0400 Subject: [nycphp-talk] Can I do this in one query? In-Reply-To: <20050411022607.GT16570@lola.aquick.org> References: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> <20050411022607.GT16570@lola.aquick.org> Message-ID: <6.1.0.6.2.20050411091327.033f3510@mail.harveyk.com> I don't think that query will work in all cases. You're still not really limiting the final query to 5 per category. What if there are 10 records in a category and they all have the same score? I think your query will return all of them. Actually, that might be better than arbitrarily limiting at 5 when there's a tie... At 10:26 PM 4/10/2005, Adam Fields wrote: >On Sat, Apr 09, 2005 at 12:28:39AM -0400, Tom wrote: > > Can I do this in one query? > > > > Suppose I have a three column table (it is really not, but I'm trying to > > keep it simple) > > > > table: scores > > name, varchar(40) > > category, varchar(40) > > points, int > >If you're on MySQL 4.1+, you ought to be able to do this with >something like: > >SELECT name, points, category FROM scores s >WHERE points IN (SELECT points FROM scores WHERE category = s.category > ORDER BY points DESC LIMIT 0,5) >ORDER BY category, points DESC; > >(I think that's right, I haven't actually tried it.) > >However, this is not guaranteed to give you exactly five results for >each category if there are duplicates on points. > > > I would like to select the top 5 in each category with the most amount of > > points, and group them by category, to ultimately be displayed like this: > > > > > > CATEGORY1 > > > > person1 1000 > > person2 900 > > person3 800 > > person4 700 > > person5 600 > > > > > > CATEGORY2 > > > > person1 950 > > person2 800 > > person3 700 > > person4 500 > > person5 400 > > > > > > I see that I can do this in two queries and some PHP code, by driving a > loop > > with the DISTINCT category, and saying something like > > > > SELECT name,points FROM scores WHERE category='$category' ORDER BY points > > DESC LIMIT 0,5 > > > > but there must be a better way > > > > > > Thanks, > > > > > > Tom > > http://www.liphp.org > > > > > > _______________________________________________ > > New York PHP Talk Mailing List > > AMP Technology > > Supporting Apache, MySQL and PHP > > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org > >-- > - Adam > >** I can fix your database problems: >http://www.everylastounce.com/mysql.html ** > >Blog............... [ http://www.aquick.org/blog ] >Links.............. [ http://del.icio.us/fields ] >Photos............. [ http://www.aquick.org/photoblog ] >Experience......... [ http://www.adamfields.com/resume.html ] >Product Reviews: .. [ http://www.buyadam.com/blog ] > >_______________________________________________ >New York PHP Talk Mailing List >AMP Technology >Supporting Apache, MySQL and PHP >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org From fields at hedge.net Mon Apr 11 09:55:43 2005 From: fields at hedge.net (Adam Fields) Date: Mon, 11 Apr 2005 09:55:43 -0400 Subject: [nycphp-talk] Can I do this in one query? In-Reply-To: <6.1.0.6.2.20050411091327.033f3510@mail.harveyk.com> References: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> <20050411022607.GT16570@lola.aquick.org> <6.1.0.6.2.20050411091327.033f3510@mail.harveyk.com> Message-ID: <20050411135543.GX16570@lola.aquick.org> On Mon, Apr 11, 2005 at 09:18:48AM -0400, harvey wrote: > I don't think that query will work in all cases. You're still not really > limiting the final query to 5 per category. What if there are 10 records in > a category and they all have the same score? I think your query will > return all of them. Actually, that might be better than arbitrarily > limiting at 5 when there's a tie... Yes, that's what I meant when I said: "However, this is not guaranteed to give you exactly five results for each category if there are duplicates on points." :) > At 10:26 PM 4/10/2005, Adam Fields wrote: > > >On Sat, Apr 09, 2005 at 12:28:39AM -0400, Tom wrote: > >> Can I do this in one query? > >> > >> Suppose I have a three column table (it is really not, but I'm trying to > >> keep it simple) > >> > >> table: scores > >> name, varchar(40) > >> category, varchar(40) > >> points, int > > > >If you're on MySQL 4.1+, you ought to be able to do this with > >something like: > > > >SELECT name, points, category FROM scores s > >WHERE points IN (SELECT points FROM scores WHERE category = s.category > > ORDER BY points DESC LIMIT 0,5) > >ORDER BY category, points DESC; > > > >(I think that's right, I haven't actually tried it.) > > > >However, this is not guaranteed to give you exactly five results for > >each category if there are duplicates on points. > > > >> I would like to select the top 5 in each category with the most amount of > >> points, and group them by category, to ultimately be displayed like this: > >> > >> > >> CATEGORY1 > >> > >> person1 1000 > >> person2 900 > >> person3 800 > >> person4 700 > >> person5 600 > >> > >> > >> CATEGORY2 > >> > >> person1 950 > >> person2 800 > >> person3 700 > >> person4 500 > >> person5 400 > >> > >> > >> I see that I can do this in two queries and some PHP code, by driving a > >loop > >> with the DISTINCT category, and saying something like > >> > >> SELECT name,points FROM scores WHERE category='$category' ORDER BY points > >> DESC LIMIT 0,5 > >> > >> but there must be a better way > >> > >> > >> Thanks, > >> > >> > >> Tom > >> http://www.liphp.org > >> > >> > >> _______________________________________________ > >> New York PHP Talk Mailing List > >> AMP Technology > >> Supporting Apache, MySQL and PHP > >> http://lists.nyphp.org/mailman/listinfo/talk > >> http://www.nyphp.org > > > >-- > > - Adam > > > >** I can fix your database problems: > >http://www.everylastounce.com/mysql.html ** > > > >Blog............... [ http://www.aquick.org/blog ] > >Links.............. [ http://del.icio.us/fields ] > >Photos............. [ http://www.aquick.org/photoblog ] > >Experience......... [ http://www.adamfields.com/resume.html ] > >Product Reviews: .. [ http://www.buyadam.com/blog ] > > > >_______________________________________________ > >New York PHP Talk Mailing List > >AMP Technology > >Supporting Apache, MySQL and PHP > >http://lists.nyphp.org/mailman/listinfo/talk > >http://www.nyphp.org > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org -- - Adam ** I can fix your database problems: http://www.everylastounce.com/mysql.html ** Blog............... [ http://www.aquick.org/blog ] Links.............. [ http://del.icio.us/fields ] Photos............. [ http://www.aquick.org/photoblog ] Experience......... [ http://www.adamfields.com/resume.html ] Product Reviews: .. [ http://www.buyadam.com/blog ] From list at harveyk.com Mon Apr 11 10:52:33 2005 From: list at harveyk.com (harvey) Date: Mon, 11 Apr 2005 10:52:33 -0400 Subject: [nycphp-talk] Can I do this in one query? In-Reply-To: <20050411135543.GX16570@lola.aquick.org> References: <0IEN00GOQVKUTK@mta8.srv.hcvlny.cv.net> <20050411022607.GT16570@lola.aquick.org> <6.1.0.6.2.20050411091327.033f3510@mail.harveyk.com> <20050411135543.GX16570@lola.aquick.org> Message-ID: <6.1.0.6.2.20050411105159.03c44680@mail.harveyk.com> ahhh, yes, maybe i should read the _whole_ post before responding! sorry... At 09:55 AM 4/11/2005, Adam Fields wrote: >On Mon, Apr 11, 2005 at 09:18:48AM -0400, harvey wrote: > > I don't think that query will work in all cases. You're still not really > > limiting the final query to 5 per category. What if there are 10 > records in > > a category and they all have the same score? I think your query will > > return all of them. Actually, that might be better than arbitrarily > > limiting at 5 when there's a tie... > >Yes, that's what I meant when I said: "However, this is not guaranteed >to give you exactly five results for each category if there are >duplicates on points." > >:) > > > > > > At 10:26 PM 4/10/2005, Adam Fields wrote: > > > > >On Sat, Apr 09, 2005 at 12:28:39AM -0400, Tom wrote: > > >> Can I do this in one query? > > >> > > >> Suppose I have a three column table (it is really not, but I'm trying to > > >> keep it simple) > > >> > > >> table: scores > > >> name, varchar(40) > > >> category, varchar(40) > > >> points, int > > > > > >If you're on MySQL 4.1+, you ought to be able to do this with > > >something like: > > > > > >SELECT name, points, category FROM scores s > > >WHERE points IN (SELECT points FROM scores WHERE category = s.category > > > ORDER BY points DESC LIMIT 0,5) > > >ORDER BY category, points DESC; > > > > > >(I think that's right, I haven't actually tried it.) > > > > > >However, this is not guaranteed to give you exactly five results for > > >each category if there are duplicates on points. > > > > > >> I would like to select the top 5 in each category with the most > amount of > > >> points, and group them by category, to ultimately be displayed like > this: > > >> > > >> > > >> CATEGORY1 > > >> > > >> person1 1000 > > >> person2 900 > > >> person3 800 > > >> person4 700 > > >> person5 600 > > >> > > >> > > >> CATEGORY2 > > >> > > >> person1 950 > > >> person2 800 > > >> person3 700 > > >> person4 500 > > >> person5 400 > > >> > > >> > > >> I see that I can do this in two queries and some PHP code, by driving a > > >loop > > >> with the DISTINCT category, and saying something like > > >> > > >> SELECT name,points FROM scores WHERE category='$category' ORDER BY > points > > >> DESC LIMIT 0,5 > > >> > > >> but there must be a better way > > >> > > >> > > >> Thanks, > > >> > > >> > > >> Tom > > >> http://www.liphp.org > > >> > > >> > > >> _______________________________________________ > > >> New York PHP Talk Mailing List > > >> AMP Technology > > >> Supporting Apache, MySQL and PHP > > >> http://lists.nyphp.org/mailman/listinfo/talk > > >> http://www.nyphp.org > > > > > >-- > > > - Adam > > > > > >** I can fix your database problems: > > >http://www.everylastounce.com/mysql.html ** > > > > > >Blog............... [ http://www.aquick.org/blog ] > > >Links.............. [ http://del.icio.us/fields ] > > >Photos............. [ http://www.aquick.org/photoblog ] > > >Experience......... [ http://www.adamfields.com/resume.html ] > > >Product Reviews: .. [ http://www.buyadam.com/blog ] > > > > > >_______________________________________________ > > >New York PHP Talk Mailing List > > >AMP Technology > > >Supporting Apache, MySQL and PHP > > >http://lists.nyphp.org/mailman/listinfo/talk > > >http://www.nyphp.org > > > > _______________________________________________ > > New York PHP Talk Mailing List > > AMP Technology > > Supporting Apache, MySQL and PHP > > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org > >-- > - Adam > >** I can fix your database problems: >http://www.everylastounce.com/mysql.html ** > >Blog............... [ http://www.aquick.org/blog ] >Links.............. [ http://del.icio.us/fields ] >Photos............. [ http://www.aquick.org/photoblog ] >Experience......... [ http://www.adamfields.com/resume.html ] >Product Reviews: .. [ http://www.buyadam.com/blog ] > >_______________________________________________ >New York PHP Talk Mailing List >AMP Technology >Supporting Apache, MySQL and PHP >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org From spot at deviantart.com Mon Apr 11 15:25:02 2005 From: spot at deviantart.com (Spot) Date: Mon, 11 Apr 2005 12:25:02 -0700 Subject: [nycphp-talk] Replace restrictions Message-ID: <425ACF0E.5080504@deviantart.com> We are having some issues with comment parsing. Each comment goes through quite a few search/replace operations. We have some malicious users posting comments with thousands of emoticons (for example) but we have not located an efficient way to limit this since all search/replace function do not have a limiting option. Any ideas? -- Spot Vice President, Information Technology deviantART Inc. www.deviantART.com Skype: spotnyk From spot at deviantart.com Mon Apr 11 15:26:25 2005 From: spot at deviantart.com (Spot) Date: Mon, 11 Apr 2005 12:26:25 -0700 Subject: [nycphp-talk] Replace restrictions In-Reply-To: <425ACF0E.5080504@deviantart.com> References: <425ACF0E.5080504@deviantart.com> Message-ID: <425ACF61.6080701@deviantart.com> This is of course without following the option of moving out formatting library to C++, which is in discussion. Spot wrote: > We are having some issues with comment parsing. > > Each comment goes through quite a few search/replace operations. We > have some malicious users posting comments with thousands of emoticons > (for example) but we have not located an efficient way to limit this > since all search/replace function do not have a limiting option. > > Any ideas? > -- Spot Vice President, Information Technology deviantART Inc. www.deviantART.com Skype: spotnyk From 1j0lkq002 at sneakemail.com Mon Apr 11 20:06:33 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Mon, 11 Apr 2005 20:06:33 -0400 Subject: [nycphp-talk] Replace restrictions In-Reply-To: <425ACF0E.5080504@deviantart.com> References: <425ACF0E.5080504@deviantart.com> Message-ID: <23613-43231@sneakemail.com> Spot spot-at-deviantart.com |nyphp dev/internal group use| wrote: > We are having some issues with comment parsing. > > Each comment goes through quite a few search/replace operations. We > have some malicious users posting comments with thousands of emoticons > (for example) but we have not located an efficient way to limit this > since all search/replace function do not have a limiting option. > > Any ideas? > You may want to pre-characterize comments before processing. There must be a clever way to run some of the faster PHP functions across the comment-as-string or binary, producing a statistic which can characterize it as likely to be normal or likely to be problematic. Then handle as appropriate. I would imagine a thousand emoticons would sign quite differently than typical prose when passed through a count_chars, if you inspect a set comprised of "special" characters (colons, semicolons, dashes, etc).... not sure if characterset presents a practical barrier, though (ascii was easy!). From tom at supertom.com Mon Apr 11 22:11:08 2005 From: tom at supertom.com (Tom) Date: Mon, 11 Apr 2005 22:11:08 -0400 Subject: [nycphp-talk] Anyone have experience with PC charge? Message-ID: <0IET006Z197JRX@mta8.srv.hcvlny.cv.net> Hey folks, Anyone have any experience with PC charge (http://www.gosoftware.com)? Anyone have any sample PHP/Perl code to interface with it? Thanks, Tom http://www.liphp.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Tue Apr 12 10:26:04 2005 From: chsnyder at gmail.com (csnyder) Date: Tue, 12 Apr 2005 10:26:04 -0400 Subject: [nycphp-talk] Replace restrictions In-Reply-To: <425ACF0E.5080504@deviantart.com> References: <425ACF0E.5080504@deviantart.com> Message-ID: On Apr 11, 2005 3:25 PM, Spot wrote: > Each comment goes through quite a few search/replace operations. We have > some malicious users posting comments with thousands of emoticons (for > example) but we have not located an efficient way to limit this since > all search/replace function do not have a limiting option. I'm guessing that you need to parse each comment every time its displayed for this to really be a problem... if you were only parsing on insert, you could discard any comments that had thousands of anything. One way to limit search and replace operations is to use the slower but more controllable preg_match_all(), and check how many matches were found before carrying out the replacements using the matches array (with captured offsets). This is probably way too bulky to use on every comment view, but should be fine on comment insertion. You should definitely be caching parsed comments, though. From jeff.loiselle at gmail.com Tue Apr 12 11:17:40 2005 From: jeff.loiselle at gmail.com (Jeff Loiselle) Date: Tue, 12 Apr 2005 11:17:40 -0400 Subject: [nycphp-talk] FreeBSD and PEAR Message-ID: <4b188711050412081740c4341b@mail.gmail.com> When I try to install PEAR packages via the ports system, I get: install ok: PEAR 1.3.5 /usr/ports/lang/php5/work/php-5.0.4/Zend/zend_hash.c(678) : ht=0x8182370 is already destroyed Does anyone know what's up? --- Jeff Loiselle Web Developer, Musician, and Observer http://jeff.loiselles.com From dcech at phpwerx.net Tue Apr 12 16:40:03 2005 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 12 Apr 2005 16:40:03 -0400 Subject: [nycphp-talk] PEAR DB Error Message-ID: <425C3223.9040703@phpwerx.net> Hey All, I'm getting a very odd error coming from PEAR DB and wondered if any of you have come across it in the past. The implode() call on line 777 in the prepare() function of common.php (1.7.6) is failing, and when I look at the error logs I'm seeing something very strange. The $val variable is being set to an array... If you have any ideas on this one let me know...right now I can't fathom the reason. Dan [query] => SELECT password_remind FROM CONFIG WHERE class_id=? [tokens] => Array ( [0] => SELECT password_remind FROM CONFIG WHERE class_id= [1] => ? [2] => ) [token] => 0 [types] => Array ( ) [newtokens] => Array ( [0] => Array ( [0] => SELECT password_remind FROM CONFIG WHERE class_id= [1] => 0 ) [1] => Array ( [0] => ? [1] => 1 ) [2] => Array ( [0] => [1] => 2 ) ) [val] => Array ( [0] => [1] => 2 ) [k] => 4 From dcech at phpwerx.net Tue Apr 12 17:11:55 2005 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 12 Apr 2005 17:11:55 -0400 Subject: [nycphp-talk] PEAR DB Error In-Reply-To: <425C3223.9040703@phpwerx.net> References: <425C3223.9040703@phpwerx.net> Message-ID: <425C399B.7010905@phpwerx.net> Turns out it was a serious problem with php on the box in question...backed it up a version and everything is playing nice again. Dan Dan Cech wrote: > Hey All, > > I'm getting a very odd error coming from PEAR DB and wondered if any of > you have come across it in the past. > > The implode() call on line 777 in the prepare() function of common.php > (1.7.6) is failing, and when I look at the error logs I'm seeing > something very strange. The $val variable is being set to an array... > > If you have any ideas on this one let me know...right now I can't fathom > the reason. > > Dan From danielc at analysisandsolutions.com Tue Apr 12 17:39:21 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 12 Apr 2005 17:39:21 -0400 Subject: [nycphp-talk] PEAR DB Error In-Reply-To: <425C399B.7010905@phpwerx.net> References: <425C3223.9040703@phpwerx.net> <425C399B.7010905@phpwerx.net> Message-ID: <20050412213921.GA19163@panix.com> Hey: On Tue, Apr 12, 2005 at 05:11:55PM -0400, Dan Cech wrote: > Turns out it was a serious problem with php on the box in > question...backed it up a version and everything is playing nice again. Which version of PHP was giving you the problems? --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From cfeldmann at gmail.com Wed Apr 13 00:53:45 2005 From: cfeldmann at gmail.com (chris feldmann) Date: Wed, 13 Apr 2005 04:53:45 +0000 Subject: [nycphp-talk] FreeBSD and PEAR In-Reply-To: <4b188711050412081740c4341b@mail.gmail.com> References: <4b188711050412081740c4341b@mail.gmail.com> Message-ID: <7e2c731f05041221534e3f1ff7@mail.gmail.com> Why not install PEAR packages through PEAR? $ pear install [package] see also: $ pear list $ pear list-upgrades $ pear upgrade [package] etc. On 4/12/05, Jeff Loiselle wrote: > > When I try to install PEAR packages via the ports system, I get: > > install ok: PEAR 1.3.5 > /usr/ports/lang/php5/work/php-5.0.4/Zend/zend_hash.c(678) : > ht=0x8182370 is already destroyed > > Does anyone know what's up? > > --- > Jeff Loiselle > Web Developer, Musician, and Observer > http://jeff.loiselles.com > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Wed Apr 13 09:59:55 2005 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 13 Apr 2005 09:59:55 -0400 Subject: [nycphp-talk] PEAR DB Error In-Reply-To: <20050412213921.GA19163@panix.com> References: <425C3223.9040703@phpwerx.net> <425C399B.7010905@phpwerx.net> <20050412213921.GA19163@panix.com> Message-ID: <425D25DB.3030002@phpwerx.net> 4.3.10-10 on debian sarge w/ apache2 It's running fine now with 4.3.10-9 We're not really sure if it was a problem with the package for 4.3.10-10 or if there is something else on the box that was conflicting with it. Dan Daniel Convissor wrote: > Hey: > > On Tue, Apr 12, 2005 at 05:11:55PM -0400, Dan Cech wrote: > >>Turns out it was a serious problem with php on the box in >>question...backed it up a version and everything is playing nice again. > > > Which version of PHP was giving you the problems? > > --Dan > From danielc at analysisandsolutions.com Wed Apr 13 10:55:51 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 13 Apr 2005 10:55:51 -0400 Subject: [nycphp-talk] PEAR DB Error In-Reply-To: <425D25DB.3030002@phpwerx.net> References: <425C3223.9040703@phpwerx.net> <425C399B.7010905@phpwerx.net> <20050412213921.GA19163@panix.com> <425D25DB.3030002@phpwerx.net> Message-ID: <20050413145550.GA24678@panix.com> On Wed, Apr 13, 2005 at 09:59:55AM -0400, Dan Cech wrote: > 4.3.10-10 on debian sarge w/ apache2 > It's running fine now with 4.3.10-9 "-9" and "-10"? A Debianism, eh? Anyway, upgrade to 4.3.11 for loads of bug fixes and some security enhancements. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From psaw at pswebcode.com Wed Apr 13 14:12:49 2005 From: psaw at pswebcode.com (Peter Sawczynec) Date: Wed, 13 Apr 2005 14:12:49 -0400 Subject: [nycphp-talk] 5 Admin/Maint Queries Regarding MySQL Server Logging Message-ID: <001301c54054$67804fe0$68e4a144@Liz> With no logging config supplied at startup or in my.cnf will the file "mysqld.log" be MySQL server query log? How often to flush/rotate query log(s)? Monthly, quarterly? Max file size? With which version of MySQL is bin logging an option. Specifically, does 4.1.0-alpha offer bin logging? With which version of MySQL did bin logging get activated by default at install? Log names starting with "ib" "ib_" are InnoDB table log files? Warmest regards, Peter Sawczynec Technology Director PSWebcode psaw at pswebcode.com 718.543.3240 From lists at zaunere.com Fri Apr 15 13:57:39 2005 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 15 Apr 2005 13:57:39 -0400 Subject: [nycphp-talk] 5 Admin/Maint Queries Regarding MySQL Server Logging In-Reply-To: <001301c54054$67804fe0$68e4a144@Liz> Message-ID: <0MKz5u-1DMV4W1xwj-0000Ws@mrelay.perfora.net> Hey Peter, > With no logging config supplied at startup or in my.cnf will the file > "mysqld.log" be MySQL server query log? MySQL won't log by default so you'll need to specify that in my.cnf, etc. > How often to flush/rotate query log(s)? Monthly, quarterly? Max file size? It really depends on how much traffic the server gets. Take a look at: http://dev.mysql.com/doc/mysql/en/log-file-maintenance.html http://dev.mysql.com/doc/mysql/en/query-log.html http://dev.mysql.com/doc/mysql/en/log-files.html > With which version of MySQL is bin logging an option. Specifically, does > 4.1.0-alpha offer bin logging? Binary logging is available in that version, although that's an alpha release. Go with 4.1.11 if you can. > With which version of MySQL did bin logging get activated by default at > install? I don't believe it's ever activated by default - you'd need to specify it in my.cnf. Also note that it only logs statements that change data - no read-only queries are logged, and it's used mostly for replication or auditing. http://dev.mysql.com/doc/mysql/en/replication.html > Log names starting with "ib" "ib_" are InnoDB table log files? Yeah - those are the internal logs for transactions in InnoDB H From chsnyder at gmail.com Sun Apr 17 12:39:48 2005 From: chsnyder at gmail.com (csnyder) Date: Sun, 17 Apr 2005 12:39:48 -0400 Subject: [nycphp-talk] mysqli_statement_prepare() vs PearDB::prepare() Message-ID: I'm that familiar with the concept of prepared queries, but I was under the impression that one of the main benefits of using them is that the values being bound to the statement are automatically typed and escaped. Is this a feature limited to Pear DB's prepare() method, and not generally applicable to other database interfaces, such as mysqli? Neither the PHP Manual nor the MySQL C API documentation mentions anything about escaping values that are bound to prepared statements. Take, for example, the following snippet: $stmt = $mysqli->prepare( "INSERT INTO Animals VALUES (?, ?)" ); $stmt->bind_param( 'ss', $_GET['name'], $_GET['taxonomy'] ); Is this safe as is, or should the code be converted to: $name = mysqli->real_escape_string( $_GET['name'] ); $taxonomy = mysqli->real_escape_string( $_GET['taxonomy'] ); $stmt = $mysqli->prepare( "INSERT INTO Animals VALUES (?, ?)" ); $stmt->bind_param( 'ss', $name, $taxonomy ); Bonus beer question -- if prepared statements don't automatically sanitize values being passed to the database, what is the point of using them? -- Chris Snyder http://chxo.com/ From adam at trachtenberg.com Sun Apr 17 13:20:22 2005 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Sun, 17 Apr 2005 13:20:22 -0400 (EDT) Subject: [nycphp-talk] mysqli_statement_prepare() vs PearDB::prepare() In-Reply-To: References: Message-ID: On Sun, 17 Apr 2005, csnyder wrote: > Is this a feature limited to Pear DB's prepare() method, and not > generally applicable to other database interfaces, such as mysqli? No. It is available in mysqli. > Neither the PHP Manual nor the MySQL C API documentation mentions > anything about escaping values that are bound to prepared statements. > Take, for example, the following snippet: > > $stmt = $mysqli->prepare( "INSERT INTO Animals VALUES (?, ?)" ); > $stmt->bind_param( 'ss', $_GET['name'], $_GET['taxonomy'] ); > > Is this safe as is, or should the code be converted to: It is safe from SQL injection. However, one should always be valiating external data to see that if falls within the general category of data that you're expecting, but I know you know this. :) > Bonus beer question -- if prepared statements don't automatically > sanitize values being passed to the database, what is the point of > using them? Speed. The DB only has to prepare the query once, so if you make multiple INSERTs (as the in the example above), they will be faster. -adam PS: I will once again shamelessly plug "Upgrading to PHP 5", its five star Amazon rating, and its Amazon sales ranking in the 150,000s. Trust me when I say there's useful stuff there that's not well-documented in other places. :) -- adam at trachtenberg.com | http://www.trachtenberg.com author of o'reilly's "upgrading to php 5" and "php cookbook" avoid the holiday rush, buy your copies today! From tgales at tgaconnect.com Sun Apr 17 14:22:53 2005 From: tgales at tgaconnect.com (Tim Gales) Date: Sun, 17 Apr 2005 14:22:53 -0400 Subject: [nycphp-talk] Oh no, beans again! Message-ID: <001f01c5437a$79f99cc0$d0893818@oberon1> init ($server); $this->namespace = 'test'; $this->addMethods (__FILE__); } /** * Sets a named value. * @access public * @param string * @param string */ function set ($name, $value) { $this->values[$name] = $value; } /** * Gets a named value. * @access public * @param string * @return string */ function get ($name) { return $this->values[$name]; } } from: http://www.phpbeans.com/index/news-app/story.3 T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From crayolalettuce at gmail.com Sun Apr 17 15:37:19 2005 From: crayolalettuce at gmail.com (Jim Bishop) Date: Sun, 17 Apr 2005 15:37:19 -0400 Subject: [nycphp-talk] memcache Message-ID: I'm considering using memcache (http://us3.php.net/manual/en/ref.memcache.php) in conjunction with a project I'm currently working on. The other developer on my team is researching Perl/PHP app servers, and my theory is that since this is a single machine web server (no room for wiggle room on this from the client) the performance hit isn't worth the hassle of installing and maintaining. Has anyone on the list used memcache before? How did it work out? Was it useful? Buggy? Persnickety? Did it introduce performace problems? etc. Thanks for your input. Jim Bishop From chsnyder at gmail.com Sun Apr 17 17:24:50 2005 From: chsnyder at gmail.com (csnyder) Date: Sun, 17 Apr 2005 17:24:50 -0400 Subject: [nycphp-talk] mysqli_statement_prepare() vs PearDB::prepare() In-Reply-To: References: Message-ID: On 4/17/05, Adam Maccabee Trachtenberg wrote: > No. It is available in mysqli. Thanks, Adam -- will take a closer look. > Trust me when I say there's useful stuff there that's not > well-documented in other places. :) Remember the good old days when people would just leave a comment on the PHP Manual when something wasn't well-documented? ;-) From adam at trachtenberg.com Sun Apr 17 19:44:05 2005 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Sun, 17 Apr 2005 19:44:05 -0400 (EDT) Subject: [nycphp-talk] mysqli_statement_prepare() vs PearDB::prepare() In-Reply-To: References: Message-ID: On Sun, 17 Apr 2005, csnyder wrote: > > Trust me when I say there's useful stuff there that's not > > well-documented in other places. :) > > Remember the good old days when people would just leave a comment on > the PHP Manual when something wasn't well-documented? ;-) That was when I was employed doing something other than writing PHP books. As I don't program fulltime with PHP now-a-days, I wouldn't have had the opportunity learn any of this if I hadn't been working on the book. Nevertheless, I have put my "PHP 5 + MySQL 5 = A Perfect 10" presentation online for free. http://www.trachtenberg.com/talks/5plus5equals10-clean.ppt That said, I do look forward to your updates to the Security section of the PHP Manual. :) http://www.apress.com/book/bookDisplay.html?bID=437 -adam -- adam at trachtenberg.com | http://www.trachtenberg.com author of o'reilly's "upgrading to php 5" and "php cookbook" avoid the holiday rush, buy your copies today! From tom at supertom.com Mon Apr 18 09:58:06 2005 From: tom at supertom.com (Tom Melendez) Date: Mon, 18 Apr 2005 09:58:06 -0400 Subject: [nycphp-talk] Pear DB and PDO In-Reply-To: <001301c54054$67804fe0$68e4a144@Liz> References: <001301c54054$67804fe0$68e4a144@Liz> Message-ID: <4263BCEE.70500@supertom.com> Good Morning Folks, I'd like to use SQLite 3 and PHP5. The only way I see to do this now is with PDO. I'm also using Pear DB. Before I go down this road, is this going to work? Thanks, Tom http://www.liphp.org From danielc at analysisandsolutions.com Mon Apr 18 10:09:12 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 18 Apr 2005 10:09:12 -0400 Subject: [nycphp-talk] Pear DB and PDO In-Reply-To: <4263BCEE.70500@supertom.com> References: <001301c54054$67804fe0$68e4a144@Liz> <4263BCEE.70500@supertom.com> Message-ID: <20050418140912.GA28962@panix.com> Hi Tom: On Mon, Apr 18, 2005 at 09:58:06AM -0400, Tom Melendez wrote: > > I'd like to use SQLite 3 and PHP5. The only way I see to do this now is > with PDO. I'm also using Pear DB. Before I go down this road, is this > going to work? PEAR DB's SQLite driver uses PHP's sqlite extension, which is based on SQLite 2.6. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From tom at supertom.com Mon Apr 18 11:08:43 2005 From: tom at supertom.com (Tom Melendez) Date: Mon, 18 Apr 2005 11:08:43 -0400 Subject: [nycphp-talk] Pear DB and PDO In-Reply-To: <20050418140912.GA28962@panix.com> References: <001301c54054$67804fe0$68e4a144@Liz> <4263BCEE.70500@supertom.com> <20050418140912.GA28962@panix.com> Message-ID: <4263CD7B.9040108@supertom.com> Hi Dan, Thanks for the quick response. So, what are my opinions if I want to use PHP5 and SQLite 3? I guess it is to: * build PDO and PDO SQLite * convert my Pear DB code to use PDO (probably write some kind of wrapper, so I don't need to change all of the code) Looks like that is what I'm going to do, unless anyone has other ideas.... Thanks, Tom http://www.liphp.org Daniel Convissor wrote: >Hi Tom: > >On Mon, Apr 18, 2005 at 09:58:06AM -0400, Tom Melendez wrote: > > >>I'd like to use SQLite 3 and PHP5. The only way I see to do this now is >>with PDO. I'm also using Pear DB. Before I go down this road, is this >>going to work? >> >> > >PEAR DB's SQLite driver uses PHP's sqlite extension, which is based on >SQLite 2.6. > >--Dan > > > From lists at zaunere.com Mon Apr 18 19:42:16 2005 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 18 Apr 2005 19:42:16 -0400 Subject: [nycphp-talk] mysqli_statement_prepare() vs PearDB::prepare() In-Reply-To: Message-ID: <0MKz5u-1DNfsi2Mh3-0000mq@mrelay.perfora.net> > I'm that familiar with the concept of prepared queries, but I was > under the impression that one of the main benefits of using them is > that the values being bound to the statement are automatically typed > and escaped. Nope - one of the big advantages is that values don't have to be escaped in the first place. > Is this a feature limited to Pear DB's prepare() method, and not > generally applicable to other database interfaces, such as mysqli? This is sort of a weird comparison. PEAR::DB's prepare() does automatically escape (AFAIK) but you're not really getting any benefit. Remember that PEAR::DB is just a wrapper around DB's APIs and as such can only emulate features that aren't available from the native DB API. For example, when using prepare() with mysql, it still has to escape the parameters and thus take up twice as much memory. Dan C. can say, however, if PEAR::DB will detect mysqli and use true prepared statements. > Neither the PHP Manual nor the MySQL C API documentation mentions > anything about escaping values that are bound to prepared statements. > Take, for example, the following snippet: > > $stmt = $mysqli->prepare( "INSERT INTO Animals VALUES (?, ?)" ); > $stmt->bind_param( 'ss', $_GET['name'], $_GET['taxonomy'] ); > > Is this safe as is, or should the code be converted to: That's safe from a SQL perspective anyway. > $name = mysqli->real_escape_string( $_GET['name'] ); > $taxonomy = mysqli->real_escape_string( $_GET['taxonomy'] ); > $stmt = $mysqli->prepare( "INSERT INTO Animals VALUES (?, ?)" ); > $stmt->bind_param( 'ss', $name, $taxonomy ); > > Bonus beer question -- if prepared statements don't automatically > sanitize values being passed to the database, what is the point of > using them? Well there are several advantages to them. But for one, they don't need to sanitize values to begin with. Prepared statements are binary and thus length based. For instance, they can say "that value starts at byte 50 and ends 5 bytes later". The original text based protocol in MySQL used deliminators, namely the single quote. Thus, it would consider a value to be between two single quotes, and thus any single quote (or other potentially special character) in the middle would need to be escaped. --- Hans Zaunere President, Founder New York PHP http://www.nyphp.org AMP Technology Supporting Apache, MySQL and PHP From danielc at analysisandsolutions.com Mon Apr 18 21:01:47 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 18 Apr 2005 21:01:47 -0400 Subject: [nycphp-talk] mysqli_statement_prepare() vs PearDB::prepare() In-Reply-To: <0MKz5u-1DNfsi2Mh3-0000mq@mrelay.perfora.net> References: <0MKz5u-1DNfsi2Mh3-0000mq@mrelay.perfora.net> Message-ID: <20050419010147.GA18390@panix.com> On Mon, Apr 18, 2005 at 07:42:16PM -0400, Hans Zaunere wrote: > if PEAR::DB will detect mysqli and use true prepared statements. Not yet, but it's in the works. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From 1j0lkq002 at sneakemail.com Tue Apr 19 00:36:52 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 19 Apr 2005 00:36:52 -0400 Subject: [nycphp-talk] [OT] life has changed in the Crawford house In-Reply-To: <20050419010147.GA18390@panix.com> References: <0MKz5u-1DNfsi2Mh3-0000mq@mrelay.perfora.net> <20050419010147.GA18390@panix.com> Message-ID: <10990-78817@sneakemail.com> Starting today Joe Crawford has a new late night companion http://blog.360.yahoo.com/blog-u1TnbMYydKJyHH_7j7hpjg-- From 1j0lkq002 at sneakemail.com Tue Apr 19 00:38:53 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 19 Apr 2005 00:38:53 -0400 Subject: [nycphp-talk] [OT] life has changed in the Crawford house In-Reply-To: <10990-78817@sneakemail.com> References: <0MKz5u-1DNfsi2Mh3-0000mq@mrelay.perfora.net> <20050419010147.GA18390@panix.com> <10990-78817@sneakemail.com> Message-ID: <10823-22762@sneakemail.com> inforequest 1j0lkq002-at-sneakemail.com |nyphp dev/internal group use| wrote: > Starting today Joe Crawford has a new late night companion > > http://blog.360.yahoo.com/blog-u1TnbMYydKJyHH_7j7hpjg-- > Stupid Y360... those dashes at the end are actually part of the url. You'll have t o cut n paste to see the pic. From codebowl at gmail.com Tue Apr 19 01:42:23 2005 From: codebowl at gmail.com (Joseph Crawford) Date: Tue, 19 Apr 2005 01:42:23 -0400 Subject: [nycphp-talk] [OT] life has changed in the Crawford house In-Reply-To: <10823-22762@sneakemail.com> References: <0MKz5u-1DNfsi2Mh3-0000mq@mrelay.perfora.net> <20050419010147.GA18390@panix.com> <10990-78817@sneakemail.com> <10823-22762@sneakemail.com> Message-ID: <8d9a428005041822429131c3e@mail.gmail.com> Hey :) Thanks for making this post, i was going to but thought it was way off topic. I cannot wait till the bundle of "cry" i mean JOY is brought home :) -- Joseph Crawford Jr. Codebowl Solutions codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From leam at reuel.net Tue Apr 19 06:50:06 2005 From: leam at reuel.net (leam at reuel.net) Date: Tue, 19 Apr 2005 06:50:06 -0400 Subject: [nycphp-talk] [OT] life has changed in the Crawford house In-Reply-To: <10990-78817@sneakemail.com> References: <0MKz5u-1DNfsi2Mh3-0000mq@mrelay.perfora.net> <20050419010147.GA18390@panix.com> <10990-78817@sneakemail.com> Message-ID: <20050419105006.GA2927@leitz> Congratulations! Good name, too. ;) leam On Tue, Apr 19, 2005 at 12:36:52AM -0400, inforequest wrote: > Starting today Joe Crawford has a new late night companion > > http://blog.360.yahoo.com/blog-u1TnbMYydKJyHH_7j7hpjg-- From shawn.coomey at cubist.com Tue Apr 19 11:17:21 2005 From: shawn.coomey at cubist.com (Shawn Coomey) Date: Tue, 19 Apr 2005 11:17:21 -0400 Subject: [nycphp-talk] PHP and Active Directory 2K3 Message-ID: <000AF5E3911DB74CB6E2143BA91D1A25D309@US1MAIL2.cubist.com> Hi folks- My first post! I've been struggling with an issue for a few months. I am attempting to search Active Directory 2003 via PHP, but am running into an issue searching from the base DN (i.e. 'cn=company,cn=com'). This seems to be somewhat of a known issue with AD2K3. A search at this level always returns: Warning: ldap_search() [function.ldap-search]: Search: Partial results and referral received If I change my base DN to 'ou=someOU,dc=company,dc=com', searches work properly. I was curious to see what would happen at the command line, so I used openldap's ldapsearch function against AD and sure enough I got a bunch of results that were truncated with ldap_result: Can't contact LDAP server Of note: I have a base php class that sets the following options whenever a bind is created (seems to be necessary for searching AD2K3 at all): ldap_set_option($this->_ldap, LDAP_OPT_REFERRALS, 0); ldap_set_option($this->_ldap, LDAP_OPT_PROTOCOL_VERSION, 3); Anyone have any feedback about how to search the base dn of AD2K3? TIA- Shawn Coomey -------------- next part -------------- _________________________________________________________________________ This e-mail and any attachments are meant for the intended recipient only and may contain information belonging to Cubist Pharmaceuticals, Inc. that is privileged, confidential, proprietary, and/or otherwise protected or prohibited from disclosure. If you have received this message in error, are not the intended recipient, or are uncertain about its proper handling, please notify the sender as soon as possible and immediately delete the e-mail and any attachments from your computer system. Cubist Pharmaceuticals, Inc., 65 Hayden Avenue, Lexington, Massachusetts, 02421, U.S.A. 781-860-8660 www.cubist.com From rs234 at cornell.edu Tue Apr 19 13:09:19 2005 From: rs234 at cornell.edu (Wai Siow) Date: Tue, 19 Apr 2005 13:09:19 -0400 (EDT) Subject: [nycphp-talk] calling another script within php In-Reply-To: <000AF5E3911DB74CB6E2143BA91D1A25D309@US1MAIL2.cubist.com> References: <000AF5E3911DB74CB6E2143BA91D1A25D309@US1MAIL2.cubist.com> Message-ID: <1700.128.253.19.86.1113930559.squirrel@128.253.19.86> Hi all: I want to call a cgi script with the client's remote address using php... which means I am trying to trick the cgi script into thinking that the client is the one who requested the cgi script. I looked at and tried Pear's HTTP_Request but couldn't get it working, what do I need to do to make it work, or is there something else in which I can use that'd work? Wai (Raymond) Siow Web Application Developer / Programmer Web Development Team Cornell Cooperative Extension Email: r s two three four at cornell dot edu Phone: (six-o-seven) two-five-five-seven-nine-four-nine From mitch.pirtle at gmail.com Tue Apr 19 16:55:44 2005 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 19 Apr 2005 16:55:44 -0400 Subject: [nycphp-talk] [OT] life has changed in the Crawford house In-Reply-To: <10990-78817@sneakemail.com> References: <0MKz5u-1DNfsi2Mh3-0000mq@mrelay.perfora.net> <20050419010147.GA18390@panix.com> <10990-78817@sneakemail.com> Message-ID: <330532b605041913551290a19a@mail.gmail.com> Well now, You have become a father, and are now invited to join the Mambo project, also known as the 'internet for dads project'. ROTFL I dunno what happend, but I last checked and we were all dads. * spacemonkey shrugs Congratulations, I think the date is actually cool, as it honors your father with your family passing on to the next generation. Glad to hear your boy is healthy, and I wish you all the best. Funny how you can't wait to get him home. I was the same way with our first - and my wife was just the opposite... "You mean we gotta go now?" She was scared to death of leaving the hospital, and I just couldn't get them out of there fast enough. Hehe! -- Mitch On 4/19/05, inforequest <1j0lkq002 at sneakemail.com> wrote: > Starting today Joe Crawford has a new late night companion > > http://blog.360.yahoo.com/blog-u1TnbMYydKJyHH_7j7hpjg-- > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From nasir81 at gmail.com Tue Apr 19 17:50:17 2005 From: nasir81 at gmail.com (Nasir Zubair) Date: Tue, 19 Apr 2005 17:50:17 -0400 Subject: [nycphp-talk] calling another script within php In-Reply-To: <1700.128.253.19.86.1113930559.squirrel@128.253.19.86> References: <000AF5E3911DB74CB6E2143BA91D1A25D309@US1MAIL2.cubist.com> <1700.128.253.19.86.1113930559.squirrel@128.253.19.86> Message-ID: <40fcda7305041914506285c8db@mail.gmail.com> This is the code I used for interface between CPanel frontend and my scripts a while ago. The code assumes that you need to login (.htaccess authentication only) and it assumes you are doing GETs, but POST isn't too hard to implement either. Hope it helps. $domainname = "mydomain.com"; $user = "loginusername"; $pass = "loginpass"; $socket = fsockopen($domainname,80); $authstr = "$user:$pass"; $login = base64_encode($authstr); $in = "GET /cgi-bin/myscript.cgi\r\n"; $in .= "HTTP/1.0\r\n"; $in .= "Authorization: Basic $login \r\n\r\n"; $results = fputs($socket,$in); if($socket) { while (!feof($socket)) { $HTML .= fgets ($socket,128); } } fclose( $socket ); return $HTML; On 4/19/05, Wai Siow wrote: > Hi all: > > I want to call a cgi script with the client's remote address using php... > which means I am trying to trick the cgi script into thinking that the > client is the one who requested the cgi script. > > I looked at and tried Pear's HTTP_Request but couldn't get it working, > what do I need to do to make it work, or is there something else in which > I can use that'd work? > > Wai (Raymond) Siow > Web Application Developer / Programmer > Web Development Team > Cornell Cooperative Extension > Email: r s two three four at cornell dot edu > Phone: (six-o-seven) two-five-five-seven-nine-four-nine > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- Nasir Zubair http://www.nasir.us/ From chsnyder at gmail.com Tue Apr 19 17:56:02 2005 From: chsnyder at gmail.com (csnyder) Date: Tue, 19 Apr 2005 17:56:02 -0400 Subject: [nycphp-talk] calling another script within php In-Reply-To: <1700.128.253.19.86.1113930559.squirrel@128.253.19.86> References: <000AF5E3911DB74CB6E2143BA91D1A25D309@US1MAIL2.cubist.com> <1700.128.253.19.86.1113930559.squirrel@128.253.19.86> Message-ID: On 4/19/05, Wai Siow wrote: > I want to call a cgi script with the client's remote address using php... > which means I am trying to trick the cgi script into thinking that the > client is the one who requested the cgi script. If you just need to make a simple HTTP GET request, that's built into PHP: $php_results = file_get_contents( 'http://google.com/search?q=php' ); If you need to do POST or set custom headers like a Cookie or User-Agent value, you will probably want to use the fsockopen() approach proposed by Nasir Zubair. That will also let you set a reasonable timeout ( 5 seconds or less ) in case the remote side is not responding. -- Chris Snyder http://chxo.com/ From alexchan.1976 at gmail.com Tue Apr 19 20:21:53 2005 From: alexchan.1976 at gmail.com (Alex C) Date: Tue, 19 Apr 2005 20:21:53 -0400 Subject: [nycphp-talk] __get __set methods.. Message-ID: <8f494f760504191721236515be@mail.gmail.com> I am trying to use __set and __get magic methods to access private properties of a class. However , I keep on getting this error. I am using PHP 5.03.. Fatal error: Cannot access private property Runner::$programName I am not sure what I am doing wrong.. thanks in advance my class looks as follows. --- class Runner { private $programName; private $programDate; private $raceNumber; private $runnerNumber; private $scratchedStatus; public function __get($property){ return $this->$property; } public function __set($property, $value){ $this->$property = $value; } } From leam at reuel.net Tue Apr 19 22:37:45 2005 From: leam at reuel.net (leam at reuel.net) Date: Tue, 19 Apr 2005 22:37:45 -0400 Subject: [nycphp-talk] [OT] life has changed in the Crawford house In-Reply-To: <330532b605041913551290a19a@mail.gmail.com> References: <0MKz5u-1DNfsi2Mh3-0000mq@mrelay.perfora.net> <20050419010147.GA18390@panix.com> <10990-78817@sneakemail.com> <330532b605041913551290a19a@mail.gmail.com> Message-ID: <20050420023745.GA2925@leitz> Gives a whole new meaning to "Doing Mambo in your spare time." ciao! leam --a dad, but often longs for those tax collectors who want your first born... On Tue, Apr 19, 2005 at 04:55:44PM -0400, Mitch Pirtle wrote: > Well now, > > You have become a father, and are now invited to join the Mambo > project, also known as the 'internet for dads project'. ROTFL I dunno > what happend, but I last checked and we were all dads. > > * spacemonkey shrugs > > Congratulations, I think the date is actually cool, as it honors your > father with your family passing on to the next generation. Glad to > hear your boy is healthy, and I wish you all the best. > > Funny how you can't wait to get him home. I was the same way with our > first - and my wife was just the opposite... "You mean we gotta go > now?" She was scared to death of leaving the hospital, and I just > couldn't get them out of there fast enough. Hehe! > > -- Mitch > > On 4/19/05, inforequest <1j0lkq002 at sneakemail.com> wrote: > > Starting today Joe Crawford has a new late night companion > > > > http://blog.360.yahoo.com/blog-u1TnbMYydKJyHH_7j7hpjg-- From chendry at gmail.com Tue Apr 19 22:01:26 2005 From: chendry at gmail.com (Christopher Hendry) Date: Tue, 19 Apr 2005 22:01:26 -0400 Subject: [nycphp-talk] __get __set methods.. In-Reply-To: <8f494f760504191721236515be@mail.gmail.com> References: <8f494f760504191721236515be@mail.gmail.com> Message-ID: <769e4ce050419190131da4c37@mail.gmail.com> __set and __get are magic methods that are called only when the properties are not defined in the class, thus, this works: class Runner { public function __get($property){ return $this->$property; } public function __set($property, $value){ $this->$property = $value; } } though I believe this is better (pg 39 - Upgrading to PHP5 - how's that for a plug Adam?): class Runner { private $data; public function __get($property){ if (isset($this->data[$property])){ return $this->data[$property]; } else return false; } public function __set($property, $value){ $this->data[$property] = $value; } } Why? My guess is because you're able to define your data as private via the array...however, I would be interested to know here from someone who knows for certain. On 4/19/05, Alex C wrote: > I am trying to use __set and __get magic methods to access private > properties of a class. However , I keep on getting this error. I am > using PHP 5.03.. > > Fatal error: Cannot access private property Runner::$programName > > I am not sure what I am doing wrong.. thanks in advance > > my class looks as follows. > --- > > class Runner { > private $programName; > private $programDate; > private $raceNumber; > private $runnerNumber; > > private $scratchedStatus; > > public function __get($property){ > return $this->$property; > } > > public function __set($property, $value){ > $this->$property = $value; > } > } > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- "When you do things right, people won't be sure you've done anything at all." From codebowl at gmail.com Tue Apr 19 22:15:23 2005 From: codebowl at gmail.com (Joseph Crawford) Date: Tue, 19 Apr 2005 22:15:23 -0400 Subject: [nycphp-talk] [OT] life has changed in the Crawford house In-Reply-To: <20050420023745.GA2925@leitz> References: <0MKz5u-1DNfsi2Mh3-0000mq@mrelay.perfora.net> <20050419010147.GA18390@panix.com> <10990-78817@sneakemail.com> <330532b605041913551290a19a@mail.gmail.com> <20050420023745.GA2925@leitz> Message-ID: <8d9a4280050419191538b52a96@mail.gmail.com> LOL nice one leam :) I have yet to look over mambo, i always thought it was too big for any of the projects that i do... guess that doesnt say much for my work LOL i will have to look through it though maybe test it out on my site ;) -- Joseph Crawford Jr. Codebowl Solutions codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From krook at us.ibm.com Tue Apr 19 23:41:04 2005 From: krook at us.ibm.com (Daniel Krook) Date: Tue, 19 Apr 2005 23:41:04 -0400 Subject: [nycphp-talk] __get __set methods.. In-Reply-To: <769e4ce050419190131da4c37@mail.gmail.com> Message-ID: Actually, the key to the whole thing (also from Adam's book, pp 261-263) is to define what values are acceptable as properties in the constructor. In this example only valOne and valTwo can be set and get: class Runner { private $data; public function __construct($runner = null) { $this->data = array( 'valOne' => 0, 'valTwo' => '' ); if (is_array($runner)) { foreach ($runner as $field => $value) { $this->$field = $value; } } } public function __set($property, $value) { if (isset($this->data[$property])) { $this->data[$property] = $value; } } public function __get($property) { if (isset($this->data[$property])) { return $this->data[$property]; } else { return false; } } } talk-bounces at lists.nyphp.org wrote on 04/19/2005 10:01:26 PM: > __set and __get are magic methods that are called only when the > properties are not defined in the class, thus, this works: > > class Runner { > > public function __get($property){ > return $this->$property; > } > > public function __set($property, $value){ > $this->$property = $value; > } > > } > > though I believe this is better (pg 39 - Upgrading to PHP5 - how's > that for a plug Adam?): > > class Runner { > private $data; > > public function __get($property){ > if (isset($this->data[$property])){ > return $this->data[$property]; > } else return false; > } > > public function __set($property, $value){ > $this->data[$property] = $value; > } > } > > > Why? My guess is because you're able to define your data as private > via the array...however, I would be interested to know here from > someone who knows for certain. > > > On 4/19/05, Alex C wrote: > > I am trying to use __set and __get magic methods to access private > > properties of a class. However , I keep on getting this error. I am > > using PHP 5.03.. > > > > Fatal error: Cannot access private property Runner::$programName > > > > I am not sure what I am doing wrong.. thanks in advance > > > > my class looks as follows. > > --- > > > > class Runner { > > private $programName; > > private $programDate; > > private $raceNumber; > > private $runnerNumber; > > > > private $scratchedStatus; > > > > public function __get($property){ > > return $this->$property; > > } > > > > public function __set($property, $value){ > > $this->$property = $value; > > } > > } > > _______________________________________________ > > New York PHP Talk Mailing List > > AMP Technology > > Supporting Apache, MySQL and PHP > > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org > > > > > -- > > "When you do things right, people won't be sure you've done anything at all." > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org From chendry at gmail.com Wed Apr 20 11:28:19 2005 From: chendry at gmail.com (Christopher Hendry) Date: Wed, 20 Apr 2005 11:28:19 -0400 Subject: [nycphp-talk] __get __set methods.. In-Reply-To: References: <769e4ce050419190131da4c37@mail.gmail.com> Message-ID: <769e4ce050420082810507090@mail.gmail.com> Ah perfect! I was never much one for reading instructions. ;) Thanks Krook... On 4/19/05, Daniel Krook wrote: > Actually, the key to the whole thing (also from Adam's book, pp 261-263) > is to define what values are acceptable as properties in the constructor. > In this example only valOne and valTwo can be set and get: > From chendry at gmail.com Wed Apr 20 11:38:24 2005 From: chendry at gmail.com (Christopher Hendry) Date: Wed, 20 Apr 2005 11:38:24 -0400 Subject: [nycphp-talk] __get __set methods.. In-Reply-To: References: <769e4ce050419190131da4c37@mail.gmail.com> Message-ID: <769e4ce05042008384fe3aaec@mail.gmail.com> I'm still kinda wondering tho - as nifty as all this is - on the engine level how much overhead is involved here. In the example below, if instantiating with an array of data, we have an 'is_array' a 'foreach' then a call to magic '__set', which then does an 'isset' ... Hmm...certainly there are times when you want your objects to act on unknown data, but for the most part, and certainly this Runner example - shouldn't we bind the data to the object and thus predefine the properties? On 4/19/05, Daniel Krook wrote: > Actually, the key to the whole thing (also from Adam's book, pp 261-263) > is to define what values are acceptable as properties in the constructor. > In this example only valOne and valTwo can be set and get: > > class Runner { > > private $data; > > public function __construct($runner = null) { > $this->data = array( > 'valOne' => 0, > 'valTwo' => '' > ); > if (is_array($runner)) { > foreach ($runner as $field => $value) { > $this->$field = $value; > } > } > } > > public function __set($property, $value) { > if (isset($this->data[$property])) { > $this->data[$property] = $value; > } > } > > public function __get($property) { > if (isset($this->data[$property])) { > return $this->data[$property]; > } else { > return false; > } > } > } > From alexchan.1976 at gmail.com Wed Apr 20 11:49:30 2005 From: alexchan.1976 at gmail.com (Alex C) Date: Wed, 20 Apr 2005 11:49:30 -0400 Subject: [nycphp-talk] __get __set methods.. In-Reply-To: <769e4ce05042008384fe3aaec@mail.gmail.com> References: <769e4ce050419190131da4c37@mail.gmail.com> <769e4ce05042008384fe3aaec@mail.gmail.com> Message-ID: <8f494f7605042008492b6d1b77@mail.gmail.com> I really think these methods might be really handy for predefined properties. Am I wrong to think that? just want to understand why this might be bad idea to have these functions work with predefined properties. with this runner class, i want to exclusively have predefine properties for this object. thanks everybody alex On 4/20/05, Christopher Hendry wrote: > I'm still kinda wondering tho - as nifty as all this is - on the > engine level how much overhead is involved here. In the example > below, if instantiating with an array of data, we have an 'is_array' a > 'foreach' then a call to magic '__set', which then does an 'isset' ... > > Hmm...certainly there are times when you want your objects to act on > unknown data, but for the most part, and certainly this Runner example > - shouldn't we bind the data to the object and thus predefine the > properties? > > On 4/19/05, Daniel Krook wrote: > > Actually, the key to the whole thing (also from Adam's book, pp 261-263) > > is to define what values are acceptable as properties in the constructor. > > In this example only valOne and valTwo can be set and get: > > > > class Runner { > > > > private $data; > > > > public function __construct($runner = null) { > > $this->data = array( > > 'valOne' => 0, > > 'valTwo' => '' > > ); > > if (is_array($runner)) { > > foreach ($runner as $field => $value) { > > $this->$field = $value; > > } > > } > > } > > > > public function __set($property, $value) { > > if (isset($this->data[$property])) { > > $this->data[$property] = $value; > > } > > } > > > > public function __get($property) { > > if (isset($this->data[$property])) { > > return $this->data[$property]; > > } else { > > return false; > > } > > } > > } > > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From chendry at gmail.com Wed Apr 20 12:03:11 2005 From: chendry at gmail.com (Christopher Hendry) Date: Wed, 20 Apr 2005 12:03:11 -0400 Subject: [nycphp-talk] __get __set methods.. In-Reply-To: <8f494f7605042008492b6d1b77@mail.gmail.com> References: <769e4ce050419190131da4c37@mail.gmail.com> <769e4ce05042008384fe3aaec@mail.gmail.com> <8f494f7605042008492b6d1b77@mail.gmail.com> Message-ID: <769e4ce0504200903391833aa@mail.gmail.com> I think Krook covered it. You can predefine the elements in the array, but otherwise __get/__set will not be called on predefined properties, AFAIK. Otherwise, you need to write your own accessor methods... On 4/20/05, Alex C wrote: > I really think these methods might be really handy for predefined > properties. Am I wrong to think that? just want to understand why this > might be bad idea to have these functions work with predefined > properties. with this runner class, i want to exclusively have > predefine properties for this object. > thanks everybody > alex > > On 4/20/05, Christopher Hendry wrote: > > I'm still kinda wondering tho - as nifty as all this is - on the > > engine level how much overhead is involved here. In the example > > below, if instantiating with an array of data, we have an 'is_array' a > > 'foreach' then a call to magic '__set', which then does an 'isset' ... > > > > Hmm...certainly there are times when you want your objects to act on > > unknown data, but for the most part, and certainly this Runner example > > - shouldn't we bind the data to the object and thus predefine the > > properties? > > > > On 4/19/05, Daniel Krook wrote: > > > Actually, the key to the whole thing (also from Adam's book, pp 261-263) > > > is to define what values are acceptable as properties in the constructor. > > > In this example only valOne and valTwo can be set and get: > > > > > > class Runner { > > > > > > private $data; > > > > > > public function __construct($runner = null) { > > > $this->data = array( > > > 'valOne' => 0, > > > 'valTwo' => '' > > > ); > > > if (is_array($runner)) { > > > foreach ($runner as $field => $value) { > > > $this->$field = $value; > > > } > > > } > > > } > > > > > > public function __set($property, $value) { > > > if (isset($this->data[$property])) { > > > $this->data[$property] = $value; > > > } > > > } > > > > > > public function __get($property) { > > > if (isset($this->data[$property])) { > > > return $this->data[$property]; > > > } else { > > > return false; > > > } > > > } > > > } > > > > > _______________________________________________ > > New York PHP Talk Mailing List > > AMP Technology > > Supporting Apache, MySQL and PHP > > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org > > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- "When you do things right, people won't be sure you've done anything at all." From krook at us.ibm.com Wed Apr 20 14:34:53 2005 From: krook at us.ibm.com (Daniel Krook) Date: Wed, 20 Apr 2005 14:34:53 -0400 Subject: [nycphp-talk] PEAR DB prepared statements. PHP 5 / DB2 8 Message-ID: Hey folks, I'm having a little trouble with PEAR DB prepared statements using PHP 5.0.4 and DB2 UDB 8.2. This particular snippet which does not a use prepared statement works and gets me the values I need: $sql = 'SELECT CB.BREED_ID, B.BREED FROM CAT_BREED CB, BREEDS B WHERE CB.CAT_ID = ' . $catId . ' AND CB.BREED_ID = B.BREED_ID'; $res =& $db->query($sql); while ($row =& $res->fetchRow()) { // Populate a Cat object and set its breeds property to the array. } Whereas this snippet which uses a prepared statement gives me "DB Error: unknown error": $sql = 'SELECT CB.BREED_ID, B.BREED FROM CAT_BREED CB, BREEDS B WHERE CB.CAT_ID = ? AND CB.BREED_ID = B.BREED_ID'; $res =& $db->query($sql, $catId); while ($row =& $res->fetchRow()) { // Populate a Cat object and set its breeds property to the array. } Any tips on where I might be going wrong? Thanks in advance. Daniel Krook, Advisory IT Specialist Application Development, Production Services - Tools, ibm.com Personal: http://info.krook.org/ BluePages: http://w3.ibm.com/bluepages?searchcnum=9A9796897 From nyphp at n0p.net Wed Apr 20 14:41:23 2005 From: nyphp at n0p.net (Flavio daCosta) Date: Wed, 20 Apr 2005 14:41:23 -0400 Subject: [nycphp-talk] PEAR DB prepared statements. PHP 5 / DB2 8 In-Reply-To: References: Message-ID: <1114022483.22114.12.camel@localhost.localdomain> On Wed, 2005-04-20 at 14:34 -0400, Daniel Krook wrote: > Whereas this snippet which uses a prepared statement gives me "DB Error: > unknown error": > > $sql = 'SELECT CB.BREED_ID, B.BREED > FROM CAT_BREED CB, BREEDS B > WHERE CB.CAT_ID = ? AND CB.BREED_ID = B.BREED_ID'; > > $res =& $db->query($sql, $catId); > > while ($row =& $res->fetchRow()) { > // Populate a Cat object and set its breeds property to the > array. > } $sth =& $db->prepare( $sql ); $res =& $db->execute($sth, $catId); From krook at us.ibm.com Wed Apr 20 14:45:20 2005 From: krook at us.ibm.com (Daniel Krook) Date: Wed, 20 Apr 2005 14:45:20 -0400 Subject: [nycphp-talk] PEAR DB prepared statements. PHP 5 / DB2 8 In-Reply-To: <1114022483.22114.12.camel@localhost.localdomain> Message-ID: Flavio, Thanks for the quick reply. That is the method for preparing statements for UPDATEs and INSERTs. I'm attempting to use the prepared statement with a SELECT according to this example (32-2): http://pear.php.net/manual/en/package.database.db.intro-query.php talk-bounces at lists.nyphp.org wrote on 04/20/2005 02:41:23 PM: > On Wed, 2005-04-20 at 14:34 -0400, Daniel Krook wrote: > > Whereas this snippet which uses a prepared statement gives me "DB Error: > > unknown error": > > > > $sql = 'SELECT CB.BREED_ID, B.BREED > > FROM CAT_BREED CB, BREEDS B > > WHERE CB.CAT_ID = ? AND CB.BREED_ID = B.BREED_ID'; > > > > $res =& $db->query($sql, $catId); > > > > while ($row =& $res->fetchRow()) { > > // Populate a Cat object and set its breeds property to the > > array. > > } > > > $sth =& $db->prepare( $sql ); > $res =& $db->execute($sth, $catId); > From nyphp at n0p.net Wed Apr 20 14:45:43 2005 From: nyphp at n0p.net (Flavio daCosta) Date: Wed, 20 Apr 2005 14:45:43 -0400 Subject: [nycphp-talk] PEAR DB prepared statements. PHP 5 / DB2 8 In-Reply-To: <1114022483.22114.12.camel@localhost.localdomain> References: <1114022483.22114.12.camel@localhost.localdomain> Message-ID: <1114022744.22114.16.camel@localhost.localdomain> Opps sorry, looks like you can use query() but you need to put your params in an array: $res =& $db->query($sql, array( $catId ) ); From nyphp at n0p.net Wed Apr 20 15:14:29 2005 From: nyphp at n0p.net (Flavio daCosta) Date: Wed, 20 Apr 2005 15:14:29 -0400 Subject: [nycphp-talk] PEAR DB prepared statements. PHP 5 / DB2 8 In-Reply-To: <1114022744.22114.16.camel@localhost.localdomain> References: <1114022483.22114.12.camel@localhost.localdomain> <1114022744.22114.16.camel@localhost.localdomain> Message-ID: <1114024469.22114.23.camel@localhost.localdomain> Well, perhaps I spoke too soon. It appears that either way (array or scalar) works fine for me in PHP 5.0.4 and PostgreSQL 7.4.7. I dont have an install of DB2 to see if it is a DB specific error. Have you tried a print_r on your $res to see if there are any better clues in there? From krook at us.ibm.com Wed Apr 20 15:24:11 2005 From: krook at us.ibm.com (Daniel Krook) Date: Wed, 20 Apr 2005 15:24:11 -0400 Subject: [nycphp-talk] PEAR DB prepared statements. PHP 5 / DB2 8 In-Reply-To: <1114024469.22114.23.camel@localhost.localdomain> Message-ID: > Well, perhaps I spoke too soon. It appears that either way (array or > scalar) works fine for me in PHP 5.0.4 and PostgreSQL 7.4.7. I dont > have an install of DB2 to see if it is a DB specific error. Have you > tried a print_r on your $res to see if there are any better clues in > there? Flavio, Indeed there were, thanks for the tip :) The prepared statement was taking the $catId integer and surrounding it with quotes, to which DB2 complained: SQL0401N The data types of the operands for the operation "=" are not compatible. SQLSTATE=42818 WHERE CB.CAT_ID = '60' I've changed the line to the following and it works. $res =& $db->query($sql, (int)$catId); Thanks again. From dmintz at davidmintz.org Wed Apr 20 16:58:05 2005 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 20 Apr 2005 16:58:05 -0400 (EDT) Subject: [nycphp-talk] __get __set methods.. In-Reply-To: <8f494f7605042008492b6d1b77@mail.gmail.com> References: <769e4ce050419190131da4c37@mail.gmail.com> <769e4ce05042008384fe3aaec@mail.gmail.com> <8f494f7605042008492b6d1b77@mail.gmail.com> Message-ID: On Wed, 20 Apr 2005, Alex C wrote: > I really think these methods might be really handy for predefined > properties. Am I wrong to think that? just want to understand why this > might be bad idea to have these functions work with predefined > properties. with this runner class, i want to exclusively have > predefine properties for this object. I might be missing something, but if you want people to be able to get and set your props directly, why not just make them public and be done with it? --- David Mintz http://davidmintz.org/ From adam at trachtenberg.com Wed Apr 20 19:42:14 2005 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Wed, 20 Apr 2005 19:42:14 -0400 (EDT) Subject: [nycphp-talk] __get __set methods.. In-Reply-To: References: <769e4ce050419190131da4c37@mail.gmail.com> <769e4ce05042008384fe3aaec@mail.gmail.com> <8f494f7605042008492b6d1b77@mail.gmail.com> Message-ID: On Wed, 20 Apr 2005, David Mintz wrote: > On Wed, 20 Apr 2005, Alex C wrote: > > > I really think these methods might be really handy for predefined > > properties. Am I wrong to think that? just want to understand why this > > might be bad idea to have these functions work with predefined > > properties. with this runner class, i want to exclusively have > > predefine properties for this object. > > I might be missing something, but if you want people to be able to get and > set your props directly, why not just make them public and be done with > it? Because it breaks encapsulation. Using accessors allows you to modify how you store/validate/etc. properties in your class without changing the public interface to the data. -adam -- adam at trachtenberg.com | http://www.trachtenberg.com author of o'reilly's "upgrading to php 5" and "php cookbook" avoid the holiday rush, buy your copies today! From dmintz at davidmintz.org Wed Apr 20 21:47:35 2005 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 20 Apr 2005 21:47:35 -0400 (EDT) Subject: [nycphp-talk] __get __set methods.. In-Reply-To: References: <769e4ce050419190131da4c37@mail.gmail.com> <769e4ce05042008384fe3aaec@mail.gmail.com> <8f494f7605042008492b6d1b77@mail.gmail.com> Message-ID: On Wed, 20 Apr 2005, Adam Maccabee Trachtenberg wrote: > On Wed, 20 Apr 2005, David Mintz wrote: > > I might be missing something, but if you want people to be able to get and > > set your props directly, why not just make them public and be done with > > it? > > Because it breaks encapsulation. Using accessors allows you to modify > how you store/validate/etc. properties in your class without changing > the public interface to the data. Ahh, I see. Fun-duh-mental. So what might look like pro forma encapsulation today might be another story tomorrow. Thanks. --- David Mintz http://davidmintz.org/ From suzerain at suzerain.com Thu Apr 21 00:42:20 2005 From: suzerain at suzerain.com (Marc Antony Vose) Date: Thu, 21 Apr 2005 00:42:20 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: References: <769e4ce050419190131da4c37@mail.gmail.com> <769e4ce05042008384fe3aaec@mail.gmail.com> <8f494f7605042008492b6d1b77@mail.gmail.com> Message-ID: Hi there: If this question is redundant, feel free to direct me to a discussion or article. But maybe it's worth asking once in a while anyway, since PHP is continually updated and performance can change. The question is: how much data should I feel free to store in a session? As much as I want? Or not? Since they're serialized text files...and have to be parsed, I'm just wondering if people have experienced slowdowns or other erratic behavior by saving too much data in the session variable. Thanks! -- Marc Antony Vose http://www.suzerain.com/ Never underestimate the power of human stupidity. -- Lazarus Long From lists at zaunere.com Thu Apr 21 13:46:09 2005 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 21 Apr 2005 13:46:09 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: Message-ID: <20050421174111.61E8299DF@mailrelay.t-mobile.com> > If this question is redundant, feel free to direct me to a discussion > or article. But maybe it's worth asking once in a while anyway, > since PHP is continually updated and performance can change. > > The question is: how much data should I feel free to store in a > session? As much as I want? Or not? > > Since they're serialized text files...and have to be parsed, I'm just > wondering if people have experienced slowdowns or other erratic > behavior by saving too much data in the session variable. If you mean sending data back and forth using cookies, keep it small, like well under a 1K is what I personally like to do. You can then of course use a session ID to link into a database, where obviously the size is unlimited. H From krook at us.ibm.com Thu Apr 21 14:00:39 2005 From: krook at us.ibm.com (Daniel Krook) Date: Thu, 21 Apr 2005 14:00:39 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: Message-ID: > The question is: how much data should I feel free > to store in a session? As much as I want? Or not? The instinct here is always to minimize what you are storing in the session on the server (in addition to what you're sending back and forth to the client in the form of cookies as Hans mentioned), so that you don't overload the file system. I saw some example a few months back about about the space required by an application that had 20k of session data on the file system x number of users x 20 minute time out which brought the space needed to 2GB for a modest amount of users. To determine how much you can store in the session, I found this passage to be the best test (even though it's a WebSphere doc it applies to web apps in general): ftp://ftp.software.ibm.com/software/dw/wes/pdf/0207_garratt.pdf (p. 25) "The best solution I have found to this problem is load testing the application in an environment that is as close as possible to the anticipated production environment. Once functional correctness has been verified, load testing provides the best opportunity to discover latent bugs in the system. These bugs range from inadequate disk space for logs (or inordinately large amounts of trace) to session persistence problems related to improper session-related coding techniques (a very common source of problems). Load testing in general will quickly flush these problems out." Daniel Krook, Advisory IT Specialist Application Development, Production Services - Tools, ibm.com Personal: http://info.krook.org/ BluePages: http://w3.ibm.com/bluepages?searchcnum=9A9796897 From chsnyder at gmail.com Thu Apr 21 14:57:38 2005 From: chsnyder at gmail.com (csnyder) Date: Thu, 21 Apr 2005 14:57:38 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: References: Message-ID: On 4/21/05, Daniel Krook wrote: > I saw some example a few months back about > about the space required by an application that had 20k of session data on > the file system x number of users x 20 minute time out which brought the > space needed to 2GB for a modest amount of users. So the answer is, store as much as you need to, and no more. But I'm still curious about the performance implications of serialize() / unserialize() -- should large sessions be broken up into many rows of a table, so that updates only touch one row and not the entire structure? It seems like if you had A LOT of data being stored in the session, you would be better off putting it into a db and only reading/writing the rows you need for a given request. Then the only thing stored in $_SESSION would be the key(s) to those rows... The disk size requirements don't go away, but processing might be more efficient. -- Chris Snyder http://chxo.com/ From dcech at phpwerx.net Thu Apr 21 16:40:43 2005 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 21 Apr 2005 16:40:43 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: References: Message-ID: <42680FCB.8000604@phpwerx.net> I've had pretty good success in the past using database-backed sessions with gzip compression. I did it by writing my own session handlers which take the $_SESSION array, serialize and (optionally) gzip it, then store the result in a table. A big advantage of this method is that you can store other useful data in the session like the activity time, user_id, etc for generating 'who's online' type reports, session timeouts, or whatever else might come in handy. If you don't want to get involved with the inner workings of the session mechanism I would recommend looking at the session functions included with ADOdb. Breaking session data across several different rows could work, however if data is getting that large I would probably think about using something like PEAR::Cache_Lite rather than extending the session mechanism. Dan csnyder wrote: > On 4/21/05, Daniel Krook wrote: > >> I saw some example a few months back about >>about the space required by an application that had 20k of session data on >>the file system x number of users x 20 minute time out which brought the >>space needed to 2GB for a modest amount of users. > > > So the answer is, store as much as you need to, and no more. > > But I'm still curious about the performance implications of > serialize() / unserialize() -- should large sessions be broken up into > many rows of a table, so that updates only touch one row and not the > entire structure? > > It seems like if you had A LOT of data being stored in the session, > you would be better off putting it into a db and only reading/writing > the rows you need for a given request. Then the only thing stored in > $_SESSION would be the key(s) to those rows... > > The disk size requirements don't go away, but processing might be more > efficient. > From mitch.pirtle at gmail.com Thu Apr 21 17:36:53 2005 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Thu, 21 Apr 2005 17:36:53 -0400 Subject: [nycphp-talk] aggregate views on serialized session data WAS: session size important? In-Reply-To: <42680FCB.8000604@phpwerx.net> References: <42680FCB.8000604@phpwerx.net> Message-ID: <330532b6050421143628dbc072@mail.gmail.com> On 4/21/05, Dan Cech wrote: > > I did it by writing my own session handlers which take the $_SESSION > array, serialize and (optionally) gzip it, then store the result in a > table. A big advantage of this method is that you can store other > useful data in the session like the activity time, user_id, etc for > generating 'who's online' type reports, session timeouts, or whatever > else might come in handy. Ooh ooh ooh! *mitchy holds up hand Then if you are storing whether someone is online or not in a serialized array in a database, how can you get aggregate views? "X of XXX people online from NYC" and so on. I am just not content with the most common approaches to this problem, and would love to learn how others deal with it. -- Mitch From suzerain at suzerain.com Thu Apr 21 17:56:12 2005 From: suzerain at suzerain.com (Marc Antony Vose) Date: Thu, 21 Apr 2005 17:56:12 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: <42680FCB.8000604@phpwerx.net> References: <42680FCB.8000604@phpwerx.net> Message-ID: Hello: I guess it's all about balance between speed and disk space. I was thinking of storing some limited data in sessions just because I figured it was less total overhead than hitting the database for a response. Perhaps, though, it's not giving much of an advantage, and I should just confine session storage to things like unique IDs, and then do lookups based on that. I guess my thinking was that involving another program in this was creates a bunch of overhead. I guess touching MySQL isn't as intensive as I imagine? Marc >I've had pretty good success in the past using database-backed >sessions with gzip compression. > >I did it by writing my own session handlers which take the $_SESSION >array, serialize and (optionally) gzip it, then store the result in >a table. A big advantage of this method is that you can store other >useful data in the session like the activity time, user_id, etc for >generating 'who's online' type reports, session timeouts, or >whatever else might come in handy. > >If you don't want to get involved with the inner workings of the >session mechanism I would recommend looking at the session functions >included with ADOdb. > >Breaking session data across several different rows could work, >however if data is getting that large I would probably think about >using something like PEAR::Cache_Lite rather than extending the >session mechanism. > >Dan > >csnyder wrote: >>On 4/21/05, Daniel Krook wrote: >> >>>I saw some example a few months back about >>>about the space required by an application that had 20k of session data on >>>the file system x number of users x 20 minute time out which brought the >>>space needed to 2GB for a modest amount of users. >> >> >>So the answer is, store as much as you need to, and no more. >> >>But I'm still curious about the performance implications of >>serialize() / unserialize() -- should large sessions be broken up into >>many rows of a table, so that updates only touch one row and not the >>entire structure? >> >>It seems like if you had A LOT of data being stored in the session, >>you would be better off putting it into a db and only reading/writing >>the rows you need for a given request. Then the only thing stored in >>$_SESSION would be the key(s) to those rows... >> >>The disk size requirements don't go away, but processing might be more >>efficient. >> > >_______________________________________________ >New York PHP Talk Mailing List >AMP Technology >Supporting Apache, MySQL and PHP >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org From dcech at phpwerx.net Thu Apr 21 18:45:35 2005 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 21 Apr 2005 18:45:35 -0400 Subject: [nycphp-talk] aggregate views on serialized session data WAS: session size important? In-Reply-To: <330532b6050421143628dbc072@mail.gmail.com> References: <42680FCB.8000604@phpwerx.net> <330532b6050421143628dbc072@mail.gmail.com> Message-ID: <42682D0F.8060400@phpwerx.net> Mitch, What I did was to create a table with several columns like: session_id,user_id,activity_timestamp,session_data Then with custom session handlers you can maintain the whole table automatically, and pull data from it to generate the aggregates. I found low-level gzip compression to be great at reducing the size of the session data for storage without adding too much overhead. If you're interested in this stuff contact me off-list and I can give you a complete rundown, code samples, etc. Dan Mitch Pirtle wrote: > On 4/21/05, Dan Cech wrote: > >>I did it by writing my own session handlers which take the $_SESSION >>array, serialize and (optionally) gzip it, then store the result in a >>table. A big advantage of this method is that you can store other >>useful data in the session like the activity time, user_id, etc for >>generating 'who's online' type reports, session timeouts, or whatever >>else might come in handy. > > > Ooh ooh ooh! > > *mitchy holds up hand > > Then if you are storing whether someone is online or not in a > serialized array in a database, how can you get aggregate views? "X > of XXX people online from NYC" and so on. > > I am just not content with the most common approaches to this problem, > and would love to learn how others deal with it. > > -- Mitch > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org From mitch.pirtle at gmail.com Thu Apr 21 19:16:27 2005 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Thu, 21 Apr 2005 19:16:27 -0400 Subject: [nycphp-talk] aggregate views on serialized session data WAS: session size important? In-Reply-To: <42682D0F.8060400@phpwerx.net> References: <42680FCB.8000604@phpwerx.net> <330532b6050421143628dbc072@mail.gmail.com> <42682D0F.8060400@phpwerx.net> Message-ID: <330532b605042116164a5b039c@mail.gmail.com> On 4/21/05, Dan Cech wrote: > > If you're interested in this stuff contact me off-list and I can give > you a complete rundown, code samples, etc. That is what I am already doing, I was just hoping for a silver bullet ;-) -- Mitch From chsnyder at gmail.com Thu Apr 21 20:15:40 2005 From: chsnyder at gmail.com (csnyder) Date: Thu, 21 Apr 2005 20:15:40 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: References: <42680FCB.8000604@phpwerx.net> Message-ID: On 4/21/05, Marc Antony Vose wrote: > I guess my thinking was that involving another program in this was > creates a bunch of overhead. I guess touching MySQL isn't as > intensive as I imagine? If you already have a connection, no. Don't involve MySQL or any other libs if PHP sessions would work -- I think we tend to underestimate just how scalable simple systems are. If your sessions have 14MB arrays in them, you'll probably want to split them up. :-) From lists at zaunere.com Fri Apr 22 09:19:18 2005 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 22 Apr 2005 09:19:18 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: Message-ID: <0MKyxe-1DOy402Mwp-00022x@mrelay.perfora.net> > > I saw some example a few months back about > > about the space required by an application that had 20k of session data on > > the file system x number of users x 20 minute time out which brought the > > space needed to 2GB for a modest amount of users. > > So the answer is, store as much as you need to, and no more. > > But I'm still curious about the performance implications of > serialize() / unserialize() -- should large sessions be broken up into > many rows of a table, so that updates only touch one row and not the > entire structure? My understanding of things (mostly from seeing discussions from Rasmus et al about serialize()) is that it's slow as heck. Basically, it was never designed for performance or production usage, and should be considered a utility function. That said, I believe there is a PECL that provides much better serialize functionality. > It seems like if you had A LOT of data being stored in the session, > you would be better off putting it into a db and only reading/writing > the rows you need for a given request. Then the only thing stored in > $_SESSION would be the key(s) to those rows... > > The disk size requirements don't go away, but processing might be more > efficient. At the end of the day, I think it's safe to use this rule: -- keep session data stored in the database as small as possible -- keep session data in transit even smaller Session data is basically just the method of keeping state. If the application requires large amounts of state, perhaps it's time to reconsider its architecture and deployment. State shouldn't be that big. If there's absolutely no way to minimize state (although there always should be) use a database/memcache combination to maintain it, but frankly, I'd never want to put it across the wire to a browser, for at least the following reasons: -- moving large amounts of data across the wire is expensive (from a network and resource perspective, not to mention possibly a bandwidth cost perspective) -- if you put things out on the wire, you really shouldn't depend on them coming back the same way. This means you're doing a lot of checksums, etc. This is a further performance hit, and one that is likely greater than using known data from a locally connected database. -- processing overhead on both the client and Apache side can be a problem. It's just a lot of data to have circulating *twice* on *every* request - plain and simple. --- Hans Zaunere President, Founder New York PHP http://www.nyphp.org AMP Technology Supporting Apache, MySQL and PHP From chsnyder at gmail.com Fri Apr 22 12:29:19 2005 From: chsnyder at gmail.com (csnyder) Date: Fri, 22 Apr 2005 12:29:19 -0400 Subject: [nycphp-talk] aggregate views on serialized session data WAS: session size important? In-Reply-To: <330532b605042116164a5b039c@mail.gmail.com> References: <42680FCB.8000604@phpwerx.net> <330532b6050421143628dbc072@mail.gmail.com> <42682D0F.8060400@phpwerx.net> <330532b605042116164a5b039c@mail.gmail.com> Message-ID: On 4/21/05, Mitch Pirtle wrote: > That is what I am already doing, I was just hoping for a silver bullet ;-) I suppose a copper bullet and an SQL join will have to do... :-) That's the way I've always done it, too, except that I'm usually lucky enough to work on small projects that don't require a custom session handler (because they don't involve multiple webservers). From chsnyder at gmail.com Fri Apr 22 12:32:07 2005 From: chsnyder at gmail.com (csnyder) Date: Fri, 22 Apr 2005 12:32:07 -0400 Subject: [nycphp-talk] aggregate views on serialized session data WAS: session size important? In-Reply-To: <42682D0F.8060400@phpwerx.net> References: <42680FCB.8000604@phpwerx.net> <330532b6050421143628dbc072@mail.gmail.com> <42682D0F.8060400@phpwerx.net> Message-ID: On 4/21/05, Dan Cech wrote: > Then with custom session handlers you can maintain the whole table > automatically, and pull data from it to generate the aggregates. Oh, and, pay special attention to your garbage collection routines - a session table with 800,000 stale records is not a pretty sight. From mitch.pirtle at gmail.com Fri Apr 22 14:42:28 2005 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Fri, 22 Apr 2005 14:42:28 -0400 Subject: [nycphp-talk] aggregate views on serialized session data WAS: session size important? In-Reply-To: References: <42680FCB.8000604@phpwerx.net> <330532b6050421143628dbc072@mail.gmail.com> <42682D0F.8060400@phpwerx.net> Message-ID: <330532b605042211428cbc597@mail.gmail.com> On 4/22/05, csnyder wrote: > > Oh, and, pay special attention to your garbage collection routines - a > session table with 800,000 stale records is not a pretty sight. I never did get ADOdb's session_expiration stuff working to clean out those records, and was forced to find another solution. I ended up omitting reference to that altogether for an article on using ADOdb and got in the John Lim Doghouse for it too (gasp!) So, I've taken two different approaches to get the "There are X people online" view: 1) store the online status as a boolean in the session table, and just get counts 2) store the summary count data in memory, and update for each login/logout I am unconvinced that one is better over the other, what does everyone else think? #2 is certainly the fastest until you need multiple servers, but #1 means you gotta count for every aggregate. -- Mitch From chsnyder at gmail.com Fri Apr 22 15:17:39 2005 From: chsnyder at gmail.com (csnyder) Date: Fri, 22 Apr 2005 15:17:39 -0400 Subject: [nycphp-talk] aggregate views on serialized session data WAS: session size important? In-Reply-To: <330532b605042211428cbc597@mail.gmail.com> References: <42680FCB.8000604@phpwerx.net> <330532b6050421143628dbc072@mail.gmail.com> <42682D0F.8060400@phpwerx.net> <330532b605042211428cbc597@mail.gmail.com> Message-ID: On 4/22/05, Mitch Pirtle wrote: > I am unconvinced that one is better over the other, what does everyone > else think? #2 is certainly the fastest until you need multiple > servers, but #1 means you gotta count for every aggregate. By aggregate, you mean: Currently online: X users from New York, Y users who like cheese Or just, there are Z users online. Since state is dubious, the number of users online is fuzzy, and you *could* just do another count every five minutes or so rather than on each request. From dcech at phpwerx.net Fri Apr 22 15:22:41 2005 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 22 Apr 2005 15:22:41 -0400 Subject: [nycphp-talk] aggregate views on serialized session data WAS: session size important? In-Reply-To: <330532b605042211428cbc597@mail.gmail.com> References: <42680FCB.8000604@phpwerx.net> <330532b6050421143628dbc072@mail.gmail.com> <42682D0F.8060400@phpwerx.net> <330532b605042211428cbc597@mail.gmail.com> Message-ID: <42694F01.90707@phpwerx.net> Mitch Pirtle wrote: > On 4/22/05, csnyder wrote: >>Oh, and, pay special attention to your garbage collection routines - a >>session table with 800,000 stale records is not a pretty sight. > > I never did get ADOdb's session_expiration stuff working to clean out > those records, and was forced to find another solution. I ended up > omitting reference to that altogether for an article on using ADOdb > and got in the John Lim Doghouse for it too (gasp!) Yeah, never having actually used ADOdb's session handlers in the real world (because I had my own already) I wasn't aware of this. The gc handler does seem unnecessarily complex. I'm also not a fan of pre-computing expiry times, I prefer to set an activity time and compute the expiry time as needed to keep things consistent if you change the timeout value. Here is the handler I used, which assumes you set a column called 'active' to the current gmtime() each time you update the session data (The optimize table stuff is obviously MySQL specific). Execute($gc_sql); if (!is_object($result)) { trigger_error ('_sess_gc (): Failed to DELETE old sessions.', E_USER_WARNING); return FALSE; } $opt_sql = 'OPTIMIZE TABLE '. SESSION_TABLE; $result = $db->Execute($opt_sql); if (!is_object($result)) { trigger_error ('_sess_gc (): Failed to OPTIMIZE session table.', E_USER_WARNING); return FALSE; } /* // uncomment to test if garbage collection gets called properly if ($fp = fopen ('/tmp/gc.txt','ab')) { fwrite($fp,gmtime() .' - '. $gc_sql ."\n"); fclose($fp); } */ // trigger_error ('_sess_gc (): Session Garbage Collection successful.', E_USER_NOTICE); return TRUE; } > So, I've taken two different approaches to get the "There are X people > online" view: > > 1) store the online status as a boolean in the session table, and just > get counts > 2) store the summary count data in memory, and update for each login/logout > > I am unconvinced that one is better over the other, what does everyone > else think? #2 is certainly the fastest until you need multiple > servers, but #1 means you gotta count for every aggregate. As for counting users, in MySQL at least, if you put an index on the 'active' field then you can use something like: 'SELECT COUNT(*) FROM '. SESSION_TABLE .' WHERE active >= '. (gmtime()-300); To get a count of all users active in the last 5 minutes, and (again at least for MySQL) it should be fairly fast because it can be computed using only the index. You could maybe use a hybrid approach where you maintain a value (either in the db or in some other cache) of the current count and increment it on login/logoff, but add a function to the session gc handler to perform the count and keep it in sync. I guess it really depends on how accurate you want the count to be. Dan From suzerain at suzerain.com Fri Apr 22 17:58:12 2005 From: suzerain at suzerain.com (Marc Antony Vose) Date: Fri, 22 Apr 2005 17:58:12 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: <0MKyxe-1DOy402Mwp-00022x@mrelay.perfora.net> References: <0MKyxe-1DOy402Mwp-00022x@mrelay.perfora.net> Message-ID: > >-- moving large amounts of data across the wire is expensive (from a >network and resource perspective, not to mention possibly a >bandwidth cost perspective) I just wanted to make sure of something. in PHP's default session management (i.e., $_SESSION), PHP really only sends around the session ID, right, regardless of how much data you are storing on your server? Cheers, From krook at us.ibm.com Sat Apr 23 00:36:14 2005 From: krook at us.ibm.com (Daniel Krook) Date: Sat, 23 Apr 2005 00:36:14 -0400 Subject: [nycphp-talk] Displaying images from a database Message-ID: Hello folks, I'm trying to display image content that has been stored in a DB2 v8.2 database as a BLOB along with its filename, size, and content type which was passed along when they were inserted via a form upload. Storing links to physical files outside the database is not an option for this application. I know that the data that is stored is not corrupt because the non-PHP content management tool that works with the uploads can redisplay them properly. It's displaying them in PHP that is the issue. I'm able to get the values I need from the database into a Photo object correctly with the following function. [The FOR READ ONLY bit is a solution for getting BLOB data through ODBC correctly in PHP]. public function getCatPhoto ($catId) { global $db; $retPhoto = new Photo(); $sql = 'SELECT NAME, SIZE, TYPE, DATA FROM DB2INST1.PHOTOS P, DB2INST1.CAT_PHOTO CP WHERE CP.CAT_ID = ? AND CP.PHOTO_ID = P.PHOTO_ID FOR READ ONLY'; $res =& $db->query($sql, (int)$catId); if (PEAR::isError($res)) { die($res->getMessage()); } else { if ($row =& $res->fetchRow()) { $retPhoto->name = $row['NAME']; $retPhoto->size = $row['SIZE']; $retPhoto->type = $row['TYPE']; $retPhoto->data = $row['DATA']; } } $res->free(); return $retPhoto; } I then take this Photo object and try to display it in the browser. Note that there's no whitespace anywhere that's messing with the headers. I have experimented with quite a few cache control headers to no avail. Firefox and IE on the PC and Safari on the Mac all fail to display the image. IE gives me the stream of data as it looks in the database. Firefox sometimes displays the data and other times tells me that "The image "x" cannot be displayed, because it contains errors." I've also tried unsuccessfully using force download techniques with header('Content-Disposition: attachment; filename="' . $photo->name . '"'); $photo = getCatPhoto($_GET['catId']); header('Content-Type: ' . $photo->type); header('Content-Length: ' . $photo->size); echo $photo->data; The script can can be tested here: http://catabase.krook.org/inc/util/view-photo.php?catId=34 (JPEG) http://catabase.krook.org/inc/util/view-photo.php?catId=60 (GIF) Can anyone see something that I'm missing? Everything I've Googled points to examples that state that at a minimum the case-sensitive Content-Type header must be there and to use the echo function (as opposed to print because it's not so picky about unstructured data). Are there any other things I'm overlooking? Thanks in advance. Daniel Krook, Advisory IT Specialist Application Development, Production Services - Tools, ibm.com Personal: http://info.krook.org/ BluePages: http://w3.ibm.com/bluepages?searchcnum=9A9796897 From chsnyder at gmail.com Sat Apr 23 00:56:39 2005 From: chsnyder at gmail.com (csnyder) Date: Sat, 23 Apr 2005 00:56:39 -0400 Subject: [nycphp-talk] Displaying images from a database In-Reply-To: References: Message-ID: On 4/23/05, Daniel Krook wrote: > The script can can be tested here: > http://catabase.krook.org/inc/util/view-photo.php?catId=34 (JPEG) > http://catabase.krook.org/inc/util/view-photo.php?catId=60 (GIF) Doesn't look like binary data to me -- looks like hex. Run it through a hex2bin function and see if the output looks more like a JPEG... -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Sat Apr 23 01:02:20 2005 From: chsnyder at gmail.com (csnyder) Date: Sat, 23 Apr 2005 01:02:20 -0400 Subject: [nycphp-talk] Displaying images from a database In-Reply-To: References: Message-ID: Message-ID: > a hex2bin function and see if the output looks more like a JPEG... Snyder, that worked like a charm. Thanks for the ridiculously quick fix at 1am :) Daniel Krook, Advisory IT Specialist Application Development, Production Services - Tools, ibm.com Personal: http://info.krook.org/ BluePages: http://w3.ibm.com/bluepages?searchcnum=9A9796897 From jsiegel1 at optonline.net Sat Apr 23 08:46:16 2005 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Sat, 23 Apr 2005 08:46:16 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: References: <0MKyxe-1DOy402Mwp-00022x@mrelay.perfora.net> Message-ID: <426A4398.9050905@optonline.net> Marc Antony Vose wrote: > > > I just wanted to make sure of something. in PHP's default session > management (i.e., $_SESSION), PHP really only sends around the session > ID, right, regardless of how much data you are storing on your server? > Yes...that's kinda the point of the sessions. Jeff From chsnyder at gmail.com Sat Apr 23 11:07:20 2005 From: chsnyder at gmail.com (csnyder) Date: Sat, 23 Apr 2005 11:07:20 -0400 Subject: [nycphp-talk] Printable PHP Cheat Sheet Message-ID: Here's a lovely desk accessory (or even a placemat for your baby's highchair) that might cut down on roundtrips to the PHP manual. http://www.ilovejackdaniels.com/php_cheat_sheet.png I haven't checked it for typos or anything, but it looks pretty handy. From chsnyder at gmail.com Sat Apr 23 11:15:25 2005 From: chsnyder at gmail.com (csnyder) Date: Sat, 23 Apr 2005 11:15:25 -0400 Subject: [nycphp-talk] Displaying images from a database In-Reply-To: References: Message-ID: On 4/23/05, Daniel Krook wrote: > Snyder, that worked like a charm. Thanks for the ridiculously quick fix > at 1am :) Thank the PHP Manual, which I should have attributed that lovely hex2bin function to. :-) From jsiegel1 at optonline.net Sat Apr 23 11:20:07 2005 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Sat, 23 Apr 2005 11:20:07 -0400 Subject: [nycphp-talk] Printable PHP Cheat Sheet In-Reply-To: References: Message-ID: <426A67A7.2070408@optonline.net> Make a nice t-shirt too. ;) Jeff csnyder wrote: > Here's a lovely desk accessory (or even a placemat for your baby's > highchair) that might cut down on roundtrips to the PHP manual. > http://www.ilovejackdaniels.com/php_cheat_sheet.png > > I haven't checked it for typos or anything, but it looks pretty handy. > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > > From codebowl at gmail.com Sat Apr 23 11:22:28 2005 From: codebowl at gmail.com (Joseph Crawford) Date: Sat, 23 Apr 2005 11:22:28 -0400 Subject: [nycphp-talk] Printable PHP Cheat Sheet In-Reply-To: <426A67A7.2070408@optonline.net> References: <426A67A7.2070408@optonline.net> Message-ID: <8d9a4280050423082248d6d433@mail.gmail.com> yea this is great :) -- Joseph Crawford Jr. Codebowl Solutions codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Sat Apr 23 20:17:19 2005 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 23 Apr 2005 20:17:19 -0400 Subject: [nycphp-talk] aggregate views on serialized session data WAS:session size important? In-Reply-To: Message-ID: <0MKyxe-1DPUoM1OFM-00020F@mrelay.perfora.net> > > Then with custom session handlers you can maintain the whole table > > automatically, and pull data from it to generate the aggregates. > > Oh, and, pay special attention to your garbage collection routines - a > session table with 800,000 stale records is not a pretty sight. Neither is a sessions table with 350 million rows, as I've just seen during a consultant gig for a large web site. So yes, GC is important :) H From lists at zaunere.com Sat Apr 23 20:19:20 2005 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 23 Apr 2005 20:19:20 -0400 Subject: [nycphp-talk] FW: OWASP Meeting Message-ID: <0MKyxe-1DPUqJ1gcs-0002A8@mrelay.perfora.net> Perhaps interesting for some of us to attend... > There's an upcoming Open Web Application Security Project (OWASP) meeting > coming up, and anyone who's interested is free to attend. > > If you would like further info, feel free to contact me off-list or see: > > (NYC) http://www.owasp.org/local/nyc.html > (NJ) http://www.owasp.org/local/nnj.html --- Hans Zaunere President, Founder New York PHP http://www.nyphp.org AMP Technology Supporting Apache, MySQL and PHP From lists at zaunere.com Sat Apr 23 20:21:02 2005 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 23 Apr 2005 20:21:02 -0400 Subject: [nycphp-talk] memcache In-Reply-To: Message-ID: <0MKyxe-1DPUrx33yI-0002D3@mrelay.perfora.net> > I'm considering using memcache > (http://us3.php.net/manual/en/ref.memcache.php) in conjunction with a > project I'm currently working on. The other developer on my team is > researching Perl/PHP app servers, and my theory is that since this is > a single machine web server (no room for wiggle room on this from the > client) the performance hit isn't worth the hassle of installing and > maintaining. > > Has anyone on the list used memcache before? > How did it work out? Was it useful? Buggy? Persnickety? > Did it introduce performace problems? I haven't used it much myself, but know of several cases where people are happy with it in production. --- Hans Zaunere President, Founder New York PHP http://www.nyphp.org AMP Technology Supporting Apache, MySQL and PHP From suzerain at suzerain.com Sat Apr 23 20:57:10 2005 From: suzerain at suzerain.com (Marc Antony Vose) Date: Sat, 23 Apr 2005 20:57:10 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: <426A4398.9050905@optonline.net> References: <0MKyxe-1DOy402Mwp-00022x@mrelay.perfora.net> <426A4398.9050905@optonline.net> Message-ID: >Marc Antony Vose wrote: >> >> >>I just wanted to make sure of something. in PHP's default session >>management (i.e., $_SESSION), PHP really only sends around the >>session ID, right, regardless of how much data you are storing on >>your server? >> > >Yes...that's kinda the point of the sessions. I only asked because Hans had mentioned: >-- moving large amounts of data across the wire is expensive (from a >network and resource perspective, not to mention possibly a >bandwidth cost perspective) I just thought here might be something else I didn't know about how it works. Marc From jsiegel1 at optonline.net Sat Apr 23 22:04:29 2005 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Sat, 23 Apr 2005 22:04:29 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: References: <0MKyxe-1DOy402Mwp-00022x@mrelay.perfora.net> <426A4398.9050905@optonline.net> Message-ID: <426AFEAD.5060802@optonline.net> Marc Antony Vose wrote: > > I only asked because Hans had mentioned: > >> -- moving large amounts of data across the wire is expensive (from a >> network and resource perspective, not to mention possibly a bandwidth >> cost perspective) > > > I just thought here might be something else I didn't know about how it > works. > I think Hans mentioned this in contrast to sessions. Jeff From lists at zaunere.com Sat Apr 23 22:10:13 2005 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 23 Apr 2005 22:10:13 -0400 Subject: [nycphp-talk] session size important? In-Reply-To: <426AFEAD.5060802@optonline.net> Message-ID: <0MKz5u-1DPWZc3OAY-0007Fw@mrelay.perfora.net> > > I only asked because Hans had mentioned: > > > >> -- moving large amounts of data across the wire is expensive (from a > >> network and resource perspective, not to mention possibly a bandwidth > >> cost perspective) > > > > > > I just thought here might be something else I didn't know about how it > > works. > > > > I think Hans mentioned this in contrast to sessions. Well sessions can of course be implemented in several ways. Obviously only a key can be sent back and forth to the browser, which is then used to lookup the complete session on the server (either by way of a database, filesystem, etc). If there is more than 1 web server, though, storing things on the filesystem won't work. So I've also seen people actually store the session data in a cookie which is then also passed back and forth. I generally never think this is a good idea, and would rather move things to a database. H From nyphp at n0p.net Sun Apr 24 02:32:42 2005 From: nyphp at n0p.net (Flavio daCosta) Date: Sun, 24 Apr 2005 02:32:42 -0400 Subject: [nycphp-talk] APC and PHP5 Message-ID: <1114324362.30384.10.camel@localhost.localdomain> Anyone know if APC (2.0.4 Latest..) works in PHP5 (5.0.4 Linux)? Never had a problem in PHP4 but getting an errors doing a 'pear install APC' in PHP5. Just wondering if I should recheck my PHP5 install, or if it's just not 5 ready. Thanks Flavio -------------- next part -------------- []$ s pear install APC downloading APC-2.0.4.tgz ... Starting to download APC-2.0.4.tgz (44,606 bytes) ............done: 44,606 bytes 35 source files, building running: phpize Configuring for: PHP Api Version: 20031224 Zend Module Api No: 20041030 Zend Extension Api No: 220040412 building in /var/tmp/pear-build-root/APC-2.0.4 running: /tmp/tmp8XMR0E/APC-2.0.4/configure checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking whether gcc and cc understand -c and -o together... yes checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr /include/php5/TSRM -I/usr/include/php5/Zend checking for PHP extension directory... /usr/lib/php5/20041030 checking for re2c... re2c checking for gawk... gawk checking for APC support... yes, shared checking for union semun... no checking whether to enable mmap support instead of IPC shm... no checking whether to prefer semaphore based locks... no checking for shm_open in -lrt... yes checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... no checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool configure: creating ./config.status config.status: creating config.h running: make /bin/sh /var/tmp/pear-build-root/APC-2.0.4/libtool --mode=compile gcc -I. -I/tm p/tmp8XMR0E/APC-2.0.4 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/APC-2.0.4/includ e -I/var/tmp/pear-build-root/APC-2.0.4/main -I/tmp/tmp8XMR0E/APC-2.0.4 -I/usr/in clude/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5 /Zend -DHAVE_CONFIG_H -g -O2 -c /tmp/tmp8XMR0E/APC-2.0.4/apc.c -o apc.lo gcc -I. -I/tmp/tmp8XMR0E/APC-2.0.4 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/APC -2.0.4/include -I/var/tmp/pear-build-root/APC-2.0.4/main -I/tmp/tmp8XMR0E/APC-2. 0.4 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr /include/php5/Zend -DHAVE_CONFIG_H -g -O2 -c /tmp/tmp8XMR0E/APC-2.0.4/apc.c -fP IC -DPIC -o apc.lo /bin/sh /var/tmp/pear-build-root/APC-2.0.4/libtool --mode=compile gcc -I. -I/tm p/tmp8XMR0E/APC-2.0.4 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/APC-2.0.4/includ e -I/var/tmp/pear-build-root/APC-2.0.4/main -I/tmp/tmp8XMR0E/APC-2.0.4 -I/usr/in clude/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5 /Zend -DHAVE_CONFIG_H -g -O2 -c /tmp/tmp8XMR0E/APC-2.0.4/apc_cache.c -o apc_ cache.lo gcc -I. -I/tmp/tmp8XMR0E/APC-2.0.4 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/APC -2.0.4/include -I/var/tmp/pear-build-root/APC-2.0.4/main -I/tmp/tmp8XMR0E/APC-2. 0.4 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr /include/php5/Zend -DHAVE_CONFIG_H -g -O2 -c /tmp/tmp8XMR0E/APC-2.0.4/apc_cache. c -fPIC -DPIC -o apc_cache.lo /tmp/tmp8XMR0E/APC-2.0.4/apc_cache.c: In function `prevent_garbage_collection': /tmp/tmp8XMR0E/APC-2.0.4/apc_cache.c:176: error: subscripted value is neither ar ray nor pointer make: *** [apc_cache.lo] Error 1 `make' failed []$ From nyphp at n0p.net Sun Apr 24 03:16:50 2005 From: nyphp at n0p.net (Flavio daCosta) Date: Sun, 24 Apr 2005 03:16:50 -0400 Subject: [nycphp-talk] APC and PHP5 In-Reply-To: <1114324362.30384.10.camel@localhost.localdomain> References: <1114324362.30384.10.camel@localhost.localdomain> Message-ID: <1114327010.30384.14.camel@localhost.localdomain> Nevermind, looks like from the INSTALL file (when downloading the file by hand) states the latest it is _tested_ for is 4.3.2 On Sun, 2005-04-24 at 02:32 -0400, Flavio daCosta wrote: > Anyone know if APC (2.0.4 Latest..) works in PHP5 (5.0.4 Linux)? > > Never had a problem in PHP4 but getting an errors doing a 'pear install > APC' in PHP5. > > Just wondering if I should recheck my PHP5 install, or if it's just not > 5 ready. > > Thanks > Flavio > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org From shiflett at php.net Sun Apr 24 13:14:29 2005 From: shiflett at php.net (Chris Shiflett) Date: Sun, 24 Apr 2005 13:14:29 -0400 Subject: [nycphp-talk] APC and PHP5 In-Reply-To: <1114324362.30384.10.camel@localhost.localdomain> References: <1114324362.30384.10.camel@localhost.localdomain> Message-ID: <426BD3F5.706@php.net> Flavio daCosta wrote: > Anyone know if APC (2.0.4 Latest..) works in PHP5 (5.0.4 Linux)? Rasmus says PHP 5 support is still "months, not weeks" away. Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ From nyphp at n0p.net Mon Apr 25 06:13:35 2005 From: nyphp at n0p.net (Flavio daCosta) Date: Mon, 25 Apr 2005 06:13:35 -0400 Subject: [nycphp-talk] APC and PHP5 In-Reply-To: <426BD3F5.706@php.net> References: <1114324362.30384.10.camel@localhost.localdomain> <426BD3F5.706@php.net> Message-ID: <1114424015.5091.3.camel@localhost.localdomain> Chris Shiflett wrote: > Rasmus says PHP 5 support is still "months, not weeks" away. Fair enough. Thanks for the reply. At least now I know it isnt my PHP5 compile/install. ;) Flavio From sajith.ml at gmail.com Mon Apr 25 07:42:31 2005 From: sajith.ml at gmail.com (Sajith A) Date: Mon, 25 Apr 2005 17:12:31 +0530 Subject: [nycphp-talk] App Server Message-ID: Has anyone come accross Sourcelabs Ampstack? The sites says they have re-configured the server to address security vulnerabilities detected through thier testing process. Also it states the scale attributes of MySQL, PHP and Static HTML were identified, profiled and documented. http://www.sourcelabs.com/AMPstack.htm To attract people to the forum for feedback and discussion they are giving an ipod every week till june http://www.sourcelabs.com/mavencontest.htm From tgales at tgaconnect.com Mon Apr 25 08:03:37 2005 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 25 Apr 2005 08:03:37 -0400 Subject: [nycphp-talk] App Server In-Reply-To: Message-ID: <000401c5498e$d19936b0$d0893818@oberon1> Sajith A writes: > Has anyone come accross Sourcelabs Ampstack? http://www.nyphp.org/content/presentations/index.php T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From danielc at analysisandsolutions.com Mon Apr 25 17:45:01 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 25 Apr 2005 17:45:01 -0400 Subject: [nycphp-talk] [ot] get a copy of my windows security CD's Message-ID: <20050425214501.GA15029@panix.com> Hey Folks: I have compiled a new edition of my Windows Security CD's. It's a free two disc set containing the following service packs, patches, tweaks and (free|share)ware: XP: Service Pack 2, post-SP2 patches, Security Template & Guide 2000: Service Pack 4, post-SP4 patches, Security Template & Guide 98 2nd Edition: most patches, Internet Explorer 6.0 w/ SP1. Registry tweaks for these operating systems and Internet Explorer 6.0 SP1 Patches for Microsoft Office versions 2000, XP (2002) and 2003 Mozilla's Firefox browser and Thunderbird email client Spybot Search and Destroy spyware checker ZoneAlarm firewall AVG anti-virus GNU Privacy Guard (aka GPG) BHODemon browser helper checker Registry Toolkit registry editor CleanMyPC registry cleaner Java Runtime Environment Macromedia Flash and Shockwave browser plugins Sysinternals monitoring utilities BootIt NG hard drive utility If you're coming to the NYPHP meeting on Tuesday, reply to me OFF LIST and I'll bring a copy for you. (Pay attention, because anyone who posts a reply to the list will be disqualified.) If you REALLY want a set but can't make the meeting, mail me two bucks cash to cover my costs for postage and the mailers, etc. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From dmintz at davidmintz.org Tue Apr 26 11:29:30 2005 From: dmintz at davidmintz.org (David Mintz) Date: Tue, 26 Apr 2005 11:29:30 -0400 (EDT) Subject: [nycphp-talk] meeting RSVP for dummies Message-ID: At the risk of appearing clueless.... I say, gee, did I forget to RSVP in time for tonight? So I go over to http://www.nyphp.org/rsvp.php and check my status, and it says I have RSVPed but I have to "re-RSVP," so I do so, and it says something confirmatory that suggests everything is cool ("Thank You and don't forget to RSVP next month"). OTOH is also says flatly that you gotta RSVP by 3:00 pm 25-Apr, which I didn't -- or did I? "Confusion now hath made his masterpiece" -- William Shakespeare --- David Mintz http://davidmintz.org/ From shiflett at php.net Tue Apr 26 11:58:06 2005 From: shiflett at php.net (Chris Shiflett) Date: Tue, 26 Apr 2005 11:58:06 -0400 Subject: [nycphp-talk] meeting RSVP for dummies In-Reply-To: References: Message-ID: <426E650E.3040206@php.net> David Mintz wrote: > At the risk of appearing clueless.... I say, gee, did I forget to RSVP in > time for tonight? So I go over to http://www.nyphp.org/rsvp.php and check > my status, and it says I have RSVPed but I have to "re-RSVP," so I do so, > and it says something confirmatory that suggests everything is cool > ("Thank You and don't forget to RSVP next month"). OTOH is also says > flatly that you gotta RSVP by 3:00 pm 25-Apr, which I didn't -- or did I? I had the same experience, and I decided to try to solve this problem permanently with my crontab file: 0 0 1 * * wget http://www.nyphp.org/rsvp.php?firstname=John&lastname=Doe&email=john%40example.org&addrsvp=Add Hope that helps. Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ From chsnyder at gmail.com Tue Apr 26 13:08:29 2005 From: chsnyder at gmail.com (csnyder) Date: Tue, 26 Apr 2005 13:08:29 -0400 Subject: [nycphp-talk] meeting RSVP for dummies In-Reply-To: <426E650E.3040206@php.net> References: <426E650E.3040206@php.net> Message-ID: On 4/26/05, Chris Shiflett wrote: > I had the same experience, and I decided to try to solve this problem > permanently with my crontab file: You built an attendance agent ... nice! Ops, is the reservation code in CVS somewhere? It seems like there might be bugs to patch. -- Chris Snyder http://chxo.com/ From hans at cyberxdesigns.com Tue Apr 26 13:39:23 2005 From: hans at cyberxdesigns.com (Hans C. Kaspersetz) Date: Tue, 26 Apr 2005 13:39:23 -0400 Subject: [nycphp-talk] meeting RSVP for dummies In-Reply-To: References: <426E650E.3040206@php.net> Message-ID: <426E7CCB.5040307@cyberxdesigns.com> csnyder wrote: >On 4/26/05, Chris Shiflett wrote: > > > >>I had the same experience, and I decided to try to solve this problem >>permanently with my crontab file: >> >> > >You built an attendance agent ... nice! > >Ops, is the reservation code in CVS somewhere? >It seems like there might be bugs to patch. > > > > I think it is time to tokenize that form and make sure we know where the submissions are coming from. Hans -- Hans C. Kaspersetz Cyber X Designs Office: 201-558-7929 Mobile: 201-681-4156 http://www.cyberxdesigns.com From shiflett at php.net Tue Apr 26 13:44:07 2005 From: shiflett at php.net (Chris Shiflett) Date: Tue, 26 Apr 2005 13:44:07 -0400 Subject: [nycphp-talk] meeting RSVP for dummies In-Reply-To: <426E7CCB.5040307@cyberxdesigns.com> References: <426E650E.3040206@php.net> <426E7CCB.5040307@cyberxdesigns.com> Message-ID: <426E7DE7.6040400@php.net> Hans C. Kaspersetz wrote: > I think it is time to tokenize that form and make sure we know where the > submissions are coming from. I'll send the updated script. :-) Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ From lists at zaunere.com Tue Apr 26 14:40:06 2005 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 26 Apr 2005 14:40:06 -0400 Subject: [nycphp-talk] meeting RSVP for dummies In-Reply-To: Message-ID: <0MKz5u-1DQUyf05ES-0007rg@mrelay.perfora.net> > At the risk of appearing clueless.... I say, gee, did I forget to RSVP in > time for tonight? So I go over to http://www.nyphp.org/rsvp.php and check > my status, and it says I have RSVPed but I have to "re-RSVP," so I do so, > and it says something confirmatory that suggests everything is cool > ("Thank You and don't forget to RSVP next month"). OTOH is also says > flatly that you gotta RSVP by 3:00 pm 25-Apr, which I didn't -- or did I? The 3:00pm bit is just to give the IBM folks some buffer time. The only thing it enforces is if you RSVP before or after midnight tonight. And by the way, RSVP is still open right now - if you want to come, RSVP within the next couple of hours. H From tom at supertom.com Thu Apr 28 17:38:50 2005 From: tom at supertom.com (Tom Melendez) Date: Thu, 28 Apr 2005 17:38:50 -0400 Subject: [nycphp-talk] efficient array manipulation Message-ID: <427157EA.9060809@supertom.com> Hey Folks, Say I have a two-dimensional array with 5000 items in it. I need to turn an array that looks like this: $myarray[0][0]="foo"; into $myarray[0][0][element1]=foo (the value of the original $myarray[0][0]) $myarray[0][0][element2]=some_value_that_never_changes I'm looking for the most efficient way possible to do this. I really don't want to use a loop, I'm looking at array_walk now, but I'm hoping there is a "one or two liner" that is efficient and easy. Any thoughts? Thanks, Tom http://www.liphp.org From joel at tagword.com Thu Apr 28 19:54:14 2005 From: joel at tagword.com (Joel De Gan) Date: Thu, 28 Apr 2005 19:54:14 -0400 Subject: [nycphp-talk] efficient array manipulation In-Reply-To: <427157EA.9060809@supertom.com> References: <427157EA.9060809@supertom.com> Message-ID: <1114732454.9079.21.camel@bezel> See: http://us2.php.net/manual/en/function.array-map.php On Thu, 2005-04-28 at 17:38, Tom Melendez wrote: > Hey Folks, > > Say I have a two-dimensional array with 5000 items in it. > > I need to turn an array that looks like this: > > $myarray[0][0]="foo"; > > into > > $myarray[0][0][element1]=foo (the value of the original $myarray[0][0]) > $myarray[0][0][element2]=some_value_that_never_changes > > I'm looking for the most efficient way possible to do this. I really > don't want to use a loop, I'm looking at array_walk now, but I'm hoping > there is a "one or two liner" that is efficient and easy. > > Any thoughts? > > Thanks, > > Tom > http://www.liphp.org > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > -- joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net From dcech at phpwerx.net Thu Apr 28 18:49:44 2005 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 28 Apr 2005 18:49:44 -0400 Subject: [nycphp-talk] efficient array manipulation In-Reply-To: <427157EA.9060809@supertom.com> References: <427157EA.9060809@supertom.com> Message-ID: <42716888.2070901@phpwerx.net> Tom, Here's a one-liner that will do what you want: array_walk($myarr,create_function('&$v','array_walk($v,create_function(\'&$v\',\'$v = array(\\\'element1\\\'=>$v,\\\'element2\\\'=>\\\'myval\\\');\'));')); For maintainability (and speed) I would probably use something a little more readable though: function callback(&$v) { $v = array( 'element1' => $v, 'element2' => 'myval' ); } array_walk($myarr,create_function('&$v','array_walk($v,\'callback\');')); or the old foreach loop: foreach ($myarr as $k => $v) { foreach ($v as $k2 => $v2) { $myarr[$k][$k2] = array( 'element1' => $v2, 'element2' => 'myval' ); } } My testing indicates the for small arrays the foreach loop is marginally faster, but when the loop grows the second array_walk is actually the fastest (the one-liner gets left in the dust because it has to recreate the second callback function for every iteration of the outer loop). Dan Tom Melendez wrote: > Hey Folks, > > Say I have a two-dimensional array with 5000 items in it. > > I need to turn an array that looks like this: > > $myarray[0][0]="foo"; > > into > > $myarray[0][0][element1]=foo (the value of the original $myarray[0][0]) > $myarray[0][0][element2]=some_value_that_never_changes > > I'm looking for the most efficient way possible to do this. I really > don't want to use a loop, I'm looking at array_walk now, but I'm hoping > there is a "one or two liner" that is efficient and easy. > > Any thoughts? > > Thanks, > > Tom > http://www.liphp.org From dcech at phpwerx.net Thu Apr 28 18:57:50 2005 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 28 Apr 2005 18:57:50 -0400 Subject: [nycphp-talk] efficient array manipulation In-Reply-To: <1114732454.9079.21.camel@bezel> References: <427157EA.9060809@supertom.com> <1114732454.9079.21.camel@bezel> Message-ID: <42716A6E.80701@phpwerx.net> Joel De Gan wrote: > See: > http://us2.php.net/manual/en/function.array-map.php Good point, I tested this: function callback2($v) { return array( 'element1' => $v, 'element2' => 'myval' ); } $myarr = array_map(create_function('$v','return array_map(\'callback2\',$v);'),$myarr); And it seems to be consistently faster than the other three methods in my previous email (possibly because it doesn't have to throw a bunch of references around). Dan From john at coolmacgames.com Thu Apr 28 21:22:10 2005 From: john at coolmacgames.com (John Nunez) Date: Thu, 28 Apr 2005 21:22:10 -0400 Subject: [nycphp-talk] Monitoring for Bounce Mail Message-ID: <9f69c334287be39f769de2ca68772284@coolmacgames.com> I manage a mailing list that started with just 64 names and it is now at 10,000+ addresses. In the past I have been manually removing emails that bounce. I know that 550 is usually an error with the email address but it there a format that I can use REGEX to get the email so I can remove them? My only other option would be to just remove any matching email address. - John From faber at linuxnj.com Thu Apr 28 21:35:34 2005 From: faber at linuxnj.com (Faber Fedor) Date: Thu, 28 Apr 2005 21:35:34 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <9f69c334287be39f769de2ca68772284@coolmacgames.com> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> Message-ID: <20050429013534.GA2273@uranus.faber.nom> On 28/04/05 21:22 -0400, John Nunez wrote: > I manage a mailing list that started with just 64 names and it is now > at 10,000+ addresses. In the past I have been manually removing emails > that bounce. Remove them how? From the mail server queue? > I know that 550 is usually an error with the email > address but it there a format that I can use REGEX to get the email so > I can remove them? My only other option would be to just remove any > matching email address. If you're removing emails from the queue, it woulddepend on what mail server you're running. If you use Postfix, this little script might do it for you: <----------------------------------< cut here >--------------------> #!/bin/sh # # Quick and dirty script to stop a mail flood from . - F^2 # 2004-01-05 # # usage: ./stop_mail_flood # if [ -z "$1" ]; then echo -e "\nusage: $0 \n" exit fi service postfix stop postqueue -p| grep $1 | awk '{print $1 }' | grep -v $1 | sed -e 's/*//'| awk \ '{ print "find /var/spool/postfix -name " $1 " -exec rm {} \\;"} ' | sh service postfix start <----------------------------------< cut here >--------------------> Although using postsuper would be better as in the following script (which delete all emails in the queue; I really need o combine these two someday): <----------------------------------< cut here >--------------------> #!/bin/sh echo "Clearing mail queue..." service postfix stop for qid in $(postqueue -p | egrep -v '(^ *|^$)' | awk '{print $1}' \ | sed -e '1d' -e '/\*$/d' -e '/--/d') do postsuper -d $qid done service postfix start <----------------------------------< cut here >--------------------> HTH -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From john at coolmacgames.com Thu Apr 28 21:51:32 2005 From: john at coolmacgames.com (John Nunez) Date: Thu, 28 Apr 2005 21:51:32 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <20050429013534.GA2273@uranus.faber.nom> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> Message-ID: <225358257b9685b068f67e2152d9460d@coolmacgames.com> What I need is to remove the bounced email addresses from my Mailing List. I send out a monthly newsletter and get back a lot of bounced backs. On Apr 28, 2005, at 9:35 PM, Faber Fedor wrote: > On 28/04/05 21:22 -0400, John Nunez wrote: >> I manage a mailing list that started with just 64 names and it is now >> at 10,000+ addresses. In the past I have been manually removing >> emails >> that bounce. > > Remove them how? From the mail server queue? > >> I know that 550 is usually an error with the email >> address but it there a format that I can use REGEX to get the email so >> I can remove them? My only other option would be to just remove any >> matching email address. > > If you're removing emails from the queue, it woulddepend on what mail > server you're running. If you use Postfix, this little script might > do > it for you: > > <----------------------------------< cut here >--------------------> > #!/bin/sh > # > # Quick and dirty script to stop a mail flood from . - F^2 > # 2004-01-05 > # > # usage: ./stop_mail_flood > # > > if [ -z "$1" ]; then > echo -e "\nusage: $0 \n" > exit > fi > > service postfix stop > > postqueue -p| grep $1 | awk '{print $1 }' | grep -v $1 | sed -e > 's/*//'| awk \ > '{ print "find /var/spool/postfix -name " $1 " -exec rm {} \\;"} ' | > sh > > service postfix start > <----------------------------------< cut here >--------------------> > > Although using postsuper would be better as in the following script > (which delete all emails in the queue; I really need o combine these > two > someday): > > <----------------------------------< cut here >--------------------> > #!/bin/sh > > echo "Clearing mail queue..." > > service postfix stop > > for qid in $(postqueue -p | egrep -v '(^ *|^$)' | awk '{print $1}' \ > | sed -e '1d' -e '/\*$/d' -e '/--/d') > do > postsuper -d $qid > done > > service postfix start > <----------------------------------< cut here >--------------------> > > HTH > > -- > > Regards, > > Faber Fedor > President > Linux New Jersey, Inc. > 908-320-0357 > 800-706-0701 > > http://www.linuxnj.com > > > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From faber at linuxnj.com Thu Apr 28 22:13:48 2005 From: faber at linuxnj.com (Faber Fedor) Date: Thu, 28 Apr 2005 22:13:48 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <225358257b9685b068f67e2152d9460d@coolmacgames.com> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> Message-ID: <20050429021347.GA2410@uranus.faber.nom> On 28/04/05 21:51 -0400, John Nunez wrote: > What I need is to remove the bounced email addresses from my Mailing > List. I send out a monthly newsletter and get back a lot of bounced > backs. Could you at least tell us which mailing list software are you using? -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From john at coolmacgames.com Thu Apr 28 22:41:52 2005 From: john at coolmacgames.com (John Nunez) Date: Thu, 28 Apr 2005 22:41:52 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <20050429021347.GA2410@uranus.faber.nom> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> <20050429021347.GA2410@uranus.faber.nom> Message-ID: <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> Sorry, I just have a script that I wrote 2 years ago. It goes through a database table of email addresses and transmits the newsletter to them. The only alteration I have made in the last two years is transmit in batches. I don't use any software because some of the sign ups are via email, http, user registrations via US Mail and the new one will be straight from a desktop application. Thanks, John On Apr 28, 2005, at 10:13 PM, Faber Fedor wrote: > On 28/04/05 21:51 -0400, John Nunez wrote: >> What I need is to remove the bounced email addresses from my Mailing >> List. I send out a monthly newsletter and get back a lot of bounced >> backs. > > Could you at least tell us which mailing list software are you using? From faber at linuxnj.com Thu Apr 28 23:27:00 2005 From: faber at linuxnj.com (Faber Fedor) Date: Thu, 28 Apr 2005 23:27:00 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> <20050429021347.GA2410@uranus.faber.nom> <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> Message-ID: <20050429032700.GA2601@uranus.faber.nom> On 28/04/05 22:41 -0400, John Nunez wrote: > Sorry, I just have a script that I wrote 2 years ago. It goes through a > database table We need to search through a database table!? Which one? MySQL? dbm? Postgres? Excel? a text file? WHAT?!?! > of email addresses and transmits the newsletter to them. > The only alteration I have made in the last two years is transmit in > batches. I don't use any software because some of the sign ups are via > email, http, user registrations via US Mail and the new one will be > straight from a desktop application. You are not giving us (read: me) *any* information to help you. Going back to your initial posting, how do you expect anyone to give you a regex to search email addresses when you never told us that the data was in a database table (we still don't know what kind) for a script that you wrote two years ago that I doubt anyone here knows about? Are we supposed to read your mind? Start here and RTFA http://www.catb.org/~esr/faqs/smart-questions.html Once we know what you have and what you need, then maybe, MAYBE we can help out. -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From jeff.loiselle at gmail.com Fri Apr 29 01:58:52 2005 From: jeff.loiselle at gmail.com (Jeff Loiselle) Date: Fri, 29 Apr 2005 01:58:52 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <20050429032700.GA2601@uranus.faber.nom> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> <20050429021347.GA2410@uranus.faber.nom> <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> <20050429032700.GA2601@uranus.faber.nom> Message-ID: <4b18871105042822584a698a6c@mail.gmail.com> What I've always done in the past is set the Return-Path header in the email to a specific bounce address (done via the MTA) plus user identifier token. For example: bounce_address+list_member_email at domain.com Then in my mail configuration, I pipe that address into a php script.. look for the Return-Path header.. and most likely if it's coming back to this address it's a bounce (unless you really feel like recognizing hundreds of bounce formats). Then I remove that list member from my database. From jeff.loiselle at gmail.com Fri Apr 29 02:08:01 2005 From: jeff.loiselle at gmail.com (Jeff Loiselle) Date: Fri, 29 Apr 2005 02:08:01 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <4b18871105042822584a698a6c@mail.gmail.com> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> <20050429021347.GA2410@uranus.faber.nom> <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> <20050429032700.GA2601@uranus.faber.nom> <4b18871105042822584a698a6c@mail.gmail.com> Message-ID: <4b1887110504282308540f6fa@mail.gmail.com> Also, I've never been fond of people being condescending in a public forum. If you have the desire to help someone, do that: be helpful. I also understand that directing people to references that persuade them to ask more concise and explanatory questions is also helpful; however, attitude is everything. Don't detract from your own usefulness by showing that even though you're eager to help, you also want to be condescending. My two cents (sense). From john at coolmacgames.com Fri Apr 29 14:08:15 2005 From: john at coolmacgames.com (John Nunez) Date: Fri, 29 Apr 2005 14:08:15 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <4b18871105042822584a698a6c@mail.gmail.com> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> <20050429021347.GA2410@uranus.faber.nom> <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> <20050429032700.GA2601@uranus.faber.nom> <4b18871105042822584a698a6c@mail.gmail.com> Message-ID: <9ec526f55641bfd448a0ec09b983984e@coolmacgames.com> Hey Jeff, Thanks for the info. So I should just be able to set the Return-Path in the header and I would get all the bounce backs. I'll look up the setup for my MTA (sendmail). Thanks Again, John On Apr 29, 2005, at 1:58 AM, Jeff Loiselle wrote: > What I've always done in the past is set the Return-Path header in the > email to a specific bounce address (done via the MTA) plus user > identifier token. > > For example: bounce_address+list_member_email at domain.com > > Then in my mail configuration, I pipe that address into a php script.. > look for the Return-Path header.. and most likely if it's coming back > to this address it's a bounce (unless you really feel like recognizing > hundreds of bounce formats). Then I remove that list member from my > database. > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From nyphp at NewAgeWeb.com Fri Apr 29 14:18:44 2005 From: nyphp at NewAgeWeb.com (Jerry Kapron) Date: Fri, 29 Apr 2005 14:18:44 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail Message-ID: <004801c54ce7$e1022e20$e001a8c0@duron.lan.newageweb.com> Faber, I think the problem here is not John not being clear with his question but rather you not understanding John's question. He's clearly asking how he should parse the bounced mail messages to know what addresses he should remove from his list. IMHO, if you can't help someone, don't open your mouth and confuse them even more asking all those irrelevant questions. I also think your attitude was inappropriate and you've done it more than once. John, The solution posted by Jeff is what I've used in the past. However, you also have to be aware that there are different types of bounces (hard, soft, block). The trick is identify what type of bounce a given bounce is. You shouldn't really do anything about soft bounces because they are usually caused by the destination MX host(s) being temporarily inaccessible. A couple of years ago I wrote a script that "tries" to establish the type of bounce at hand. It actually did a good job. I'll look for it and e-mail you off-list or if anyone else is interested I'll post it here. Jerry -----Original Message----- From: Faber Fedor To: NYPHP Talk Date: Thursday, April 28, 2005 11:27 PM Subject: [nycphp-talk] Re: Monitoring for Bounce Mail >On 28/04/05 22:41 -0400, John Nunez wrote: >> Sorry, I just have a script that I wrote 2 years ago. It goes through a >> database table > >We need to search through a database table!? Which one? MySQL? dbm? >Postgres? Excel? a text file? WHAT?!?! > >> of email addresses and transmits the newsletter to them. >> The only alteration I have made in the last two years is transmit in >> batches. I don't use any software because some of the sign ups are via >> email, http, user registrations via US Mail and the new one will be >> straight from a desktop application. > >You are not giving us (read: me) *any* information to help you. > >Going back to your initial posting, how do you expect anyone to give you >a regex to search email addresses when you never told us that the data >was in a database table (we still don't know what kind) for a script >that you wrote two years ago that I doubt anyone here knows about? > >Are we supposed to read your mind? > >Start here and RTFA http://www.catb.org/~esr/faqs/smart-questions.html > >Once we know what you have and what you need, then maybe, MAYBE we can >help out. > > >-- > >Regards, > >Faber Fedor >President >Linux New Jersey, Inc. >908-320-0357 >800-706-0701 > >http://www.linuxnj.com > > > >_______________________________________________ >New York PHP Talk Mailing List >AMP Technology >Supporting Apache, MySQL and PHP >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org > From danielc at analysisandsolutions.com Fri Apr 29 14:52:58 2005 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 29 Apr 2005 14:52:58 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <20050429032700.GA2601@uranus.faber.nom> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> <20050429021347.GA2410@uranus.faber.nom> <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> <20050429032700.GA2601@uranus.faber.nom> Message-ID: <20050429185258.GA833@panix.com> On Thu, Apr 28, 2005 at 11:27:00PM -0400, Faber Fedor wrote: > > We need to search through a database table!? Which one? MySQL? dbm? > Postgres? Excel? a text file? WHAT?!?! Faber. He's not asking about the process of deleting a record. He's asking about how to accurately interpret the bounced email. As I'm sure you've realized, if you are looking at the bounced emails themselves, each mail server formats the responses differently. If you're looking to capture the interaction at the Mail Transfer Agent level, then you'll have a consistent procedure. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From john at coolmacgames.com Fri Apr 29 16:08:20 2005 From: john at coolmacgames.com (John Nunez) Date: Fri, 29 Apr 2005 16:08:20 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <20050429032700.GA2601@uranus.faber.nom> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> <20050429021347.GA2410@uranus.faber.nom> <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> <20050429032700.GA2601@uranus.faber.nom> Message-ID: <206309cd788b6a89abdd9f6fcd731a54@coolmacgames.com> Faber, Sorry for the confusion. My original email was requesting a REGEX for SMTP code 550 because I thought they all followed a specific format. 550 is the usual SMTP Error code which is sent along with the bounced mail. This varies with each implementation and installation of MTA's. I know how to search a database and remove records plus I have a good REGEX for finding email addresses. I was wondering if it followed a specific format (which is doesn't). Jeff suggestion of the Return-Path works because every email sent to the Return-Path address would be bounced emails and not tech support questions. Jerry if you can find the script on determining Hard and Soft bounces that would be great. Thanks to everyone for their assistance. Thanks, John On Apr 28, 2005, at 11:27 PM, Faber Fedor wrote: > On 28/04/05 22:41 -0400, John Nunez wrote: >> Sorry, I just have a script that I wrote 2 years ago. It goes through >> a >> database table > > We need to search through a database table!? Which one? MySQL? dbm? > Postgres? Excel? a text file? WHAT?!?! > >> of email addresses and transmits the newsletter to them. >> The only alteration I have made in the last two years is transmit in >> batches. I don't use any software because some of the sign ups are via >> email, http, user registrations via US Mail and the new one will be >> straight from a desktop application. > > You are not giving us (read: me) *any* information to help you. > > Going back to your initial posting, how do you expect anyone to give > you > a regex to search email addresses when you never told us that the data > was in a database table (we still don't know what kind) for a script > that you wrote two years ago that I doubt anyone here knows about? > > Are we supposed to read your mind? > > Start here and RTFA http://www.catb.org/~esr/faqs/smart-questions.html > > Once we know what you have and what you need, then maybe, MAYBE we can > help out. > > > -- > > Regards, > > Faber Fedor > President > Linux New Jersey, Inc. > 908-320-0357 > 800-706-0701 > > http://www.linuxnj.com > > > > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From chsnyder at gmail.com Fri Apr 29 16:12:49 2005 From: chsnyder at gmail.com (csnyder) Date: Fri, 29 Apr 2005 16:12:49 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <206309cd788b6a89abdd9f6fcd731a54@coolmacgames.com> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> <20050429021347.GA2410@uranus.faber.nom> <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> <20050429032700.GA2601@uranus.faber.nom> <206309cd788b6a89abdd9f6fcd731a54@coolmacgames.com> Message-ID: On 4/29/05, John Nunez wrote: > Thanks to everyone for their assistance. This is problem that anyone who has rolled their own member database or mailing list manager has faced. As time goes by and people change or abandon their email addresses, the number of bounces quickly overwhelms any kind of manual unsubscribe process. From pl at eskimo.net Fri Apr 29 18:28:23 2005 From: pl at eskimo.net (Peter Lehrer) Date: Fri, 29 Apr 2005 18:28:23 -0400 (EDT) Subject: [nycphp-talk] OT: Vistaprint free business cards Message-ID: <3405.64.24.26.201.1114813703.squirrel@64.24.26.201> I just want to know if anyone has any experience getting free business cards from Vista Print (vistaprint.com). I read the info about getting the free cards, and there doesn't seem to be any catch, but I was just wondering if anyone had any information they wished to share. Regards, Peter From john at coolmacgames.com Fri Apr 29 18:32:41 2005 From: john at coolmacgames.com (John Nunez) Date: Fri, 29 Apr 2005 18:32:41 -0400 Subject: [nycphp-talk] OT: Vistaprint free business cards In-Reply-To: <3405.64.24.26.201.1114813703.squirrel@64.24.26.201> References: <3405.64.24.26.201.1114813703.squirrel@64.24.26.201> Message-ID: <0D669751-6586-424D-A711-024A8BFEFAD7@coolmacgames.com> A co-worker had some printed but I don't remember the company. They placed an advertisement in the back of the card. Just a tag-line that says "This card was printed by: XXXXXXX" The paper used was also pretty weak. -John On Apr 29, 2005, at 6:28 PM, Peter Lehrer wrote: > I just want to know if anyone has any experience getting free business > cards from Vista Print (vistaprint.com). I read the info about > getting the > free cards, and there doesn't seem to be any catch, but I was just > wondering if anyone had any information they wished to share. > > Regards, > > Peter > _______________________________________________ > New York PHP Talk Mailing List > AMP Technology > Supporting Apache, MySQL and PHP > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org > From codebowl at gmail.com Fri Apr 29 18:34:14 2005 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 29 Apr 2005 18:34:14 -0400 Subject: [nycphp-talk] OT: Vistaprint free business cards In-Reply-To: <0D669751-6586-424D-A711-024A8BFEFAD7@coolmacgames.com> References: <3405.64.24.26.201.1114813703.squirrel@64.24.26.201> <0D669751-6586-424D-A711-024A8BFEFAD7@coolmacgames.com> Message-ID: <8d9a428005042915346d085a16@mail.gmail.com> my friend did this, he paid shipping that was all, on the back is an ad for thier company though atleast on the free ones.. hope that helps :) -- Joseph Crawford Jr. Codebowl Solutions codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at supertom.com Sat Apr 30 09:44:32 2005 From: tom at supertom.com (Tom Melendez) Date: Sat, 30 Apr 2005 09:44:32 -0400 Subject: [nycphp-talk] OT: Vistaprint free business cards In-Reply-To: <8d9a428005042915346d085a16@mail.gmail.com> Message-ID: <0IFR00LN2HC9LU@mta7.srv.hcvlny.cv.net> Yes, the free cards have an advertisement on the back. If you were actually to use these for business, I would say that this is pretty tacky, though. >From what I recall, to have the ad removed was only like $10 or so. I've used them for some regular printing a few times. They are OK. I'm sure you can shop around and get a better price, but they are pretty reasonable in that regard. Tom http://www.liphp.org _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Joseph Crawford Sent: Friday, April 29, 2005 6:34 PM To: NYPHP Talk Subject: Re: [nycphp-talk] OT: Vistaprint free business cards my friend did this, he paid shipping that was all, on the back is an ad for thier company though atleast on the free ones.. hope that helps :) -- Joseph Crawford Jr. Codebowl Solutions codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From leam at reuel.net Sat Apr 30 10:03:35 2005 From: leam at reuel.net (leam at reuel.net) Date: Sat, 30 Apr 2005 10:03:35 -0400 Subject: [nycphp-talk] Writing a file and ownership Message-ID: <20050430140335.GB2941@leitz> Somehow the Apache on my remote shared host has changed, I think. My form writes a new file each time it is used. The shared host is Linux with the user private group so the files have been written as "user:user". Until a few days ago they started to be written as "nobody:nobody", the user:group the apache server runs under. The issue is that I can't edit my own file, which is a problem. ;) Should I go back to the host and whine or is this a better security posture that I need to work around in my form-processing. Any idea what may have been changed to cause this? ciao! leam From leam at reuel.net Sat Apr 30 10:36:43 2005 From: leam at reuel.net (leam at reuel.net) Date: Sat, 30 Apr 2005 10:36:43 -0400 Subject: [nycphp-talk] Writing a file and ownership In-Reply-To: <20050430140335.GB2941@leitz> References: <20050430140335.GB2941@leitz> Message-ID: <20050430143643.GE2941@leitz> Well, something also dropped the execute bit on my public_html folder! Not sure it's connected but it worked earlier this morning. *sigh* leam On Sat, Apr 30, 2005 at 10:03:35AM -0400, leam at reuel.net wrote: > Somehow the Apache on my remote shared host has changed, I think. My form writes a new file each time it is used. The shared host is Linux with the user private group so the files have been written as "user:user". Until a few days ago they started to be written as "nobody:nobody", the user:group the apache server runs under. The issue is that I can't edit my own file, which is a problem. ;) > > Should I go back to the host and whine or is this a better security posture that I need to work around in my form-processing. Any idea what may have been changed to cause this? > > ciao! > > leam From dmintz at davidmintz.org Sat Apr 30 13:26:27 2005 From: dmintz at davidmintz.org (David Mintz) Date: Sat, 30 Apr 2005 13:26:27 -0400 (EDT) Subject: [nycphp-talk] [OT] SSH security question Message-ID: Is it normal to get attacked like this just about every day? --------------------- SSHD Begin ------------------------ Failed logins from these: bin/password from 210.68.71.220: 17 Time(s) boss/password from 210.68.71.220: 17 Time(s) chris/password from 210.68.71.220: 17 Time(s) cristina/password from 210.68.71.220: 17 Time(s) daemon/password from 210.68.71.220: 17 Time(s) ftp/password from 210.68.71.220: 17 Time(s) ftpuser/password from 210.68.71.220: 17 Time(s) mailtest/password from 210.68.71.220: 17 Time(s) michelle/password from 210.68.71.220: 17 Time(s) mysql/password from 210.68.71.220: 17 Time(s) news/password from 210.68.71.220: 17 Time(s) oracle/password from 210.68.71.220: 17 Time(s) postfix/password from 210.68.71.220: 17 Time(s) postgres/password from 210.68.71.220: 17 Time(s) richard/password from 210.68.71.220: 17 Time(s) service/password from 210.68.71.220: 17 Time(s) testuser/password from 210.68.71.220: 17 Time(s) --- David Mintz http://davidmintz.org/ From leam at reuel.net Sat Apr 30 13:37:09 2005 From: leam at reuel.net (leam at reuel.net) Date: Sat, 30 Apr 2005 13:37:09 -0400 Subject: [nycphp-talk] [OT] SSH security question In-Reply-To: References: Message-ID: <20050430173709.GB2941@leitz> Nope. Might want to have your router drop that IP off the access list. ciao! leam On Sat, Apr 30, 2005 at 01:26:27PM -0400, David Mintz wrote: > > Is it normal to get attacked like this just about every day? > > > --------------------- SSHD Begin ------------------------ > > > Failed logins from these: > bin/password from 210.68.71.220: 17 Time(s) ... From rolan at omnistep.com Sat Apr 30 13:43:28 2005 From: rolan at omnistep.com (Rolan Yang) Date: Sat, 30 Apr 2005 13:43:28 -0400 Subject: [nycphp-talk] [OT] SSH security question In-Reply-To: References: Message-ID: <4273C3C0.7020008@omnistep.com> Sometimes. I have found portsentry to be a useful tool in blocking/annoying port scan hackers. Basically, it listens on handful of ports where active services are not running. When portsentry detects a connection, that ip is nullrouted for a period of time using iptables or ipchains thus preventing any further attacks. Check it out. ~Rolan David Mintz wrote: >Is it normal to get attacked like this just about every day? > > > --------------------- SSHD Begin ------------------------ > > >Failed logins from these: > bin/password from 210.68.71.220: 17 Time(s) > boss/password from 210.68.71.220: 17 Time(s) > chris/password from 210.68.71.220: 17 Time(s) > cristina/password from 210.68.71.220: 17 Time(s) > daemon/password from 210.68.71.220: 17 Time(s) > ftp/password from 210.68.71.220: 17 Time(s) > ftpuser/password from 210.68.71.220: 17 Time(s) > mailtest/password from 210.68.71.220: 17 Time(s) > michelle/password from 210.68.71.220: 17 Time(s) > mysql/password from 210.68.71.220: 17 Time(s) > news/password from 210.68.71.220: 17 Time(s) > oracle/password from 210.68.71.220: 17 Time(s) > postfix/password from 210.68.71.220: 17 Time(s) > postgres/password from 210.68.71.220: 17 Time(s) > richard/password from 210.68.71.220: 17 Time(s) > service/password from 210.68.71.220: 17 Time(s) > testuser/password from 210.68.71.220: 17 Time(s) > > >--- >David Mintz >http://davidmintz.org/ >_______________________________________________ >New York PHP Talk Mailing List >AMP Technology >Supporting Apache, MySQL and PHP >http://lists.nyphp.org/mailman/listinfo/talk >http://www.nyphp.org > > > From 1j0lkq002 at sneakemail.com Sat Apr 30 17:55:17 2005 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Sat, 30 Apr 2005 17:55:17 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <4b18871105042822584a698a6c@mail.gmail.com> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> <20050429021347.GA2410@uranus.faber.nom> <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> <20050429032700.GA2601@uranus.faber.nom> <4b18871105042822584a698a6c@mail.gmail.com> Message-ID: <1884-38062@sneakemail.com> Jeff Loiselle jeff.loiselle-at-gmail.com |nyphp dev/internal group use| wrote: >What I've always done in the past is set the Return-Path header in the >email to a specific bounce address (done via the MTA) plus user >identifier token. > >For example: bounce_address+list_member_email at domain.com > >Then in my mail configuration, I pipe that address into a php script.. >look for the Return-Path header.. and most likely if it's coming back >to this address it's a bounce (unless you really feel like recognizing >hundreds of bounce formats). Then I remove that list member from my >database. >_______________________________________________ > > In this day of opt-in mailing lists, you might consider taking bounces and re-subscribing them to a parallel list (so they get sent an opt-in notification for that second, parallel list.. the subscribe message could say say you've had trouble getting thru, click this link to try again). Then if they bounce from that list as well, auto-remove them. If they click however, it's a re-subscribe, and they're on your mailing list again (but your second list, where you know them to have troublesome email addy's). Send your emails to both lists; don't allow any subscribes to the second list except via your bounce management setup. I think it's good to never lose a customer unless you really have to, and really good to have an affirmation of desire to receive mailings, and really good to be know you have 10k subscribers, where 9,500 are solid and 500 are "pretty good" etc. for segmenting purposes. -=john andrews From adam at trachtenberg.com Sat Apr 30 18:26:15 2005 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Sat, 30 Apr 2005 18:26:15 -0400 (EDT) Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: <1884-38062@sneakemail.com> References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> <20050429021347.GA2410@uranus.faber.nom> <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> <20050429032700.GA2601@uranus.faber.nom> <4b18871105042822584a698a6c@mail.gmail.com> <1884-38062@sneakemail.com> Message-ID: On Sat, 30 Apr 2005, inforequest wrote: > I think it's good to never lose a customer unless you really have to, > and really good to have an affirmation of desire to receive mailings, > and really good to be know you have 10k subscribers, where 9,500 are > solid and 500 are "pretty good" etc. for segmenting purposes. When David and I worked at Student.Com, we managed a large opt-in mailing list. We set up a system where we'd record bounces in a database, and if you bounced 3 weeks in a row, we'd unsubscribe you. That allowed us to filter out noise from legitimate bounces. We also incorporated a tracking code in the body of every message, so if someone replied with an "unsubscribe" request from a "from" address other than the original "to", we could properly handle the request. We found that lots of times people had accounts set up where there wasn't a direct match -- which made it hard to automate without the code. -adam -- adam at trachtenberg.com | http://www.trachtenberg.com author of o'reilly's "upgrading to php 5" and "php cookbook" avoid the holiday rush, buy your copies today! From dmintz at davidmintz.org Sat Apr 30 18:50:17 2005 From: dmintz at davidmintz.org (David Mintz) Date: Sat, 30 Apr 2005 18:50:17 -0400 (EDT) Subject: [nycphp-talk] [OT] SSH security question In-Reply-To: <4273C3C0.7020008@omnistep.com> References: <4273C3C0.7020008@omnistep.com> Message-ID: re leam's response: I should have been a little clearer. It's not coming from the same address every day, it comes from different directions from day to day or within in the same day. Rolan said: <> sshd is running and this is happening on the port where it's listening (I presume). I use ssh to communicate with this box from Out There, and unauthorized others also attempt to, evidently. I'm just wondering what defensive measures can/should be taken. But I need to learn more about security in general, so I guess I'll STFU and RTFM. Thanks. --- David Mintz http://davidmintz.org/ From fields at hedge.net Sat Apr 30 18:56:55 2005 From: fields at hedge.net (Adam Fields) Date: Sat, 30 Apr 2005 18:56:55 -0400 Subject: [nycphp-talk] [OT] SSH security question In-Reply-To: References: <4273C3C0.7020008@omnistep.com> Message-ID: <20050430225655.GF28979@lola.aquick.org> On Sat, Apr 30, 2005 at 06:50:17PM -0400, David Mintz wrote: > sshd is running and this is happening on the port where it's listening (I > presume). I use ssh to communicate with this box from Out There, and > unauthorized others also attempt to, evidently. Change the port ssh listens on. -- - Adam ** I can fix your database problems: http://www.everylastounce.com/mysql.html ** Blog............... [ http://www.aquick.org/blog ] Links.............. [ http://del.icio.us/fields ] Photos............. [ http://www.aquick.org/photoblog ] Experience......... [ http://www.adamfields.com/resume.html ] Product Reviews: .. [ http://www.buyadam.com/blog ] From john at coolmacgames.com Sat Apr 30 22:11:10 2005 From: john at coolmacgames.com (John Nunez) Date: Sat, 30 Apr 2005 22:11:10 -0400 Subject: [nycphp-talk] Re: Monitoring for Bounce Mail In-Reply-To: References: <9f69c334287be39f769de2ca68772284@coolmacgames.com> <20050429013534.GA2273@uranus.faber.nom> <225358257b9685b068f67e2152d9460d@coolmacgames.com> <20050429021347.GA2410@uranus.faber.nom> <6a6328877ef5e77a328bed50acd10d3d@coolmacgames.com> <20050429032700.GA2601@uranus.faber.nom> <4b18871105042822584a698a6c@mail.gmail.com> <1884-38062@sneakemail.com> Message-ID: Hey Adam This is exactly what I was thinking. The transmissions are monthly but 3 bounces are good enough. Sometimes the emails are product alerts (plain text) and mostly it's HTML. So you have the code in plain sight? Like the footer? I need to get approval from by boss for this one. How do you encode the email address? A quick idea would be to send a md5 of the email address. Thanks, John On Apr 30, 2005, at 6:26 PM, Adam Maccabee Trachtenberg wrote: > > > We also incorporated a tracking code in the body of every message, so > if someone replied with an "unsubscribe" request from a "from" address > other than the original "to", we could properly handle the request. We > found that lots of times people had accounts set up where there wasn't > a direct match -- which made it hard to automate without the code. > From chsnyder at gmail.com Sat Apr 30 22:33:13 2005 From: chsnyder at gmail.com (csnyder) Date: Sat, 30 Apr 2005 22:33:13 -0400 Subject: [nycphp-talk] [OT] SSH security question In-Reply-To: References: Message-ID: On 4/30/05, David Mintz wrote: > > Is it normal to get attacked like this just about every day? Apparently it's not considered as an "attack" if it's only a few (I'm guessing 20? 30?) probes a day. The chances of a lucky guess if you enfore decent passwords are pretty slim at those numbers. Even if it's not an attack, it's an annoyance. It feels... dirty to see all those usernames in your logs. Solutions I've seen range from ignoring them to using keys only (no passwords) to crafting a dynamic firewall (a la portsentry) -- 6 failed logins and your ip is blocked for 20 minutes, or longer. Make sure you can whitelist your own ip address. You don't want to be locked out by somebody else borrowing your address. From sajith.ml at gmail.com Sat Apr 30 22:35:18 2005 From: sajith.ml at gmail.com (Sajith A) Date: Sun, 1 May 2005 08:05:18 +0530 Subject: [nycphp-talk] Writing a file and ownership In-Reply-To: <20050430143643.GE2941@leitz> References: <20050430140335.GB2941@leitz> <20050430143643.GE2941@leitz> Message-ID: On 4/30/05, leam at reuel.net wrote: >The shared host is Linux with the user private group so the files have been written as >"user:user". Until a few days ago they started to be written as "nobody:nobody", the >user:group the apache server runs under. The issue is that I can't edit my own file, which >is a problem. ;) If php is not properly configured[open_basedir , safe_mode], leaving it ownership as nobody might allow other people to access you script with thier php code. Did you try executing Filesystem functions from php. so after creating file you could try changing thier permissions. http://in2.php.net/manual/en/ref.filesystem.php http://in2.php.net/manual/en/features.safe-mode.php God bless Sajith A