From corey at gelform.com Wed Apr 1 11:08:12 2009 From: corey at gelform.com (Corey H Maass - gelform.com) Date: Wed, 01 Apr 2009 11:08:12 -0400 Subject: [nycphp-talk] php image resizing Message-ID: <1238598492.30334.1308437483@webmail.messagingengine.com> I have a fun project that I need to build which revolves around php resizing photos. There's no money involved, but you never know what will come of it... I've used php for basic resizing, but don't really want to get into it right now. Anyone interested? I will be building the front-end and you will do the script. i don't image it will be much more than a single script. Hit me up! Corey // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From zippy1981 at gmail.com Wed Apr 1 11:10:05 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Wed, 1 Apr 2009 11:10:05 -0400 Subject: [nycphp-talk] php image resizing In-Reply-To: <1238598492.30334.1308437483@webmail.messagingengine.com> References: <1238598492.30334.1308437483@webmail.messagingengine.com> Message-ID: <5458db3c0904010810r6dce42dap7524dbeb83dd3fd4@mail.gmail.com> So if their is no money invoiced will the source be released? On Wed, Apr 1, 2009 at 11:08 AM, Corey H Maass - gelform.com < corey at gelform.com> wrote: > I have a fun project that I need to build which revolves around php > resizing photos. There's no money involved, but you never know what will > come of it... I've used php for basic resizing, but don't really want to > get into it right now. Anyone interested? I will be building the > front-end and you will do the script. i don't image it will be much more > than a single script. > > Hit me up! > > Corey > > // > Corey H Maass > Gelform Design > Brooklyn, NY > Web design and development for art and business > > em corey at gelform.com > ww http://www.gelform.com > ph 646/228.5048 > fx 866/502.4861 > IM gelform > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From corey at gelform.com Wed Apr 1 11:30:59 2009 From: corey at gelform.com (Corey H Maass - gelform.com) Date: Wed, 01 Apr 2009 11:30:59 -0400 Subject: [nycphp-talk] php image resizing In-Reply-To: <5458db3c0904010810r6dce42dap7524dbeb83dd3fd4@mail.gmail.com> References: <1238598492.30334.1308437483@webmail.messagingengine.com> <5458db3c0904010810r6dce42dap7524dbeb83dd3fd4@mail.gmail.com> Message-ID: <1238599859.2312.1308439163@webmail.messagingengine.com> Hadn't thought about it. No, I don't think so, because I don't think we're doing anything new and different. If we end up doing something really amazing then maybe. On Wed, 1 Apr 2009 11:10:05 -0400, "Justin Dearing" said: > So if their is no money invoiced will the source be released? > > On Wed, Apr 1, 2009 at 11:08 AM, Corey H Maass - gelform.com < > corey at gelform.com> wrote: > > > I have a fun project that I need to build which revolves around php > > resizing photos. There's no money involved, but you never know what will > > come of it... I've used php for basic resizing, but don't really want to > > get into it right now. Anyone interested? I will be building the > > front-end and you will do the script. i don't image it will be much more > > than a single script. > > > > Hit me up! > > > > Corey > > > > // > > Corey H Maass > > Gelform Design > > Brooklyn, NY > > Web design and development for art and business > > > > em corey at gelform.com > > ww http://www.gelform.com > > ph 646/228.5048 > > fx 866/502.4861 > > IM gelform > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From lists at zaunere.com Wed Apr 1 12:56:52 2009 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 1 Apr 2009 12:56:52 -0400 Subject: [nycphp-talk] git'er Done! Message-ID: <03e201c9b2ea$db1d9450$9158bcf0$@com> NYCBUG meeting tonight - I got a preview of the talk yesterday and it should be great. H > > Git: A Case Study In Distributed Version Control > > Wednesday, April 1 > > 6:45 pm, Suspenders Restaurant > http://www.suspendersbar.com/location.php > > Brian Cully will speak on Git: A Case Study In Distributed Version > Control. This talk will go over what distributed version control > systems > (dVCS) mean, and how git applies itself to its problems. > > bjc has been involved in open source since the mid 90s, contributing to > the BSDs and Linux at various points. He once worked at Panix, and now > works at Junction Networks. Wherever he goes he seems to end up working > on the version control system, and is now using git exclusively. > > (pls note later meeting time. We recommend that you arrive early in > event you plan to have dinner) From lists at nopersonal.info Thu Apr 2 07:08:20 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Thu, 02 Apr 2009 06:08:20 -0500 Subject: [nycphp-talk] PHP Security Scripts In-Reply-To: <003001c9a719$5997c770$0cc75650$@com> References: <003001c9a719$5997c770$0cc75650$@com> Message-ID: <49D49CA4.7020704@nopersonal.info> Hans Zaunere wrote: > I've come across these script suite: > > http://www.irongeek.com/i.php?page=security/mutillidae-deliberately-vulnerab > le-php-owasp-top-10 > > And wanted to pass it on as it might be useful for some. Has anyone looked > at these before? > As someone who's aware of security risks but still basically a novice, I always find working examples very helpful?thanks! Bev From paul at devonianfarm.com Thu Apr 2 10:49:57 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Thu, 02 Apr 2009 10:49:57 -0400 Subject: [nycphp-talk] Best practices for combining paths? In-Reply-To: References: Message-ID: <49D4D095.2070803@devonianfarm.com> Ajai Khattri wrote: > On Mon, 30 Mar 2009, Paul A Houle wrote: > > >> My question is, am I missing a good PHP built-in for combining parts of >> URLs or filesystem paths? Is there a good library I should use? >> > > You might want to look at routing components. For example, you can use > symfony's routing component by itself without using the whole framework to > match URLs (and generate URLs I think): > > The site I'm thinking about most at the moment has it's own routing framework that's got some influence from symfony, but it's got a little more interaction between the "master controller" and the "subcontrollers" that allows it to manage it's relationship with web browsers, crawlers and semweb clients. For instance, I can move stuff around in crazy ways and everything will redirect correctly. Just launched it at http://carpictures.cc/ For a number of practical reasons, I'm obsessive about URL canonicalization for this site, so don't want to see //'s in URLs, not like the //'s that GNU autoconf codes into applications when people aren't careful about specifying the --prefix. There's a lot of things I like about symfony: overall I think the routing is OK for content-oriented sites, even tolerable for webapps (though I sometimes like to route based on POST variables there) but I've got enough differences to roll my own. The framework for that site is designed to enable extreme reuse of schemas, templates and such for similar sorts of sites: it's kind of a CMS built for machines instead of people. Chris and Brent had practical solutions and I'll probably built a simple library for path wrangling. Overall I don't agree w/ Dan's idea that this is a training and documentation issue. Car Pictures is a pilot project for something that's going to be at least 100 times bigger: it's going to involve getting more people in, and controlling costs is going to be an important part of making the vision work. I think it's cheaper to build a system that can't be screwed up than it is to (i) spend time writing documentation, (ii) expect people to spend time reading it, (iii) looking over people's shoulders to make sure that they read the docs and that they follow it, and (iv) dealing with the downstream consequences of people not complying. See http://en.wikipedia.org/wiki/Poka-yoke http://en.wikipedia.org/wiki/Quality_costs From chsnyder at gmail.com Thu Apr 2 12:07:43 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 2 Apr 2009 12:07:43 -0400 Subject: [nycphp-talk] Best practices for combining paths? In-Reply-To: <20090401024426.GA15840@panix.com> References: <49D13832.50008@devonianfarm.com> <20090401024426.GA15840@panix.com> Message-ID: On Tue, Mar 31, 2009 at 10:44 PM, Daniel Convissor wrote: > > This calls for comments in the code, documentation, coding standards and > training; a technical solution is inappropriate, in my eyes. You disregard Postel's Advice at your peril. Be liberal in what you expect, and use every technical solution at your disposal to convert it into what the system actually needs. From danielc at analysisandsolutions.com Thu Apr 2 12:49:37 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 2 Apr 2009 12:49:37 -0400 Subject: [nycphp-talk] Best practices for combining paths? In-Reply-To: References: <49D13832.50008@devonianfarm.com> <20090401024426.GA15840@panix.com> Message-ID: <20090402164937.GB25864@panix.com> Sire: On Thu, Apr 02, 2009 at 12:07:43PM -0400, Chris Snyder wrote: > > Be liberal in what you expect, and use every technical solution at > your disposal to convert it into what the system actually needs. Depends on the context. When it comes to user input, absolutely. When it comes to people writing the code, I expect good work. Though when things turn into a huge project, that gets harder and harder. --Dan PS: Anyone interested in taking a ride on my unicorn, drop me a line. -- 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 Thu Apr 2 13:02:11 2009 From: tom at supertom.com (Tom Melendez) Date: Thu, 2 Apr 2009 10:02:11 -0700 Subject: [nycphp-talk] Best practices for combining paths? In-Reply-To: <49D4D095.2070803@devonianfarm.com> References: <49D4D095.2070803@devonianfarm.com> Message-ID: <117286890904021002y24159687v6d01a86b1614714e@mail.gmail.com> > Car Pictures is a pilot project for something that's > going to be at least 100 times bigger: ?it's going to involve getting more > people in, ?and controlling costs is going to be an important part of making > the vision work. I don't know what 100 times bigger turns out to be in terms of users/traffic, but I would recommend not investing a lot of time investing in the FE handling this. When you get to the point where you're partitioning users based on shards of data, or just site functions, you'll probably want a proxy cluster (and caching I'm sure) in front of your FEs. Most of your routing would need to happen at level then. Thanks, Tom http://www.liphp.org From paul at devonianfarm.com Thu Apr 2 13:12:17 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Thu, 02 Apr 2009 13:12:17 -0400 Subject: [nycphp-talk] Best practices for combining paths? In-Reply-To: <117286890904021002y24159687v6d01a86b1614714e@mail.gmail.com> References: <49D4D095.2070803@devonianfarm.com> <117286890904021002y24159687v6d01a86b1614714e@mail.gmail.com> Message-ID: <49D4F1F1.1090506@devonianfarm.com> Tom Melendez wrote: > > I don't know what 100 times bigger turns out to be in terms of > users/traffic, but I would recommend not investing a lot of time > investing in the FE handling this. When you get to the point where > you're partitioning users based on shards of data, or just site > functions, you'll probably want a proxy cluster (and caching I'm sure) > in front of your FEs. Most of your routing would need to happen at > level then. > > The system I'm planning is going to be essentially sharded into silos, though there will be some stuff shared between shards. It's really going to be a network of sites on specific topics that, together, cover very wide subject areas. From a business standpoint it's easier to make things work for a site that's about a topic than it is a site that's about "everything". In the short term I'm planning on introducing something like WP-Supercache to handle most of the HTML and RDF traffic without hitting PHP at all, particularly when the site has social media spikes. From mmwaldman at nyc.rr.com Fri Apr 3 15:10:40 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Fri, 3 Apr 2009 15:10:40 -0400 Subject: [nycphp-talk] Why - Safari? Message-ID: <20090403191038.YUAQ21082.hrndva-omta04.mail.rr.com@DeJaVu> I have a setenvif which works when using ie and ff, but not safari. Since it's on the server-side, I figured it should always work just as long as the browser sets the HTTP Headers correctly. SetEnvIf Cookie "logged_out=1" logged_out_env=1 Order Allow,Deny Deny from env=logged_out_env SetEnvIf Authorization "realm=\"account\"" logged_in_env=1 Order Allow,Deny Allow from env=logged_in_env I set the realm with htaccess digest and the cookie with php. I've tried things like "^(.*)?logged_out=1(.*)?$", etc. Both of these statements deny access. For some reason neither of these statements allow the user access when using Safari, but if I turn the orders off and look at phpinfo, the headers look like: Cookie __utmz=125407186.1238772749.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none ); PHPSESSID=sqh58tnkrkmb46o6bd1e60srq7; logged_out=0; __utma=125407186.2910789677633345500.1238772749.1238783965.1238784122.7; __utmc=125407186; __utmb=125407186.42.10.1238784122 Authorization Digest username="auser", realm="account", nonce="jpCKC6tmBAA=d6657424b87e5916af57b6184e62949d9638d4c6", uri="/account/", response="b52f484b12096ec8b376349366616b95", algorithm="MD5", cnonce="e3545cc852130483f1cc536f40f9c6ff", nc=00000001, qop="auth" Does anyone know why this wouldn't work? It's throwing me for a loop. What is Safari doing? Thanks, Michele -------------- next part -------------- An HTML attachment was scrubbed... URL: From corey at gelform.com Sun Apr 5 16:28:20 2009 From: corey at gelform.com (Corey H Maass - gelform.com) Date: Sun, 05 Apr 2009 16:28:20 -0400 Subject: [nycphp-talk] php script timeout not working Message-ID: <1238963300.32520.1309079819@webmail.messagingengine.com> Hey, folks. I've got a script that uploads a file from my server to Amazon's S3. It works fine, and I'm using ignore_user_abort(true) so that I can call it, but don't have to wait for the response. Great. Now I am trying to create the file that will call the uploader and then die. It basically looks like this: set_time_limit(1); $handle = fopen("http://localhost/s3uploader.php", "r"); stream_set_timeout($handle, 1); But neither timeout is working - it sits and spins while the upload takes place. Any ideas? Thanks, Corey // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From dsteplight at gmail.com Sun Apr 5 16:46:41 2009 From: dsteplight at gmail.com (Darryle Steplight) Date: Sun, 5 Apr 2009 16:46:41 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <1238963300.32520.1309079819@webmail.messagingengine.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> Message-ID: <47f4c4570904051346u4b20b176rf57691673b3253bf@mail.gmail.com> set_time_limit(1); in that line you are setting the time limit to one second. You should make this number a lot higher. set_time_limit(60) if you want to set the time limit to 60 seconds. Also, you just might be running out of memory so try increasing your script's memory usage. ini_set(?memory_limit?,?16M?); On Sun, Apr 5, 2009 at 4:28 PM, Corey H Maass - gelform.com wrote: > Hey, folks. I've got a script that uploads a file from my server to > Amazon's S3. It works fine, and I'm using ignore_user_abort(true) so > that I can call it, but don't have to wait for the response. Great. Now > I am trying to create the file that will call the uploader and then die. > It basically looks like this: > > set_time_limit(1); > > $handle = fopen("http://localhost/s3uploader.php", "r"); > stream_set_timeout($handle, 1); > > But neither timeout is working - it sits and spins while the upload > takes place. Any ideas? > > Thanks, > > Corey > > // > Corey H Maass > Gelform Design > Brooklyn, NY > Web design and development for art and business > > em corey at gelform.com > ww http://www.gelform.com > ph 646/228.5048 > fx 866/502.4861 > IM gelform > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From corey at gelform.com Sun Apr 5 16:51:02 2009 From: corey at gelform.com (Corey H Maass - gelform.com) Date: Sun, 05 Apr 2009 16:51:02 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <47f4c4570904051346u4b20b176rf57691673b3253bf@mail.gmail.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> <47f4c4570904051346u4b20b176rf57691673b3253bf@mail.gmail.com> Message-ID: <1238964662.4360.1309081761@webmail.messagingengine.com> I want it to call the other script (the uploader) and then stop. So I'm setting it to timeout after one second on purpose to make sure it won't keep running. On Sun, 5 Apr 2009 16:46:41 -0400, "Darryle Steplight" said: > set_time_limit(1); > in that line you are setting the time limit to one second. You should > make this number a lot higher. set_time_limit(60) if you want to set > the time limit to 60 seconds. > > > Also, you just might be running out of memory so try increasing your > script's memory usage. ini_set(”memory_limit”,”16M”); > > > On Sun, Apr 5, 2009 at 4:28 PM, Corey H Maass - gelform.com > wrote: > > Hey, folks. I've got a script that uploads a file from my server to > > Amazon's S3. It works fine, and I'm using ignore_user_abort(true) so > > that I can call it, but don't have to wait for the response. Great. Now > > I am trying to create the file that will call the uploader and then die. > > It basically looks like this: > > > > set_time_limit(1); > > > > $handle = fopen("http://localhost/s3uploader.php", "r"); > > stream_set_timeout($handle, 1); > > > > But neither timeout is working - it sits and spins while the upload > > takes place. Any ideas? > > > > Thanks, > > > > Corey > > > > // > > Corey H Maass > > Gelform Design > > Brooklyn, NY > > Web design and development for art and business > > > > em corey at gelform.com > > ww http://www.gelform.com > > ph 646/228.5048 > > fx 866/502.4861 > > IM gelform > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From ajai at bitblit.net Sun Apr 5 16:54:36 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sun, 5 Apr 2009 16:54:36 -0400 (EDT) Subject: [nycphp-talk] php script timeout not working In-Reply-To: <1238964662.4360.1309081761@webmail.messagingengine.com> Message-ID: On Sun, 5 Apr 2009, Corey H Maass - gelform.com wrote: > I want it to call the other script (the uploader) and then stop. So I'm > setting it to timeout after one second on purpose to make sure it won't > keep running. Unless you're running it in a separate thread, won't the script die when the launcher exits? -- Aj. From corey at gelform.com Sun Apr 5 17:15:40 2009 From: corey at gelform.com (Corey H Maass - gelform.com) Date: Sun, 05 Apr 2009 17:15:40 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: References: Message-ID: <1238966140.8288.1309084123@webmail.messagingengine.com> Nope - by specifying ignore_user_abort(true); in the uploader script, the uploader script will continue after the launcher exits. On Sun, 5 Apr 2009 16:54:36 -0400 (EDT), "Ajai Khattri" said: > On Sun, 5 Apr 2009, Corey H Maass - gelform.com wrote: > > > I want it to call the other script (the uploader) and then stop. So I'm > > setting it to timeout after one second on purpose to make sure it won't > > keep running. > > Unless you're running it in a separate thread, won't the script die when > the launcher exits? > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From danielc at analysisandsolutions.com Sun Apr 5 18:16:31 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sun, 5 Apr 2009 18:16:31 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <1238963300.32520.1309079819@webmail.messagingengine.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> Message-ID: <20090405221631.GA21052@panix.com> Hi Corey: On Sun, Apr 05, 2009 at 04:28:20PM -0400, Corey H Maass - gelform.com wrote: > > set_time_limit(1); set_time_limit() works for your PHP code. Streams, in a way, are outside your PHP code. > $handle = fopen("http://localhost/s3uploader.php", "r"); > stream_set_timeout($handle, 1); > > But neither timeout is working - it sits and spins while the upload > takes place. Any ideas? That's not working because you're opening and reading the file directly. The timeout setting has no effect because you haven't gotten to that line yet Two options. Use fsockopen() instead of fopen(), see the stream_set_timeout() documentation for examples. Or use ini_set('default_socket_timeout', 1) before you call fopen(). --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 rmarscher at beaffinitive.com Sun Apr 5 18:51:44 2009 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Sun, 5 Apr 2009 18:51:44 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <20090405221631.GA21052@panix.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> <20090405221631.GA21052@panix.com> Message-ID: <748476AC-9863-4BD6-BA54-82B4F3D4855F@beaffinitive.com> Corey, Are you on a unix based machine? Is that script really local? Try shell_exec('/path/to/s3uploader.php &'); instead of fopen. The ampersand will get it to return without waiting for the upload script to finish. On Apr 5, 2009, at 6:16 PM, Daniel Convissor wrote: > Hi Corey: > > On Sun, Apr 05, 2009 at 04:28:20PM -0400, Corey H Maass - > gelform.com wrote: >> >> set_time_limit(1); > > set_time_limit() works for your PHP code. Streams, in a way, are > outside > your PHP code. > > >> $handle = fopen("http://localhost/s3uploader.php", "r"); >> stream_set_timeout($handle, 1); >> >> But neither timeout is working - it sits and spins while the upload >> takes place. Any ideas? > > That's not working because you're opening and reading the file > directly. > The timeout setting has no effect because you haven't gotten to that > line > yet > > Two options. Use fsockopen() instead of fopen(), see the > stream_set_timeout() documentation for examples. Or use > ini_set('default_socket_timeout', 1) before you call fopen(). > > --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 User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From krozinov at gmail.com Sun Apr 5 20:56:22 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Sun, 5 Apr 2009 20:56:22 -0400 Subject: [nycphp-talk] Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? Message-ID: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> Hey guys, I have a question about logging messages. Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? For example, if I have a function called check_username(), which checks that the username only consists of A-Za-z0-9, is it safe to have check_username() write to a logfile that it was called on the particaular user-inputted string, like so: Function definition: function check_username($username, &$error) { .. set $log_file... /* print out informational message. */ error_log(__FUNCTION__ . '(' . $username . '): called.', 3, $log_file); ..check the username for correctness.. } Function called like so: check_username('$_POST['username'], $error); Output to logfile: check_username(user1): called. Is it possible for an attacker to submit a specific string as the $username to somehow "escape" out of the error_log() function and have code executed instead (like calling phpinfo())? thanks, Konstantin From brianw1975 at gmail.com Sun Apr 5 21:06:25 2009 From: brianw1975 at gmail.com (Brian Williams) Date: Sun, 5 Apr 2009 21:06:25 -0400 Subject: [nycphp-talk] Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? In-Reply-To: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> References: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> Message-ID: phpinfo() pish... $user_input = "`rm -Rf /`" nuff said. in case it wasn't - backticks are basically the short cut to get PHP to execute something on the command line. *always *check incoming user data. On Sun, Apr 5, 2009 at 8:56 PM, Konstantin Rozinov wrote: > Hey guys, > > I have a question about logging messages. > > Is it safe to log unsanitized, unvalidated user-inputted data into a > logfile? > > For example, if I have a function called check_username(), which > checks that the username only consists of A-Za-z0-9, is it safe to > have check_username() write to a logfile that it was called on the > particaular user-inputted string, like so: > > Function definition: > function check_username($username, &$error) > { > .. set $log_file... > > /* print out informational message. */ > error_log(__FUNCTION__ . '(' . $username . '): called.', 3, $log_file); > > ..check the username for correctness.. > } > > Function called like so: > check_username('$_POST['username'], $error); > > Output to logfile: > check_username(user1): called. > > > Is it possible for an attacker to submit a specific string as the > $username to somehow "escape" out of the error_log() function and have > code executed instead (like calling phpinfo())? > > > > thanks, > Konstantin > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at devonianfarm.com Sun Apr 5 21:42:28 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Sun, 05 Apr 2009 21:42:28 -0400 Subject: [nycphp-talk] Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? In-Reply-To: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> References: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> Message-ID: <49D95E04.5000500@devonianfarm.com> Konstantin Rozinov wrote: > Hey guys, > > I have a question about logging messages. > > Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? > It all depends on how paranoid you are. Strange text can be toxic to any of the software that processes your logfiles. For instance, there are some character sequences that can cause some terminal programs to capture some characters from the screen and send them back to the command line. Any software that looks at your log files can potentially have buffer overflows that could be triggered by them. From ioplex at gmail.com Sun Apr 5 23:17:05 2009 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 5 Apr 2009 23:17:05 -0400 Subject: [nycphp-talk] Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? In-Reply-To: References: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> Message-ID: <78c6bd860904052017x7c47cd97v8a78c9069c730cb5@mail.gmail.com> On Sun, Apr 5, 2009 at 9:06 PM, Brian Williams wrote: > phpinfo() pish... > > > $user_input = "`rm -Rf /`" > > nuff said. > > in case it wasn't - backticks are basically the short cut to get PHP to > execute something on the command line. I don't understand how this has any impact on the OP's code. The backticks would simply be written to the log file. If you are careless enough to try to execute a log file as a shell script then you might as well erase your disk. > always check incoming user data. Actually I do not validate incoming data. At least not when it is first received. I assume everything is tainted until it gets to the point of where it really matters and then I validate it there. If I'm writing some field to a database, I always escape the data just before it's inserted so if someone supplies total garbage it doesn't matter. As long as it's escaped it's completely benign (to the database). In fact I would go so far as to say that validating data at the point-of-entry is a coding error. For example, Joomla! validates usernames before it passes them to authentication plugins. This is an error because Joomla! does not know what a valid username is in the context of the external authority. At one point Joomla! would not work with OpenID or Windows Active Directory because it explicitly excluded certain characters that were valid for those external authorities. The proper solution is to allow the authentication plugin to define username validation and provide a default implementation that can easily be overridden. Note that even though validating data when it is first received is not critical to security, escaping output /is/ critical to security. So it's ok to receive garbage. Just don't send garbage. This leads me back to the OP's question of "do I need to validate user input that is written to a log file?". The answer is no but you do need to escape (or rather remove, truncate or flatten) anything that you don't want to end up being read by a program that reads log files like passwords and excessively long messages that might fill up the disk or prevent someone from viewing the log. Mike > On Sun, Apr 5, 2009 at 8:56 PM, Konstantin Rozinov > wrote: >> >> Hey guys, >> >> I have a question about logging messages. >> >> Is it safe to log unsanitized, unvalidated user-inputted data into a >> logfile? >> >> For example, if I have a function called check_username(), which >> checks that the username only consists of A-Za-z0-9, is it safe to >> have check_username() write to a logfile that it was called on the >> particaular user-inputted string, like so: >> >> Function definition: >> function check_username($username, &$error) >> { >> ?.. set $log_file... >> >> ?/* print out informational message. */ >> ?error_log(__FUNCTION__ . '(' . $username . '): called.', 3, $log_file); >> >> ?..check the username for correctness.. >> } >> >> Function called like so: >> check_username('$_POST['username'], $error); >> >> Output to logfile: >> check_username(user1): called. >> >> >> Is it possible for an attacker to submit ?a specific string as the >> $username to somehow "escape" out of the error_log() function and have >> code executed instead (like calling phpinfo())? >> >> >> >> thanks, >> Konstantin >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Michael B Allen Java Active Directory Integration http://www.ioplex.com/ From brianw1975 at gmail.com Mon Apr 6 00:47:58 2009 From: brianw1975 at gmail.com (Brian Williams) Date: Mon, 6 Apr 2009 00:47:58 -0400 Subject: [nycphp-talk] Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? In-Reply-To: <78c6bd860904052017x7c47cd97v8a78c9069c730cb5@mail.gmail.com> References: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> <78c6bd860904052017x7c47cd97v8a78c9069c730cb5@mail.gmail.com> Message-ID: On Sun, Apr 5, 2009 at 11:17 PM, Michael B Allen wrote: > On Sun, Apr 5, 2009 at 9:06 PM, Brian Williams > wrote: > > phpinfo() pish... > > > > > > $user_input = "`rm -Rf /`" > > > > nuff said. > > > > in case it wasn't - backticks are basically the short cut to get PHP to > > execute something on the command line. > > I don't understand how this has any impact on the OP's code. The > backticks would simply be written to the log file. If you are careless > enough to try to execute a log file as a shell script then you might > as well erase your disk. > and if the text isn't passed with double quotes? > > > always check incoming user data. > > Actually I do not validate incoming data. At least not when it is > first received. I assume everything is tainted until it gets to the > point of where it really matters and then I validate it there. If I'm > writing some field to a database, I always escape the data just before > it's inserted so if someone supplies total garbage it doesn't matter. > As long as it's escaped it's completely benign (to the database). > Don't be absurd. You are long-windedly saying that you validate user-input just like everyone else -- before you put it in the database and before you present it back to the user. All of that *typically* happens in short order. You can't test the database for a username existance if you haven't completely escaped it beforehand. > > In fact I would go so far as to say that validating data at the > point-of-entry is a coding error. For example, Joomla! validates > usernames before it passes them to authentication plugins. This is an > error because Joomla! does not know what a valid username is in the > context of the external authority. At one point Joomla! would not work > with OpenID or Windows Active Directory because it explicitly excluded > certain characters that were valid for those external authorities. The > proper solution is to allow the authentication plugin to define > username validation and provide a default implementation that can > easily be overridden. This is overly complicating the matter because the OP never mentioned Joomla! or any other specific instances of using said data outside of inserting into the log file. if his code had read: error_log(__FUNCTION__ . "($username): called.", 3, $log_file); I wouldn't have made any comment at all. If the backticked code were not in double quotes it would be executed and the resulting output of the backticked code would be recorded to the log. > Note that even though validating data when it is first received is not > critical to security, escaping output /is/ critical to security. So > it's ok to receive garbage. Just don't send garbage. are you joking? how do you test for "garbage" without having tested the input? how do you tell your php script what garbage is? You can't, at best you can only program the script to test for what *isn't* garbage - i.e. a regex. and then proceed to allow the function to work safely. > This leads me > back to the OP's question of "do I need to validate user input that is > written to a log file?". The answer is no but you do need to escape > (or rather remove, truncate or flatten) anything that you don't want > to end up being read by a program that reads log files like passwords > and excessively long messages that might fill up the disk or prevent > someone from viewing the log. i admit, yes, you have to escape stuff before it gets recorded (which is obvious)... but you also have to make sure that by contatenating text to anything that the text does not actually *do* something if the text is referenced without double quotes. throw into a file and see what happens. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Mon Apr 6 02:40:51 2009 From: ioplex at gmail.com (Michael B Allen) Date: Mon, 6 Apr 2009 02:40:51 -0400 Subject: [nycphp-talk] Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? In-Reply-To: References: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> <78c6bd860904052017x7c47cd97v8a78c9069c730cb5@mail.gmail.com> Message-ID: <78c6bd860904052340tce0c629hfaa5e76e54ab3bd1@mail.gmail.com> On Mon, Apr 6, 2009 at 12:47 AM, Brian Williams wrote: > and if the text isn't passed with double quotes? > if his code had read: > > error_log(__FUNCTION__ . "($username): called.", 3, $log_file); > > I wouldn't have made any comment at all. > > If the backticked code were not in double quotes it would be executed and > the resulting output of the backticked code would be recorded to the log. Backticks must be interpreted as part of the script or using eval. So because user input would be in the form of a string, the backticks will not be interpreted. >> Note that even though validating data when it is first received is not >> critical to security, escaping output /is/ critical to security. So >> it's ok to receive garbage. Just don't send garbage. > > are you joking?? how do you test for "garbage" without having tested the > input?? how do you tell your php script what garbage is?? You can't, at best > you can only program the script to test for what *isn't* garbage - i.e. a > regex. and then proceed to allow the function to work safely. No. I'm not joking. By "garbage" I mean anything so you don't need to "test" it. You can safely put totally unvalidated "garbage" into a database. It just needs to be escaped. Validating and escaping are two completely different things. > i admit, yes, you have to escape stuff before it gets recorded (which is > obvious)... but you also have to make sure that by contatenating text to > anything that the text does not actually *do* something if the text is > referenced without double quotes. > > throw into a > file and see what happens. That's not what the OP's code does. The OP code does the equivalent of this: References: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> <78c6bd860904052017x7c47cd97v8a78c9069c730cb5@mail.gmail.com> Message-ID: <49D9B3AB.1000009@justinhileman.info> Brian Williams wrote: > > > On Sun, Apr 5, 2009 at 11:17 PM, Michael B Allen > wrote: > > On Sun, Apr 5, 2009 at 9:06 PM, Brian Williams > wrote: > > phpinfo() pish... > > > > > > $user_input = "`rm -Rf /`" > > > > nuff said. > > > > in case it wasn't - backticks are basically the short cut to get > PHP to > > execute something on the command line. > > I don't understand how this has any impact on the OP's code. The > backticks would simply be written to the log file. If you are careless > enough to try to execute a log file as a shell script then you might > as well erase your disk. > > > and if the text isn't passed with double quotes? > The text isn't ever passed with double quotes. It's passed as a string. Double quotes are just a mechanism used *inside a PHP file* to clump a bunch of characters into a string. The real contents of the variable is what's between the double quotes. That's why the following are all equivalent: $bar = 'test'; $foo = "test"; $baz = << References: <1238963300.32520.1309079819@webmail.messagingengine.com> <20090405221631.GA21052@panix.com> <748476AC-9863-4BD6-BA54-82B4F3D4855F@beaffinitive.com> Message-ID: <1239029630.2982.1309202369@webmail.messagingengine.com> Thanks, Rob. I looked at that for a minute cos it seems like the best option, but I'm using the Zend framework, where it would be a pain to break the code out to be an executable script. Plus I want to be able to call it from a URL. Corey On Sun, 5 Apr 2009 18:51:44 -0400, "Rob Marscher" said: > Corey, > Are you on a unix based machine? Is that script really local? > > Try > shell_exec('/path/to/s3uploader.php &'); > instead of fopen. > > The ampersand will get it to return without waiting for the upload > script to finish. > > On Apr 5, 2009, at 6:16 PM, Daniel Convissor > > wrote: > > > Hi Corey: > > > > On Sun, Apr 05, 2009 at 04:28:20PM -0400, Corey H Maass - > > gelform.com wrote: > >> > >> set_time_limit(1); > > > > set_time_limit() works for your PHP code. Streams, in a way, are > > outside > > your PHP code. > > > > > >> $handle = fopen("http://localhost/s3uploader.php", "r"); > >> stream_set_timeout($handle, 1); > >> > >> But neither timeout is working - it sits and spins while the upload > >> takes place. Any ideas? > > > > That's not working because you're opening and reading the file > > directly. > > The timeout setting has no effect because you haven't gotten to that > > line > > yet > > > > Two options. Use fsockopen() instead of fopen(), see the > > stream_set_timeout() documentation for examples. Or use > > ini_set('default_socket_timeout', 1) before you call fopen(). > > > > --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 User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From brenttech at gmail.com Mon Apr 6 12:02:33 2009 From: brenttech at gmail.com (Brent Baisley) Date: Mon, 6 Apr 2009 12:02:33 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <1239029630.2982.1309202369@webmail.messagingengine.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> <20090405221631.GA21052@panix.com> <748476AC-9863-4BD6-BA54-82B4F3D4855F@beaffinitive.com> <1239029630.2982.1309202369@webmail.messagingengine.com> Message-ID: <5d515c620904060902w4bbfa3adkd3e9340f15481190@mail.gmail.com> It's fairly easy to convert a PHP script to an executable script under Unix. Just make it executable. Most things work without changes, although you will be missing any URL parameters and web specific directives. I've used parts of the Zend framework in command line scripts without changes. But if you really need to keep it as a web page, use wget as the exec script. It's round about, but you are running and releasing the script while keeping it web based. Although for php to call the script and not wait for it to complete, I think you need to do more than just put it in the background. You have to make sure PHP has no return values to wait for (>/dev/null 2>&1) and "gives up" control of it (nohup) shell_exec('nohup wget ... > /dev/null 2>&1) Brent Baisley On Mon, Apr 6, 2009 at 10:53 AM, Corey H Maass - gelform.com wrote: > Thanks, Rob. I looked at that for a minute cos it seems like the best > option, but I'm using the Zend framework, where it would be a pain to > break the code out to be an executable script. Plus I want to be able to > call it from a URL. > > Corey > > On Sun, 5 Apr 2009 18:51:44 -0400, "Rob Marscher" > said: >> Corey, >> Are you on a unix based machine? ?Is that script really local? >> >> Try >> shell_exec('/path/to/s3uploader.php &'); >> instead of fopen. >> >> The ampersand will get it to return without waiting for the upload >> script to finish. >> >> On Apr 5, 2009, at 6:16 PM, Daniel Convissor >> > ?> wrote: >> >> > Hi Corey: >> > >> > On Sun, Apr 05, 2009 at 04:28:20PM -0400, Corey H Maass - >> > gelform.com wrote: >> >> >> >> set_time_limit(1); >> > >> > set_time_limit() works for your PHP code. ?Streams, in a way, are >> > outside >> > your PHP code. >> > >> > >> >> $handle = fopen("http://localhost/s3uploader.php", "r"); >> >> stream_set_timeout($handle, 1); >> >> >> >> But neither timeout is working - it sits and spins while the upload >> >> takes place. Any ideas? >> > >> > That's not working because you're opening and reading the file >> > directly. >> > The timeout setting has no effect because you haven't gotten to that >> > line >> > yet >> > >> > Two options. ?Use fsockopen() instead of fopen(), see the >> > stream_set_timeout() documentation for examples. ?Or use >> > ini_set('default_socket_timeout', 1) before you call fopen(). >> > >> > --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 User Group Community Talk Mailing List >> > http://lists.nyphp.org/mailman/listinfo/talk >> > >> > http://www.nyphp.org/show_participation.php >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > // > Corey H Maass > Gelform Design > Brooklyn, NY > Web design and development for art and business > > em corey at gelform.com > ww http://www.gelform.com > ph 646/228.5048 > fx 866/502.4861 > IM gelform > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From corey at gelform.com Mon Apr 6 14:01:27 2009 From: corey at gelform.com (Corey H Maass - gelform.com) Date: Mon, 06 Apr 2009 14:01:27 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <5d515c620904060902w4bbfa3adkd3e9340f15481190@mail.gmail.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> <20090405221631.GA21052@panix.com> <748476AC-9863-4BD6-BA54-82B4F3D4855F@beaffinitive.com> <1239029630.2982.1309202369@webmail.messagingengine.com> <5d515c620904060902w4bbfa3adkd3e9340f15481190@mail.gmail.com> Message-ID: <1239040887.9866.1309238597@webmail.messagingengine.com> Interesting. I'll take a look at wget. I do need to pass a param so I do need to run it as a URL I think. Corey On Mon, 6 Apr 2009 12:02:33 -0400, "Brent Baisley" said: > It's fairly easy to convert a PHP script to an executable script under > Unix. Just make it executable. Most things work without changes, > although you will be missing any URL parameters and web specific > directives. I've used parts of the Zend framework in command line > scripts without changes. > But if you really need to keep it as a web page, use wget as the exec > script. It's round about, but you are running and releasing the script > while keeping it web based. > Although for php to call the script and not wait for it to complete, I > think you need to do more than just put it in the background. You have > to make sure PHP has no return values to wait for (>/dev/null 2>&1) > and "gives up" control of it (nohup) > shell_exec('nohup wget ... > /dev/null 2>&1) > > Brent Baisley > > On Mon, Apr 6, 2009 at 10:53 AM, Corey H Maass - gelform.com > wrote: > > Thanks, Rob. I looked at that for a minute cos it seems like the best > > option, but I'm using the Zend framework, where it would be a pain to > > break the code out to be an executable script. Plus I want to be able to > > call it from a URL. > > > > Corey > > > > On Sun, 5 Apr 2009 18:51:44 -0400, "Rob Marscher" > > said: > >> Corey, > >> Are you on a unix based machine? Is that script really local? > >> > >> Try > >> shell_exec('/path/to/s3uploader.php &'); > >> instead of fopen. > >> > >> The ampersand will get it to return without waiting for the upload > >> script to finish. > >> > >> On Apr 5, 2009, at 6:16 PM, Daniel Convissor > >> >> > wrote: > >> > >> > Hi Corey: > >> > > >> > On Sun, Apr 05, 2009 at 04:28:20PM -0400, Corey H Maass - > >> > gelform.com wrote: > >> >> > >> >> set_time_limit(1); > >> > > >> > set_time_limit() works for your PHP code. Streams, in a way, are > >> > outside > >> > your PHP code. > >> > > >> > > >> >> $handle = fopen("http://localhost/s3uploader.php", "r"); > >> >> stream_set_timeout($handle, 1); > >> >> > >> >> But neither timeout is working - it sits and spins while the upload > >> >> takes place. Any ideas? > >> > > >> > That's not working because you're opening and reading the file > >> > directly. > >> > The timeout setting has no effect because you haven't gotten to that > >> > line > >> > yet > >> > > >> > Two options. Use fsockopen() instead of fopen(), see the > >> > stream_set_timeout() documentation for examples. Or use > >> > ini_set('default_socket_timeout', 1) before you call fopen(). > >> > > >> > --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 User Group Community Talk Mailing List > >> > http://lists.nyphp.org/mailman/listinfo/talk > >> > > >> > http://www.nyphp.org/show_participation.php > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > > > > // > > Corey H Maass > > Gelform Design > > Brooklyn, NY > > Web design and development for art and business > > > > em corey at gelform.com > > ww http://www.gelform.com > > ph 646/228.5048 > > fx 866/502.4861 > > IM gelform > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From brenttech at gmail.com Mon Apr 6 14:27:26 2009 From: brenttech at gmail.com (Brent Baisley) Date: Mon, 6 Apr 2009 14:27:26 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <1239040887.9866.1309238597@webmail.messagingengine.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> <20090405221631.GA21052@panix.com> <748476AC-9863-4BD6-BA54-82B4F3D4855F@beaffinitive.com> <1239029630.2982.1309202369@webmail.messagingengine.com> <5d515c620904060902w4bbfa3adkd3e9340f15481190@mail.gmail.com> <1239040887.9866.1309238597@webmail.messagingengine.com> Message-ID: <5d515c620904061127i5fd3bc34u4adde157818d989f@mail.gmail.com> wget or curl basically hit a web page. One of the parameters is a URL to hit, you're just not using a browser. Although you could tell the server you are a browser of your choice. Brent Baisley On Mon, Apr 6, 2009 at 2:01 PM, Corey H Maass - gelform.com wrote: > Interesting. I'll take a look at wget. I do need to pass a param so I do > need to run it as a URL I think. > > Corey > > On Mon, 6 Apr 2009 12:02:33 -0400, "Brent Baisley" > said: >> It's fairly easy to convert a PHP script to an executable script under >> Unix. Just make it executable. Most things work without changes, >> although you will be missing any URL parameters and web specific >> directives. I've used parts of the Zend framework in command line >> scripts without changes. >> But if you really need to keep it as a web page, use wget as the exec >> script. It's round about, but you are running and releasing the script >> while keeping it web based. >> Although for php to call the script and not wait for it to complete, I >> think you need to do more than just put it in the background. You have >> to make sure PHP has no return values to wait for (>/dev/null 2>&1) >> and "gives up" control of it (nohup) >> shell_exec('nohup wget ... > /dev/null 2>&1) >> >> Brent Baisley >> >> On Mon, Apr 6, 2009 at 10:53 AM, Corey H Maass - gelform.com >> wrote: >> > Thanks, Rob. I looked at that for a minute cos it seems like the best >> > option, but I'm using the Zend framework, where it would be a pain to >> > break the code out to be an executable script. Plus I want to be able to >> > call it from a URL. >> > >> > Corey >> > >> > On Sun, 5 Apr 2009 18:51:44 -0400, "Rob Marscher" >> > said: >> >> Corey, >> >> Are you on a unix based machine? ?Is that script really local? >> >> >> >> Try >> >> shell_exec('/path/to/s3uploader.php &'); >> >> instead of fopen. >> >> >> >> The ampersand will get it to return without waiting for the upload >> >> script to finish. >> >> >> >> On Apr 5, 2009, at 6:16 PM, Daniel Convissor >> >> > >> ?> wrote: >> >> >> >> > Hi Corey: >> >> > >> >> > On Sun, Apr 05, 2009 at 04:28:20PM -0400, Corey H Maass - >> >> > gelform.com wrote: >> >> >> >> >> >> set_time_limit(1); >> >> > >> >> > set_time_limit() works for your PHP code. ?Streams, in a way, are >> >> > outside >> >> > your PHP code. >> >> > >> >> > >> >> >> $handle = fopen("http://localhost/s3uploader.php", "r"); >> >> >> stream_set_timeout($handle, 1); >> >> >> >> >> >> But neither timeout is working - it sits and spins while the upload >> >> >> takes place. Any ideas? >> >> > >> >> > That's not working because you're opening and reading the file >> >> > directly. >> >> > The timeout setting has no effect because you haven't gotten to that >> >> > line >> >> > yet >> >> > >> >> > Two options. ?Use fsockopen() instead of fopen(), see the >> >> > stream_set_timeout() documentation for examples. ?Or use >> >> > ini_set('default_socket_timeout', 1) before you call fopen(). >> >> > >> >> > --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 User Group Community Talk Mailing List >> >> > http://lists.nyphp.org/mailman/listinfo/talk >> >> > >> >> > http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> >> New York PHP User Group Community Talk Mailing List >> >> http://lists.nyphp.org/mailman/listinfo/talk >> >> >> >> http://www.nyphp.org/show_participation.php >> > >> > // >> > Corey H Maass >> > Gelform Design >> > Brooklyn, NY >> > Web design and development for art and business >> > >> > em corey at gelform.com >> > ww http://www.gelform.com >> > ph 646/228.5048 >> > fx 866/502.4861 >> > IM gelform >> > >> > _______________________________________________ >> > New York PHP User Group Community Talk Mailing List >> > http://lists.nyphp.org/mailman/listinfo/talk >> > >> > http://www.nyphp.org/show_participation.php >> > >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > // > Corey H Maass > Gelform Design > Brooklyn, NY > Web design and development for art and business > > em corey at gelform.com > ww http://www.gelform.com > ph 646/228.5048 > fx 866/502.4861 > IM gelform > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From corey at gelform.com Mon Apr 6 15:28:03 2009 From: corey at gelform.com (Corey H Maass - gelform.com) Date: Mon, 06 Apr 2009 15:28:03 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <5d515c620904061127i5fd3bc34u4adde157818d989f@mail.gmail.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> <20090405221631.GA21052@panix.com> <748476AC-9863-4BD6-BA54-82B4F3D4855F@beaffinitive.com> <1239029630.2982.1309202369@webmail.messagingengine.com> <5d515c620904060902w4bbfa3adkd3e9340f15481190@mail.gmail.com> <1239040887.9866.1309238597@webmail.messagingengine.com> <5d515c620904061127i5fd3bc34u4adde157818d989f@mail.gmail.com> Message-ID: <1239046083.27126.1309254059@webmail.messagingengine.com> Okay, awesome. I was looking at curl too at one point. I'll try it with: CURLOPT_TIMEOUT - The maximum number of seconds to allow cURL functions to execute. On Mon, 6 Apr 2009 14:27:26 -0400, "Brent Baisley" said: > wget or curl basically hit a web page. One of the parameters is a URL > to hit, you're just not using a browser. Although you could tell the > server you are a browser of your choice. > > Brent Baisley > > On Mon, Apr 6, 2009 at 2:01 PM, Corey H Maass - gelform.com > wrote: > > Interesting. I'll take a look at wget. I do need to pass a param so I do > > need to run it as a URL I think. > > > > Corey > > > > On Mon, 6 Apr 2009 12:02:33 -0400, "Brent Baisley" > > said: > >> It's fairly easy to convert a PHP script to an executable script under > >> Unix. Just make it executable. Most things work without changes, > >> although you will be missing any URL parameters and web specific > >> directives. I've used parts of the Zend framework in command line > >> scripts without changes. > >> But if you really need to keep it as a web page, use wget as the exec > >> script. It's round about, but you are running and releasing the script > >> while keeping it web based. > >> Although for php to call the script and not wait for it to complete, I > >> think you need to do more than just put it in the background. You have > >> to make sure PHP has no return values to wait for (>/dev/null 2>&1) > >> and "gives up" control of it (nohup) > >> shell_exec('nohup wget ... > /dev/null 2>&1) > >> > >> Brent Baisley > >> > >> On Mon, Apr 6, 2009 at 10:53 AM, Corey H Maass - gelform.com > >> wrote: > >> > Thanks, Rob. I looked at that for a minute cos it seems like the best > >> > option, but I'm using the Zend framework, where it would be a pain to > >> > break the code out to be an executable script. Plus I want to be able to > >> > call it from a URL. > >> > > >> > Corey > >> > > >> > On Sun, 5 Apr 2009 18:51:44 -0400, "Rob Marscher" > >> > said: > >> >> Corey, > >> >> Are you on a unix based machine? Is that script really local? > >> >> > >> >> Try > >> >> shell_exec('/path/to/s3uploader.php &'); > >> >> instead of fopen. > >> >> > >> >> The ampersand will get it to return without waiting for the upload > >> >> script to finish. > >> >> > >> >> On Apr 5, 2009, at 6:16 PM, Daniel Convissor > >> >> >> >> > wrote: > >> >> > >> >> > Hi Corey: > >> >> > > >> >> > On Sun, Apr 05, 2009 at 04:28:20PM -0400, Corey H Maass - > >> >> > gelform.com wrote: > >> >> >> > >> >> >> set_time_limit(1); > >> >> > > >> >> > set_time_limit() works for your PHP code. Streams, in a way, are > >> >> > outside > >> >> > your PHP code. > >> >> > > >> >> > > >> >> >> $handle = fopen("http://localhost/s3uploader.php", "r"); > >> >> >> stream_set_timeout($handle, 1); > >> >> >> > >> >> >> But neither timeout is working - it sits and spins while the upload > >> >> >> takes place. Any ideas? > >> >> > > >> >> > That's not working because you're opening and reading the file > >> >> > directly. > >> >> > The timeout setting has no effect because you haven't gotten to that > >> >> > line > >> >> > yet > >> >> > > >> >> > Two options. Use fsockopen() instead of fopen(), see the > >> >> > stream_set_timeout() documentation for examples. Or use > >> >> > ini_set('default_socket_timeout', 1) before you call fopen(). > >> >> > > >> >> > --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 User Group Community Talk Mailing List > >> >> > http://lists.nyphp.org/mailman/listinfo/talk > >> >> > > >> >> > http://www.nyphp.org/show_participation.php > >> >> _______________________________________________ > >> >> New York PHP User Group Community Talk Mailing List > >> >> http://lists.nyphp.org/mailman/listinfo/talk > >> >> > >> >> http://www.nyphp.org/show_participation.php > >> > > >> > // > >> > Corey H Maass > >> > Gelform Design > >> > Brooklyn, NY > >> > Web design and development for art and business > >> > > >> > em corey at gelform.com > >> > ww http://www.gelform.com > >> > ph 646/228.5048 > >> > fx 866/502.4861 > >> > IM gelform > >> > > >> > _______________________________________________ > >> > New York PHP User Group Community Talk Mailing List > >> > http://lists.nyphp.org/mailman/listinfo/talk > >> > > >> > http://www.nyphp.org/show_participation.php > >> > > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > > > > // > > Corey H Maass > > Gelform Design > > Brooklyn, NY > > Web design and development for art and business > > > > em corey at gelform.com > > ww http://www.gelform.com > > ph 646/228.5048 > > fx 866/502.4861 > > IM gelform > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From corey at gelform.com Mon Apr 6 20:29:18 2009 From: corey at gelform.com (Corey H Maass - gelform.com) Date: Mon, 06 Apr 2009 20:29:18 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <5d515c620904061127i5fd3bc34u4adde157818d989f@mail.gmail.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> <20090405221631.GA21052@panix.com> <748476AC-9863-4BD6-BA54-82B4F3D4855F@beaffinitive.com> <1239029630.2982.1309202369@webmail.messagingengine.com> <5d515c620904060902w4bbfa3adkd3e9340f15481190@mail.gmail.com> <1239040887.9866.1309238597@webmail.messagingengine.com> <5d515c620904061127i5fd3bc34u4adde157818d989f@mail.gmail.com> Message-ID: <1239064158.20717.1309297493@webmail.messagingengine.com> Okay, trying curl. Using: $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'http://localhost/uploader'); curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2); curl_exec($curl_handle); curl_close($curl_handle); But it doesn't timeout. Any ideas? Thanks, Corey On Mon, 6 Apr 2009 14:27:26 -0400, "Brent Baisley" said: > wget or curl basically hit a web page. One of the parameters is a URL > to hit, you're just not using a browser. Although you could tell the > server you are a browser of your choice. > > Brent Baisley > > On Mon, Apr 6, 2009 at 2:01 PM, Corey H Maass - gelform.com > wrote: > > Interesting. I'll take a look at wget. I do need to pass a param so I do > > need to run it as a URL I think. > > > > Corey > > > > On Mon, 6 Apr 2009 12:02:33 -0400, "Brent Baisley" > > said: > >> It's fairly easy to convert a PHP script to an executable script under > >> Unix. Just make it executable. Most things work without changes, > >> although you will be missing any URL parameters and web specific > >> directives. I've used parts of the Zend framework in command line > >> scripts without changes. > >> But if you really need to keep it as a web page, use wget as the exec > >> script. It's round about, but you are running and releasing the script > >> while keeping it web based. > >> Although for php to call the script and not wait for it to complete, I > >> think you need to do more than just put it in the background. You have > >> to make sure PHP has no return values to wait for (>/dev/null 2>&1) > >> and "gives up" control of it (nohup) > >> shell_exec('nohup wget ... > /dev/null 2>&1) > >> > >> Brent Baisley > >> > >> On Mon, Apr 6, 2009 at 10:53 AM, Corey H Maass - gelform.com > >> wrote: > >> > Thanks, Rob. I looked at that for a minute cos it seems like the best > >> > option, but I'm using the Zend framework, where it would be a pain to > >> > break the code out to be an executable script. Plus I want to be able to > >> > call it from a URL. > >> > > >> > Corey > >> > > >> > On Sun, 5 Apr 2009 18:51:44 -0400, "Rob Marscher" > >> > said: > >> >> Corey, > >> >> Are you on a unix based machine? ?Is that script really local? > >> >> > >> >> Try > >> >> shell_exec('/path/to/s3uploader.php &'); > >> >> instead of fopen. > >> >> > >> >> The ampersand will get it to return without waiting for the upload > >> >> script to finish. > >> >> > >> >> On Apr 5, 2009, at 6:16 PM, Daniel Convissor > >> >> >> >> ?> wrote: > >> >> > >> >> > Hi Corey: > >> >> > > >> >> > On Sun, Apr 05, 2009 at 04:28:20PM -0400, Corey H Maass - > >> >> > gelform.com wrote: > >> >> >> > >> >> >> set_time_limit(1); > >> >> > > >> >> > set_time_limit() works for your PHP code. ?Streams, in a way, are > >> >> > outside > >> >> > your PHP code. > >> >> > > >> >> > > >> >> >> $handle = fopen("http://localhost/s3uploader.php", "r"); > >> >> >> stream_set_timeout($handle, 1); > >> >> >> > >> >> >> But neither timeout is working - it sits and spins while the upload > >> >> >> takes place. Any ideas? > >> >> > > >> >> > That's not working because you're opening and reading the file > >> >> > directly. > >> >> > The timeout setting has no effect because you haven't gotten to that > >> >> > line > >> >> > yet > >> >> > > >> >> > Two options. ?Use fsockopen() instead of fopen(), see the > >> >> > stream_set_timeout() documentation for examples. ?Or use > >> >> > ini_set('default_socket_timeout', 1) before you call fopen(). > >> >> > > >> >> > --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 User Group Community Talk Mailing List > >> >> > http://lists.nyphp.org/mailman/listinfo/talk > >> >> > > >> >> > http://www.nyphp.org/show_participation.php > >> >> _______________________________________________ > >> >> New York PHP User Group Community Talk Mailing List > >> >> http://lists.nyphp.org/mailman/listinfo/talk > >> >> > >> >> http://www.nyphp.org/show_participation.php > >> > > >> > // > >> > Corey H Maass > >> > Gelform Design > >> > Brooklyn, NY > >> > Web design and development for art and business > >> > > >> > em corey at gelform.com > >> > ww http://www.gelform.com > >> > ph 646/228.5048 > >> > fx 866/502.4861 > >> > IM gelform > >> > > >> > _______________________________________________ > >> > New York PHP User Group Community Talk Mailing List > >> > http://lists.nyphp.org/mailman/listinfo/talk > >> > > >> > http://www.nyphp.org/show_participation.php > >> > > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > > > > // > > Corey H Maass > > Gelform Design > > Brooklyn, NY > > Web design and development for art and business > > > > em corey at gelform.com > > ww http://www.gelform.com > > ph 646/228.5048 > > fx 866/502.4861 > > IM gelform > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From corey at gelform.com Mon Apr 6 20:38:19 2009 From: corey at gelform.com (Corey H Maass - gelform.com) Date: Mon, 06 Apr 2009 20:38:19 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <20090405221631.GA21052@panix.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> <20090405221631.GA21052@panix.com> Message-ID: <1239064699.22049.1309298431@webmail.messagingengine.com> > Two options. Use fsockopen() instead of fopen(), see the > stream_set_timeout() documentation for examples. Or use > ini_set('default_socket_timeout', 1) before you call fopen(). Ooh, this worked: ini_set('default_socket_timeout', 1); @fopen("http://dubfiler/upload/tos3/Id/11", "r"); Had to use @ to suppress the warning that I was exceeding the timeout, but otherwise. Thanks! Corey // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From krozinov at gmail.com Tue Apr 7 22:34:40 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Tue, 7 Apr 2009 22:34:40 -0400 Subject: [nycphp-talk] Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? In-Reply-To: References: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> <78c6bd860904052017x7c47cd97v8a78c9069c730cb5@mail.gmail.com> Message-ID: <865a7acf0904071934l273893e8t7d0c2f4c7b2021f9@mail.gmail.com> On Mon, Apr 6, 2009 at 12:47 AM, Brian Williams wrote: > > if his code had read: > > error_log(__FUNCTION__ . "($username): called.", 3, $log_file); > > I wouldn't have made any comment at all. > > If the backticked code were not in double quotes it would be executed and > the resulting output of the backticked code would be recorded to the log. > Brian, This is not true. I tested what was discussed in this thread and here are the results. (1) If an attacker submits the following as the $username: `touch /tmp/fooooo` This will be outputted to the logfile: check_username(`touch /tmp/fooooo`): called. The attacker's input is not executed. It is treated as a string. (2) If an attacker submits the following as the $username: This will be outputted to the logfile: check_username(): called. The attacker's input is not executed. It is treated as a string. Only if I process the logfile with php -f will the code in (2) actually execute. The code in (1) won't even run since it's outside the tags, but that's a minor point. Paul raises a good question about log processing software that might interpret and run the code....it seems that's where the real problem lies. Konstantin Rozinov From brianw1975 at gmail.com Tue Apr 7 23:58:07 2009 From: brianw1975 at gmail.com (Brian Williams) Date: Tue, 7 Apr 2009 23:58:07 -0400 Subject: [nycphp-talk] Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? In-Reply-To: <865a7acf0904071934l273893e8t7d0c2f4c7b2021f9@mail.gmail.com> References: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> <78c6bd860904052017x7c47cd97v8a78c9069c730cb5@mail.gmail.com> <865a7acf0904071934l273893e8t7d0c2f4c7b2021f9@mail.gmail.com> Message-ID: On Tue, Apr 7, 2009 at 10:34 PM, Konstantin Rozinov wrote: > On Mon, Apr 6, 2009 at 12:47 AM, Brian Williams > wrote: > > > > if his code had read: > > > > error_log(__FUNCTION__ . "($username): called.", 3, $log_file); > > > > I wouldn't have made any comment at all. > > > > If the backticked code were not in double quotes it would be executed and > > the resulting output of the backticked code would be recorded to the log. > > > > Brian, > > This is not true. I tested what was discussed in this thread and here > are the results. > > (1) > If an attacker submits the following as the $username: `touch /tmp/fooooo` > This will be outputted to the logfile: check_username(`touch > /tmp/fooooo`): called. > The attacker's input is not executed. It is treated as a string. > > (2) > If an attacker submits the following as the $username: /tmp/fooooo` ?> > This will be outputted to the logfile: check_username( /tmp/fooooo` ?>): called. > The attacker's input is not executed. It is treated as a string. > > Only if I process the logfile with php -f will the code in > (2) actually execute. > The code in (1) won't even run since it's outside the tags, > but that's a minor point. > > Paul raises a good question about log processing software that might > interpret and run the code....it seems that's where the real problem > lies. > > Konstantin Rozinov Ok, after bad examples, and all the hulabaloo, and being proven wrong about said bad examples... what I say still stands: Always check the data the user sent you - just check it in such a way that is appropriate for your situation. If you don't believe in that then stop checking the data any user enters on any of your forms, and don't worry about XSS or SQL injections because that's basically what Michael is saying, only escape user data before inserting into the database. I guess that would make form processing easier. Insanity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From krozinov at gmail.com Wed Apr 8 02:39:55 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Wed, 8 Apr 2009 02:39:55 -0400 Subject: [nycphp-talk] Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? In-Reply-To: <78c6bd860904052017x7c47cd97v8a78c9069c730cb5@mail.gmail.com> References: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> <78c6bd860904052017x7c47cd97v8a78c9069c730cb5@mail.gmail.com> Message-ID: <865a7acf0904072339o19b559ew95749a1d80f3c99f@mail.gmail.com> > it's ok to receive garbage. Just don't send garbage. This leads me > back to the OP's question of "do I need to validate user input that is > written to a log file?". The answer is no but you do need to escape > (or rather remove, truncate or flatten) anything that you don't want > to end up being read by a program that reads log files like passwords > and excessively long messages that might fill up the disk or prevent > someone from viewing the log. > > Mike > Mike brings up a good point about truncating excessively long user-inputted strings when logging them. I'm currently using something like this: if (strlen($msg) > ProjectConstants::LOG_MESSAGE_MAX_LENGTH) { $msg = substr($msg, 0, ProjectConstants::LOG_MESSAGE_MAX_LENGTH); $msg .= '...'; } Any suggestions or ideas? thanks, Konstantin From danielc at analysisandsolutions.com Wed Apr 8 15:22:58 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 8 Apr 2009 15:22:58 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <1239064158.20717.1309297493@webmail.messagingengine.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> <20090405221631.GA21052@panix.com> <748476AC-9863-4BD6-BA54-82B4F3D4855F@beaffinitive.com> <1239029630.2982.1309202369@webmail.messagingengine.com> <5d515c620904060902w4bbfa3adkd3e9340f15481190@mail.gmail.com> <1239040887.9866.1309238597@webmail.messagingengine.com> <5d515c620904061127i5fd3bc34u4adde157818d989f@mail.gmail.com> <1239064158.20717.1309297493@webmail.messagingengine.com> Message-ID: <20090408192257.GA16791@panix.com> On Mon, Apr 06, 2009 at 08:29:18PM -0400, Corey H Maass - gelform.com wrote: > > curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2); ... > But it doesn't timeout. Any ideas? FYI... CURLOPT_CONNECTTIMEOUT just works on the connection attempt. So once you're connected, this option doesn't mean anything. CURLOPT_TIMEOUT, on the other hand, works on the whole process, I believe. --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 corey at gelform.com Wed Apr 8 15:34:21 2009 From: corey at gelform.com (Corey H Maass - gelform.com) Date: Wed, 08 Apr 2009 15:34:21 -0400 Subject: [nycphp-talk] php script timeout not working In-Reply-To: <20090408192257.GA16791@panix.com> References: <1238963300.32520.1309079819@webmail.messagingengine.com> <20090405221631.GA21052@panix.com> <748476AC-9863-4BD6-BA54-82B4F3D4855F@beaffinitive.com> <1239029630.2982.1309202369@webmail.messagingengine.com> <5d515c620904060902w4bbfa3adkd3e9340f15481190@mail.gmail.com> <1239040887.9866.1309238597@webmail.messagingengine.com> <5d515c620904061127i5fd3bc34u4adde157818d989f@mail.gmail.com> <1239064158.20717.1309297493@webmail.messagingengine.com> <20090408192257.GA16791@panix.com> Message-ID: <1239219261.19959.1309645849@webmail.messagingengine.com> Aaah, that's huge. Okay. I will continue to play. On Wed, 8 Apr 2009 15:22:58 -0400, "Daniel Convissor" said: > On Mon, Apr 06, 2009 at 08:29:18PM -0400, Corey H Maass - gelform.com > wrote: > > > > curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2); > ... > > But it doesn't timeout. Any ideas? > > FYI... > > CURLOPT_CONNECTTIMEOUT just works on the connection attempt. So once > you're connected, this option doesn't mean anything. > > CURLOPT_TIMEOUT, on the other hand, works on the whole process, I > believe. > > --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 User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From justin at justinhileman.info Wed Apr 8 18:09:17 2009 From: justin at justinhileman.info (Justin Hileman) Date: Wed, 08 Apr 2009 18:09:17 -0400 Subject: [nycphp-talk] Is it safe to log unsanitized, unvalidated user-inputted data into a logfile? In-Reply-To: <865a7acf0904072339o19b559ew95749a1d80f3c99f@mail.gmail.com> References: <865a7acf0904051756x1bd04be1l1c1bdecc88007da2@mail.gmail.com> <78c6bd860904052017x7c47cd97v8a78c9069c730cb5@mail.gmail.com> <865a7acf0904072339o19b559ew95749a1d80f3c99f@mail.gmail.com> Message-ID: <49DD208D.3020507@justinhileman.info> Konstantin Rozinov wrote: >> it's ok to receive garbage. Just don't send garbage. This leads me >> back to the OP's question of "do I need to validate user input that is >> written to a log file?". The answer is no but you do need to escape >> (or rather remove, truncate or flatten) anything that you don't want >> to end up being read by a program that reads log files like passwords >> and excessively long messages that might fill up the disk or prevent >> someone from viewing the log. >> >> Mike >> > > Mike brings up a good point about truncating excessively long > user-inputted strings when logging them. > > I'm currently using something like this: > > if (strlen($msg)> ProjectConstants::LOG_MESSAGE_MAX_LENGTH) > { > $msg = substr($msg, 0, ProjectConstants::LOG_MESSAGE_MAX_LENGTH); > $msg .= '...'; > } > > Any suggestions or ideas? > I generally use this method for truncating strings (breaks on word boundaries): http://tr.im/itax -- justin http://justinhileman.com From d at ingk.com Fri Apr 10 12:07:22 2009 From: d at ingk.com (Damion Hankejh (ingk)) Date: Fri, 10 Apr 2009 12:07:22 -0400 Subject: [nycphp-talk] Amazon FPS API (v2008-09-17) Message-ID: <09d201c9b9f6$6f6456f0$4e2d04d0$@com> Greetings, Before we build a new wheel has anyone had success leveraging the Amazon FPS API with PHP? I?m not referring to the COBUI (Co-Branded User Interface) pipeline. I want to use the Gatekeeper API with installed tokens ? preferably API version 2008-09-17, though experience with the prior 2007 version could be useful. __________________________________ Damion H?nkejh | www.ingk.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From leam at reuel.net Sat Apr 11 16:49:18 2009 From: leam at reuel.net (Leam Hall) Date: Sat, 11 Apr 2009 16:49:18 -0400 Subject: [nycphp-talk] W3 Schools? Message-ID: <49E1024E.5020402@reuel.net> Anyone have any experience with the W3 Schools tutorials and Certification? The site has a lot of tutorials and look decently well written. Testing for a cert is $75, and I'm not sure if it's going to affect any hiring decisions but it does let us "externally motivated" folks test ourselves against a measurable standard. http://www.w3schools.com/php/default.asp Since I'm not yet in the PHP Rock Star ranks, do you think this might help? Leam From corey at gelform.com Sat Apr 11 16:59:03 2009 From: corey at gelform.com (Corey H Maass - gelform.com) Date: Sat, 11 Apr 2009 16:59:03 -0400 Subject: [nycphp-talk] W3 Schools? In-Reply-To: <49E1024E.5020402@reuel.net> References: <49E1024E.5020402@reuel.net> Message-ID: <1239483543.15810.1310071887@webmail.messagingengine.com> Learn the info, take the practice exams, and then move on to learning from every other site, too. I can't imagine a 'certification' from an automated test by an unofficiated company (w3 is a company, not an organization) would help you get hired. Either yre a rockstar or yre not. Don't get my wrong - I love the w3schools. I use them daily. I just don't think their certs are worth a lot. Corey On Sat, 11 Apr 2009 16:49:18 -0400, "Leam Hall" said: > Anyone have any experience with the W3 Schools tutorials and > Certification? The site has a lot of tutorials and look decently well > written. Testing for a cert is $75, and I'm not sure if it's going to > affect any hiring decisions but it does let us "externally motivated" > folks test ourselves against a measurable standard. > > http://www.w3schools.com/php/default.asp > > Since I'm not yet in the PHP Rock Star ranks, do you think this might > help? > > Leam > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php // Corey H Maass Gelform Design Brooklyn, NY Web design and development for art and business em corey at gelform.com ww http://www.gelform.com ph 646/228.5048 fx 866/502.4861 IM gelform From lists at zaunere.com Sat Apr 11 17:19:05 2009 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 11 Apr 2009 17:19:05 -0400 Subject: [nycphp-talk] Facebook's LAMP Stack Message-ID: <086401c9baeb$254cc980$6fe65c80$@com> Interesting presentation: http://www.infoq.com/presentations/Facebook-Software-Stack A lot of valid pros/cons in my opinion. If the cons can be dealt with, I see PHP remaining and growing as the dominant language on the web, both for larger and smaller sites. --- Hans Zaunere / Managing Member / New York PHP www.nyphp.org / www.nyphp.com From mmwaldman at nyc.rr.com Sat Apr 11 19:40:48 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Sat, 11 Apr 2009 19:40:48 -0400 Subject: [nycphp-talk] W3 Schools? In-Reply-To: <49E1024E.5020402@reuel.net> Message-ID: <20090411234046.EUCQ10927.hrndva-omta03.mail.rr.com@DeJaVu> What always got me in the door was a Computer Science degree from UC-Berkeley. That seemed to help. As an employer, I'd be looking for a combination of education and number of years of direct experience. Five years is considered an even exchange for an education by some employers. There was a different website and no one I either met or heard about had used their test results as a way to document their knowledge. I may have heard this from a headhunter. From what I understood, it actually worked. As an employer, I would put much stock in it. But, if I can remember the website, I'll forward the link. Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Leam Hall Sent: Saturday, April 11, 2009 4:49 PM To: NYPHP Talk Subject: [nycphp-talk] W3 Schools? Anyone have any experience with the W3 Schools tutorials and Certification? The site has a lot of tutorials and look decently well written. Testing for a cert is $75, and I'm not sure if it's going to affect any hiring decisions but it does let us "externally motivated" folks test ourselves against a measurable standard. http://www.w3schools.com/php/default.asp Since I'm not yet in the PHP Rock Star ranks, do you think this might help? Leam _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From mmwaldman at nyc.rr.com Sat Apr 11 20:16:02 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Sat, 11 Apr 2009 20:16:02 -0400 Subject: [nycphp-talk] W3 Schools? In-Reply-To: <20090411234046.EUCQ10927.hrndva-omta03.mail.rr.com@DeJaVu> Message-ID: <20090412001559.GTCR19377.hrndva-omta04.mail.rr.com@DeJaVu> Found it. This was a website that I was told was being recognized by some employers as verifying experience. I don't know how much stock I'd put in it though. http://www.brainbench.com/ Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michele Waldman Sent: Saturday, April 11, 2009 7:41 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] W3 Schools? What always got me in the door was a Computer Science degree from UC-Berkeley. That seemed to help. As an employer, I'd be looking for a combination of education and number of years of direct experience. Five years is considered an even exchange for an education by some employers. There was a different website and no one I either met or heard about had used their test results as a way to document their knowledge. I may have heard this from a headhunter. From what I understood, it actually worked. As an employer, I would put much stock in it. But, if I can remember the website, I'll forward the link. Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Leam Hall Sent: Saturday, April 11, 2009 4:49 PM To: NYPHP Talk Subject: [nycphp-talk] W3 Schools? Anyone have any experience with the W3 Schools tutorials and Certification? The site has a lot of tutorials and look decently well written. Testing for a cert is $75, and I'm not sure if it's going to affect any hiring decisions but it does let us "externally motivated" folks test ourselves against a measurable standard. http://www.w3schools.com/php/default.asp Since I'm not yet in the PHP Rock Star ranks, do you think this might help? Leam _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From ben at projectskyline.com Sat Apr 11 20:32:28 2009 From: ben at projectskyline.com (Ben Sgro) Date: Sat, 11 Apr 2009 20:32:28 -0400 Subject: [nycphp-talk] W3 Schools? In-Reply-To: <20090412001559.GTCR19377.hrndva-omta04.mail.rr.com@DeJaVu> References: <20090412001559.GTCR19377.hrndva-omta04.mail.rr.com@DeJaVu> Message-ID: <49E1369C.3050309@projectskyline.com> Hello, Typically, I've seen this website used by large corporations to sift through candidates - I've had HR or a HH require a test from this website be taken to progress to the next stage of the interview. I always felt it was a bit *silly* - The type of organization that includes this as part of their metrics is typically NOT the type of place I want to work. A search of PHP from brainbench returned: CGI Scripting Available Plan Learn Test $49.95 MySQL 3.23 Administration Available Plan Learn Test $49.95 PHP 4 Available Plan Learn Test $49.95 PHP 5 Available Plan Learn Test $49.95 Personally, I'd focus on a Zend test, or a college course. I obviously cannot comment on the quality of this test since I dont know if its the same as the ones I've taken or not. Both sites look similar: http://www.brainbench.com/xml/bb/common/testcenter/taketest.xml?testId=2523 http://www.w3schools.com/cert/cert_php.asp Anyways, to the point, if your looking for a job at one of the companies that may employ this test, great - that might look good for you. I don't think it can hurt you - good luck w/whatever you decide to do! It always a good idea to be sharpening your skill set. - Ben Michele Waldman wrote: > Found it. > > This was a website that I was told was being recognized by some employers as > verifying experience. > > I don't know how much stock I'd put in it though. > > http://www.brainbench.com/ > > Michele > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On > Behalf Of Michele Waldman > Sent: Saturday, April 11, 2009 7:41 PM > To: 'NYPHP Talk' > Subject: Re: [nycphp-talk] W3 Schools? > > What always got me in the door was a Computer Science degree from > UC-Berkeley. > > That seemed to help. As an employer, I'd be looking for a combination of > education and number of years of direct experience. Five years is > considered an even exchange for an education by some employers. > > There was a different website and no one I either met or heard about had > used their test results as a way to document their knowledge. I may have > heard this from a headhunter. From what I understood, it actually worked. > > As an employer, I would put much stock in it. > > But, if I can remember the website, I'll forward the link. > > Michele > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On > Behalf Of Leam Hall > Sent: Saturday, April 11, 2009 4:49 PM > To: NYPHP Talk > Subject: [nycphp-talk] W3 Schools? > > Anyone have any experience with the W3 Schools tutorials and > Certification? The site has a lot of tutorials and look decently well > written. Testing for a cert is $75, and I'm not sure if it's going to > affect any hiring decisions but it does let us "externally motivated" > folks test ourselves against a measurable standard. > > http://www.w3schools.com/php/default.asp > > Since I'm not yet in the PHP Rock Star ranks, do you think this might help? > > Leam > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From zippy1981 at gmail.com Sat Apr 11 23:33:47 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Sat, 11 Apr 2009 23:33:47 -0400 Subject: [nycphp-talk] W3 Schools? In-Reply-To: <49E1369C.3050309@projectskyline.com> References: <20090412001559.GTCR19377.hrndva-omta04.mail.rr.com@DeJaVu> <49E1369C.3050309@projectskyline.com> Message-ID: <5458db3c0904112033j5ebc15cj19ccb630081542ea@mail.gmail.com> My $2*10^-2, Zend PHP5 certification is $125. For $165 you get the self study lit that comes with a PDF, 10 online practice tests, and a voucher for the exam. Passing the exam gets you listed in the zend yellow pages, and you can join an exclusive group on linked in. I took and passed the test on Monday with minimal preparation. I have not written PHP regularly since 2007, but wrote an entire media sharing portal in PHP for a site that never launched before then. Since then all my PHP hacking has been for writing sample applications for talks I gave at LIPHP and a little bit of hacking on an open source project called http://www.andromeda-project.org/. I've been a full time .NET developer since then, and thats all been back end ETL coding. So I am by no means a PHP expert, and I'm a bit rusty. On the brainbench side of things, I took the unix and apache brainbench when I got hired as a junior unix and as/400 operator a few years back, I passed both without special preparation. Overall I think the problem with PHP certification is there is no advanced certification. Cisco has the CCIE. Microsoft has the MSCE and MCPD. Netware has (and I assume still has) the CNE. Redhat has advanced certification beyond the RHCE. I have something to show companies that I've mastered the PHP basics. There's no formal certification I can obtain to say I have advanced knowledge of PHP. Regards, Justin Dearing On Sat, Apr 11, 2009 at 8:32 PM, Ben Sgro wrote: > Hello, > > Typically, I've seen this website used by large corporations to sift > through candidates - I've had HR or a HH > require a test from this website be taken to progress to the next stage of > the interview. I always felt it was > a bit *silly* - The type of organization that includes this as part of > their metrics is typically NOT the > type of place I want to work. > > A search of PHP from brainbench returned: > CGI Scripting Available Plan Learn Test $49.95 > MySQL 3.23 Administration Available Plan Learn Test $49.95 > PHP 4 Available Plan Learn Test $49.95 > PHP 5 Available Plan Learn Test $49.95 > > Personally, I'd focus on a Zend test, or a college course. I obviously > cannot comment on the quality of this test since > I dont know if its the same as the ones I've taken or not. > > Both sites look similar: > http://www.brainbench.com/xml/bb/common/testcenter/taketest.xml?testId=2523 > http://www.w3schools.com/cert/cert_php.asp > > > Anyways, to the point, if your looking for a job at one of the companies > that may employ this test, > great - that might look good for you. > > I don't think it can hurt you - good luck w/whatever you decide to do! It > always a good idea to be > sharpening your skill set. > > - Ben > > > Michele Waldman wrote: > >> Found it. >> >> This was a website that I was told was being recognized by some employers >> as >> verifying experience. >> >> I don't know how much stock I'd put in it though. >> >> http://www.brainbench.com/ >> >> Michele >> >> -----Original Message----- >> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >> On >> Behalf Of Michele Waldman >> Sent: Saturday, April 11, 2009 7:41 PM >> To: 'NYPHP Talk' >> Subject: Re: [nycphp-talk] W3 Schools? >> >> What always got me in the door was a Computer Science degree from >> UC-Berkeley. >> >> That seemed to help. As an employer, I'd be looking for a combination of >> education and number of years of direct experience. Five years is >> considered an even exchange for an education by some employers. >> >> There was a different website and no one I either met or heard about had >> used their test results as a way to document their knowledge. I may have >> heard this from a headhunter. From what I understood, it actually worked. >> >> As an employer, I would put much stock in it. >> >> But, if I can remember the website, I'll forward the link. >> >> Michele >> >> -----Original Message----- >> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >> On >> Behalf Of Leam Hall >> Sent: Saturday, April 11, 2009 4:49 PM >> To: NYPHP Talk >> Subject: [nycphp-talk] W3 Schools? >> >> Anyone have any experience with the W3 Schools tutorials and >> Certification? The site has a lot of tutorials and look decently well >> written. Testing for a cert is $75, and I'm not sure if it's going to affect >> any hiring decisions but it does let us "externally motivated" folks test >> ourselves against a measurable standard. >> >> http://www.w3schools.com/php/default.asp >> >> Since I'm not yet in the PHP Rock Star ranks, do you think this might >> help? >> >> Leam >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> >> >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rotsen at gmail.com Tue Apr 14 20:01:43 2009 From: rotsen at gmail.com (=?ISO-8859-1?B?TulzdG9y?=) Date: Tue, 14 Apr 2009 17:01:43 -0700 Subject: [nycphp-talk] Add event button to email Message-ID: Fellow PHPers, I seen email that speople send that includes a button to add the a specific email event to your outlook. You can see something similar if you have gmail. whe you compose a message there is a button that says add event. How is this done? Can this be done using php? Thanks, Nestor :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Apr 15 16:44:26 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 15 Apr 2009 16:44:26 -0400 (EDT) Subject: [nycphp-talk] Add event button to email In-Reply-To: Message-ID: On Tue, 14 Apr 2009, N?stor wrote: > Fellow PHPers, > > I seen email that speople send that includes a button to add the > a specific email event to your outlook. > > You can see something similar if you have gmail. whe you compose a message > there is a button that says add event. > > How is this done? > > Can this be done using php? Basically you add a .ics attachment to the email with MIME type text/calendar. The attached file should be in VCALENDAR format. -- Aj. From rotsen at gmail.com Wed Apr 15 17:46:22 2009 From: rotsen at gmail.com (=?ISO-8859-1?B?TulzdG9y?=) Date: Wed, 15 Apr 2009 14:46:22 -0700 Subject: [nycphp-talk] Add event button to email In-Reply-To: References: Message-ID: Ajai, thanks for the info. I read somthing about this but I figured that most be another way. I guess is not completly automatically. The user still has to open the attachment and click save . Thanks again, Nestor :-) On Wed, Apr 15, 2009 at 1:44 PM, Ajai Khattri wrote: > On Tue, 14 Apr 2009, N?stor wrote: > > > Fellow PHPers, > > > > I seen email that speople send that includes a button to add the > > a specific email event to your outlook. > > > > You can see something similar if you have gmail. whe you compose a > message > > there is a button that says add event. > > > > How is this done? > > > > Can this be done using php? > > Basically you add a .ics attachment to the email with MIME type > text/calendar. The attached file should be in VCALENDAR format. > > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Thu Apr 16 08:54:45 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 16 Apr 2009 08:54:45 -0400 (EDT) Subject: [nycphp-talk] Add event button to email In-Reply-To: Message-ID: On Wed, 15 Apr 2009, N?stor wrote: > thanks for the info. I read somthing about this but I figured that most be > another way. > I guess is not completly automatically. The user still has to open the > attachment and click save . Depends on the client. Entourage and Outlook will show a link or a button to add, refuse or tentatively add the event to its calendar. Im assuming Apple Mail does something similar? I think Thunderbird will also do this if you have the calendar extension installed. -- Aj. From monalisa20042006 at gmail.com Tue Apr 21 17:01:14 2009 From: monalisa20042006 at gmail.com (Mona Borham) Date: Tue, 21 Apr 2009 23:01:14 +0200 Subject: [nycphp-talk] Escrow Service Message-ID: Hey there, I wanted to know where can I find escrow service script or how can I begin one? because I don't find much in that also I never coded a web service Regards; Mona Adel Web Developer Develpoment Department CairoIT Solutions Team Egypt-Mansoura Branch E-mail:mona_adel at cairoit.com Website: www.cairoit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bonsaime at gmail.com Tue Apr 21 17:20:20 2009 From: bonsaime at gmail.com (Jesse Callaway) Date: Tue, 21 Apr 2009 17:20:20 -0400 Subject: [nycphp-talk] Escrow Service In-Reply-To: References: Message-ID: Try lime exchange. It has some escrow feature, not sure if that helps or what. -jesse On Tue, Apr 21, 2009 at 5:01 PM, Mona Borham wrote: > Hey there, > > I wanted to know where can I find escrow service script or how can I begin > one? because I don't find much in that also I never coded a web service > > > Regards; > Mona Adel > Web Developer > Develpoment Department > CairoIT Solutions Team > Egypt-Mansoura Branch > E-mail:mona_adel at cairoit.com > Website: www.cairoit.com > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ioplex at gmail.com Tue Apr 21 18:01:03 2009 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 21 Apr 2009 18:01:03 -0400 Subject: [nycphp-talk] Escrow Service In-Reply-To: References: Message-ID: <78c6bd860904211501r6e12a48cva66d5ebba3bcfaf8@mail.gmail.com> On Tue, Apr 21, 2009 at 5:01 PM, Mona Borham wrote: > Hey there, > > I wanted to know where can I find escrow service script or how can I begin > one? because I don't find much in that also I never coded a web service Code escrow is something that has been nagging me from multiple angles lately. In fact I have one customer right now who wants an escrow clause in their agreement that they can invoke on demand. They agree to pay the annual fee of course and they have very limited rights to the source. Unfortunately professional code escrow services seem unfairly expensive to me. It's at least $500 USD per year. But I'm wondering if there's a way to do this on-the-cheap. For example, I would have no problem supplying customers with source packages encrypted with something ridiculously hard to crack. Then all I would need is a document that lists beneficiaries, the encryption key, how to decrypt a package, do a Will, get it notarized and put it all in a safe deposit box. There ya go - poor man's code escrow. It's also serves as an extra offsite backup since presumably the source packages would be pushed around to (or pulled by) different customers on a regular basis. Mike -- Michael B Allen Java Active Directory Integration http://www.ioplex.com/ From ioplex at gmail.com Tue Apr 21 18:05:40 2009 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 21 Apr 2009 18:05:40 -0400 Subject: [nycphp-talk] Escrow Service In-Reply-To: References: Message-ID: <78c6bd860904211505g4a7b96b0q8c61e63bac13609e@mail.gmail.com> On Tue, Apr 21, 2009 at 5:01 PM, Mona Borham wrote: > Hey there, > > I wanted to know where can I find escrow service script or how can I begin > one? because I don't find much in that also I never coded a web service Actually are you asking about code escrow or escrow of payment for services? Mike -- Michael B Allen Java Active Directory Integration http://www.ioplex.com/ From monalisa20042006 at gmail.com Tue Apr 21 18:11:11 2009 From: monalisa20042006 at gmail.com (Mona Borham) Date: Wed, 22 Apr 2009 00:11:11 +0200 Subject: [nycphp-talk] Escrow Service In-Reply-To: <78c6bd860904211505g4a7b96b0q8c61e63bac13609e@mail.gmail.com> References: <78c6bd860904211505g4a7b96b0q8c61e63bac13609e@mail.gmail.com> Message-ID: Escrow for payment for services Regards; Mona Adel Web Developer Develpoment Department CairoIT Solutions Team Egypt-Mansoura Branch E-mail:mona_adel at cairoit.com Website: www.cairoit.com On Wed, Apr 22, 2009 at 12:05 AM, Michael B Allen wrote: > On Tue, Apr 21, 2009 at 5:01 PM, Mona Borham > wrote: > > Hey there, > > > > I wanted to know where can I find escrow service script or how can I > begin > > one? because I don't find much in that also I never coded a web service > > Actually are you asking about code escrow or escrow of payment for > services? > > Mike > > -- > Michael B Allen > Java Active Directory Integration > http://www.ioplex.com/ > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Wed Apr 22 12:02:57 2009 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 22 Apr 2009 12:02:57 -0400 Subject: [nycphp-talk] Free Microsoft Interop Seminars Message-ID: <2e1b01c9c363$cdc66640$695332c0$@com> All, I'm passing along this free event which includes the how to setup WIMP/WAMP/etc. Looks pretty informative: http://www.technetevents.com/interop/ See you there. From brian at realm3.com Wed Apr 22 17:18:16 2009 From: brian at realm3.com (Brian D.) Date: Wed, 22 Apr 2009 17:18:16 -0400 Subject: [nycphp-talk] Facebook's LAMP Stack In-Reply-To: <086401c9baeb$254cc980$6fe65c80$@com> References: <086401c9baeb$254cc980$6fe65c80$@com> Message-ID: I know I'm late on this, but I finally got around to watching it and found it pretty fascinating. Agarwal mentions how including PHP files has a linear effect on execution time. He also mentioned that PHP tends to become difficult to manage when a project becomes really large. One of the ways that developers tend to organize things would be distributing logic into different files (most major frameworks are a good example of this) and when you do that you start to take a performance hit. I wonder how developers usually overcome that conundrum. Interesting video, though, thanks for sharing. - Brian realm3 web applications [realm3.com] Information architecture, application development. phone: (917) 512-3594 fax: (440) 744-3559 On Sat, Apr 11, 2009 at 5:19 PM, Hans Zaunere wrote: > Interesting presentation: > > http://www.infoq.com/presentations/Facebook-Software-Stack > > A lot of valid pros/cons in my opinion. ?If the cons can be dealt with, I > see PHP remaining and growing as the dominant language on the web, both for > larger and smaller sites. > > --- > Hans Zaunere / Managing Member / New York PHP > ? ? ?www.nyphp.org ?/ ?www.nyphp.com > > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From krozinov at gmail.com Wed Apr 22 17:41:32 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Wed, 22 Apr 2009 17:41:32 -0400 Subject: [nycphp-talk] Facebook's LAMP Stack In-Reply-To: References: <086401c9baeb$254cc980$6fe65c80$@com> Message-ID: <865a7acf0904221441k62da9f17wf2b4a7b6ab4d0277@mail.gmail.com> I think this may have been mentioned in the presentation, but one way to improve performance is to use an opcode cache like APC (with the stat check turned off) so that the included files don't have to be recompiled every single time. The compilation of and the *stat() calls for the included files are what takes the longest time. Konstantin On Wed, Apr 22, 2009 at 5:18 PM, Brian D. wrote: > I know I'm late on this, but I finally got around to watching it and > found it pretty fascinating. > > Agarwal mentions how including PHP files has a linear effect on > execution time. He also mentioned that PHP tends to become difficult > to manage when a project becomes really large. One of the ways that > developers tend to organize things would be distributing logic into > different files (most major frameworks are a good example of this) and > when you do that you start to take a performance hit. I wonder how > developers usually overcome that conundrum. > > Interesting video, though, thanks for sharing. > > - Brian > > realm3 web applications [realm3.com] > Information architecture, application development. > phone: (917) 512-3594 > fax: (440) 744-3559 > > > > On Sat, Apr 11, 2009 at 5:19 PM, Hans Zaunere wrote: > > Interesting presentation: > > > > http://www.infoq.com/presentations/Facebook-Software-Stack > > > > A lot of valid pros/cons in my opinion. If the cons can be dealt with, I > > see PHP remaining and growing as the dominant language on the web, both > for > > larger and smaller sites. > > > > --- > > Hans Zaunere / Managing Member / New York PHP > > www.nyphp.org / www.nyphp.com > > > > > > > > > > > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Wed Apr 22 20:48:49 2009 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 22 Apr 2009 20:48:49 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? Message-ID: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> Hi, A young family member has a domain that I used to host until I started doing real business with credit cards and such at which point I had to shut her down. So now I'm wondering if I can find somewhere cheap to host her site where she can mess around with PHP and web design. What do you recommend for cheap PHP hosting? Also, what is the standard tool-chain for developing your HTML, PHP, JavaScript and then uploading it to your site? I use vim, tar and scp glued together with shell scripts but for her I'm hoping for a really simple point-n-click experience. She uses a Macbook. Mike -- Michael B Allen PHP Active Directory Integration http://www.ioplex.com/plexcel.html From ps at blu-studio.com Thu Apr 23 09:18:41 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Thu, 23 Apr 2009 09:18:41 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> Message-ID: <001101c9c416$06278e30$1276aa90$@com> A very plausible beginner production style: 1) Photoshop. Design original site in Photoshop. a) Photoshop has a learning curve, but once mastered sites that start in Photoshop and use all the great styling and layering tools come out looking more custom, unique and artistic. Plus, once Photoshop knowledge is gained, those skills overflow into the ability to handle all digital imagery manipulation needs both for personal and professional use. b) Photoshop has Save for Web feature that can be set to a custom output that includes XHTML, images, divs and layers positioned with CSS. 2) Dreamweaver. Handle site updates in Dreamweaver. a) Dreamweaver has very sophisticated point and click interface, excellent autocompletion, properties inspector, and code hints. Plus, one can set up "websites" to catalog assets and have site updating, where Dreamweaver automatically sends all new changes and needed assets via FTP up to the actual site. http://www.academicsuperstore.com This site allows you to buy very deeply discounted fully licensed software as long as you or someone in your family can prove you are in any kind of school. Excellent academic pricing, as far as I have experienced. Go look at Adobe Suite prices there. http://www.lynda.com See this site for a ton of free online video tutorials that will be especially useful to a newbie. (You need to look hard for the freebies but they are there.) For some lowest price web hosting on a shoestring with decent 24 hr. tech support and plenty of online admin tools that will especially educate and challenge the novice, you can just try GoDaddy. $4.99 per mo. gets Linux, MySQL (4 or 5), and PHP (4 or 5), plus a ton of very popular opensource projects (blog, photo gallery, etc.) that one can "turn on and install" from the admin interface and then explore those too. I know there are plenty of alternatives, but these suggestions will do in a pinch. Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michael B Allen Sent: Wednesday, April 22, 2009 8:49 PM To: nyphp Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? Hi, A young family member has a domain that I used to host until I started doing real business with credit cards and such at which point I had to shut her down. So now I'm wondering if I can find somewhere cheap to host her site where she can mess around with PHP and web design. What do you recommend for cheap PHP hosting? Also, what is the standard tool-chain for developing your HTML, PHP, JavaScript and then uploading it to your site? I use vim, tar and scp glued together with shell scripts but for her I'm hoping for a really simple point-n-click experience. She uses a Macbook. Mike -- Michael B Allen PHP Active Directory Integration http://www.ioplex.com/plexcel.html _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From ajai at bitblit.net Thu Apr 23 09:41:49 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 23 Apr 2009 09:41:49 -0400 (EDT) Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> Message-ID: On Wed, 22 Apr 2009, Michael B Allen wrote: > She uses a Macbook. Why not iWeb? -- Aj. From monalisa20042006 at gmail.com Thu Apr 23 10:15:38 2009 From: monalisa20042006 at gmail.com (Mona Borham) Date: Thu, 23 Apr 2009 16:15:38 +0200 Subject: [nycphp-talk] Web Services Resource Message-ID: Hey there, I need a good resource so that I can quickly understand and implement php in web services I'm good in XML, DOM, SAX...etc most of the technologies related to XML tell me any suggestion if you please Thanks& Best Regards; Mona Adel Web Developer Develpoment Department CairoIT Solutions Team Egypt-Mansoura Branch E-mail:mona_adel at cairoit.com Website: www.cairoit.com On Wed, Apr 22, 2009 at 12:11 AM, Mona Borham wrote: > Escrow for payment for services > > Regards; > Mona Adel > Web Developer > Develpoment Department > CairoIT Solutions Team > Egypt-Mansoura Branch > E-mail:mona_adel at cairoit.com > Website: www.cairoit.com > > > On Wed, Apr 22, 2009 at 12:05 AM, Michael B Allen wrote: > >> On Tue, Apr 21, 2009 at 5:01 PM, Mona Borham >> wrote: >> > Hey there, >> > >> > I wanted to know where can I find escrow service script or how can I >> begin >> > one? because I don't find much in that also I never coded a web service >> >> Actually are you asking about code escrow or escrow of payment for >> services? >> >> Mike >> >> -- >> Michael B Allen >> Java Active Directory Integration >> http://www.ioplex.com/ >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Thu Apr 23 12:17:18 2009 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 23 Apr 2009 12:17:18 -0400 Subject: [nycphp-talk] Web Services Resource In-Reply-To: References: Message-ID: <01ee01c9c42e$f93130a0$eb9391e0$@com> Hi, > I need a good resource so that I can quickly understand and implement > php in web services I'm good in XML, DOM, SAX...etc most of the > technologies related to XML tell me any suggestion if you please PHP is just the server-side programming language that consumes and produces XML. This is akin to a web service in Java, .NET, etc. This is a very broad topic so you'd need to start investigating what your project requires and ask specific questions, but you can start by looking at the various XML support available in PHP: http://us.php.net/xml H From lists at zaunere.com Thu Apr 23 12:18:28 2009 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 23 Apr 2009 12:18:28 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> Message-ID: <01ef01c9c42f$22ba6e00$682f4a00$@com> > > She uses a Macbook. > > Why not iWeb? I've been helping my mother's friend, who uses iWeb... it's total junk. You can even upload files to the right directory on the server (it always tries to create a sub-directory, apparently). H From chsnyder at gmail.com Thu Apr 23 12:24:21 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 23 Apr 2009 12:24:21 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> Message-ID: On Wed, Apr 22, 2009 at 8:48 PM, Michael B Allen wrote: > Hi, > > A young family member has a domain that I used to host until I started > doing real business with credit cards and such at which point I had to > shut her down. So now I'm wondering if I can find somewhere cheap to > host her site where she can mess around with PHP and web design. > > What do you recommend for cheap PHP hosting? > > Also, what is the standard tool-chain for developing your HTML, PHP, > JavaScript and then uploading it to your site? I use vim, tar and scp > glued together with shell scripts but for her I'm hoping for a really > simple point-n-click experience. > > She uses a Macbook. > > Mike I've been pretty happy with Media Temple (mt) -- they're grid service is reasonably priced and seems compatible with visually-oriented Mac-type people. It may be overkill for what you want to do, but it will give her plenty of room to grow. Comes with snap-in WordPress and other apps. iWeb is great for point-click page composition, and of course it's integreated with iPhoto, iMovie, and Garage Band. Like MySpace on steroids! Transmit is the best Mac SFTP/FTPS client for Mac if your hosting provider doesn't support the WebDAV scheme that iWeb uses. chris. From chsnyder at gmail.com Thu Apr 23 12:27:24 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 23 Apr 2009 12:27:24 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <01ef01c9c42f$22ba6e00$682f4a00$@com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <01ef01c9c42f$22ba6e00$682f4a00$@com> Message-ID: On Thu, Apr 23, 2009 at 12:18 PM, Hans Zaunere wrote: >> > She uses a Macbook. >> >> Why not iWeb? > > I've been helping my mother's friend, who uses iWeb... it's total junk. ?You > can even upload files to the right directory on the server (it always tries > to create a sub-directory, apparently). > It also falls down when you want to move away from the built-in templates. But come on, Dreamweaver is junky, too. If you want point-and-click page creation, you're stuck with what any of us would consider a toy. The pros design in Photoshop and then code templates by hand for some CMS or another. From lists at zaunere.com Thu Apr 23 12:51:10 2009 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 23 Apr 2009 12:51:10 -0400 Subject: [nycphp-talk] Facebook's LAMP Stack In-Reply-To: <865a7acf0904221441k62da9f17wf2b4a7b6ab4d0277@mail.gmail.com> References: <086401c9baeb$254cc980$6fe65c80$@com> <865a7acf0904221441k62da9f17wf2b4a7b6ab4d0277@mail.gmail.com> Message-ID: <021901c9c433$b4569880$1d03c980$@com> > I think this may have been mentioned in the presentation, but one way > to improve performance is to use an opcode cache like APC (with the > stat check turned off) so that the included files don't have to be > recompiled every single time. The compilation of and the *stat() calls > for the included files are what takes the longest time. Yeah, but it's not really always a good solution either. So way back, when Rasmus joined Yahoo, some of the big improvements that came from their work on performance was improving and caching the various stat types of calls. This included lessening usage of things like require_once() in favor of things like require(). APC takes it further (with the stat check turned off) by removing the disk seeks, but there's still an execution path for including the actual file (pulling in the code, checking to see if it's been included, etc). What I'd really like is a way to "statically link" a PHP application. While this is somewhat possible today, PHP's dynamic nature makes this difficult to fully realize. For example, it can be cumbersome on the developer to check in multiple places if APC is available, what files are cached, what should be included, etc. Rather, it'd be great if APC could set a flag that says all files are included, and we can skip the big chunk of code that includes the other source files. Granted, it's more complicated than this, but hopefully it's somewhat clear as to the overall concept. H From chsnyder at gmail.com Thu Apr 23 13:00:35 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 23 Apr 2009 13:00:35 -0400 Subject: [nycphp-talk] Facebook's LAMP Stack In-Reply-To: <021901c9c433$b4569880$1d03c980$@com> References: <086401c9baeb$254cc980$6fe65c80$@com> <865a7acf0904221441k62da9f17wf2b4a7b6ab4d0277@mail.gmail.com> <021901c9c433$b4569880$1d03c980$@com> Message-ID: On Thu, Apr 23, 2009 at 12:51 PM, Hans Zaunere wrote: > > What I'd really like is a way to "statically link" a PHP application. ?While > this is somewhat possible today, PHP's dynamic nature makes this difficult > to fully realize. ?For example, it can be cumbersome on the developer to > check in multiple places if APC is available, what files are cached, what > should be included, etc. > You could take a page out of the javascript book and write a pre-compiler that creates one big script using concatenation. From lists at zaunere.com Thu Apr 23 13:12:03 2009 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 23 Apr 2009 13:12:03 -0400 Subject: [nycphp-talk] Facebook's LAMP Stack In-Reply-To: References: <086401c9baeb$254cc980$6fe65c80$@com> <865a7acf0904221441k62da9f17wf2b4a7b6ab4d0277@mail.gmail.com> <021901c9c433$b4569880$1d03c980$@com> Message-ID: <023c01c9c436$9f5c1560$de144020$@com> > > What I'd really like is a way to "statically link" a PHP application. While > > this is somewhat possible today, PHP's dynamic nature makes this difficult > > to fully realize. For example, it can be cumbersome on the developer to > > check in multiple places if APC is available, what files are cached, what > > should be included, etc. > > You could take a page out of the javascript book and write a > pre-compiler that creates one big script using concatenation. True - but then don't you get into a bootstrapping problem? I suppose it could be managed to the point that you're only really reading one script off the disk (something that is auto_prepend, perhaps). You would need some type of deployment script too I'd imagine. It just seems that once APC has cached something in RAM, there should be a more straightforward way to know that, and thus get usage of it, rather than doing a standard include/require call. But I do realize that the dynamic of PHP makes this difficult. H From ioplex at gmail.com Thu Apr 23 13:15:50 2009 From: ioplex at gmail.com (Michael B Allen) Date: Thu, 23 Apr 2009 13:15:50 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <001101c9c416$06278e30$1276aa90$@com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <001101c9c416$06278e30$1276aa90$@com> Message-ID: <78c6bd860904231015j66c071cavcb918ccb41f41ec5@mail.gmail.com> 2009/4/23 Peter Sawczynec : > A very plausible beginner production style: > > 1) Photoshop. > Design original site in Photoshop. > a) Photoshop has a learning curve, but once mastered sites that start in > Photoshop and use all the great styling and layering tools come out > looking more custom, unique and artistic. Plus, once Photoshop knowledge > is gained, those skills overflow into the ability to handle all digital > imagery manipulation needs both for personal and professional use. > b) Photoshop has Save for Web feature that can be set to a custom output > that includes XHTML, images, divs and layers positioned with CSS. > > 2) Dreamweaver. > Handle site updates in Dreamweaver. > a) Dreamweaver has very sophisticated point and click interface, > excellent autocompletion, properties inspector, and code hints. Plus, > one can set up "websites" to catalog assets and have site updating, > where Dreamweaver automatically sends all new changes and needed assets > via FTP up to the actual site. > > http://www.academicsuperstore.com > This site allows you to buy very deeply discounted fully licensed > software as long as you or someone in your family can prove you are in > any kind of school. > Excellent academic pricing, as far as I have experienced. Go look at > Adobe Suite prices there. She's not looking to be a career developer. She's just doing this for kicks at this point so I really need something free. Is there a standard "Free" and "free" tool-chain? > http://www.lynda.com > See this site for a ton of free online video tutorials that will be > especially useful to a newbie. > (You need to look hard for the freebies but they are there.) > > For some lowest price web hosting on a shoestring with decent 24 hr. > tech support and plenty of online admin tools that will especially > educate and challenge the novice, you can just try GoDaddy. $4.99 per > mo. gets Linux, MySQL (4 or 5), and PHP (4 or 5), plus a ton of very > popular opensource projects (blog, photo gallery, etc.) that one can > "turn on and install" from the admin interface and then explore those > too. Perfect. That definitely fits my budget. How does GoDaddy compare to HostGator? Thanks, Mike > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Michael B Allen > Sent: Wednesday, April 22, 2009 8:49 PM > To: nyphp > Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? > > Hi, > > A young family member has a domain that I used to host until I started > doing real business with credit cards and such at which point I had to > shut her down. So now I'm wondering if I can find somewhere cheap to > host her site where she can mess around with PHP and web design. > > What do you recommend for cheap PHP hosting? > > Also, what is the standard tool-chain for developing your HTML, PHP, > JavaScript and then uploading it to your site? I use vim, tar and scp > glued together with shell scripts but for her I'm hoping for a really > simple point-n-click experience. > > She uses a Macbook. > > Mike > > -- > Michael B Allen > PHP Active Directory Integration > http://www.ioplex.com/plexcel.html From ioplex at gmail.com Thu Apr 23 13:35:38 2009 From: ioplex at gmail.com (Michael B Allen) Date: Thu, 23 Apr 2009 13:35:38 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <01ef01c9c42f$22ba6e00$682f4a00$@com> Message-ID: <78c6bd860904231035q5b33cc05n129b5240e5594028@mail.gmail.com> On Thu, Apr 23, 2009 at 12:27 PM, Chris Snyder wrote: > On Thu, Apr 23, 2009 at 12:18 PM, Hans Zaunere wrote: >>> > She uses a Macbook. >>> >>> Why not iWeb? >> >> I've been helping my mother's friend, who uses iWeb... it's total junk. ?You >> can even upload files to the right directory on the server (it always tries >> to create a sub-directory, apparently). >> > > It also falls down when you want to move away from the built-in templates. > > But come on, Dreamweaver is junky, too. If you want point-and-click > page creation, you're stuck with what any of us would consider a toy. Actually I when I said "point and click" I did not mean to imply that the actual code would be generated by point and click. I just meant the save, upload and view cycle would ideally be a mostly point and click experience as opposed to running things on the command line like scp. Again, since I use vim and ssh I'm not familiar with the standard "Free" tool-chain so I'm trying to figure that out. What I'm thinking should exist is something like the following: 1. An editor to write .php, .html, .css, .js files. I have no idea what people use for an editor on Mac. What's the Mac equivalent of Notepad? Is Eclipse good for this? 2. A way to upload / sync files. It would be great if this was built into the editor so that she could just make some changes, hit "Upload" and it would automatically sync the server with whatever files she modified locally. If such a thing does not exist I suppose an sftp with UI style program would do. I know there's something like that for Windows but what is the Mac equivalent? 3. Debugging tools. Firebug, Burp proxy, ...? Mike From tim_lists at o2group.com Thu Apr 23 13:39:34 2009 From: tim_lists at o2group.com (Tim Lieberman) Date: Thu, 23 Apr 2009 13:39:34 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> Message-ID: <6444798E-1C5B-4C49-B878-CC5A29098C43@o2group.com> On Apr 23, 2009, at 12:24 PM, Chris Snyder wrote: > > iWeb is great for point-click page composition, and of course it's > integreated with iPhoto, iMovie, and Garage Band. Like MySpace on > steroids! > > Transmit is the best Mac SFTP/FTPS client for Mac if your hosting > provider doesn't support the WebDAV scheme that iWeb uses. If you're not married to point-and-click/WYSIWYG HTML authoring, I've recently become a pretty big fan of Coda, another product from the makers of Transmit: http://www.panic.com/coda/ I pretty slick editor, with well-thought-out bells and whistles. Nice preview mode via WebKit. Built-in FTP/SFTP/WebDAV works fine. Integrates nicely with subversion. Nice CSS editing facilities... Overall pretty nice. I ponied up my $99 recently after using TextWrangler/CyberDuck or emacs for years and years. For a stand-alone FTP client, Transmit seems to be the gold standard. I've never used it, myself, instead relying on the free, and adequate, CyberDuck: http://cyberduck.ch/ For someone young, it's probably not a bad idea to encourage writing markup by hand. From codebowl at gmail.com Thu Apr 23 13:44:24 2009 From: codebowl at gmail.com (Joseph Crawford) Date: Thu, 23 Apr 2009 13:44:24 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904231035q5b33cc05n129b5240e5594028@mail.gmail.com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <01ef01c9c42f$22ba6e00$682f4a00$@com> <78c6bd860904231035q5b33cc05n129b5240e5594028@mail.gmail.com> Message-ID: <2DB872D2-D6E0-4B97-B788-8CF42BDD243A@gmail.com> Coda is nice, also is easy to publish the sites with. It does however require knowledge of hand coding sites, it's not a what you see is what you get. Nice CSS editor also :) On Apr 23, 2009, at 1:35 PM, Michael B Allen wrote: > On Thu, Apr 23, 2009 at 12:27 PM, Chris Snyder > wrote: >> On Thu, Apr 23, 2009 at 12:18 PM, Hans Zaunere >> wrote: >>>>> She uses a Macbook. >>>> >>>> Why not iWeb? >>> >>> I've been helping my mother's friend, who uses iWeb... it's total >>> junk. You >>> can even upload files to the right directory on the server (it >>> always tries >>> to create a sub-directory, apparently). >>> >> >> It also falls down when you want to move away from the built-in >> templates. >> >> But come on, Dreamweaver is junky, too. If you want point-and-click >> page creation, you're stuck with what any of us would consider a toy. > > Actually I when I said "point and click" I did not mean to imply that > the actual code would be generated by point and click. I just meant > the save, upload and view cycle would ideally be a mostly point and > click experience as opposed to running things on the command line like > scp. > > Again, since I use vim and ssh I'm not familiar with the standard > "Free" tool-chain so I'm trying to figure that out. What I'm thinking > should exist is something like the following: > > 1. An editor to write .php, .html, .css, .js files. I have no idea > what people use for an editor on Mac. What's the Mac equivalent of > Notepad? Is Eclipse good for this? > > 2. A way to upload / sync files. It would be great if this was built > into the editor so that she could just make some changes, hit "Upload" > and it would automatically sync the server with whatever files she > modified locally. If such a thing does not exist I suppose an sftp > with UI style program would do. I know there's something like that for > Windows but what is the Mac equivalent? > > 3. Debugging tools. Firebug, Burp proxy, ...? > > Mike > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From tim_lists at o2group.com Thu Apr 23 13:45:54 2009 From: tim_lists at o2group.com (Tim Lieberman) Date: Thu, 23 Apr 2009 13:45:54 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904231035q5b33cc05n129b5240e5594028@mail.gmail.com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <01ef01c9c42f$22ba6e00$682f4a00$@com> <78c6bd860904231035q5b33cc05n129b5240e5594028@mail.gmail.com> Message-ID: On Apr 23, 2009, at 1:35 PM, Michael B Allen wrote: > Again, since I use vim and ssh I'm not familiar with the standard > "Free" tool-chain so I'm trying to figure that out. What I'm thinking > should exist is something like the following: > > 1. An editor to write .php, .html, .css, .js files. I have no idea > what people use for an editor on Mac. What's the Mac equivalent of > Notepad? Is Eclipse good for this? Eclipse is probably overkill. If you're looking for "Free" TextWrangler is the little brother of the venerable BBEdit: http://www.barebones.com/products/TextWrangler/ No built-in preview, but command-tab/command-R to Safari or Firefox works just fine. > 2. A way to upload / sync files. It would be great if this was built > into the editor so that she could just make some changes, hit "Upload" > and it would automatically sync the server with whatever files she > modified locally. If such a thing does not exist I suppose an sftp > with UI style program would do. I know there's something like that for > Windows but what is the Mac equivalent? TextWrangler supports Open/Save to FTP/SFTP very well. Coda (mentioned in my last email) supports that syncing stuff, I think. I personally never use that kind of functionality. I either develop locally and move changes to a server via subversion, or develop "directly" on a remote machine via sftp. > 3. Debugging tools. Firebug, Burp proxy, ...? Firebug pretty much does nearly everything one might need, in my experience. From danielc at analysisandsolutions.com Thu Apr 23 15:38:56 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 23 Apr 2009 15:38:56 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904231035q5b33cc05n129b5240e5594028@mail.gmail.com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <01ef01c9c42f$22ba6e00$682f4a00$@com> <78c6bd860904231035q5b33cc05n129b5240e5594028@mail.gmail.com> Message-ID: <20090423193856.GA23583@panix.com> Hi Michael: On Thu, Apr 23, 2009 at 01:35:38PM -0400, Michael B Allen wrote: > > Actually I when I said "point and click" I did not mean to imply that > the actual code would be generated by point and click. I just meant > the save, upload and view cycle would ideally be a mostly point and > click experience as opposed to running things on the command line like > scp. Couldn't you could write a shell script that runs the various commands needed (rsync, scp, etc). Put that shell script on the desktop (or wherever) that the user can then click on. Voila! Point and click uploading! Plus your daughter will get to know the wonders of shell scripting. --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 ajai at bitblit.net Thu Apr 23 15:41:22 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 23 Apr 2009 15:41:22 -0400 (EDT) Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: Message-ID: On Thu, 23 Apr 2009, Chris Snyder wrote: > Transmit is the best Mac SFTP/FTPS client for Mac if your hosting > provider doesn't support the WebDAV scheme that iWeb uses. Ive happily been using Cyberduck. -- Aj. From ajai at bitblit.net Thu Apr 23 15:44:01 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 23 Apr 2009 15:44:01 -0400 (EDT) Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <2DB872D2-D6E0-4B97-B788-8CF42BDD243A@gmail.com> Message-ID: On Thu, 23 Apr 2009, Joseph Crawford wrote: > Coda is nice, also is easy to publish the sites with. It does however > require knowledge of hand coding sites, it's not a what you see is > what you get. > > Nice CSS editor also :) Coda is very nice. -- Aj. From ajai at bitblit.net Thu Apr 23 15:52:01 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 23 Apr 2009 15:52:01 -0400 (EDT) Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904231035q5b33cc05n129b5240e5594028@mail.gmail.com> Message-ID: On Thu, 23 Apr 2009, Michael B Allen wrote: > 1. An editor to write .php, .html, .css, .js files. I have no idea > what people use for an editor on Mac. What's the Mac equivalent of > Notepad? Is Eclipse good for this? Bear in mind I have a free open source mind bent. A lot of developers on Mac use TextMate (especially the Ruby crowd) but its not free. Ive also tried TextWrangler which is similar to BBEdit. Im a vi guy and MacVim is pretty good. (Advantage of learning vi/vim is that's available on practially every platform known to man and damn useful when you need to ssh into a server and fix something fast). For visual editing, you might want to look at Kompozer (I dont know if Nvu is still around - anyone?). Hopefully, in the future something like the BeSpin project from Mozilla will bear fruit... > 2. A way to upload / sync files. It would be great if this was built > into the editor so that she could just make some changes, hit "Upload" > and it would automatically sync the server with whatever files she > modified locally. If such a thing does not exist I suppose an sftp > with UI style program would do. I know there's something like that for > Windows but what is the Mac equivalent? Someone mentioned Transmit (I agree, its pretty good). Im happy with Cyberduck (free). > 3. Debugging tools. Firebug, Burp proxy, ...? I use Firefox with Firebug and FirePHP. The Web Developer toolbar is a must-install too. And I love Mozilla's Ubiquity - Ive written my own commands for it. -- Aj. From ajai at bitblit.net Thu Apr 23 16:02:56 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 23 Apr 2009 16:02:56 -0400 (EDT) Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <2DB872D2-D6E0-4B97-B788-8CF42BDD243A@gmail.com> Message-ID: On Thu, 23 Apr 2009, Joseph Crawford wrote: > Coda is nice, also is easy to publish the sites with. It does however > require knowledge of hand coding sites, it's not a what you see is > what you get. Espresso is similar: http://macrabbit.com/espresso/ -- Aj. From ps at blu-studio.com Thu Apr 23 16:16:22 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Thu, 23 Apr 2009 16:16:22 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904231015j66c071cavcb918ccb41f41ec5@mail.gmail.com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <001101c9c416$06278e30$1276aa90$@com> <78c6bd860904231015j66c071cavcb918ccb41f41ec5@mail.gmail.com> Message-ID: <002a01c9c450$5f7f8430$1e7e8c90$@com> This list tends to beat up on Dreamweaver all the time. But, note I am not suggesting that Dreamweaver is to be used to code or manage complex PHP web applications. But for creating web sites / web pages, I have not come across a better turned out user interface than Dreamweaver. I go and look at all the free/shareware/opensource/commercial (semi-graphical interface) products every year or so. I download, install with all my wits and calculating nerve, then grippingly study the vast overload of poorly documented competitive plugins that all do some of this or some of that, then I install the plugins and then I go and get the dependencies for the plugins (and discover the odd bit of code has not been updated since '05 and was never made for my operating system and was unstable the whole time anyway); then I install all the exotic stuff - which you will need to do - don?t think you won't - to really shape up the product's user experience and then it still isn't as singularly cohesive and organized as Dreamweaver. And now you have to study forums and foreign language blogs deep into the night and the next morning to look for answers that only obliquely address the yet unsolved, undocumented quirk that stops you now. I have sampled the dedicated XML tools, specialized CSS editors (which you will rarely - almost never - need if you know your CSS yourself). Yep, Tidy is great but frankly I only needed it one time 5 years ago. Don?t get me wrong I can hand code and yes I can perform at the command prompt too with a little UNIX cheat book at my elbow. But, dude, I am telling you that other than in this narrow very vertical world of hard corps programmers; I have never been in an agency or studio or talked to another contemporary web slinger (and by a web slinger I mean someone who also actually uses and programs Flash, let's say) where I ever heard the word Eclipse or BBEdit or, OMG, Notepad get mentioned as a serious tool of the trade. Not even in the most dark back room data center with dust clogged cables running in and out of routers and across coffee stained carpet, nope not even there. Dreamweaver is the de facto web design product used out there everywhere in the cold free world. And one should learn it first and then decide personally and only when knocking out a job (under pressure and while commuting) on your PDA souped up with a web server and MySQL database. Then maybe you gotta program in Notepad. Viva Adobe mis amigos who went from a great company to a cool great company when they bought Macromedia out from under Microsoft. Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michael B Allen Sent: Thursday, April 23, 2009 1:16 PM To: NYPHP Talk Subject: Re: [nycphp-talk] PHP hosting and standard tool-chain for newbie? 2009/4/23 Peter Sawczynec : > A very plausible beginner production style: > > 1) Photoshop. > Design original site in Photoshop. > a) Photoshop has a learning curve, but once mastered sites that start in > Photoshop and use all the great styling and layering tools come out > looking more custom, unique and artistic. Plus, once Photoshop knowledge > is gained, those skills overflow into the ability to handle all digital > imagery manipulation needs both for personal and professional use. > b) Photoshop has Save for Web feature that can be set to a custom output > that includes XHTML, images, divs and layers positioned with CSS. > > 2) Dreamweaver. > Handle site updates in Dreamweaver. > a) Dreamweaver has very sophisticated point and click interface, > excellent autocompletion, properties inspector, and code hints. Plus, > one can set up "websites" to catalog assets and have site updating, > where Dreamweaver automatically sends all new changes and needed assets > via FTP up to the actual site. > > http://www.academicsuperstore.com > This site allows you to buy very deeply discounted fully licensed > software as long as you or someone in your family can prove you are in > any kind of school. > Excellent academic pricing, as far as I have experienced. Go look at > Adobe Suite prices there. She's not looking to be a career developer. She's just doing this for kicks at this point so I really need something free. Is there a standard "Free" and "free" tool-chain? > http://www.lynda.com > See this site for a ton of free online video tutorials that will be > especially useful to a newbie. > (You need to look hard for the freebies but they are there.) > > For some lowest price web hosting on a shoestring with decent 24 hr. > tech support and plenty of online admin tools that will especially > educate and challenge the novice, you can just try GoDaddy. $4.99 per > mo. gets Linux, MySQL (4 or 5), and PHP (4 or 5), plus a ton of very > popular opensource projects (blog, photo gallery, etc.) that one can > "turn on and install" from the admin interface and then explore those > too. Perfect. That definitely fits my budget. How does GoDaddy compare to HostGator? Thanks, Mike > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Michael B Allen > Sent: Wednesday, April 22, 2009 8:49 PM > To: nyphp > Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? > > Hi, > > A young family member has a domain that I used to host until I started > doing real business with credit cards and such at which point I had to > shut her down. So now I'm wondering if I can find somewhere cheap to > host her site where she can mess around with PHP and web design. > > What do you recommend for cheap PHP hosting? > > Also, what is the standard tool-chain for developing your HTML, PHP, > JavaScript and then uploading it to your site? I use vim, tar and scp > glued together with shell scripts but for her I'm hoping for a really > simple point-n-click experience. > > She uses a Macbook. > > Mike > > -- > Michael B Allen > PHP Active Directory Integration > http://www.ioplex.com/plexcel.html _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From ramons at gmx.net Thu Apr 23 16:20:07 2009 From: ramons at gmx.net (David Krings) Date: Thu, 23 Apr 2009 16:20:07 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: References: Message-ID: <49F0CD77.2010602@gmx.net> Ajai Khattri wrote: > On Thu, 23 Apr 2009, Michael B Allen wrote: > For visual editing, you might want to look at Kompozer (I dont know if Nvu > is still around - anyone?). Hopefully, in the future something like the > BeSpin project from Mozilla will bear fruit... Based on the nvu website the *nix version of Nvu is KompoZer, so thez appear to be about the same. And yes, Nvu is a nice tool as well. From ajai at bitblit.net Thu Apr 23 16:33:33 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 23 Apr 2009 16:33:33 -0400 (EDT) Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <002a01c9c450$5f7f8430$1e7e8c90$@com> Message-ID: On Thu, 23 Apr 2009, Peter Sawczynec wrote: > But, dude, I am telling you that other than in this narrow very vertical > world of hard corps programmers; I have never been in an agency or > studio or talked to another contemporary web slinger (and by a web > slinger I mean someone who also actually uses and programs Flash, let's > say) where I ever heard the word Eclipse or BBEdit or, OMG, Notepad get > mentioned as a serious tool of the trade. Not even in the most dark > back room data center with dust clogged cables running in and out of > routers and across coffee stained carpet, nope not even there. > > Dreamweaver is the de facto web design product used out there everywhere > in the cold free world. I would agree, but add that that's true for web DESIGNERs. No serious PHP / Ruby / Java guys use Dreamweaver for writing CODE and web apps are more than just design. -- Aj. (who gets tired tidying up the crazy psycho HTML indentation introduced whenever a designer touches a PHP template with DW :-) From chsnyder at gmail.com Thu Apr 23 16:34:56 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 23 Apr 2009 16:34:56 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <002a01c9c450$5f7f8430$1e7e8c90$@com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <001101c9c416$06278e30$1276aa90$@com> <78c6bd860904231015j66c071cavcb918ccb41f41ec5@mail.gmail.com> <002a01c9c450$5f7f8430$1e7e8c90$@com> Message-ID: 2009/4/23 Peter Sawczynec : > This list tends to beat up on Dreamweaver all the time. But, note I am > not suggesting that Dreamweaver is to be used to code or manage complex > PHP web applications. > > But for creating web sites / web pages, I have not come across a better > turned out user interface than Dreamweaver. Mozilla Composer was my personal favorite. All of the editing features and a clean professional GUI, for free. Wrote beautiful code, too. I'm currently converting a site with ~400 obsessively Dreamweavered pages, and I'm seeing spaghetti code that makes MSHTML look well-formed. We're talking
here, in every possible nesting combination. And I can't just tidy out the font tags, because font size was used instead of

and

for headings. Dreamweaver's main strength, to me, was its ftp client. Much easier to use than WS_FTP or Fetch or even modern clients like WinSCP or Transmit. But as an editor for markup? Harmful. From ps at blu-studio.com Thu Apr 23 16:43:53 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Thu, 23 Apr 2009 16:43:53 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: References: <002a01c9c450$5f7f8430$1e7e8c90$@com> Message-ID: <002b01c9c454$37540540$a5fc0fc0$@com> I totally agree. But I think at least with CS3 (maybe a little earlier), Dreamweaver has become more respectful of your existing indenting and spaces. But alas it will go and format to old world HTML indenting style if you give it a chance. Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Ajai Khattri Sent: Thursday, April 23, 2009 4:34 PM To: NYPHP Talk Subject: Re: [nycphp-talk] PHP hosting and standard tool-chain for newbie? On Thu, 23 Apr 2009, Peter Sawczynec wrote: > But, dude, I am telling you that other than in this narrow very vertical > world of hard corps programmers; I have never been in an agency or > studio or talked to another contemporary web slinger (and by a web > slinger I mean someone who also actually uses and programs Flash, let's > say) where I ever heard the word Eclipse or BBEdit or, OMG, Notepad get > mentioned as a serious tool of the trade. Not even in the most dark > back room data center with dust clogged cables running in and out of > routers and across coffee stained carpet, nope not even there. > > Dreamweaver is the de facto web design product used out there everywhere > in the cold free world. I would agree, but add that that's true for web DESIGNERs. No serious PHP / Ruby / Java guys use Dreamweaver for writing CODE and web apps are more than just design. -- Aj. (who gets tired tidying up the crazy psycho HTML indentation introduced whenever a designer touches a PHP template with DW :-) _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From ps at blu-studio.com Thu Apr 23 16:57:45 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Thu, 23 Apr 2009 16:57:45 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <001101c9c416$06278e30$1276aa90$@com> <78c6bd860904231015j66c071cavcb918ccb41f41ec5@mail.gmail.com> <002a01c9c450$5f7f8430$1e7e8c90$@com> Message-ID: <002c01c9c456$278af720$76a0e560$@com> That is absolutely true, mostly. If the user does a lot of selecting of text in Design mode and then applies numerous styles one can get back mixed up overformatted output from Dreamweaver. But, I've noted that the application has gotten pretty smart about consolidating redundant overlapped styles. And, yes, if you let Dreamweaver write code for you (like rotating divs or a menu), it will dish out some indecipherable clogged up language. I never use that stuff myself. But, I feel that every time I have seen a project with the automatic MM code snippets, they are good, solid, and cross platform. Meanwhile, I'd like to take a moment to thank all the fine people who brought us "jquery". As of late I am trying to use jquery for everything. And the cross platform, browser independent nature of it seems awesome. Seems over the last two years that client side scripting has just broken out into fresh new heights and every cool, gee-whiz gimmick (slideshows, dissolves, zoom, drag and drop, sort, mapping) that used to take days or weeks to painstakingly sculpt can be knocked out in 15 min. and work just excellently. Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Chris Snyder Sent: Thursday, April 23, 2009 4:35 PM To: NYPHP Talk Subject: Re: [nycphp-talk] PHP hosting and standard tool-chain for newbie? 2009/4/23 Peter Sawczynec : > This list tends to beat up on Dreamweaver all the time. But, note I am > not suggesting that Dreamweaver is to be used to code or manage complex > PHP web applications. > > But for creating web sites / web pages, I have not come across a better > turned out user interface than Dreamweaver. Mozilla Composer was my personal favorite. All of the editing features and a clean professional GUI, for free. Wrote beautiful code, too. I'm currently converting a site with ~400 obsessively Dreamweavered pages, and I'm seeing spaghetti code that makes MSHTML look well-formed. We're talking
here, in every possible nesting combination. And I can't just tidy out the font tags, because font size was used instead of

and

for headings. Dreamweaver's main strength, to me, was its ftp client. Much easier to use than WS_FTP or Fetch or even modern clients like WinSCP or Transmit. But as an editor for markup? Harmful. _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From jcampbell1 at gmail.com Thu Apr 23 17:16:47 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 23 Apr 2009 17:16:47 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904231035q5b33cc05n129b5240e5594028@mail.gmail.com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <01ef01c9c42f$22ba6e00$682f4a00$@com> <78c6bd860904231035q5b33cc05n129b5240e5594028@mail.gmail.com> Message-ID: <8f0676b40904231416g1f304898ued515fb5a61738ab@mail.gmail.com> On Thu, Apr 23, 2009 at 1:35 PM, Michael B Allen wrote: > 2. A way to upload / sync files. It would be great if this was built > into the editor so that she could just make some changes, hit "Upload" > and it would automatically sync the server with whatever files she > modified locally. If such a thing does not exist I suppose an sftp > with UI style program would do. I know there's something like that for > Windows but what is the Mac equivalent? I have seen some mac people use software that mounts a remote folder over ssh/sftp as a drive. I personally just use the command line, but does anyone know of a good free tool to mount remote file systems? I did a quick search and found MacFuse, but that looks like overkill. Standalone FTP programs seem ridiculous these days. Regards, John Campbell From chsnyder at gmail.com Thu Apr 23 17:31:21 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 23 Apr 2009 17:31:21 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <8f0676b40904231416g1f304898ued515fb5a61738ab@mail.gmail.com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <01ef01c9c42f$22ba6e00$682f4a00$@com> <78c6bd860904231035q5b33cc05n129b5240e5594028@mail.gmail.com> <8f0676b40904231416g1f304898ued515fb5a61738ab@mail.gmail.com> Message-ID: On Thu, Apr 23, 2009 at 5:16 PM, John Campbell wrote: > I have seen some mac people use software that mounts a remote folder > over ssh/sftp as a drive. ?I personally just use the command line, but > does anyone know of a good free tool to mount remote file systems? ?I > did a quick search and found MacFuse, but that looks like overkill. OS X Finder will mount WebDAV and SMB/CIFS (Windows) shares. maybe some others. MacFUSE is indeed the tool to use if you want to mount filesystems via ssh, it's pretty handy but not 100% stable. Then again, nothing in Finder is 100% stable... From krozinov at gmail.com Thu Apr 23 21:47:50 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Thu, 23 Apr 2009 21:47:50 -0400 Subject: [nycphp-talk] Facebook's LAMP Stack In-Reply-To: <021901c9c433$b4569880$1d03c980$@com> References: <086401c9baeb$254cc980$6fe65c80$@com> <865a7acf0904221441k62da9f17wf2b4a7b6ab4d0277@mail.gmail.com> <021901c9c433$b4569880$1d03c980$@com> Message-ID: <865a7acf0904231847w682e79ccgb7fa599de36acea1@mail.gmail.com> On Thu, Apr 23, 2009 at 12:51 PM, Hans Zaunere wrote: > > What I'd really like is a way to "statically link" a PHP application. > While > this is somewhat possible today, PHP's dynamic nature makes this difficult > to fully realize. For example, it can be cumbersome on the developer to > check in multiple places if APC is available, what files are cached, what > should be included, etc. > Hans, can you give more detail what you mean by statically link a PHP application and how it's possible to do it? I'm interested in hearing about that. thanks, Konstantin -------------- next part -------------- An HTML attachment was scrubbed... URL: From nhart at partsauthority.com Fri Apr 24 13:06:34 2009 From: nhart at partsauthority.com (Nicholas Hart) Date: Fri, 24 Apr 2009 13:06:34 -0400 Subject: [nycphp-talk] zend framework Message-ID: <3719ecad0904241006wf7f264h66124bf2050b9f05@mail.gmail.com> I am looking for detailed information on how to configure zend framework for i5/OS. The framework.zend.com website doesn't make this distinction. Also, if anyone has a working examples, I would very much like to see them. Any idea how popular/unpopluar this zend framework is in the php community? Ultimately looking to make it easy to create and manage multi form web pages. Thanks, Nick Parts Authority IT -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Fri Apr 24 13:20:55 2009 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 24 Apr 2009 13:20:55 -0400 Subject: [nycphp-talk] zend framework In-Reply-To: <3719ecad0904241006wf7f264h66124bf2050b9f05@mail.gmail.com> References: <3719ecad0904241006wf7f264h66124bf2050b9f05@mail.gmail.com> Message-ID: <045801c9c501$06a0f220$13e2d660$@com> Nick, not to make you repost, but we do have a Zend Framework list that would be best suited for this type of discussion (and in the interest of getting some traffic going over there). http://lists.nyphp.org/mailman/listinfo/zendframework Subscribe there if you could and repost - I know personally some folks on that list are experts in this specific arena. H > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk- > bounces at lists.nyphp.org] On Behalf Of Nicholas Hart > Sent: Friday, April 24, 2009 1:07 PM > To: talk at lists.nyphp.org > Subject: [nycphp-talk] zend framework > > I am looking for detailed information on how to configure zend > framework for i5/OS. The framework.zend.com website doesn't make this > distinction. Also, if anyone has a working examples, I would very much > like to see them. Any idea how popular/unpopluar this zend framework > is in the php community? Ultimately looking to make it easy to create > and manage multi form web pages. > > Thanks, > Nick > Parts Authority IT > > From ajai at bitblit.net Fri Apr 24 13:54:05 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 24 Apr 2009 13:54:05 -0400 (EDT) Subject: [nycphp-talk] zend framework In-Reply-To: <3719ecad0904241006wf7f264h66124bf2050b9f05@mail.gmail.com> Message-ID: On Fri, 24 Apr 2009, Nicholas Hart wrote: > Any > idea how popular/unpopluar this zend framework is in the php community? Its popular but that's because its Zend. Personally, I call it an unframework because to me its just a library of components... -- Aj. From ioplex at gmail.com Fri Apr 24 14:17:53 2009 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 24 Apr 2009 14:17:53 -0400 Subject: [nycphp-talk] zend framework In-Reply-To: References: <3719ecad0904241006wf7f264h66124bf2050b9f05@mail.gmail.com> Message-ID: <78c6bd860904241117p5d2e585evc2d26ab8ef5b49e8@mail.gmail.com> On Fri, Apr 24, 2009 at 1:54 PM, Ajai Khattri wrote: > On Fri, 24 Apr 2009, Nicholas Hart wrote: > >> Any >> idea how popular/unpopluar this zend framework is in the php community? > > Its popular but that's because its Zend. Personally, I call it an > unframework because to me its just a library of components... I'm not sure if you're casting ZF in a negative light but personally I much prefer a library of independent components over a framework. Some Zend Framework components are crap but I can choose not to use those components whereas with a framework I'm committed to using the crap even if the rest of it is great. Mike -- Michael B Allen PHP Active Directory Integration http://www.ioplex.com/plexcel.html From ajai at bitblit.net Fri Apr 24 14:50:08 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 24 Apr 2009 14:50:08 -0400 (EDT) Subject: [nycphp-talk] zend framework In-Reply-To: <78c6bd860904241117p5d2e585evc2d26ab8ef5b49e8@mail.gmail.com> Message-ID: On Fri, 24 Apr 2009, Michael B Allen wrote: > I'm not sure if you're casting ZF in a negative light but personally I > much prefer a library of independent components over a framework. Some > Zend Framework components are crap but I can choose not to use those > components whereas with a framework I'm committed to using the crap > even if the rest of it is great. Depends on the framework doesn't it. Some allow you to replace parts with your own layers if you want. But as you confirm, 'Zend Framework' is thus a misnomer. -- Aj. From ajai at bitblit.net Fri Apr 24 15:09:49 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 24 Apr 2009 15:09:49 -0400 (EDT) Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <002c01c9c456$278af720$76a0e560$@com> Message-ID: On Thu, 23 Apr 2009, Peter Sawczynec wrote: > Meanwhile, I'd like to take a moment to thank all the fine people who > brought us "jquery". As of late I am trying to use jquery for > everything. And the cross platform, browser independent nature of it > seems awesome. I totally agree. Every week there's some new plugin or effect for it. Definately nicer than Scriptaculous and more actively developed. -- Aj. From ajai at bitblit.net Fri Apr 24 15:11:42 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 24 Apr 2009 15:11:42 -0400 (EDT) Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <8f0676b40904231416g1f304898ued515fb5a61738ab@mail.gmail.com> Message-ID: On Thu, 23 Apr 2009, John Campbell wrote: > I have seen some mac people use software that mounts a remote folder > over ssh/sftp as a drive. I personally just use the command line, but > does anyone know of a good free tool to mount remote file systems? I > did a quick search and found MacFuse, but that looks like overkill. I believe MacFuse is the only game in town. Works pretty well. > Standalone FTP programs seem ridiculous these days. Not to mention how insecure FTP is. -- Aj. From ken at secdat.com Fri Apr 24 15:12:38 2009 From: ken at secdat.com (Kenneth Downs) Date: Fri, 24 Apr 2009 15:12:38 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: References: Message-ID: <49F20F26.2060108@secdat.com> Ajai Khattri wrote: > On Thu, 23 Apr 2009, Peter Sawczynec wrote: > > >> Meanwhile, I'd like to take a moment to thank all the fine people who >> brought us "jquery". As of late I am trying to use jquery for >> everything. And the cross platform, browser independent nature of it >> seems awesome. >> > > I totally agree. Every week there's some new plugin or effect for it. > Definately nicer than Scriptaculous and more actively developed. > > > > Yeah, it's more or less da bomb. -- Kenneth Downs Secure Data Software ken at secdat.com www.andromeda-project.org www.secdat.com Office: 631-689-7200 Cell: 631-379-0010 Fax: 631-689-0527 -------------- next part -------------- An HTML attachment was scrubbed... URL: From vtbludgeon at gmail.com Fri Apr 24 16:37:59 2009 From: vtbludgeon at gmail.com (David Mintz) Date: Fri, 24 Apr 2009 16:37:59 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: References: <002c01c9c456$278af720$76a0e560$@com> Message-ID: <721f1cc50904241337x2feb29e6p911649c1e0cadf55@mail.gmail.com> On Fri, Apr 24, 2009 at 3:09 PM, Ajai Khattri wrote: > On Thu, 23 Apr 2009, Peter Sawczynec wrote: > > > Meanwhile, I'd like to take a moment to thank all the fine people who > > brought us "jquery". As of late I am trying to use jquery for > > everything. And the cross platform, browser independent nature of it > > seems awesome. > > I totally agree. Every week there's some new plugin or effect for it. > Definately nicer than Scriptaculous and more actively developed. > Now that we've gotten nice and OT here, I might add that the number of JQuery plugins that do x is a little overwhelming. Want a tooltip thingy? 25 alternatives to choose from. Then you tire of trying them one by one and finding something unsatisfactory about them all, so you write your own. Then you think hey maybe I should contribute this, and voil?, now there are 26. The Protype vs JQuery debate strikes me as religious. Both are class acts, take your pick. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken at secdat.com Fri Apr 24 16:52:50 2009 From: ken at secdat.com (Kenneth Downs) Date: Fri, 24 Apr 2009 16:52:50 -0400 Subject: [nycphp-talk] jQuery (Was: PHP hosting and standard tool-chain for newbie?) In-Reply-To: <721f1cc50904241337x2feb29e6p911649c1e0cadf55@mail.gmail.com> References: <002c01c9c456$278af720$76a0e560$@com> <721f1cc50904241337x2feb29e6p911649c1e0cadf55@mail.gmail.com> Message-ID: <49F226A2.7070205@secdat.com> David Mintz wrote: > On Fri, Apr 24, 2009 at 3:09 PM, Ajai Khattri wrote: > > >> On Thu, 23 Apr 2009, Peter Sawczynec wrote: >> >> >>> Meanwhile, I'd like to take a moment to thank all the fine people who >>> brought us "jquery". As of late I am trying to use jquery for >>> everything. And the cross platform, browser independent nature of it >>> seems awesome. >>> >> I totally agree. Every week there's some new plugin or effect for it. >> Definately nicer than Scriptaculous and more actively developed. >> >> > > Now that we've gotten nice and OT here, I might add that the number of > JQuery plugins that do x is a little overwhelming. Want a tooltip thingy? 25 > alternatives to choose from. Then you tire of trying them one by one and > finding something unsatisfactory about them all, so you write your own. Then > you think hey maybe I should contribute this, and voil?, now there are 26. > ...and some of them don't work so good. I found myself settling on jQuery UI and then trying to do minimal additions, this gave some sense of stability. > The Protype vs JQuery debate strikes me as religious. Both are class acts, > take your pick. > Why stop there, let's drag extjs into the picture :) > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software ken at secdat.com www.andromeda-project.org www.secdat.com Office: 631-689-7200 Cell: 631-379-0010 Fax: 631-689-0527 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Fri Apr 24 17:06:47 2009 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 24 Apr 2009 17:06:47 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> Message-ID: <78c6bd860904241406l719517a7n978be1b0747f9e73@mail.gmail.com> Well the tool-chain I ended up using was: 1. GoDaddy.com for hosting for $4.75/mo with a 1yr payment. 2. TextWrangler for editing files directly on the server or locally 3. Transmit for uploading, downloading, renaming and deleting files and so on She hasn't tried it yet but I was able to do everything that I think someone would need to do. Thanks, Mike From chsnyder at gmail.com Fri Apr 24 17:07:09 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Fri, 24 Apr 2009 17:07:09 -0400 Subject: [nycphp-talk] jQuery (Was: PHP hosting and standard tool-chain for newbie?) In-Reply-To: <49F226A2.7070205@secdat.com> References: <002c01c9c456$278af720$76a0e560$@com> <721f1cc50904241337x2feb29e6p911649c1e0cadf55@mail.gmail.com> <49F226A2.7070205@secdat.com> Message-ID: On Fri, Apr 24, 2009 at 4:52 PM, Kenneth Downs wrote: > The Protype vs JQuery debate strikes me as religious. Both are class acts, > take your pick. > > > Why stop there, let's drag extjs into the picture :) Or MochiKit, which has been making JavaScript suck less since 2005. They all do almost the same thing, in mostly the same way, but everyone gets to find their favorite flavor. The main thing is that if you're still writing js without a framework, you're working way too hard. From vtbludgeon at gmail.com Fri Apr 24 17:13:27 2009 From: vtbludgeon at gmail.com (David Mintz) Date: Fri, 24 Apr 2009 17:13:27 -0400 Subject: [nycphp-talk] jQuery (Was: PHP hosting and standard tool-chain for newbie?) In-Reply-To: References: <002c01c9c456$278af720$76a0e560$@com> <721f1cc50904241337x2feb29e6p911649c1e0cadf55@mail.gmail.com> <49F226A2.7070205@secdat.com> Message-ID: <721f1cc50904241413w6f09c4d8j225e665c6489317d@mail.gmail.com> On Fri, Apr 24, 2009 at 5:07 PM, Chris Snyder wrote: > On Fri, Apr 24, 2009 at 4:52 PM, Kenneth Downs wrote: > > > The Protype vs JQuery debate strikes me as religious. Both are class > acts, > > take your pick. > > > > > > Why stop there, let's drag extjs into the picture :) > > Or MochiKit, which has been making JavaScript suck less since 2005. Oh -- Javascript is inherently suckish! Now I understand why it gives me trouble sometimes. I still don't understand how the hell to write class definitions. Seems there's more than one way and they're all odd. But that's ok, don't even try to teach me. Lest we digress from the digression. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri Apr 24 17:16:18 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Fri, 24 Apr 2009 17:16:18 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904241406l719517a7n978be1b0747f9e73@mail.gmail.com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <78c6bd860904241406l719517a7n978be1b0747f9e73@mail.gmail.com> Message-ID: On Fri, Apr 24, 2009 at 5:06 PM, Michael B Allen wrote: > 2. TextWrangler for editing files directly on the server or locally I hadn't heard about TextWrangler before now. What (besides the low low price) made that the one to use? Also, I can't believe no one mentioned Apple's Developer Tools. XCode is actually quite a nice free editor for markup and css. From ioplex at gmail.com Fri Apr 24 17:22:27 2009 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 24 Apr 2009 17:22:27 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <78c6bd860904241406l719517a7n978be1b0747f9e73@mail.gmail.com> Message-ID: <78c6bd860904241422o424e7651t86469d69538bc3df@mail.gmail.com> On Fri, Apr 24, 2009 at 5:16 PM, Chris Snyder wrote: > On Fri, Apr 24, 2009 at 5:06 PM, Michael B Allen wrote: > >> 2. TextWrangler for editing files directly on the server or locally > > I hadn't heard about TextWrangler before now. What (besides the low > low price) made that the one to use? Just because someone mentioned it and it worked. Mike -- Michael B Allen PHP Active Directory Integration http://www.ioplex.com/plexcel.html From tim_lists at o2group.com Fri Apr 24 18:05:39 2009 From: tim_lists at o2group.com (Tim Lieberman) Date: Fri, 24 Apr 2009 18:05:39 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <78c6bd860904241406l719517a7n978be1b0747f9e73@mail.gmail.com> References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <78c6bd860904241406l719517a7n978be1b0747f9e73@mail.gmail.com> Message-ID: > Well the tool-chain I ended up using was: > > 1. GoDaddy.com for hosting for $4.75/mo with a 1yr payment. > 2. TextWrangler for editing files directly on the server or locally > 3. Transmit for uploading, downloading, renaming and deleting files > and so on I must admit I've never actually used Transmit, but what made you choose it over the free CyberDuck? -Tim From tim_lists at o2group.com Fri Apr 24 18:13:36 2009 From: tim_lists at o2group.com (Tim Lieberman) Date: Fri, 24 Apr 2009 18:13:36 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <78c6bd860904241406l719517a7n978be1b0747f9e73@mail.gmail.com> Message-ID: On Apr 24, 2009, at 5:16 PM, Chris Snyder wrote: > On Fri, Apr 24, 2009 at 5:06 PM, Michael B Allen > wrote: > >> 2. TextWrangler for editing files directly on the server or locally > > I hadn't heard about TextWrangler before now. What (besides the low > low price) made that the one to use? I know I gravitated towards it when I first went back to using a Mac because I had fond memories of using BBEdit years ago. BBEdit has a great slogan, btw: "It doesn't suck." Once upon a time, it was the only decent programmer's editor on the mac platform. So when I first picked up a MacBook Pro a few years back, I went looking for BBEdit, noticed there was this free TextWrangler thing, and gave it a shot. It's got a nice feature set, while remaining fairly lightweight, and it just works. I tried going to Eclipse a few times, but i always found myself fighting over one thing or another (managing remote files was a big one). So I went back to TextWrangler. These days, I still use TextWrangler daily for quick changes via SFTP to remote systems. For real development work, running on my local AMP stack, it's usually Coda (for the past few weeks) -Tim From ioplex at gmail.com Fri Apr 24 18:40:53 2009 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 24 Apr 2009 18:40:53 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: References: <78c6bd860904221748t65c2f6d4m3b990a0bc777aadc@mail.gmail.com> <78c6bd860904241406l719517a7n978be1b0747f9e73@mail.gmail.com> Message-ID: <78c6bd860904241540lc9a702ds50dae8c21a2ba070@mail.gmail.com> On Fri, Apr 24, 2009 at 6:05 PM, Tim Lieberman wrote: > >> Well the tool-chain I ended up using was: >> >> 1. GoDaddy.com for hosting for $4.75/mo with a 1yr payment. >> 2. TextWrangler for editing files directly on the server or locally >> 3. Transmit for uploading, downloading, renaming and deleting files and so >> on > > I must admit I've never actually used Transmit, but what made you choose it > over the free CyberDuck? Just because someone mentioned it and it worked. -- Michael B Allen PHP Active Directory Integration http://www.ioplex.com/plexcel.html From ken at secdat.com Fri Apr 24 21:03:51 2009 From: ken at secdat.com (Kenneth Downs) Date: Fri, 24 Apr 2009 21:03:51 -0400 Subject: [nycphp-talk] jQuery (Was: PHP hosting and standard tool-chain for newbie?) In-Reply-To: <721f1cc50904241413w6f09c4d8j225e665c6489317d@mail.gmail.com> References: <002c01c9c456$278af720$76a0e560$@com> <721f1cc50904241337x2feb29e6p911649c1e0cadf55@mail.gmail.com> <49F226A2.7070205@secdat.com> <721f1cc50904241413w6f09c4d8j225e665c6489317d@mail.gmail.com> Message-ID: <49F26177.4050500@secdat.com> David Mintz wrote: > On Fri, Apr 24, 2009 at 5:07 PM, Chris Snyder wrote: > > >> On Fri, Apr 24, 2009 at 4:52 PM, Kenneth Downs wrote: >> >> >>> The Protype vs JQuery debate strikes me as religious. Both are class >>> >> acts, >> >>> take your pick. >>> >>> >>> Why stop there, let's drag extjs into the picture :) >>> >> Or MochiKit, which has been making JavaScript suck less since 2005. >> > > > > Oh -- Javascript is inherently suckish! Now I understand why it gives me > trouble sometimes. I still don't understand how the hell to write class > definitions. Seems there's more than one way and they're all odd. > Javascript gave me fits until I dug through some of the younger tikes' code, and ended up writing this blog entry on "Javascript as a foreign language": http://database-programmer.blogspot.com/2008/08/javascript-as-foreign-language.html > But that's ok, don't even try to teach me. Lest we digress from the > digression. > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software ken at secdat.com www.andromeda-project.org www.secdat.com Office: 631-689-7200 Cell: 631-379-0010 Fax: 631-689-0527 -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Sat Apr 25 01:13:17 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 25 Apr 2009 01:13:17 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <721f1cc50904241337x2feb29e6p911649c1e0cadf55@mail.gmail.com> References: <002c01c9c456$278af720$76a0e560$@com> <721f1cc50904241337x2feb29e6p911649c1e0cadf55@mail.gmail.com> Message-ID: <20090425051316.GA3938@panix.com> On Fri, Apr 24, 2009 at 04:37:59PM -0400, David Mintz wrote: > > The Protype vs JQuery debate strikes me as religious. Both are class acts, > take your pick. The fact that JQuery doesn't have JSON encoding/decoding built in makes me think Prototype has their act together a bit more. --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 chsnyder at gmail.com Sat Apr 25 01:15:25 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Sat, 25 Apr 2009 01:15:25 -0400 Subject: [nycphp-talk] jQuery (Was: PHP hosting and standard tool-chain for newbie?) In-Reply-To: <49F26177.4050500@secdat.com> References: <002c01c9c456$278af720$76a0e560$@com> <721f1cc50904241337x2feb29e6p911649c1e0cadf55@mail.gmail.com> <49F226A2.7070205@secdat.com> <721f1cc50904241413w6f09c4d8j225e665c6489317d@mail.gmail.com> <49F26177.4050500@secdat.com> Message-ID: On Fri, Apr 24, 2009 at 9:03 PM, Kenneth Downs wrote: > Javascript gave me fits until I dug through some of the younger tikes' code, > and ended up writing this blog entry on "Javascript as a foreign language": > > http://database-programmer.blogspot.com/2008/08/javascript-as-foreign-language.html > Nice. I like how you relate it to php. From danielc at analysisandsolutions.com Sat Apr 25 01:27:26 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 25 Apr 2009 01:27:26 -0400 Subject: [nycphp-talk] zend framework In-Reply-To: References: <3719ecad0904241006wf7f264h66124bf2050b9f05@mail.gmail.com> Message-ID: <20090425052724.GB3938@panix.com> On Fri, Apr 24, 2009 at 01:54:05PM -0400, Ajai Khattri wrote: > > Its popular but that's because its Zend. Personally, I call it an > unframework because to me its just a library of components... While there are a lot of library components in ZF, there really is a framework in there as well: http://framework.zend.com/docs/quickstart --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 oorza2k5 at gmail.com Sat Apr 25 02:10:26 2009 From: oorza2k5 at gmail.com (oorza2k5 at gmail.com) Date: Sat, 25 Apr 2009 06:10:26 +0000 Subject: [nycphp-talk] LEMP? Message-ID: <0016e6476e622bc27504685af84f@google.com> Hey, all, new to the mailing list (really, the first email I've sent :D). I was wondering if anyone had any experience using the EMP (nginx, mysql, php) instead of the AMP stack, specifically using php-fpm as a process manager? I've read some pretty impressive benchmarks: http://www.yawn.it/2008/04/30/nginx-php-php-fpm-on-debian-etch-40/ and recently got it compiled and have been playing with it. It seems great, but I was wondering if there were any suggestions, warnings, weird behaviors, etc. that I should be aware of. To date, I've only noticed one thing, namely that $_SERVER['HTTPS'] isn't set when using SSL (easy enough to workaround) but do I need to keep my eye out for anything else? -------------- next part -------------- An HTML attachment was scrubbed... URL: From monalisa20042006 at gmail.com Sat Apr 25 11:47:19 2009 From: monalisa20042006 at gmail.com (Mona Borham) Date: Sat, 25 Apr 2009 18:47:19 +0300 Subject: [nycphp-talk] Website quotation Message-ID: Hey there, How to make a website(project) quotation? Regards; Mona Adel Web Developer Develpoment Department CairoIT Solutions Team Egypt-Mansoura Branch E-mail:mona_adel at cairoit.com Website: www.cairoit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Sat Apr 25 12:37:00 2009 From: ramons at gmx.net (David Krings) Date: Sat, 25 Apr 2009 12:37:00 -0400 Subject: [nycphp-talk] Website quotation In-Reply-To: References: Message-ID: <49F33C2C.3080708@gmx.net> Mona Borham wrote: > Hey there, > > How to make a website(project) quotation? Uhm..can you be more unclear? David From ben at projectskyline.com Sat Apr 25 12:56:18 2009 From: ben at projectskyline.com (Ben Sgro) Date: Sat, 25 Apr 2009 12:56:18 -0400 Subject: [nycphp-talk] Website quotation In-Reply-To: <49F33C2C.3080708@gmx.net> References: <49F33C2C.3080708@gmx.net> Message-ID: <49F340B2.1050705@projectskyline.com> http://lmgtfy.com/?q=How+to+make+a+website(project)+quotation David Krings wrote: > Mona Borham wrote: >> Hey there, >> >> How to make a website(project) quotation? > > Uhm..can you be more unclear? > > David > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From monalisa20042006 at gmail.com Sat Apr 25 13:10:46 2009 From: monalisa20042006 at gmail.com (Mona Borham) Date: Sat, 25 Apr 2009 20:10:46 +0300 Subject: [nycphp-talk] Website quotation In-Reply-To: <49F33C2C.3080708@gmx.net> References: <49F33C2C.3080708@gmx.net> Message-ID: A customer asked for a project quotation while we are making the deal (for accurate quotation) and thanks Mr David I did it before and it didn't return me any good results. And I found now that Microsoft dynamics AX do this and I decided to give it a try. Thank you all for your interest Regards; Mona Adel Web Developer Develpoment Department CairoIT Solutions Team Egypt-Mansoura Branch E-mail:mona_adel at cairoit.com Website: www.cairoit.com On Sat, Apr 25, 2009 at 7:37 PM, David Krings wrote: > Mona Borham wrote: > >> Hey there, >> >> How to make a website(project) quotation? >> > > Uhm..can you be more unclear? > > David > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Sat Apr 25 15:11:51 2009 From: ramons at gmx.net (David Krings) Date: Sat, 25 Apr 2009 15:11:51 -0400 Subject: [nycphp-talk] Website quotation In-Reply-To: <49F340B2.1050705@projectskyline.com> References: <49F33C2C.3080708@gmx.net> <49F340B2.1050705@projectskyline.com> Message-ID: <49F36077.5070108@gmx.net> Ben Sgro wrote: > http://lmgtfy.com/?q=How+to+make+a+website(project)+quotation Thanks, point taken, but wouldn't one need some more info to give a reasonable response other than RTFM...or lmgtfy. I guess the issue is resolved by now. Keep in mind, I am German and need context, not just bullet points. ;) David From ben at projectskyline.com Sat Apr 25 15:43:51 2009 From: ben at projectskyline.com (Ben Sgro) Date: Sat, 25 Apr 2009 15:43:51 -0400 Subject: [nycphp-talk] Website quotation In-Reply-To: <49F36077.5070108@gmx.net> References: <49F33C2C.3080708@gmx.net> <49F340B2.1050705@projectskyline.com> <49F36077.5070108@gmx.net> Message-ID: <49F367F7.8000404@projectskyline.com> Hey David, Heh, of course - that was for the original poster - just having fun. - Ben David Krings wrote: > Ben Sgro wrote: >> http://lmgtfy.com/?q=How+to+make+a+website(project)+quotation > > Thanks, point taken, but wouldn't one need some more info to give a > reasonable response other than RTFM...or lmgtfy. I guess the issue is > resolved by now. Keep in mind, I am German and need context, not just > bullet points. ;) > > David > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From nhart at partsauthority.com Mon Apr 27 14:25:45 2009 From: nhart at partsauthority.com (Nicholas Hart) Date: Mon, 27 Apr 2009 14:25:45 -0400 Subject: [nycphp-talk] zend framework..multi forms. Message-ID: <3719ecad0904271125o63276eadyee5e7c99ea6a6b1c@mail.gmail.com> Thanks for the responses. I am looking at Zend Framework since it supports i5/OS. But what I really want is to easily handle multiple forms on one page. Any examples of this would be much appreciated. BTW Hans, I have posted to the zendframework forum but I think I'm the only one there. Thanks. Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Mon Apr 27 14:38:55 2009 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 27 Apr 2009 14:38:55 -0400 Subject: [nycphp-talk] Facebook's LAMP Stack In-Reply-To: <865a7acf0904231847w682e79ccgb7fa599de36acea1@mail.gmail.com> References: <086401c9baeb$254cc980$6fe65c80$@com> <865a7acf0904221441k62da9f17wf2b4a7b6ab4d0277@mail.gmail.com> <021901c9c433$b4569880$1d03c980$@com> <865a7acf0904231847w682e79ccgb7fa599de36acea1@mail.gmail.com> Message-ID: <02dd01c9c767$6ba2cc80$42e86580$@com> > > What I'd really like is a way to "statically link" a PHP application. While > > this is somewhat possible today, PHP's dynamic nature makes this difficult > > to fully realize. For example, it can be cumbersome on the developer to > > check in multiple places if APC is available, what files are cached, what > > should be included, etc. > > Hans, can you give more detail what you mean by statically link a PHP > application and how it's possible to do it? I'm interested in hearing > about that. Well, honestly, I'm not 100% sure either :) It's not an easily solvable problem. >From the Facebook talk, and other comments I've heard in general, PHP's highly dynamic nature is a good thing and a bad thing. While flexible, there is the overhead, both from a I/O perspective and from a internals perspective. As applications become large, as the gentlemen from Facebook pointed out, it gets increasingly difficult to manage and optimize all those PHP files. I suppose fundamentally, each PHP source file is its own program in a sense. It could be executed (with whatever result) as its own script, ie, the classic .php vs .inc problem in the document root. As a result, it's the responsibility of the programmer - or framework in some cases - to ensure these code files are put together in the correct way - and for EVERY request. This is tedious. The flip side, of course, is a compiled language, where this assembly of the program is done beforehand. It seems as though (and again, this is very ballpark), that some happy medium could be done. For example, let's look at a APC use case. -- the first request of an application is performed after a server restart -- the APC cache is empty, so the application realizes this and requires/includes files as needed to fulfill the request -- in a well written application, there will always be some of the same set of assembly required -- on subsequent requests, this assembly, however, is still always performed. Granted, it's improved because the source files are being read from memory and cached, but the legwork is there still. What might be useful, would be the ability to store the block of cached code as a single entity - let's call it a "library" for example. Upon subsequent requests, the application would already have this core already available with a single "link" statement, rather than having to do the legwork each time of assembling all the blocks. Perhaps, afterall, it's more of a dynamic link model? :) Hopefully, though, this makes some sense. At the end of the day, as applications get larger and more complex, there's always a common set of code that's needed. While some things in the PHP world have attempted to help manage this, I guess it comes down to - maybe compiling PHP isn't such a bad thing :) H From lists at zaunere.com Mon Apr 27 14:40:25 2009 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 27 Apr 2009 14:40:25 -0400 Subject: [nycphp-talk] PHP hosting and standard tool-chain for newbie? In-Reply-To: <20090425051316.GA3938@panix.com> References: <002c01c9c456$278af720$76a0e560$@com> <721f1cc50904241337x2feb29e6p911649c1e0cadf55@mail.gmail.com> <20090425051316.GA3938@panix.com> Message-ID: <02e401c9c767$a10184c0$e3048e40$@com> > > The Protype vs JQuery debate strikes me as religious. Both are class acts, > > take your pick. > > The fact that JQuery doesn't have JSON encoding/decoding built in makes > me think Prototype has their act together a bit more. For what it's worth, I'm a YUI fan. http://developer.yahoo.com/yui/ There's a learning curve, no doubt, but they've got the active development and software engineering team to keep it on the right track, IMHO. H From lists at nopersonal.info Mon Apr 27 16:51:45 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Mon, 27 Apr 2009 16:51:45 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? Message-ID: <49F61AE1.2080708@nopersonal.info> Hi everyone, I've been making steady (if slow) progress with my understanding of PHP/MySQL, but now that I'm finally starting to do more complex things, I find that I really need to figure out a consistent naming convention & coding style. I've read several articles on the subject and they all seem to be different. Is there a de facto professional standard, or is it just whatever you personally prefer (provided that you're not part of a larger team with specific guidelines)? So far I'm doing the following: -Functions are all lower case, no numbers, underscores used to separate words -Variables (same as functions--should they be different?) -Constants and MySQL reserved words & functions are all upper case -Classes... I'm not that advanced yet! -Plenty of comments to help me remember what the code was for -Tabs for indentation -No echoing HTML code except where moving between it and PHP is too messy -Stick with single quotes for string literals where there are no variable substitutions and/or where there ARE variable substitutions, but where using double quotes would necessitate lots of escaping Two things I've read about that I don't do are 1.) put spaces before & after the string concatenator, and 2.) keep my opening/closing braces on their own lines. //I find it much easier to read: if ($foo == '') { echo '

'.$message.'

'; } else { echo '

'.$message.'

'; } //Than: if ($foo == '') { echo '

' . $message . '

'; } else { echo '

' . $message . '

'; } Are any of the things I'm doing/not doing a major no-no? It's not too late for me to unlearn bad habits, so I'd really appreciate any advice you could give. Thanks, Bev From ant92083 at gmail.com Mon Apr 27 16:58:13 2009 From: ant92083 at gmail.com (Anthony Wlodarski) Date: Mon, 27 Apr 2009 16:58:13 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <49F61AE1.2080708@nopersonal.info> References: <49F61AE1.2080708@nopersonal.info> Message-ID: <43bc541c0904271358i29f5338mbbbea7b6f81a40d7@mail.gmail.com> I think this is more of a comfort issue then an issue with standards. If you work for a company that you would fall back to the company's best practice's. If you are doing freelance/consulting work then you fallback to your own CONSISTENT practices. I emphasize consistent because when you open up a file in VIM that was edited with tabs one week vs. two spaces for indents another week it becomes a real nightmare. -Anthony On Mon, Apr 27, 2009 at 4:51 PM, lists at nopersonal.info < lists at nopersonal.info> wrote: > Hi everyone, > > I've been making steady (if slow) progress with my understanding of > PHP/MySQL, but now that I'm finally starting to do more complex things, > I find that I really need to figure out a consistent naming convention & > coding style. I've read several articles on the subject and they all > seem to be different. > > Is there a de facto professional standard, or is it just whatever you > personally prefer (provided that you're not part of a larger team with > specific guidelines)? So far I'm doing the following: > > -Functions are all lower case, no numbers, underscores used to separate > words > -Variables (same as functions--should they be different?) > -Constants and MySQL reserved words & functions are all upper case > -Classes... I'm not that advanced yet! > -Plenty of comments to help me remember what the code was for > -Tabs for indentation > -No echoing HTML code except where moving between it and PHP is too messy > -Stick with single quotes for string literals where there are no > variable substitutions and/or where there ARE variable substitutions, > but where using double quotes would necessitate lots of escaping > > Two things I've read about that I don't do are 1.) put spaces before & > after the string concatenator, and 2.) keep my opening/closing braces on > their own lines. > > > //I find it much easier to read: > > if ($foo == '') { > echo '

'.$message.'

'; > } else { > echo '

'.$message.'

'; > } > > //Than: > > if ($foo == '') > { > echo '

' . $message . '

'; > } > else > { > echo '

' . $message . '

'; > } > > Are any of the things I'm doing/not doing a major no-no? It's not too > late for me to unlearn bad habits, so I'd really appreciate any advice > you could give. > > Thanks, > > Bev > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Anthony W. ant92083 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at nopersonal.info Mon Apr 27 17:29:38 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Mon, 27 Apr 2009 17:29:38 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <43bc541c0904271358i29f5338mbbbea7b6f81a40d7@mail.gmail.com> References: <49F61AE1.2080708@nopersonal.info> <43bc541c0904271358i29f5338mbbbea7b6f81a40d7@mail.gmail.com> Message-ID: <49F623C2.4070807@nopersonal.info> Anthony Wlodarski wrote: > I emphasize consistent because when you open up a file in VIM that was > edited with tabs one week vs. two spaces for indents another week it > becomes a real nightmare. Point well taken. Thanks. Bev From justin at justinhileman.info Mon Apr 27 18:00:08 2009 From: justin at justinhileman.info (Justin Hileman) Date: Mon, 27 Apr 2009 18:00:08 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <49F61AE1.2080708@nopersonal.info> References: <49F61AE1.2080708@nopersonal.info> Message-ID: <49F62AE8.1040600@justinhileman.info> lists at nopersonal.info wrote: > I've been making steady (if slow) progress with my understanding of > PHP/MySQL, but now that I'm finally starting to do more complex things, > I find that I really need to figure out a consistent naming convention& > coding style. I've read several articles on the subject and they all > seem to be different. > For your own work, find one that works for you and stick with it. If you're looking for suggestions, I tend to use a modified PEAR coding style--with a just a handful of exceptions where they got stupid--when I write PHP. It's a lot like K&R/1TBS, so it's comfortable to me... And it helps that several of the projects I work on have compatible coding standards. See: http://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS http://pear.php.net/manual/en/standards.php http://drupal.org/coding-standards http://zoopframework.com/docs/coding-standard -- justin http://justinhileman.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Mon Apr 27 18:45:55 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 27 Apr 2009 18:45:55 -0400 (EDT) Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <43bc541c0904271358i29f5338mbbbea7b6f81a40d7@mail.gmail.com> Message-ID: On Mon, 27 Apr 2009, Anthony Wlodarski wrote: > I think this is more of a comfort issue then an issue with standards. If > you work for a company that you would fall back to the company's best > practice's. Often if you're using a framework, you might have to use the framework's naming conventions. Apart from that, stick with consistently with whatever you're comfortable with. -- Aj. From ramons at gmx.net Mon Apr 27 19:07:33 2009 From: ramons at gmx.net (David Krings) Date: Mon, 27 Apr 2009 19:07:33 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <49F61AE1.2080708@nopersonal.info> References: <49F61AE1.2080708@nopersonal.info> Message-ID: <49F63AB5.5060700@gmx.net> lists at nopersonal.info wrote: > Hi everyone, > > I've been making steady (if slow) progress with my understanding of > PHP/MySQL, but now that I'm finally starting to do more complex things, > I find that I really need to figure out a consistent naming convention & > coding style. I've read several articles on the subject and they all > seem to be different. Because in that regards, if you ask five people you will get seven opinions. Just watch the responses. ;) It is good that you realized that and took action. That is the biggest step forward. > Is there a de facto professional standard, or is it just whatever you > personally prefer (provided that you're not part of a larger team with Not that I know of, unless you are in a particular camp. That means the DotNet folks use the Microsoft bible of coding and often enough violate their own rules. > specific guidelines)? So far I'm doing the following: > > -Functions are all lower case, no numbers, underscores used to separate > words Some use CaMeLcAsE for that, the point is the same, pick what you can read better. > -Variables (same as functions--should they be different?) Yep, I'd handle them the same way. As important is that you give them meaningful names. I once had a coworker who used his first and last name as variable names for everything. He'd even write code to change the type from string to integer. Don't do crap like that. Modern IDEs have autocomplete/intellisense and there is really no reason to be that self-centered. Also, I find a $counter to be way clearer than a $i, although the $i, $j, $k, $l ... approach is very common. > -Constants and MySQL reserved words & functions are all upper case With MySQL reserved words you mean SQL? Yep, I do the same. > -Classes... I'm not that advanced yet! Same here...also applies to objects. I do use some for handling zip files, but that is limited to copying sample code. > -Plenty of comments to help me remember what the code was for Exactly! What I do is write the comments first and ideally do it as detailed as possible. Then I fill in the code, which for me is the easiest way. > -Tabs for indentation Yep! > -No echoing HTML code except where moving between it and PHP is too messy See, here I differ, but that is just me. I rather echo HTML than deal with the opening and closing tags, which I find confusing in a sense that I have a tought time finding where PHP is and where HTML is. Again, this is purely personal preference and if you are OK with the way you do it, stick with it, it is faster. Also, keep in mind that you should separate display from process. So first do all the PHP magic and stick everything ready to go into variables, then make a big line and below that start the output. On very rare occasions I had to divert from that, but I am sure that is simply because I'm inexperienced and that there is a better way. > -Stick with single quotes for string literals where there are no > variable substitutions and/or where there ARE variable substitutions, > but where using double quotes would necessitate lots of escaping Uhhh, you may want to dig through the archives of this list. Some time ago we had a very passionate discussion about it and if I recall correctly, everyone was right a bit and wrong a little. > Two things I've read about that I don't do are 1.) put spaces before & > after the string concatenator, Same here, after all, it is a concatenation, so why throw spaces in there. and 2.) keep my opening/closing braces on > their own lines. I do it the same way, but I can see that it adds more white space and thus makes things easier to read. It also separates "code" lines from "control characters", if you know what I mean. Again, do what works best for you, the PHP interpretor doesn't care either way. > > //I find it much easier to read: > > if ($foo == '') { > echo '

'.$message.'

'; > } else { > echo '

'.$message.'

'; > } > > //Than: > > if ($foo == '') > { > echo '

' . $message . '

'; > } > else > { > echo '

' . $message . '

'; > } > > Are any of the things I'm doing/not doing a major no-no? It's not too I know it is just an example, but I'd double or triple the commentary in the code above. A one liner may be OK for you, but others will appreciate the detail and what is clear to you today may not be that clear in six months from now. > late for me to unlearn bad habits, so I'd really appreciate any advice > you could give. I think with writing this all up you did yourself the best favor. Now stick to your own coding guidelines and add lots of commentary. Again, modern IDEs help out with that, because you can craft templates for if..else or switch statements or new files and already have the basic commentary lines in place. You are definitely on the right track. David From edwardpotter at gmail.com Mon Apr 27 19:56:00 2009 From: edwardpotter at gmail.com (Edward Potter) Date: Mon, 27 Apr 2009 19:56:00 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <49F63AB5.5060700@gmx.net> References: <49F61AE1.2080708@nopersonal.info> <49F63AB5.5060700@gmx.net> Message-ID: Suggest pear style for your code. I stick with Ruby'ish style for naming my sql stuff. table : locations field: location Sticking with something that simple can save you DAYS of headaches~! seems to work out well. On Mon, Apr 27, 2009 at 7:07 PM, David Krings wrote: > lists at nopersonal.info wrote: > >> Hi everyone, >> >> I've been making steady (if slow) progress with my understanding of >> PHP/MySQL, but now that I'm finally starting to do more complex things, >> I find that I really need to figure out a consistent naming convention & >> coding style. I've read several articles on the subject and they all >> seem to be different. >> > > Because in that regards, if you ask five people you will get seven > opinions. Just watch the responses. ;) > It is good that you realized that and took action. That is the biggest step > forward. > > Is there a de facto professional standard, or is it just whatever you >> personally prefer (provided that you're not part of a larger team with >> > > Not that I know of, unless you are in a particular camp. That means the > DotNet folks use the Microsoft bible of coding and often enough violate > their own rules. > > specific guidelines)? So far I'm doing the following: >> >> -Functions are all lower case, no numbers, underscores used to separate >> words >> > Some use CaMeLcAsE for that, the point is the same, pick what you can read > better. > > -Variables (same as functions--should they be different?) >> > Yep, I'd handle them the same way. As important is that you give them > meaningful names. I once had a coworker who used his first and last name as > variable names for everything. He'd even write code to change the type from > string to integer. Don't do crap like that. Modern IDEs have > autocomplete/intellisense and there is really no reason to be that > self-centered. Also, I find a $counter to be way clearer than a $i, although > the $i, $j, $k, $l ... approach is very common. > > -Constants and MySQL reserved words & functions are all upper case >> > With MySQL reserved words you mean SQL? Yep, I do the same. > > -Classes... I'm not that advanced yet! >> > Same here...also applies to objects. I do use some for handling zip files, > but that is limited to copying sample code. > > -Plenty of comments to help me remember what the code was for >> > Exactly! What I do is write the comments first and ideally do it as > detailed as possible. Then I fill in the code, which for me is the easiest > way. > > -Tabs for indentation >> > Yep! > > -No echoing HTML code except where moving between it and PHP is too messy >> > See, here I differ, but that is just me. I rather echo HTML than deal with > the opening and closing tags, which I find confusing in a sense that I have > a tought time finding where PHP is and where HTML is. Again, this is purely > personal preference and if you are OK with the way you do it, stick with it, > it is faster. > Also, keep in mind that you should separate display from process. So first > do all the PHP magic and stick everything ready to go into variables, then > make a big line and below that start the output. On very rare occasions I > had to divert from that, but I am sure that is simply because I'm > inexperienced and that there is a better way. > > > -Stick with single quotes for string literals where there are no >> variable substitutions and/or where there ARE variable substitutions, >> but where using double quotes would necessitate lots of escaping >> > > Uhhh, you may want to dig through the archives of this list. Some time ago > we had a very passionate discussion about it and if I recall correctly, > everyone was right a bit and wrong a little. > > > Two things I've read about that I don't do are 1.) put spaces before & >> after the string concatenator, >> > Same here, after all, it is a concatenation, so why throw spaces in there. > > and 2.) keep my opening/closing braces on > >> their own lines. >> > I do it the same way, but I can see that it adds more white space and thus > makes things easier to read. It also separates "code" lines from "control > characters", if you know what I mean. Again, do what works best for you, the > PHP interpretor doesn't care either way. > > >> //I find it much easier to read: >> >> if ($foo == '') { >> echo '

'.$message.'

'; >> } else { >> echo '

'.$message.'

'; >> } >> >> //Than: >> >> if ($foo == '') >> { >> echo '

' . $message . '

'; >> } >> else >> { >> echo '

' . $message . '

'; >> } >> >> Are any of the things I'm doing/not doing a major no-no? It's not too >> > > I know it is just an example, but I'd double or triple the commentary in > the code above. A one liner may be OK for you, but others will appreciate > the detail and what is clear to you today may not be that clear in six > months from now. > > late for me to unlearn bad habits, so I'd really appreciate any advice >> you could give. >> > > I think with writing this all up you did yourself the best favor. Now stick > to your own coding guidelines and add lots of commentary. Again, modern IDEs > help out with that, because you can craft templates for if..else or switch > statements or new files and already have the basic commentary lines in > place. You are definitely on the right track. > > David > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Mon Apr 27 20:00:03 2009 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 27 Apr 2009 20:00:03 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: References: <49F61AE1.2080708@nopersonal.info> <49F63AB5.5060700@gmx.net> Message-ID: <49F64703.3050802@phpwerx.net> Edward Potter wrote: > Suggest pear style for your code. I stick with Ruby'ish style for naming my > sql stuff. > > table : locations > field: location Plural-names for tables are a pain... field: person table: ??? Is it persons or people or something else? Dan From danielc at analysisandsolutions.com Mon Apr 27 21:34:04 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 27 Apr 2009 21:34:04 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <49F64703.3050802@phpwerx.net> References: <49F61AE1.2080708@nopersonal.info> <49F63AB5.5060700@gmx.net> <49F64703.3050802@phpwerx.net> Message-ID: <20090428013404.GA13362@panix.com> On Mon, Apr 27, 2009 at 08:00:03PM -0400, Dan Cech wrote: > > Plural-names for tables are a pain... > > field: person > table: ??? > > Is it persons or people or something else? Yep. Plus it makes consistency very easy and makes life easier by allowing the use of USING. person ------ person_id first_name last_name company_id ... company ------- company_id company_name ... etc --Another 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 ka at kacomputerconsulting.com Mon Apr 27 21:55:15 2009 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Mon, 27 Apr 2009 18:55:15 -0700 Subject: [nycphp-talk] Best practices for naming conventions & coding style? Message-ID: <1240883715.29216@coral.he.net> Very interesting topic. My thoughts. Name functions and variables meaningfully so that you enhance readability. Don't be afraid of "too long" names, within reason. Indenting is important but not worth going insane over. Camelcase leads to frustrating typing errors and is just silly in most cases. Use all lower, or even underscores are less annoying. But be consistent. Or try to be. Lastly anyone who tries to impose THEIR conventions on you is to be ignored. This is all about you, and what widget YOU think is easiest to use. Worrying about where to put a curly bracket is not worth it -- put it where you like it! As long as the code works you are golden. Happy coding!! :) Kristina > lists at nopersonal.info wrote: > > Hi everyone, > > > > I've been making steady (if slow) progress with my understanding of > > PHP/MySQL, but now that I'm finally starting to do more complex things, > > I find that I really need to figure out a consistent naming convention & > > coding style. I've read several articles on the subject and they all > > seem to be different. > > Because in that regards, if you ask five people you will get seven opinions. > Just watch the responses. ;) > It is good that you realized that and took action. That is the biggest step > forward. > > > Is there a de facto professional standard, or is it just whatever you > > personally prefer (provided that you're not part of a larger team with > > Not that I know of, unless you are in a particular camp. That means the DotNet > folks use the Microsoft bible of coding and often enough violate their own rules. > > > specific guidelines)? So far I'm doing the following: > > > > -Functions are all lower case, no numbers, underscores used to separate > > words > Some use CaMeLcAsE for that, the point is the same, pick what you can read better. > > > -Variables (same as functions--should they be different?) > Yep, I'd handle them the same way. As important is that you give them > meaningful names. I once had a coworker who used his first and last name as > variable names for everything. He'd even write code to change the type from > string to integer. Don't do crap like that. Modern IDEs have > autocomplete/intellisense and there is really no reason to be that > self-centered. Also, I find a $counter to be way clearer than a $i, although > the $i, $j, $k, $l ... approach is very common. > > > -Constants and MySQL reserved words & functions are all upper case > With MySQL reserved words you mean SQL? Yep, I do the same. > > > -Classes... I'm not that advanced yet! > Same here...also applies to objects. I do use some for handling zip files, but > that is limited to copying sample code. > > > -Plenty of comments to help me remember what the code was for > Exactly! What I do is write the comments first and ideally do it as detailed > as possible. Then I fill in the code, which for me is the easiest way. > > > -Tabs for indentation > Yep! > > > -No echoing HTML code except where moving between it and PHP is too messy > See, here I differ, but that is just me. I rather echo HTML than deal with the > opening and closing tags, which I find confusing in a sense that I have a > tought time finding where PHP is and where HTML is. Again, this is purely > personal preference and if you are OK with the way you do it, stick with it, > it is faster. > Also, keep in mind that you should separate display from process. So first do > all the PHP magic and stick everything ready to go into variables, then make a > big line and below that start the output. On very rare occasions I had to > divert from that, but I am sure that is simply because I'm inexperienced and > that there is a better way. > > > > -Stick with single quotes for string literals where there are no > > variable substitutions and/or where there ARE variable substitutions, > > but where using double quotes would necessitate lots of escaping > > Uhhh, you may want to dig through the archives of this list. Some time ago we > had a very passionate discussion about it and if I recall correctly, everyone > was right a bit and wrong a little. > > > > Two things I've read about that I don't do are 1.) put spaces before & > > after the string concatenator, > Same here, after all, it is a concatenation, so why throw spaces in there. > > and 2.) keep my opening/closing braces on > > their own lines. > I do it the same way, but I can see that it adds more white space and thus > makes things easier to read. It also separates "code" lines from "control > characters", if you know what I mean. Again, do what works best for you, the > PHP interpretor doesn't care either way. > > > > > //I find it much easier to read: > > > > if ($foo == '') { > > echo '

'.$message.'

'; > > } else { > > echo '

'.$message.'

'; > > } > > > > //Than: > > > > if ($foo == '') > > { > > echo '

' . $message . '

'; > > } > > else > > { > > echo '

' . $message . '

'; > > } > > > > Are any of the things I'm doing/not doing a major no-no? It's not too > > I know it is just an example, but I'd double or triple the commentary in the > code above. A one liner may be OK for you, but others will appreciate the > detail and what is clear to you today may not be that clear in six months from > now. > > > late for me to unlearn bad habits, so I'd really appreciate any advice > > you could give. > > I think with writing this all up you did yourself the best favor. Now stick to > your own coding guidelines and add lots of commentary. Again, modern IDEs help > out with that, because you can craft templates for if..else or switch > statements or new files and already have the basic commentary lines in place. > You are definitely on the right track. > > David > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > ------------------- Kristina D. H. Anderson PHP Application Developer "Building a Better Tomorrow, One Line of Code at a Time" 347 254 2810 From justin at justinhileman.info Mon Apr 27 22:06:43 2009 From: justin at justinhileman.info (Justin Hileman) Date: Mon, 27 Apr 2009 22:06:43 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <1240883715.29216@coral.he.net> References: <1240883715.29216@coral.he.net> Message-ID: <49F664B3.5050308@justinhileman.info> Kristina Anderson wrote: > Lastly anyone who tries to impose THEIR conventions on you is to be ignored. This is all > about you, and what widget YOU think is easiest to use. Worrying about where to put a > curly bracket is not worth it -- put it where you like it! As long as the code works you are > golden. > Absolutely right. Ignore everyone who tries to impose their conventions on you... Unless, of course, they're telling you to use the One True Brace Style :) -- justin http://justinhileman.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Mon Apr 27 22:12:18 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 27 Apr 2009 22:12:18 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <1240883715.29216@coral.he.net> References: <1240883715.29216@coral.he.net> Message-ID: <20090428021218.GA29653@panix.com> On Mon, Apr 27, 2009 at 06:55:15PM -0700, Kristina Anderson wrote: > > Lastly anyone who tries to impose THEIR conventions on you is to be > ignored. If you're working on your own, sure. But if you're on a team, then everyone on the team needs to follow the same convention. --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 edwardpotter at gmail.com Mon Apr 27 22:18:42 2009 From: edwardpotter at gmail.com (Edward Potter) Date: Mon, 27 Apr 2009 22:18:42 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <20090428013404.GA13362@panix.com> References: <49F61AE1.2080708@nopersonal.info> <49F63AB5.5060700@gmx.net> <49F64703.3050802@phpwerx.net> <20090428013404.GA13362@panix.com> Message-ID: person ------ person_id first_name last_name company_id company ------- company_id company_name OR >>> employees -------------- id firstname <= generally for my field names I'll link words with _, just firstname and lastname I concatenate. lastname company_id companies ------------- id company ;-) On Mon, Apr 27, 2009 at 9:34 PM, Daniel Convissor < danielc at analysisandsolutions.com> wrote: > On Mon, Apr 27, 2009 at 08:00:03PM -0400, Dan Cech wrote: > > > > Plural-names for tables are a pain... > > > > field: person > > table: ??? > > > > Is it persons or people or something else? > > Yep. Plus it makes consistency very easy and makes life easier by > allowing the use of USING. > > person > ------ > person_id > first_name > last_name > company_id > ... > > company > ------- > company_id > company_name > ... > > > etc > > --Another 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 User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From michaelforte at hotmail.com Tue Apr 28 00:16:15 2009 From: michaelforte at hotmail.com (Michael J. Forte) Date: Tue, 28 Apr 2009 00:16:15 -0400 Subject: [nycphp-talk] WAMP (minus the M) forking question - also open to other ideas Message-ID: An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Tue Apr 28 00:42:08 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Tue, 28 Apr 2009 00:42:08 -0400 Subject: [nycphp-talk] WAMP (minus the M) forking question - also open to other ideas In-Reply-To: References: Message-ID: <8f0676b40904272142m405a8c15l84774039291c4726@mail.gmail.com> A quick google search for "windows run process in background" yielded: "In case anyone has this problem in future, I finally found out the solution. The START command in Windows command line allows you to start another command window running any command; and the /B option can start the command without the extra command window, so you get similar behavior to Unix's background processes. Look it up for more details." I don't use windows, but I trigger background processes with and "&" in *nix, and it looks like windows offers the same functionality with "start /b" regards, John Campbell On Tue, Apr 28, 2009 at 12:16 AM, Michael J. Forte wrote: > Hi experienced and talented community of which I have been trolling for a > few years! > > I have a question for all of you and I hope this makes sense. > > First, the background. I am coding a PHP Web application that has to call a > external program, however, because only one instance of the program can be > ran at a time I need to implement a queue. In addition, it is important the > users need to not wait (keep the browser open) for their job to process. The > script will send them an e-mail with a link after their job completes. This > means I need something to persistently run whenever there is something in > the queue. In summary: front end script calls secondary child which runs > until queue is empty by calling external program. > > My problem is, I cannot figure out how to properly fork under Windows, > allowing the parent script to run to completion, and not hang the browser > waiting for the child to complete. I am at the point where I can spawn the > child and it will run even when the parent browser is closed but will not > release the parent script until it completes. I have tried exec(), system(), > shell_exec(), popen(), and a COM call (which I might have done wrong). Each > of those called php -f childScript.php. > > I thought about a few other alternatives: > > 1. Use a scheduled task to check for a queue at a set interval. This is the > least desired solution as it could cause unwanted delay. > 2. Write a PHP daemon/Win32 service to monitor a queue of which could be > queried and started if needed by parent script and it would run until the > queue is empty at which time it would shutdown. > 3. Write a Perl script to be called by the parent which would fork and call > the secondary PHP script, subsequently terminating and releasing the parent > PHP script. > > In summary: > > - WAMP environment, cannot use Linux as external program is Windows only > (BUMMER!) > - Need a queue to handle calls to an external program, currently stored in a > flat file > - Parent script needs to fork to a child script which can run independent of > the parent until queue is empty > - Parent script needs to be able to complete prior to child completing > - Because of time required to run a job and because of the potential for > many users, users need to be able to submit'n'run. > > Do any of you PHP gods (and goddesses!) have any thoughts on how to fork > under Windows, how to handle this situation, or alternatives? Should I be > using some other language? Perl, AJAX, other? > > Google (or my search string) was less than helpful. > > -- > Thank you, > Michael J. Forte > Web Designer, WR Web Designs > Webmaster, Town of LaFayette > Software Engineer, IBM > > Education: Clarkson University Alum (2005) :: Resume > E-mail: michaelforte at hotmail.com > > "Often those who work the hardest are the luckiest..." > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From danielc at analysisandsolutions.com Tue Apr 28 08:54:36 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 28 Apr 2009 08:54:36 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: References: <49F61AE1.2080708@nopersonal.info> <49F63AB5.5060700@gmx.net> <49F64703.3050802@phpwerx.net> <20090428013404.GA13362@panix.com> Message-ID: <20090428125436.GA19583@panix.com> On Mon, Apr 27, 2009 at 10:18:42PM -0400, Edward Potter wrote: > > employees > -------------- > id > firstname <= generally for my field names I'll link words with _, just > firstname and lastname I concatenate. > lastname > company_id > > > companies > ------------- > id > company But in that scheme, in order to join tables, you have to use an ON syntax JOIN companies ON (companies.id = employees.company_id) rather than the more elegant USING syntax JOIN companies USING (company_id) Plus it causes the use of different words for table vs field names, making it harder to guess/remember what a given identifier's name is and results in hacks when implementing automated schema tools. --Dan ... snip ... -- 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 edwardpotter at gmail.com Tue Apr 28 10:51:18 2009 From: edwardpotter at gmail.com (Edward Potter) Date: Tue, 28 Apr 2009 10:51:18 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <20090428125436.GA19583@panix.com> References: <49F61AE1.2080708@nopersonal.info> <49F63AB5.5060700@gmx.net> <49F64703.3050802@phpwerx.net> <20090428013404.GA13362@panix.com> <20090428125436.GA19583@panix.com> Message-ID: I just kind of like: delete from companies where id = 1; I think this is more of a rails syntax. just so zen simple! but everyone comes up with their best naming. we are all different, as long as it's consistent. I never use person as a field name. Leads to confusion. I think you can be a bit more specific then that. I look at source code for naming conventions, how does mediawiki do it (wikipedia)? pear things, oracle code. CSS for major sites (NYTs), etc. Yes, even google, but they are a bit looser in naming conventions, which may be ok. too rigid and u can shoot yourself. I'm really an ObjC guy (iPhone), where u really have monster long names, a smalltalk feature grafted onto c++. :-) On Tue, Apr 28, 2009 at 8:54 AM, Daniel Convissor < danielc at analysisandsolutions.com> wrote: > On Mon, Apr 27, 2009 at 10:18:42PM -0400, Edward Potter wrote: > > > > employees > > -------------- > > id > > firstname <= generally for my field names I'll link words with _, just > > firstname and lastname I concatenate. > > lastname > > company_id > > > > > > companies > > ------------- > > id > > company > > But in that scheme, in order to join tables, you have to use an ON syntax > JOIN companies ON (companies.id = employees.company_id) > rather than the more elegant USING syntax > JOIN companies USING (company_id) > > Plus it causes the use of different words for table vs field names, > making it harder to guess/remember what a given identifier's name is and > results in hacks when implementing automated schema tools. > > --Dan > > ... snip ... > > -- > 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 User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at nopersonal.info Tue Apr 28 10:59:20 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 28 Apr 2009 10:59:20 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: References: Message-ID: <49F719C8.4010504@nopersonal.info> Ajai Khattri wrote: > Often if you're using a framework, you might have to use the framework's > naming conventions. > I wasn't aware of that?thanks for the heads-up. Bev From lists at nopersonal.info Tue Apr 28 11:01:37 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 28 Apr 2009 11:01:37 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <49F62AE8.1040600@justinhileman.info> References: <49F61AE1.2080708@nopersonal.info> <49F62AE8.1040600@justinhileman.info> Message-ID: <49F71A51.40306@nopersonal.info> Justin Hileman wrote: > If you're looking for suggestions, I tend to use a modified PEAR > coding style--with a just a handful of exceptions where they got > stupid--when I write PHP. It's a lot like K&R/1TBS, so it's > comfortable to me... And it helps that several of the projects I work > on have compatible coding standards. > > See: > > http://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS > http://pear.php.net/manual/en/standards.php > http://drupal.org/coding-standards > http://zoopframework.com/docs/coding-standard > I'll take a look at those, thanks. Bev From ajai at bitblit.net Tue Apr 28 11:31:03 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Apr 2009 11:31:03 -0400 (EDT) Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: Message-ID: On Tue, 28 Apr 2009, Edward Potter wrote: > I'm really an ObjC guy (iPhone), where u really have monster long names, a > smalltalk feature grafted onto c++. Yeah, ObjC is just one step away from obfuscated Perl :-) -- Aj. From ajai at bitblit.net Tue Apr 28 11:35:06 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Apr 2009 11:35:06 -0400 (EDT) Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <1240883715.29216@coral.he.net> Message-ID: On Mon, 27 Apr 2009, Kristina Anderson wrote: > Lastly anyone who tries to impose THEIR conventions on you is to be ignored. This is all > about you, and what widget YOU think is easiest to use. Worrying about where to put a > curly bracket is not worth it -- put it where you like it! As long as the code works you are > golden. The only problem with this is when in a team and different members work on the same bits of code. Can you imagine a class written in two or three different bracing styles is like?! Your team HAS to agree on some standards and stick to them. Some of these might go against your own personal grain but such is the price of teamwork and consistent code. So no, a free-for-all is not always good advice. -- Aj. (who had to formulate team rules early on... :-) From oorza2k5 at gmail.com Tue Apr 28 11:54:17 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Tue, 28 Apr 2009 11:54:17 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: References: <1240883715.29216@coral.he.net> Message-ID: <68de37340904280854y19ebb041kdfbc1ce4d56f0943@mail.gmail.com> To be fair, despite the talk about what's best or what isn't, in the end it really doesn't matter what the code looks like, given two things. One, most importantly, it works (well). And two, it's consistent. It doesn't matter if your variables are named $like_this or $likeThis as long as it's one and not both :) On Tue, Apr 28, 2009 at 11:35 AM, Ajai Khattri wrote: > On Mon, 27 Apr 2009, Kristina Anderson wrote: > > > Lastly anyone who tries to impose THEIR conventions on you is to be > ignored. This is all > > about you, and what widget YOU think is easiest to use. Worrying about > where to put a > > curly bracket is not worth it -- put it where you like it! As long as > the code works you are > > golden. > > The only problem with this is when in a team and different members work on > the same bits of code. Can you imagine a class written in two or three > different bracing styles is like?! Your team HAS to agree on some > standards and stick to them. Some of these might go against your own > personal grain but such is the price of teamwork and consistent code. > > So no, a free-for-all is not always good advice. > > > > -- > Aj. (who had to formulate team rules early on... :-) > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Tue Apr 28 12:08:40 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Apr 2009 12:08:40 -0400 (EDT) Subject: [nycphp-talk] ORM that uses more advanced MySQL features Message-ID: Does anyone know of an ORM that can use views and stored procedures in MySQL? -- Aj. From guilhermeblanco at gmail.com Tue Apr 28 12:31:35 2009 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Tue, 28 Apr 2009 13:31:35 -0300 Subject: [nycphp-talk] ORM that uses more advanced MySQL features In-Reply-To: References: Message-ID: www.doctrine-project.org =) On Tue, Apr 28, 2009 at 1:08 PM, Ajai Khattri wrote: > > Does anyone know of an ORM that can use views and stored procedures in > MySQL? > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Paulo - SP/Brazil From marcelosaraujo at gmail.com Tue Apr 28 12:37:31 2009 From: marcelosaraujo at gmail.com (Marcelo Araujo) Date: Tue, 28 Apr 2009 13:37:31 -0300 Subject: [nycphp-talk] ORM that uses more advanced MySQL features In-Reply-To: References: Message-ID: <5947f2ab0904280937w1a09b5a5t8ad3871207b84183@mail.gmail.com> Since when, Guilherme? On Tue, Apr 28, 2009 at 1:31 PM, Guilherme Blanco wrote: > www.doctrine-project.org > > =) > > On Tue, Apr 28, 2009 at 1:08 PM, Ajai Khattri wrote: >> >> Does anyone know of an ORM that can use views and stored procedures in >> MySQL? > -- > Guilherme Blanco - Web Developer > CBC - Certified Bindows Consultant > Cell Phone: +55 (16) 9215-8480 > MSN: guilhermeblanco at hotmail.com > URL: http://blog.bisna.com > S?o Paulo - SP/Brazil > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php -- Marcelo Araujo Zend Certified Engineer http://www.crosi.com.br +55 34 9144 1472 From guilhermeblanco at gmail.com Tue Apr 28 12:46:39 2009 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Tue, 28 Apr 2009 13:46:39 -0300 Subject: [nycphp-talk] ORM that uses more advanced MySQL features In-Reply-To: <5947f2ab0904280937w1a09b5a5t8ad3871207b84183@mail.gmail.com> References: <5947f2ab0904280937w1a09b5a5t8ad3871207b84183@mail.gmail.com> Message-ID: Doctrine_View is able to handle views in any DBMS. Also, you can manually map the view if you want to work on updatable views, just like Oracle supports. Stored procedures works on the fly, just like a common function call. Doctrine does something like that: In case DQL can interpret it, apply the custom workarounds, otherwise, just bypass it to DBMS driver. If not enough, you can use Doctrine_RawSql to create your custom DBMS specific call, when DQL is not smart enough to handle the query (something like UNIONS or SELECT of a selected query table: SELECT * FROM (SELECT ...)) If you need more guidance on it, feel free to subscribe to doctrine-user or doctrine-dev mailing lists. We also have IRC channel at freenode #doctrine and a forum in the website. Finally... manual have been updated a lot recently. We're releasing a printed version in the next couple of weeks. Cheers, On Tue, Apr 28, 2009 at 1:37 PM, Marcelo Araujo wrote: > Since when, Guilherme? > > On Tue, Apr 28, 2009 at 1:31 PM, Guilherme Blanco > wrote: >> www.doctrine-project.org >> >> =) >> >> On Tue, Apr 28, 2009 at 1:08 PM, Ajai Khattri wrote: >>> >>> Does anyone know of an ORM that can use views and stored procedures in >>> MySQL? >> -- >> Guilherme Blanco - Web Developer >> CBC - Certified Bindows Consultant >> Cell Phone: +55 (16) 9215-8480 >> MSN: guilhermeblanco at hotmail.com >> URL: http://blog.bisna.com >> S?o Paulo - SP/Brazil >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > > > -- > Marcelo Araujo > Zend Certified Engineer > http://www.crosi.com.br > +55 34 9144 1472 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Paulo - SP/Brazil From lists at nopersonal.info Tue Apr 28 13:14:31 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 28 Apr 2009 13:14:31 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <49F63AB5.5060700@gmx.net> References: <49F61AE1.2080708@nopersonal.info> <49F63AB5.5060700@gmx.net> Message-ID: <49F73977.1020005@nopersonal.info> David Krings wrote: >> -Variables (same as functions--should they be different?) > Yep, I'd handle them the same way. As important is that you give them > meaningful names. I once had a coworker who used his first and last > name as variable names for everything. He'd even write code to change > the type from string to integer. Don't do crap like that. Modern IDEs > have autocomplete/intellisense and there is really no reason to be > that self-centered. Also, I find a $counter to be way clearer than a > $i, although the $i, $j, $k, $l ... approach is very common. Re your friend, yikes! I know what you mean about using $counter. I figured out that $i or $n stands for an integer, but it still throws me off sometimes when I see something like $l in someone's example code (below)... what is the "l" supposed to stand for? Or does it depend on the context? I still have to "translate" code by reading out loud to myself line-by-line and noting what it does in a comment. Here's a snippet of some example code I got somewhere for exporting to a CSV file where I added my own translation: //get results form db $results = mysql_query("SELECT * FROM foo") or die(mysql_error()); //$out?? Maybe $output? $out = ''; //retrieve field info from table--mysql_list_fields() appears to be deprecated? $fields = mysql_list_fields('db_name','table_name',$conn); //get the number of MySQL fields in the table and assign that value to $columns $columns = mysql_num_fields($fields); //set counter to 0, as long as it is less than the number of $columns, increment it by 1 for ($i = 0; $i < $columns; $i++) { //name each field--why $l? $l = mysql_field_name($fields, $i); //huh? $out .= '"'.$l.'",'; } Obviously I didn't quite get what every line did, but I usually figure it out on my own (eventually). >> -Constants and MySQL reserved words & functions are all upper case > With MySQL reserved words you mean SQL? Yep, I do the same. Yep, I meant SQL. I understand the distinction, but I guess in my head the two are interchangeable since MySQL the only thing I'm remotely familiar with. :) Oh man, speaking of reserved words, a couple of weeks ago I was stuck for almost half a day trying to figure out why one of my queries kept throwing errors (it doesn't help that the error messages are so darned enigmatic). Anyway, after about 6 hours of picking at the query trying to figure out why it refused to work when others with the same syntax worked fine, something that had been nibbling at the edge of my consciousness finally rose to the surface--I had named one of the fields in my table "desc" (for description). I was like, "Wait a minute... desc... DESC... OMG, that's a reserved word--what a stupid newbie mistake!!" *headdesk, headdesk, headdesk* Suffice it to say that I won't be making THAT mistake again. > Also, keep in mind that you should separate display from process. So > first do all the PHP magic and stick everything ready to go into > variables, then make a big line and below that start the output. On > very rare occasions I had to divert from that, but I am sure that is > simply because I'm inexperienced and that there is a better way. Sounds great--I'll definitely start doing that. >> -Stick with single quotes for string literals where there are no >> variable substitutions and/or where there ARE variable substitutions, >> but where using double quotes would necessitate lots of escaping > > Uhhh, you may want to dig through the archives of this list. Some time > ago we had a very passionate discussion about it and if I recall > correctly, everyone was right a bit and wrong a little. Hehehe, sounds interesting. I'll have to check that out. >> //I find it much easier to read: >> >> if ($foo == '') { >> echo '

'.$message.'

'; >> } else { >> echo '

'.$message.'

'; >> } > > I know it is just an example, but I'd double or triple the commentary > in the code above. A one liner may be OK for you, but others will > appreciate the detail and what is clear to you today may not be that > clear in six months from now. Oh yeah, believe me I do! I just left out additional comments for the sake of saving space here. >> late for me to unlearn bad habits, so I'd really appreciate any advice >> you could give. > > I think with writing this all up you did yourself the best favor. Now > stick to your own coding guidelines and add lots of commentary. Again, > modern IDEs help out with that, because you can craft templates for > if..else or switch statements or new files and already have the basic > commentary lines in place. You are definitely on the right track. I'm (somewhat) embarrassed to admit in present company that I do most of my PHP in Dreamweaver as I know most of you probably think that's pretty lame. But I'm comfortable with DW, you know? Most of the PHP I do involves working around the HTML in web pages, and I have my own snippets for stuff I use frequently. I know how to hand code, but seeing as how may keyboarding skills have always been deplorable, I find it much easier to use DW's split mode (code on one side, wysiwyg on the other) to navigate through the code. Not only that, but CS4 has some nice new features for working with code. Aside from code completion, I don't use any of the PHP stuff that DW provides (server behaviors, bindings. etc.) as the code it creates confuses me and puts stuff where I'd rather not have it (I'm a control freak when it comes to understanding what's going on). IOW, I basically use DW as a glorified text editor. I have a copy of phpDesigner, but I don't use it as much as I probably should. I guess I should explore it more as it might have features I'm unaware of that'll save me time (especially where debugging is concerned). I tried a couple of open source IDEs, but didn't stick with any of them. I hate anything Java-based because of the system resources it eats up, so Eclipse was out (though I have a strong front-end coding background, my primary job function is that of graphic designer, so I tend have a ton of other resource hogging things running in the background most of the time). Komodo Edit was nice, but missing many features of the IDE version...Since I'm still not experienced enough to be able to take on the heavy-duty back-end stuff, I don't really feel comfortable trying to justify the purchase price of something like that to my employer. Okay, I've prattled on far too long! Thanks for the advice. Bev From y2rob at aol.com Tue Apr 28 13:42:34 2009 From: y2rob at aol.com (y2rob at aol.com) Date: Tue, 28 Apr 2009 13:42:34 -0400 Subject: [nycphp-talk] ORM that uses more advanced MySQL features In-Reply-To: References: <5947f2ab0904280937w1a09b5a5t8ad3871207b84183@mail.gmail.com> Message-ID: <8CB963FD8ACE59B-1740-150@WEBMAIL-MA11.sysops.aol.com> i've heard about doctrine and i am not working with it, and i love and hate it.? i think once you spend the time to set it up (minus certain quirks with doctrine migrations),? it will do a pretty decent job, but if you have a large (and i mean large) database, you'll can spend a good amount of time creating your models before you start doing actual php coding. the point being, is if i were to start a project and if i deemed it worthy to use doctrine as the model in an mvc style project, then it's great (esp for migrations), but if i had an existing huge database and you wanted to refactor the project and wanted minimal development time with great results, i would lean more towards using a framework like codeigniter.? minimal model defining and rapid development with fairly great retrieval of data, and method chaining. it all depends on the situation ~rob ps - sorry for going on the tangent -----Original Message----- From: Guilherme Blanco To: NYPHP Talk Sent: Tue, 28 Apr 2009 12:46 pm Subject: Re: [nycphp-talk] ORM that uses more advanced MySQL features Doctrine_View is able to handle views in any DBMS. Also, you can manually map the view if you want to work on updatable views, just like Oracle supports. Stored procedures works on the fly, just like a common function call. Doctrine does something like that: In case DQL can interpret it, apply the custom workarounds, otherwise, just bypass it to DBMS driver. If not enough, you can use Doctrine_RawSql to create your custom DBMS specific call, when DQL is not smart enough to handle the query (something like UNIONS or SELECT of a selected query table: SELECT * FROM (SELECT ...)) If you need more guidance on it, feel free to subscribe to doctrine-user or doctrine-dev mailing lists. We also have IRC channel at freenode #doctrine and a forum in the website. Finally... manual have been updated a lot recently. We're releasing a printed version in the next couple of weeks. Cheers, On Tue, Apr 28, 2009 at 1:37 PM, Marcelo Araujo wrote: > Since when, Guilherme? > > On Tue, Apr 28, 2009 at 1:31 PM, Guilherme Blanco > wrote: >> www.doctrine-project.org >> >> =) >> >> On Tue, Apr 28, 2009 at 1:08 PM, Ajai Khattri wrote: >>> >>> Does anyone know of an ORM that can use views and stored procedures in >>> MySQL? >> -- >> Guilherme Blanco - Web Developer >> CBC - Certified Bindows Consultant >> Cell Phone: +55 (16) 9215-8480 >> MSN: guilhermeblanco at hotmail.com >> URL: http://blog.bisna.com >> S?o Paulo - SP/Brazil >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > > > -- > Marcelo Araujo > Zend Certified Engineer > http://www.crosi.com.br > +55 34 9144 1472 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Paulo - SP/Brazil _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at nopersonal.info Tue Apr 28 13:43:33 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 28 Apr 2009 13:43:33 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: References: <49F61AE1.2080708@nopersonal.info> <49F63AB5.5060700@gmx.net> Message-ID: <49F74045.1020801@nopersonal.info> Edward Potter wrote: > Suggest pear style for your code. I stick with Ruby'ish style for > naming my sql stuff. > > table : locations > field: location > > Sticking with something that simple can save you DAYS of headaches~! Thanks, Edward (and Dan & Daniel as well). I recently discovered the hard way how easily field names can give you headaches. Ugh! Lesson learned. Bev From lists at nopersonal.info Tue Apr 28 13:52:22 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 28 Apr 2009 13:52:22 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <68de37340904280854y19ebb041kdfbc1ce4d56f0943@mail.gmail.com> References: <1240883715.29216@coral.he.net> <68de37340904280854y19ebb041kdfbc1ce4d56f0943@mail.gmail.com> Message-ID: <49F74256.9030509@nopersonal.info> Eddie Drapkin wrote: > To be fair, despite the talk about what's best or what isn't, in the > end it really doesn't matter what the code looks like, given two > things. One, most importantly, it works (well). And two, it's > consistent. It doesn't matter if your variables are named $like_this > or $likeThis as long as it's one and not both :) > > On Tue, Apr 28, 2009 at 11:35 AM, Ajai Khattri > wrote: > > On Mon, 27 Apr 2009, Kristina Anderson wrote: > > > Lastly anyone who tries to impose THEIR conventions on you is to > be ignored. This is all > > about you, and what widget YOU think is easiest to use. > Worrying about where to put a > > curly bracket is not worth it -- put it where you like it! As > long as the code works you are > > golden. > > The only problem with this is when in a team and different members > work on > the same bits of code. Can you imagine a class written in two or three > different bracing styles is like?! Your team HAS to agree on some > standards and stick to them. Some of these might go against your own > personal grain but such is the price of teamwork and consistent code. > > So no, a free-for-all is not always good advice. > Kristina, Justin Daniel, Ajai & Eddie--a big thanks to all of you (and everyone else who responded). I'll do my best to keep everyone's advice in mind going forward. Bev -------------- next part -------------- An HTML attachment was scrubbed... URL: From guilhermeblanco at gmail.com Tue Apr 28 14:16:39 2009 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Tue, 28 Apr 2009 15:16:39 -0300 Subject: [nycphp-talk] ORM that uses more advanced MySQL features In-Reply-To: <8CB963FD8ACE59B-1740-150@WEBMAIL-MA11.sysops.aol.com> References: <5947f2ab0904280937w1a09b5a5t8ad3871207b84183@mail.gmail.com> <8CB963FD8ACE59B-1740-150@WEBMAIL-MA11.sysops.aol.com> Message-ID: Specially for people like you, Doctrine provide a couple of CLI tasks that can do a lot of things. For example... you can define your models into an YAML file, and simply call: php ./doctrine.php generate-models-yaml It'll generate all models based on the YAML schema. Then, simply do: php ./doctrine.php generate-sql And you'll have an optimized SQL file in the specified folder... or, if you want to automatically apply the SQLs in DB... php ./doctrine.php build-all-reload This task will create models from YAML, execute the SQLs in DB and also import any basic import data that is defined through fixtures. To import only the fixtures: php ./doctrine.php load-data There're some people that already have some legacy code (like you) and wants to migrate to Doctrine. The CLI command of Doctrine provide one specific command to grab everything from your DB and generate the models automatically. php ./doctrine.php generate-models-db The only issue with this command is the relations between each table, which cannot be built automatically, since the DESC TABLE XXX may different between all supported DBMS, aswell in the same DBMS, each version may be different. We could not make it be built automatically. Currently Doctrine is in version 1.1.0, we're about to release 1.1.1. Also we'll release 1.0.9, which is our LTS (Long Term/Time Support) version. Manual is full of details about CLI tasks... to configure the CLI task is quite trivial... a 15 lines scripts and you have all the power of Doctrine at the palm of your hands. BTW... I'm one of the core developers of Doctrine if you didn't notice! =D Cheers, On Tue, Apr 28, 2009 at 2:42 PM, wrote: > i've heard about doctrine and i am not working with it, and i love and hate > it.? i think once you spend the time to set it up (minus certain quirks with > doctrine migrations),? it will do a pretty decent job, but if you have a > large (and i mean large) database, you'll can spend a good amount of time > creating your models before you start doing actual php coding. > > the point being, is if i were to start a project and if i deemed it worthy > to use doctrine as the model in an mvc style project, then it's great (esp > for migrations), but if i had an existing huge database and you wanted to > refactor the project and wanted minimal development time with great results, > i would lean more towards using a framework like codeigniter.? minimal model > defining and rapid development with fairly great retrieval of data, and > method chaining. > > it all depends on the situation > > ~rob > ps - sorry for going on the tangent > > -----Original Message----- > From: Guilherme Blanco > To: NYPHP Talk > Sent: Tue, 28 Apr 2009 12:46 pm > Subject: Re: [nycphp-talk] ORM that uses more advanced MySQL features > > Doctrine_View is able to handle views in any DBMS. > > Also, you can manually map the view if you want to work on updatable > views, just like Oracle supports. > > Stored procedures works on the fly, just like a common function call. > Doctrine does something like that: > In case DQL can interpret it, apply the custom workarounds, otherwise, > just bypass it to DBMS driver. > > If not enough, you can use Doctrine_RawSql to create your custom DBMS > specific call, when DQL is not smart enough to handle the query > (something like UNIONS or SELECT of a selected query table: SELECT * > FROM (SELECT ...)) > > If you need more guidance on it, feel free to subscribe to > doctrine-user or doctrine-dev mailing lists. > We also have IRC channel at freenode #doctrine and a forum in the website. > > Finally... manual have been updated a lot recently. We're releasing a > printed version in the next couple of weeks. > > > Cheers, > > On Tue, Apr 28, 2009 at 1:37 PM, Marcelo Araujo > wrote: >> Since when, Guilherme? >> >> On Tue, Apr 28, 2009 at 1:31 PM, Guilherme Blanco >> wrote: >>> www.doctrine-project.org >>> >>> =) >>> >>> On Tue, Apr 28, 2009 at 1:08 PM, Ajai Khattri wrote: >>>> >>>> Does anyone know of an ORM that can use views and stored procedures in >>>> MySQL? >>> -- >>> Guilherme Blanco - Web Developer >>> CBC - Certified Bindows Consultant >>> Cell Phone: +55 (16) 9215-8480 >>> MSN: guilhermeblanco at hotmail.com >>> URL: http://blog.bisna.com >>> S?o Paulo - SP/Brazil >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >> >> >> >> -- >> Marcelo Araujo >> Zend Certified Engineer >> http://www.crosi.com.br >> +55 34 9144 1472 >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > > > -- > Guilherme Blanco - Web Developer > CBC - Certified Bindows Consultant > Cell Phone: +55 (16) 9215-8480 > MSN: guilhermeb lanco at hotmail.com > URL: http://blog.bisna.com > S?o Paulo - SP/Brazil > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > ________________________________ > A Good Credit Score is 700 or Above. See yours in just 2 easy steps! > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Paulo - SP/Brazil From mitch.pirtle at gmail.com Tue Apr 28 14:31:19 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 28 Apr 2009 14:31:19 -0400 Subject: [nycphp-talk] LEMP? In-Reply-To: <0016e6476e622bc27504685af84f@google.com> References: <0016e6476e622bc27504685af84f@google.com> Message-ID: <330532b60904281131re29ad8dv7dc47d13496ae97c@mail.gmail.com> Would love to know what everyone's experiences were with nginx-vs-lighttpd, as both seem to basically achieve the same exact thing while being separate projects. Is there a reason you chose nginx over lighttpd? -- Mitch 2009/4/25 : > Hey, all, new to the mailing list (really, the first email I've sent :D). > > I was wondering if anyone had any experience using the EMP (nginx, mysql, > php) instead of the AMP stack, specifically using php-fpm as a process > manager? > > I've read some pretty impressive benchmarks: > http://www.yawn.it/2008/04/30/nginx-php-php-fpm-on-debian-etch-40/ and > recently got it compiled and have been playing with it. It seems great, but > I was wondering if there were any suggestions, warnings, weird behaviors, > etc. that I should be aware of. To date, I've only noticed one thing, namely > that $_SERVER['HTTPS'] isn't set when using SSL (easy enough to workaround) > but do I need to keep my eye out for anything else? > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ajai at bitblit.net Tue Apr 28 15:18:03 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Apr 2009 15:18:03 -0400 (EDT) Subject: [nycphp-talk] ORM that uses more advanced MySQL features In-Reply-To: Message-ID: On Tue, 28 Apr 2009, Guilherme Blanco wrote: > Specially for people like you, Doctrine provide a couple of CLI tasks > that can do a lot of things. Im using symfony and I know a lot of these tasks are available through the symfony CLI tool. But Im new to Doctrine in symfony (still learning it). Are there any examples of using MySQL views and stored procedures from within symfony? Love migrations but I think the Jobeet tutorial doesn't talk about that. -- Aj. From tmpvar at gmail.com Tue Apr 28 15:46:22 2009 From: tmpvar at gmail.com (Elijah Insua) Date: Tue, 28 Apr 2009 15:46:22 -0400 Subject: [nycphp-talk] WAMP (minus the M) forking question - also open to other ideas In-Reply-To: <8f0676b40904272142m405a8c15l84774039291c4726@mail.gmail.com> References: <8f0676b40904272142m405a8c15l84774039291c4726@mail.gmail.com> Message-ID: <2b4feca10904281246h3eb2546el7bdd0f53dc9d434a@mail.gmail.com> Here is some C code I had laying around which executes a detached process, much like START. #include #include #include int main(int argc, char *argv[]) { if (argc < 2) { printf("Fork32 v1.0 - A windows process splitter\n\n"); printf("Usage: fork32.exe C:\\full\\path\\to\\application.exe"); return 0; } _spawnl( _P_DETACH, argv[2], NULL); return 1; } hope it helps -- Elijah On Tue, Apr 28, 2009 at 12:42 AM, John Campbell wrote: > A quick google search for "windows run process in background" yielded: > > "In case anyone has this problem in future, I finally found out the > solution. The START command in Windows command line allows you to > start another command window running any command; and the /B option > can start the command without the extra command window, so you get > similar behavior to Unix's background processes. Look it up for more > details." > > I don't use windows, but I trigger background processes with and "&" > in *nix, and it looks like windows offers the same functionality with > "start /b" > > regards, > John Campbell > > > On Tue, Apr 28, 2009 at 12:16 AM, Michael J. Forte > wrote: > > Hi experienced and talented community of which I have been trolling for a > > few years! > > > > I have a question for all of you and I hope this makes sense. > > > > First, the background. I am coding a PHP Web application that has to call > a > > external program, however, because only one instance of the program can > be > > ran at a time I need to implement a queue. In addition, it is important > the > > users need to not wait (keep the browser open) for their job to process. > The > > script will send them an e-mail with a link after their job completes. > This > > means I need something to persistently run whenever there is something in > > the queue. In summary: front end script calls secondary child which runs > > until queue is empty by calling external program. > > > > My problem is, I cannot figure out how to properly fork under Windows, > > allowing the parent script to run to completion, and not hang the browser > > waiting for the child to complete. I am at the point where I can spawn > the > > child and it will run even when the parent browser is closed but will not > > release the parent script until it completes. I have tried exec(), > system(), > > shell_exec(), popen(), and a COM call (which I might have done wrong). > Each > > of those called php -f childScript.php. > > > > I thought about a few other alternatives: > > > > 1. Use a scheduled task to check for a queue at a set interval. This is > the > > least desired solution as it could cause unwanted delay. > > 2. Write a PHP daemon/Win32 service to monitor a queue of which could be > > queried and started if needed by parent script and it would run until the > > queue is empty at which time it would shutdown. > > 3. Write a Perl script to be called by the parent which would fork and > call > > the secondary PHP script, subsequently terminating and releasing the > parent > > PHP script. > > > > In summary: > > > > - WAMP environment, cannot use Linux as external program is Windows only > > (BUMMER!) > > - Need a queue to handle calls to an external program, currently stored > in a > > flat file > > - Parent script needs to fork to a child script which can run independent > of > > the parent until queue is empty > > - Parent script needs to be able to complete prior to child completing > > - Because of time required to run a job and because of the potential for > > many users, users need to be able to submit'n'run. > > > > Do any of you PHP gods (and goddesses!) have any thoughts on how to fork > > under Windows, how to handle this situation, or alternatives? Should I be > > using some other language? Perl, AJAX, other? > > > > Google (or my search string) was less than helpful. > > > > -- > > Thank you, > > Michael J. Forte > > Web Designer, WR Web Designs > > Webmaster, Town of LaFayette > > Software Engineer, IBM > > > > Education: Clarkson University Alum (2005) :: Resume > > E-mail: michaelforte at hotmail.com > > > > "Often those who work the hardest are the luckiest..." > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From y2rob at aol.com Tue Apr 28 18:04:15 2009 From: y2rob at aol.com (y2rob at aol.com) Date: Tue, 28 Apr 2009 18:04:15 -0400 Subject: [nycphp-talk] ORM that uses more advanced MySQL features In-Reply-To: References: <5947f2ab0904280937w1a09b5a5t8ad3871207b84183@mail.gmail.com><8CB963FD8ACE59B-1740-150@WEBMAIL-MA11.sysops.aol.com> Message-ID: <8CB9664679F9EF0-1740-1216@WEBMAIL-MA11.sysops.aol.com> ahh yes..nice.? cool nice to meet you and btw, i mean that "i am currently working with doctrine" in my last email. nice to see some great people are on this mailing list!!! sincerely, ~rob -----Original Message----- From: Guilherme Blanco To: NYPHP Talk Sent: Tue, 28 Apr 2009 2:16 pm Subject: Re: [nycphp-talk] ORM that uses more advanced MySQL features Specially for people like you, Doctrine provide a couple of CLI tasks that can do a lot of things. For example... you can define your models into an YAML file, and simply call: php ./doctrine.php generate-models-yaml It'll generate all models based on the YAML schema. Then, simply do: php ./doctrine.php generate-sql And you'll have an optimized SQL file in the specified folder... or, if you want to automatically apply the SQLs in DB... php ./doctrine.php build-all-reload This task will create models from YAML, execute the SQLs in DB and also import any basic import data that is defined through fixtures. To import only the fixtures: php ./doctrine.php load-data There're some people that already have some legacy code (like you) and wants to migrate to Doctrine. The CLI command of Doctrine provide one specific command to grab everything from your DB and generate the models automatically. php ./doctrine.php generate-models-db The only issue with this command is the relations between each table, which cannot be built automatically, since the DESC TABLE XXX=2 0may different between all supported DBMS, aswell in the same DBMS, each version may be different. We could not make it be built automatically. Currently Doctrine is in version 1.1.0, we're about to release 1.1.1. Also we'll release 1.0.9, which is our LTS (Long Term/Time Support) version. Manual is full of details about CLI tasks... to configure the CLI task is quite trivial... a 15 lines scripts and you have all the power of Doctrine at the palm of your hands. BTW... I'm one of the core developers of Doctrine if you didn't notice! =D Cheers, On Tue, Apr 28, 2009 at 2:42 PM, wrote: > i've heard about doctrine and i am not working with it, and i love and hate > it.? i think once you spend the time to set it up (minus certain quirks with > doctrine migrations),? it will do a pretty decent job, but if you have a > large (and i mean large) database, you'll can spend a good amount of time > creating your models before you start doing actual php coding. > > the point being, is if i were to start a project and if i deemed it worthy > to use doctrine as the model in an mvc style project, then it's great (esp > for migrations), but if i had an existing huge database and you wanted to > refactor the project and wanted minimal development time with great results, > i would lean more towards using a framework like codeigniter.? minimal model > defining and rapid development with fairly great retrieval of data, and > method chaining.=0 A> > it all depends on the situation > > ~rob > ps - sorry for going on the tangent > > -----Original Message----- > From: Guilherme Blanco > To: NYPHP Talk > Sent: Tue, 28 Apr 2009 12:46 pm > Subject: Re: [nycphp-talk] ORM that uses more advanced MySQL features > > Doctrine_View is able to handle views in any DBMS. > > Also, you can manually map the view if you want to work on updatable > views, just like Oracle supports. > > Stored procedures works on the fly, just like a common function call. > Doctrine does something like that: > In case DQL can interpret it, apply the custom workarounds, otherwise, > just bypass it to DBMS driver. > > If not enough, you can use Doctrine_RawSql to create your custom DBMS > specific call, when DQL is not smart enough to handle the query > (something like UNIONS or SELECT of a selected query table: SELECT * > FROM (SELECT ...)) > > If you need more guidance on it, feel free to subscribe to > doctrine-user or doctrine-dev mailing lists. > We also have IRC channel at freenode #doctrine and a forum in the website. > > Finally... manual have been updated a lot recently. We're releasing a > printed version in the next couple of weeks. > > > Cheers, > > On Tue, Apr 28, 2009 at 1:37 PM, Marcelo Araujo > wrote: >> Since when, Guilherme? >> >> On Tue, Apr 28, 2009 at 1:31 PM, Guilherme Blanco >> wrote: >>> www.doctrine-project.org >>> >>> =) >>> >>>=2 0On Tue, Apr 28, 2009 at 1:08 PM, Ajai Khattri wrote: >>>> >>>> Does anyone know of an ORM that can use views and stored procedures in >>>> MySQL? >>> -- >>> Guilherme Blanco - Web Developer >>> CBC - Certified Bindows Consultant >>> Cell Phone: +55 (16) 9215-8480 >>> MSN: guilhermeblanco at hotmail.com >>> URL: http://blog.bisna.com >>> S?o Paulo - SP/Brazil >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >> >> >> >> -- >> Marcelo Araujo >> Zend Certified Engineer >> http://www.crosi.com.br >> +55 34 9144 1472 >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > > > -- > Guilherme Blanco - Web Developer > CBC - Certified Bindows Consultant > Cell Phone: +55 (16) 9215-8480 > MSN: guilhermeb lanco at hotmail.com > URL: http://blog.bisna.com > S?o Paulo - SP/Brazil > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > ________________________________ > A Good Credit Score is 700 or Above. See yours in just 2 easy steps! > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > --20 Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Paulo - SP/Brazil _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From guilhermeblanco at gmail.com Tue Apr 28 18:46:18 2009 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Tue, 28 Apr 2009 19:46:18 -0300 Subject: [nycphp-talk] ORM that uses more advanced MySQL features In-Reply-To: References: Message-ID: The usage of Doctrine will never be found on Symfony tutorials... you can probably find a couple of examples in the Doctrine manual. On Tue, Apr 28, 2009 at 4:18 PM, Ajai Khattri wrote: > On Tue, 28 Apr 2009, Guilherme Blanco wrote: > >> Specially for people like you, Doctrine provide a couple of CLI tasks >> that can do a lot of things. > > Im using symfony and I know a lot of these tasks are available through the > symfony CLI tool. But Im new to Doctrine in symfony (still learning it). > > Are there any examples of using MySQL views and stored procedures from > within symfony? > > Love migrations but I think the Jobeet tutorial doesn't talk about that. > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Paulo - SP/Brazil From guilhermeblanco at gmail.com Tue Apr 28 18:48:47 2009 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Tue, 28 Apr 2009 19:48:47 -0300 Subject: [nycphp-talk] ORM that uses more advanced MySQL features In-Reply-To: <8CB9664679F9EF0-1740-1216@WEBMAIL-MA11.sysops.aol.com> References: <5947f2ab0904280937w1a09b5a5t8ad3871207b84183@mail.gmail.com> <8CB963FD8ACE59B-1740-150@WEBMAIL-MA11.sysops.aol.com> <8CB9664679F9EF0-1740-1216@WEBMAIL-MA11.sysops.aol.com> Message-ID: Nice to meet you too!!! I just can't remember why I joined the mailing list... I'm from S?o Paulo, Brazil! =) IIRC, it was due to good discussions on this list. Cheers, On Tue, Apr 28, 2009 at 7:04 PM, wrote: > ahh yes..nice.? cool nice to meet you and btw, i mean that "i am currently > working with doctrine" in my last email. > > nice to see some great people are on this mailing list!!! > > sincerely, > ~rob > > > -----Original Message----- > From: Guilherme Blanco > To: NYPHP Talk > Sent: Tue, 28 Apr 2009 2:16 pm > Subject: Re: [nycphp-talk] ORM that uses more advanced MySQL features > > Specially for people like you, Doctrine provide a couple of CLI tasks > > that can do a lot of things. > > > > For example... you can define your models into an YAML file, and simply > call: > > > > php ./doctrine.php generate-models-yaml > > > > It'll generate all models based on the YAML schema. > > Then, simply do: > > > > php ./doctrine.php generate-sql > > > > And you'll have an optimized SQL file in the specified folder... or, > > if you want to automatically apply the SQLs in DB... > > > > php ./doctrine.php build-all-reload > > > > This task will create models from YAML, execute the SQLs in DB and > > also import any basic import data that is defined through fixtures. To > > import only the fixtures: > > > > php ./doctrine.php load-data > > > > > > T > here're some people that already have some legacy code (like you) and > > wants to migrate to Doctrine. The CLI command of Doctrine provide one > > specific command to grab everything from your DB and generate the > > models automatically. > > > > php ./doctrine.php generate-models-db > > > > The only issue with this command is the relations between each table, > > which cannot be built automatically, since the DESC TABLE XXX may > > different between all supported DBMS, aswell in the same DBMS, each > > version may be different. We could not make it be built automatically. > > > > > > Currently Doctrine is in version 1.1.0, we're about to release 1.1.1. > > Also we'll release 1.0.9, which is our LTS (Long Term/Time Support) > > version. > > > > Manual is full of details about CLI tasks... to configure the CLI task > > is quite trivial... a 15 lines scripts and you have all the power of > > Doctrine at the palm of your hands. > > > > > > BTW... I'm one of the core developers of Doctrine if you didn't notice! =D > > > > > > Cheers, > > > > On Tue, Apr 28, 2009 at 2:42 PM, wrote: > >> i've heard about doctrine and i am not working with it, and i love and >> hate > >> it.? i think once you spend the time to set it up (minus certain quirks >> with > >> doctrine migrations),? it will do a pretty decent job, but if you have a > >> large (and i mean large) database, you'll can spend a good amount of time > >> creating your models before=2 > 0you start doing actual php coding. > >> > >> the point being, is if i were to start a project and if i deemed it worthy > >> to use doctrine as the model in an mvc style project, then it's great (esp > >> for migrations), but if i had an existing huge database and you wanted to > >> refactor the project and wanted minimal development time with great >> results, > >> i would lean more towards using a framework like codeigniter.? minimal >> model > >> defining and rapid development with fairly great retrieval of data, and > >> method chaining. > >> > >> it all depends on the situation > >> > >> ~rob > >> ps - sorry for going on the tangent > >> > >> -----Original Message----- > >> From: Guilherme Blanco > >> To: NYPHP Talk > >> Sent: Tue, 28 Apr 2009 12:46 pm > >> Subject: Re: [nycphp-talk] ORM that uses more advanced MySQL features > >> > >> Doctrine_View is able to handle views in any DBMS. > >> > >> Also, you can manually map the view if you want to work on updatable > >> views, just like Oracle supports. > >> > >> Stored procedures works on the fly, just like a common function call. > >> Doctrine does something like that: > >> In case DQL can interpret it, apply the custom workarounds, otherwise, > >> just bypass it to DBMS driver. > >> > >> If not enough, you can use Doctrine_RawSql > to create your custom DBMS > >> specific call, when DQL is not smart enough to handle the query > >> (something like UNIONS or SELECT of a selected query table: SELECT * > >> FROM (SELECT ...)) > >> > >> If you need more guidance on it, feel free to subscribe to > >> doctrine-user or doctrine-dev mailing lists. > >> We also have IRC channel at freenode #doctrine and a forum in the website. > >> > >> Finally... manual have been updated a lot recently. We're releasing a > >> printed version in the next couple of weeks. > >> > >> > >> Cheers, > >> > >> On Tue, Apr 28, 2009 at 1:37 PM, Marcelo Araujo > >> wrote: > >>> Since when, Guilherme? > >>> > >>> On Tue, Apr 28, 2009 at 1:31 PM, Guilherme Blanco > >>> wrote: > >>>> www.doctrine-project.org > >>>> > >>>> =) > >>>> > >>>> On Tue, Apr 28, 2009 at 1:08 PM, Ajai Khattri wrote: > >>>>> > >>>>> Does anyone know of an ORM that can use views and stored procedures in > >>>>> MySQL? > >>>> -- > >>>> Guilherme Blanco - Web Developer > >>>> CBC - Certified Bindows Consultant > >>>> Cell Phone: +55 (16) 9215-8480 > >>>> MSN: guilhermeblanco at hotmail.com > > >>>> URL: http://blog.bisna.com > >>>> S?o Paulo - SP/Brazil > >>>> _______________________________________________ > >>>> New York PHP User Group Community Talk Mailing List > >>>> http://lists.nyphp.org/mailman/listinfo/talk > >>>> > >>>> http://www.nyphp.org/show_participation.php > >>> > >>> > >>> > >>> -- > >>> Marcelo Araujo > >>> Zend Certified Engineer > >>> http://www.crosi.com.br > >>> +55 34 9144 1472 > >>> _______________________________________________ > >>> New York PHP User Group Community Talk Mailing List > >>> http://lists.nyphp.org/mailman/listinfo/talk > >>> > >>> http://www.nyphp.org/show_participation.php > >>> > >> > >> > >> > >> -- > >> Guilherme Blanco - Web Developer > >> CBC - Certified Bindows Consultant > >> Cell Phone: +55 (16) 9215-8480 > >> MSN: guilhermeb lanco at hotmail.com > >> URL: http://blog.bisna.com > >> S?o Paulo - SP/Brazil > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > >> > >> ________________________________ > >> A Good Credit Score is 700 or Above. See yours in just 2 easy steps! > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > >> > > > > > > > > -- > > Guilherme Blanco - Web Developer > > CBC - Certified Bindows Consultant > > Cell Phone: +55 (16) 9215-8480 > > MSN: guilhermeblanco at hotmail.com > > URL: http://blog.bisna.com > > S?o Paulo - SP/Brazil > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > ________________________________ > A Good Credit Score is 700 or Above. See yours in just 2 easy steps! > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Paulo - SP/Brazil From oorza2k5 at gmail.com Tue Apr 28 18:57:43 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Tue, 28 Apr 2009 18:57:43 -0400 Subject: [nycphp-talk] LEMP? In-Reply-To: <330532b60904281131re29ad8dv7dc47d13496ae97c@mail.gmail.com> References: <0016e6476e622bc27504685af84f@google.com> <330532b60904281131re29ad8dv7dc47d13496ae97c@mail.gmail.com> Message-ID: <68de37340904281557q2269d50axfa9d745cda5472bf@mail.gmail.com> I had a view reasons, not really anything ground shaking. 1.) nginx is much more actively developed than lightty. 2.) One of the people that recommended it to me was/is a blackhat and I tend to take security advice from blackhats very, very seriously. 3.) nginx is growing more and more popular, lightty less and less, and this matters a lot in FOSS software (more users = more contributors) : http://survey.netcraft.com/Reports/200901/ http://survey.netcraft.com/Reports/200902/ http://survey.netcraft.com/Reports/200903/ http://survey.netcraft.com/Reports/200904/ 4.) There's a ton of colloquial evidence of lightty's memleak issues. 5.) One of the things I hated most about Apache was writing and maintaining server configuration (were it not for the semi-decent default configurations that ship with most distributions, I don't know if anyone could ever figure out how to write one. Lightty's configuration isn't much better, but nginx's is ridiculously easy and I loved that immediately. Nothing really major, but enough to pull me over to the nginx side. On Tue, Apr 28, 2009 at 2:31 PM, Mitch Pirtle wrote: > Would love to know what everyone's experiences were with > nginx-vs-lighttpd, as both seem to basically achieve the same exact > thing while being separate projects. Is there a reason you chose nginx > over lighttpd? > > -- Mitch > > 2009/4/25 : > > Hey, all, new to the mailing list (really, the first email I've sent :D). > > > > I was wondering if anyone had any experience using the EMP (nginx, mysql, > > php) instead of the AMP stack, specifically using php-fpm as a process > > manager? > > > > I've read some pretty impressive benchmarks: > > http://www.yawn.it/2008/04/30/nginx-php-php-fpm-on-debian-etch-40/ and > > recently got it compiled and have been playing with it. It seems great, > but > > I was wondering if there were any suggestions, warnings, weird behaviors, > > etc. that I should be aware of. To date, I've only noticed one thing, > namely > > that $_SERVER['HTTPS'] isn't set when using SSL (easy enough to > workaround) > > but do I need to keep my eye out for anything else? > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Tue Apr 28 20:02:17 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Apr 2009 20:02:17 -0400 (EDT) Subject: [nycphp-talk] ORM that uses more advanced MySQL features In-Reply-To: Message-ID: On Tue, 28 Apr 2009, Guilherme Blanco wrote: > The usage of Doctrine will never be found on Symfony tutorials... > you can probably find a couple of examples in the Doctrine manual. Some docs here: http://www.symfony-project.org/doctrine/1_2/en/ -- Aj. From guilhermeblanco at gmail.com Tue Apr 28 20:07:40 2009 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Tue, 28 Apr 2009 21:07:40 -0300 Subject: [nycphp-talk] ORM that uses more advanced MySQL features In-Reply-To: References: Message-ID: Hey, http://www.doctrine-project.org/documentation/manual/1_1/en Use this for Doctrine reference.... =) Cheers, On Tue, Apr 28, 2009 at 9:02 PM, Ajai Khattri wrote: > On Tue, 28 Apr 2009, Guilherme Blanco wrote: > >> The usage of Doctrine will never be found on Symfony tutorials... >> you can probably find a couple of examples in the Doctrine manual. > > Some docs here: http://www.symfony-project.org/doctrine/1_2/en/ > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Paulo - SP/Brazil From ajai at bitblit.net Tue Apr 28 20:24:17 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Apr 2009 20:24:17 -0400 (EDT) Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: <49F73977.1020005@nopersonal.info> Message-ID: On Tue, 28 Apr 2009, lists at nopersonal.info wrote: > Re your friend, yikes! I know what you mean about using $counter. I > figured out that $i or $n stands for an integer, but it still throws me > off sometimes when I see something like $l in someone's example code > (below)... what is the "l" supposed to stand for? Or does it depend on > the context? Its mainly a historical thing. The same way every first program says 'Hello World'. Even when I was a kid learning BASIC, popular programming books still used i, j and k (or I%, J% and K% in BBC BASIC :-) -- Aj. From lists at nopersonal.info Tue Apr 28 23:10:05 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 28 Apr 2009 23:10:05 -0400 Subject: [nycphp-talk] Best practices for naming conventions & coding style? In-Reply-To: References: Message-ID: <49F7C50D.4070202@nopersonal.info> Ajai Khattri wrote: > On Tue, 28 Apr 2009, lists at nopersonal.info wrote: > > >> Re your friend, yikes! I know what you mean about using $counter. I >> figured out that $i or $n stands for an integer, but it still throws me >> off sometimes when I see something like $l in someone's example code >> (below)... what is the "l" supposed to stand for? Or does it depend on >> the context? >> > > Its mainly a historical thing. The same way every first program says > 'Hello World'. Even when I was a kid learning BASIC, popular programming > books still used i, j and k (or I%, J% and K% in BBC BASIC :-) > Ahhh, okay. Thanks. Bev -------------- next part -------------- An HTML attachment was scrubbed... URL: From michaelforte at hotmail.com Tue Apr 28 23:27:51 2009 From: michaelforte at hotmail.com (Michael J. Forte) Date: Tue, 28 Apr 2009 23:27:51 -0400 Subject: [nycphp-talk] WAMP (minus the M) forking question - also open to other ideas In-Reply-To: <2b4feca10904281246h3eb2546el7bdd0f53dc9d434a@mail.gmail.com> References: <8f0676b40904272142m405a8c15l84774039291c4726@mail.gmail.com> <2b4feca10904281246h3eb2546el7bdd0f53dc9d434a@mail.gmail.com> Message-ID: An HTML attachment was scrubbed... URL: From artur at marnik.net Tue Apr 28 23:59:43 2009 From: artur at marnik.net (Artur Marnik) Date: Tue, 28 Apr 2009 23:59:43 -0400 Subject: [nycphp-talk] Website quotation In-Reply-To: <49F367F7.8000404@projectskyline.com> References: <49F33C2C.3080708@gmx.net> <49F340B2.1050705@projectskyline.com> <49F36077.5070108@gmx.net> <49F367F7.8000404@projectskyline.com> Message-ID: <49F7D0AF.3020006@marnik.net> Hi Ben I have never seen http://lmgtfy.com before this made my day :) I am sure I will use it a lot (I have many friends asking silly questions on ICQ etc) Artur Ben Sgro wrote: > Hey David, > > Heh, of course - that was for the original poster - just having fun. > > - Ben > From ben at projectskyline.com Wed Apr 29 00:06:08 2009 From: ben at projectskyline.com (Ben Sgro) Date: Wed, 29 Apr 2009 00:06:08 -0400 Subject: [nycphp-talk] Website quotation In-Reply-To: <49F7D0AF.3020006@marnik.net> References: <49F33C2C.3080708@gmx.net> <49F340B2.1050705@projectskyline.com> <49F36077.5070108@gmx.net> <49F367F7.8000404@projectskyline.com> <49F7D0AF.3020006@marnik.net> Message-ID: <49F7D230.6010600@projectskyline.com> Hey Artur, Glad it gave you a laugh! Yeah, its always best the first time - Take care, - Ben Artur Marnik wrote: > Hi Ben > I have never seen http://lmgtfy.com before > this made my day :) I am sure I will use it a lot (I have many friends > asking silly questions on ICQ etc) > > Artur > > Ben Sgro wrote: >> Hey David, >> >> Heh, of course - that was for the original poster - just having fun. >> >> - Ben >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From dcech at phpwerx.net Wed Apr 29 08:57:03 2009 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 29 Apr 2009 08:57:03 -0400 Subject: [nycphp-talk] WAMP (minus the M) forking question - also open to other ideas In-Reply-To: References: <8f0676b40904272142m405a8c15l84774039291c4726@mail.gmail.com> <2b4feca10904281246h3eb2546el7bdd0f53dc9d434a@mail.gmail.com> Message-ID: <49F84E9F.6000502@phpwerx.net> Michael J. Forte wrote: > - I found COM(Wscript.Shell) ... $->Run(...) on the web but could not get it > working. It would spawn a cmd.exe but would not run the rest of the command. The > cmd.exe child would not die. If I ran the same command from Start > Run it would > work just fine. > > $WshShell = new COM(Wscript.Shell); > $oRun = $WshShell->Run("cmd /C php.exe -f child.php"); I've had luck in the past with: $shell = new COM('WScript.Shell'); $shell->Run('php.exe -f child.php',0,false); The additional parameters basically tell it to skip creating a window and not wait for the command to return. http://msdn.microsoft.com/en-us/library/d5fk67ky(VS.85).aspx Hope this helps, Dan From reneasaf at gmail.com Wed Apr 29 10:02:51 2009 From: reneasaf at gmail.com (Rene Samson) Date: Wed, 29 Apr 2009 10:02:51 -0400 Subject: [nycphp-talk] WAMP (minus the M) forking question - also open to other ideas In-Reply-To: References: Message-ID: <49F85E0B.3040704@gmail.com> Michael, I don't know how much control you have over the webserver, but have you looked at the PCNTL extension? I've played around with it a while ago, and it works very nicely. I've only used it in a LAMP environment, but it should do the same in a WAMP environment. Rene Michael J. Forte wrote: > Hi experienced and talented community of which I have been trolling > for a few years! > > I have a question for all of you and I hope this makes sense. > > First, the background. I am coding a PHP Web application that has to > call a external program, however, because only one instance of the > program can be ran at a time I need to implement a queue. In addition, > it is important the users need to not wait (keep the browser open) for > their job to process. The script will send them an e-mail with a link > after their job completes. This means I need something to persistently > run whenever there is something in the queue. In summary: front end > script calls secondary child which runs until queue is empty by > calling external program. > > My problem is, I cannot figure out how to properly fork under Windows, > allowing the parent script to run to completion, and not hang the > browser waiting for the child to complete. I am at the point where I > can spawn the child and it will run even when the parent browser is > closed but will not release the parent script until it completes. I > have tried exec(), system(), shell_exec(), popen(), and a COM call > (which I might have done wrong). Each of those called php -f > childScript.php. > > I thought about a few other alternatives: > > 1. Use a scheduled task to check for a queue at a set interval. This > is the least desired solution as it could cause unwanted delay. > 2. Write a PHP daemon/Win32 service to monitor a queue of which could > be queried and started if needed by parent script and it would run > until the queue is empty at which time it would shutdown. > 3. Write a Perl script to be called by the parent which would fork and > call the secondary PHP script, subsequently terminating and releasing > the parent PHP script. > > In summary: > > - WAMP environment, cannot use Linux as external program is Windows > only (BUMMER!) > - Need a queue to handle calls to an external program, currently > stored in a flat file > - Parent script needs to fork to a child script which can run > independent of the parent until queue is empty > - Parent script needs to be able to complete prior to child completing > - Because of time required to run a job and because of the potential > for many users, users need to be able to submit'n'run. > > Do any of you PHP gods (and goddesses!) have any thoughts on how to > fork under Windows, how to handle this situation, or alternatives? > Should I be using some other language? Perl, AJAX, other? > > Google (or my search string) was less than helpful. > > -- > Thank you, > Michael J. Forte > Web Designer, WR Web Designs > Webmaster, Town of LaFayette > Software Engineer, IBM > > Education: Clarkson University Alum (2005) > :: Resume > E-mail: michaelforte at hotmail.com > > "Often those who work the hardest are the luckiest..." > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Wed Apr 29 10:10:54 2009 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 29 Apr 2009 10:10:54 -0400 Subject: [nycphp-talk] WAMP (minus the M) forking question - also open to other ideas In-Reply-To: <49F85E0B.3040704@gmail.com> References: <49F85E0B.3040704@gmail.com> Message-ID: <49F85FEE.50304@phpwerx.net> Rene Samson wrote: > I don't know how much control you have over the webserver, but have you > looked at the PCNTL extension? I've played around with it a while ago, > and it works very nicely. I've only used it in a LAMP environment, but > it should do the same in a WAMP environment. Sadly, the PCNTL extension is not available for Windows. Dan From michaelforte at hotmail.com Wed Apr 29 11:01:26 2009 From: michaelforte at hotmail.com (Michael J. Forte) Date: Wed, 29 Apr 2009 11:01:26 -0400 Subject: [nycphp-talk] WAMP (minus the M) forking question - also open to other ideas In-Reply-To: <49F85FEE.50304@phpwerx.net> References: <49F85E0B.3040704@gmail.com> <49F85FEE.50304@phpwerx.net> Message-ID: An HTML attachment was scrubbed... URL: From michaelforte at hotmail.com Wed Apr 29 13:31:38 2009 From: michaelforte at hotmail.com (Michael J. Forte) Date: Wed, 29 Apr 2009 13:31:38 -0400 Subject: [nycphp-talk] WAMP (minus the M) forking question - also open to other ideas In-Reply-To: <49F84E9F.6000502@phpwerx.net> References: <8f0676b40904272142m405a8c15l84774039291c4726@mail.gmail.com> <2b4feca10904281246h3eb2546el7bdd0f53dc9d434a@mail.gmail.com> <49F84E9F.6000502@phpwerx.net> Message-ID: An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Wed Apr 29 20:21:33 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 29 Apr 2009 20:21:33 -0400 Subject: [nycphp-talk] Remote addess Message-ID: <20090430002135055.OZBR12322@hrndva-omta03.mail.rr.com> When I try to include a php from a remote server, I get the following error: URL file-access is disabled in the server configuration. Does anyone know how to configure the server to allow remote access? Thank you, M* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ant92083 at gmail.com Wed Apr 29 20:27:48 2009 From: ant92083 at gmail.com (Anthony Wlodarski) Date: Wed, 29 Apr 2009 20:27:48 -0400 Subject: [nycphp-talk] Remote addess In-Reply-To: <20090430002135055.OZBR12322@hrndva-omta03.mail.rr.com> References: <20090430002135055.OZBR12322@hrndva-omta03.mail.rr.com> Message-ID: <43bc541c0904291727k6c5a2db8oa07238a70139ea4c@mail.gmail.com> I generally in my code do not access an external server for include and include_once or require_once functions. But I believe http://us2.php.net/manual/en/features.remote-files.php can steer you in the right direction. -Anthony On Wed, Apr 29, 2009 at 8:21 PM, Michele Waldman wrote: > When I try to include a php from a remote server, I get the following > error: > > > > URL file-access is disabled in the server configuration. > > > > Does anyone know how to configure the server to allow remote access? > > > > Thank you, > > > > M* > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Anthony W. ant92083 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Apr 29 21:53:45 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 29 Apr 2009 21:53:45 -0400 (EDT) Subject: [nycphp-talk] jQuery (Was: PHP hosting and standard tool-chain for newbie?) In-Reply-To: <49F226A2.7070205@secdat.com> Message-ID: On Fri, 24 Apr 2009, Kenneth Downs wrote: > I found myself settling on jQuery UI and then trying to do minimal > additions, this gave some sense of stability. Well the fact that jQuery plays nice with the namespace compared to scriptaculous drew me to it... -- Aj. From jcampbell1 at gmail.com Wed Apr 29 22:53:44 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 29 Apr 2009 22:53:44 -0400 Subject: [nycphp-talk] Remote addess In-Reply-To: <20090430002135055.OZBR12322@hrndva-omta03.mail.rr.com> References: <20090430002135055.OZBR12322@hrndva-omta03.mail.rr.com> Message-ID: <8f0676b40904291953n1cc068e0lac0a3b88ff028c2@mail.gmail.com> On Wed, Apr 29, 2009 at 8:21 PM, Michele Waldman wrote: > Does anyone know how to configure the server to allow remote access? There is never a valid reason to include remote files, but if you really want to do it, just enable allow_url_fopen and allow_url_include From nynj.tech at hotmail.com Wed Apr 29 23:22:30 2009 From: nynj.tech at hotmail.com (chad qian) Date: Wed, 29 Apr 2009 23:22:30 -0400 Subject: [nycphp-talk] anyone have idea about the following warning message? Message-ID: I always get this warning message on one php page: " Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 " How to fix this issue?php problem or apache web server problem?I have no clue. Thanks in advance! chad _________________________________________________________________ Rediscover Hotmail?: Get e-mail storage that grows with you. http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomsartain at gmail.com Wed Apr 29 23:33:20 2009 From: tomsartain at gmail.com (Tom Sartain) Date: Wed, 29 Apr 2009 23:33:20 -0400 Subject: [nycphp-talk] anyone have idea about the following warning message? In-Reply-To: References: Message-ID: <20190d950904292033p68307e85n5014dce195190f1d@mail.gmail.com> Found this from googling the first sentance: http://www.spiration.co.uk/post/1231/Your%20script%20possibly%20relies%20on%20a%20session%20side-effect Apparently you're trying to assign a global variable into the session directly. Of course, if you could provide some sort of code, we could help out a bit more. You say you've got this isolated down to one PHP page... have you tried working down the code line-by-line to see what ends up throwing the error? On 4/29/09, chad qian wrote: > > I always get this warning message on one php page: > > " > > Warning: Unknown: Your script possibly relies on a session side-effect which > existed until PHP 4.2.3. Please be advised that the session extension does > not consider global variables as a source of data, unless register_globals > is enabled. You can disable this functionality and this warning by setting > session.bug_compat_42 or session.bug_compat_warn to off, respectively. in > Unknown on line 0 > > " > > How to fix this issue?php problem or apache web server problem?I have no > clue. > > > > Thanks in advance! > > > > chad > > _________________________________________________________________ > Rediscover Hotmail?: Get e-mail storage that grows with you. > http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009 From tim_lists at o2group.com Thu Apr 30 03:39:54 2009 From: tim_lists at o2group.com (Tim Lieberman) Date: Thu, 30 Apr 2009 03:39:54 -0400 Subject: [nycphp-talk] Remote addess In-Reply-To: <8f0676b40904291953n1cc068e0lac0a3b88ff028c2@mail.gmail.com> References: <20090430002135055.OZBR12322@hrndva-omta03.mail.rr.com> <8f0676b40904291953n1cc068e0lac0a3b88ff028c2@mail.gmail.com> Message-ID: On Apr 29, 2009, at 10:53 PM, John Campbell wrote: > On Wed, Apr 29, 2009 at 8:21 PM, Michele Waldman > wrote: >> Does anyone know how to configure the server to allow remote access? > > There is never a valid reason to include remote files, but if you > really want to do it, just enable allow_url_fopen and > allow_url_include That's almost always right. Aside from some very, very narrow circumstances, this is a bad, bad, bad, idea. Even when it's not an awful idea, it should still make you very nervous. From lists at zaunere.com Thu Apr 30 07:04:46 2009 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 30 Apr 2009 07:04:46 -0400 Subject: [nycphp-talk] WAMP (minus the M) forking question - also open to other ideas In-Reply-To: References: Message-ID: <061401c9c983$795608b0$6c021a10$@com> Hi, > Hi experienced and talented community of which I have been trolling for > a few years! > > I have a question for all of you and I hope this makes sense. > > First, the background. I am coding a PHP Web application that has to > call a external program, however, because only one instance of the > program can be ran at a time I need to implement a queue. In addition, > it is important the users need to not wait (keep the browser open) for > their job to process. The script will send them an e-mail with a link > after their job completes. This means I need something to persistently > run whenever there is something in the queue. In summary: front end > script calls secondary child which runs until queue is empty by calling > external program. > > My problem is, I cannot figure out how to properly fork under Windows, > allowing the parent script to run to completion, and not hang the > browser waiting for the child to complete. I am at the point where I > can spawn the child and it will run even when the parent browser is > closed but will not release the parent script until it completes. I > have tried exec(), system(), shell_exec(), popen(), and a COM call > (which I might have done wrong). Each of those called php -f > childScript.php. > > I thought about a few other alternatives: > > 1. Use a scheduled task to check for a queue at a set interval. This is > the least desired solution as it could cause unwanted delay. > 2. Write a PHP daemon/Win32 service to monitor a queue of which could > be queried and started if needed by parent script and it would run > until the queue is empty at which time it would shutdown. > 3. Write a Perl script to be called by the parent which would fork and > call the secondary PHP script, subsequently terminating and releasing > the parent PHP script. > > In summary: > > - WAMP environment, cannot use Linux as external program is Windows > only (BUMMER!) > - Need a queue to handle calls to an external program, currently stored > in a flat file > - Parent script needs to fork to a child script which can run > independent of the parent until queue is empty > - Parent script needs to be able to complete prior to child completing > - Because of time required to run a job and because of the potential > for many users, users need to be able to submit'n'run. > > Do any of you PHP gods (and goddesses!) have any thoughts on how to > fork under Windows, how to handle this situation, or alternatives? > Should I be using some other language? Perl, AJAX, other? > > Google (or my search string) was less than helpful. Hmm, this is a good question. I know this can happen on Linux/Apache as well. Basically there's always a problem forking from apache because of various file descriptors/etc. which are held onto within the forked PHP process. If you do decide to fork, read: http://marc.info/?l=bugtraq&m=107247844327956&w=2 And specifically the code around "Need to fork so apache doesn't kill us". Effectively, you need to close down and reopen all filedes that are inherited into the PHP process, otherwise you get the hang problem you describe. Search around also for forking from an apache module as there are other resources on this. The other option would be to simply execute a batch file which queues and returns immediately. Another independent process could be the queue runner. This is more of an "async" way doing this type of thing, and actually may be preferred for scalability and flexibility reasons. H From mmwaldman at nyc.rr.com Thu Apr 30 09:04:20 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Thu, 30 Apr 2009 09:04:20 -0400 Subject: [nycphp-talk] Remote addess In-Reply-To: Message-ID: <20090430130419018.FJFK12322@hrndva-omta03.mail.rr.com> This was one of the narrow circumstances where it might be a very practical idea because we're dealing with over 800 portals. There was some nervousness over the decision. But, it would have made maintenance practical. But, some of the code contained ajax, so we couldn't do it, anyway, which sucks for the person maintaining the portals. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Tim Lieberman > Sent: Thursday, April 30, 2009 3:40 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Remote addess > > On Apr 29, 2009, at 10:53 PM, John Campbell wrote: > > > On Wed, Apr 29, 2009 at 8:21 PM, Michele Waldman > > wrote: > >> Does anyone know how to configure the server to allow remote access? > > > > There is never a valid reason to include remote files, but if you > > really want to do it, just enable allow_url_fopen and > > allow_url_include > > That's almost always right. > > Aside from some very, very narrow circumstances, this is a bad, bad, > bad, idea. > > Even when it's not an awful idea, it should still make you very nervous. > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From ant92083 at gmail.com Thu Apr 30 10:46:06 2009 From: ant92083 at gmail.com (Anthony Wlodarski) Date: Thu, 30 Apr 2009 10:46:06 -0400 Subject: [nycphp-talk] Remote addess In-Reply-To: <20090430130419018.FJFK12322@hrndva-omta03.mail.rr.com> References: <20090430130419018.FJFK12322@hrndva-omta03.mail.rr.com> Message-ID: <43bc541c0904300746q691e2bdbp57d7ad323b040545@mail.gmail.com> Well not to beat on a dead horse but has anyone ever found a good use for this (Other than Michele's need for this.)? I have never designed/developed any piece of software in PHP to access its code base via an external server. -Anthony On Thu, Apr 30, 2009 at 9:04 AM, Michele Waldman wrote: > This was one of the narrow circumstances where it might be a very practical > idea because we're dealing with over 800 portals. There was some > nervousness over the decision. But, it would have made maintenance > practical. > > But, some of the code contained ajax, so we couldn't do it, anyway, which > sucks for the person maintaining the portals. > > Michele > > > -----Original Message----- > > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > > On Behalf Of Tim Lieberman > > Sent: Thursday, April 30, 2009 3:40 AM > > To: NYPHP Talk > > Subject: Re: [nycphp-talk] Remote addess > > > > On Apr 29, 2009, at 10:53 PM, John Campbell wrote: > > > > > On Wed, Apr 29, 2009 at 8:21 PM, Michele Waldman > > > wrote: > > >> Does anyone know how to configure the server to allow remote access? > > > > > > There is never a valid reason to include remote files, but if you > > > really want to do it, just enable allow_url_fopen and > > > allow_url_include > > > > That's almost always right. > > > > Aside from some very, very narrow circumstances, this is a bad, bad, > > bad, idea. > > > > Even when it's not an awful idea, it should still make you very nervous. > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Anthony W. ant92083 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nynj.tech at hotmail.com Thu Apr 30 10:47:51 2009 From: nynj.tech at hotmail.com (chad qian) Date: Thu, 30 Apr 2009 10:47:51 -0400 Subject: [nycphp-talk] anyone have idea about the following warning message? In-Reply-To: <20190d950904292033p68307e85n5014dce195190f1d@mail.gmail.com> References: <20190d950904292033p68307e85n5014dce195190f1d@mail.gmail.com> Message-ID: I check link:http://www.spiration.co.uk/post/1231/Your%20script%20possibly%20relies%20on%20a%20session%20side-effect and make change. However,I still get the same warning message. I list my php code as the following: Any more help?Many thanks! chad > Date: Wed, 29 Apr 2009 23:33:20 -0400 > From: tomsartain at gmail.com > To: talk at lists.nyphp.org > Subject: Re: [nycphp-talk] anyone have idea about the following warning message? > > Found this from googling the first sentance: > http://www.spiration.co.uk/post/1231/Your%20script%20possibly%20relies%20on%20a%20session%20side-effect > > Apparently you're trying to assign a global variable into the session > directly. Of course, if you could provide some sort of code, we could > help out a bit more. > > You say you've got this isolated down to one PHP page... have you > tried working down the code line-by-line to see what ends up throwing > the error? > > On 4/29/09, chad qian wrote: > > > > I always get this warning message on one php page: > > > > " > > > > Warning: Unknown: Your script possibly relies on a session side-effect which > > existed until PHP 4.2.3. Please be advised that the session extension does > > not consider global variables as a source of data, unless register_globals > > is enabled. You can disable this functionality and this warning by setting > > session.bug_compat_42 or session.bug_compat_warn to off, respectively. in > > Unknown on line 0 > > > > " > > > > How to fix this issue?php problem or apache web server problem?I have no > > clue. > > > > > > > > Thanks in advance! > > > > > > > > chad > > > > _________________________________________________________________ > > Rediscover Hotmail?: Get e-mail storage that grows with you. > > http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php _________________________________________________________________ Rediscover Hotmail?: Get e-mail storage that grows with you. http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009 -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Thu Apr 30 11:07:24 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 30 Apr 2009 11:07:24 -0400 Subject: [nycphp-talk] jQuery (Was: PHP hosting and standard tool-chain for newbie?) In-Reply-To: References: <49F226A2.7070205@secdat.com> Message-ID: On Wed, Apr 29, 2009 at 9:53 PM, Ajai Khattri wrote: > On Fri, 24 Apr 2009, Kenneth Downs wrote: > >> I found myself settling on jQuery UI and then trying to do minimal >> additions, this gave some sense of stability. > > Well the fact that jQuery plays nice with the namespace compared to > scriptaculous drew me to it... > Amen to that. I left prototype/scriptaculous for the same reason: rather than provide an enhanced calls in their own namespace, it redefines javascript itself. When mixed with legacy code, unintended results ensue. Also, I couldn't stand to type scriptaculous any more. Meh. From randalrust at gmail.com Thu Apr 30 11:10:16 2009 From: randalrust at gmail.com (Randal Rust) Date: Thu, 30 Apr 2009 11:10:16 -0400 Subject: [nycphp-talk] Help with a CakePHP View Message-ID: We have inherited a Cake app that needs to be up and running by the end of next week. I downloaded the application and installed it locally. While running through testing, I discovered that some things work, and some don't. The particular piece of code that is being troublesome is this: $whereClause = '`District`.`id` = "' . $this->mrClean->sql($this->passedArgs[0]) . '"'; $this->set('district', $this->District->find($whereClause)); $this->passedArgs[0] is an integer, the ID of the record. If I remove $whereClause from the second line, the view works. But I get the first record from the database. If I leave it in there, I get a blank page. I have set debugging to 3, so that if the view works, I see the SQL query, but that doesn't do me a bit of good if I can't see why the query seems to fail when an ID is passed. Any ideas? This should not be this difficult, which only adds to the frustration. The exact same structure works on other data models, but not this District model. -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From jcampbell1 at gmail.com Thu Apr 30 13:25:27 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 30 Apr 2009 13:25:27 -0400 Subject: [nycphp-talk] anyone have idea about the following warning message? In-Reply-To: References: <20190d950904292033p68307e85n5014dce195190f1d@mail.gmail.com> Message-ID: <8f0676b40904301025m1733c5ffxeaea827d667e9688@mail.gmail.com> DRY! DRY! DRY! Try something like this: $cart_keys = array( 'mouse_choice','monitor_choice','wifi_choice','subtotal','offsets','amount','desc','first_name','last_name','address','city','state','zip','phone','billeve','email','ship_to_first_name','ship_to_last_name','ship_to_address','ship_to_city','ship_to_state','ship_to_zip','shipday','card_num','exp_date','card_code'); foreach($cart_keys as $key) { if($_POST[$key]) $_SESSION[$key] = $_POST[$key]; } // load the keys as variables, not really needed because the values already exist in _SESSION. extract(array_intersect_key($_SESSION,array_flip($cart_keys))); Regards, John Campbell On Thu, Apr 30, 2009 at 10:47 AM, chad qian wrote: > I check > link:http://www.spiration.co.uk/post/1231/Your%20script%20possibly%20relies%20on%20a%20session%20side-effect > and make change. However,I still get the same warning message. > > I list my php code?as the following: > session_start(); > $mouse_choice=$_POST["mouse_choice"]; > $monitor_choice=$_POST["monitor_choice"]; > $wifi_choice=$_POST["wifi_choice"]; > $subtotal=$_POST["subtotal"]; > $offsets=$_POST["offsets"]; > $amount=$_POST["amount"]; > $desc=$_POST["desc"]; > $first_name=$_POST["first_name"]; > $last_name=$_POST["last_name"]; > $address=$_POST["address"]; > $city=$_POST["city"]; > $state=$_POST["state"]; > $zip=$_POST["zip"]; > $phone=$_POST["phone"]; > $billeve=$_POST["billeve"]; > $email=$_POST["email"]; > $ship_to_first_name=$_POST["ship_to_first_name"]; > $ship_to_last_name=$_POST["ship_to_last_name"]; > $ship_to_address=$_POST["ship_to_address"]; > $ship_to_city=$_POST["ship_to_city"]; > $ship_to_state=$_POST["ship_to_state"]; > $ship_to_zip=$_POST["ship_to_zip"]; > $shipday=$_POST["shipday"]; > $card_num=$_POST["card_num"]; > $exp_date=$_POST["exp_date"]; > $card_code=$_POST["card_code"]; > > > > if($_POST["mouse_choice"]) > $_SESSION["mouse_choice"]=$mouse_choice; > else > $mouse_choice=$_SESSION["mouse_choice"]; > > if($_POST["monitor_choice"]) > $_SESSION["monitor_choice"]=$monitor_choice; > else > $monitor_choice=$_SESSION["monitor_choice"]; > > if($_POST["wifi_choice"]) > $_SESSION["wifi_choice"]=$wifi_choice; > else > $wifi_choice=$_SESSION["wifi_choice"]; > > if($_POST["subtotal"]) > $_SESSION["subtotal"]=$subtotal; > else > $subtotal=$_SESSION["subtotal"]; > > if($_POST["offsets"]) > $_SESSION["offsets"]=$offsets; > else > $offsets=$_SESSION["offsets"]; > > if($_POST["amount"]) > $_SESSION["amount"]=$amount; > else > $amount=$_SESSION["amount"]; > $sum=$subtotal; > > if($_POST["desc"]) > $_SESSION["desc"]=$desc; > else > $desc=$_SESSION["desc"]; > > if($_POST["first_name"]) > $_SESSION["first_name"]=$first_name; > else > $first_name=$_SESSION["first_name"]; > > if($_POST["last_name"]) > $_SESSION["last_name"]=$last_name; > else > $last_name=$_SESSION["last_name"]; > > if($_POST["address"]) > $_SESSION["address"]=$address; > else > $address=$_SESSION["address"]; > > if($_POST["city"]) > $_SESSION["city"]=$city; > else > $city=$_SESSION["city"]; > > if($_POST["state"]) > $_SESSION["state"]=$sate; > else > $state=$_SESSION["state"]; > > if($_POST["zip"]) > $_SESSION["zip"]=$zip; > else > $zip=$_SESSION["zip"]; > > if($_POST["phone"]) > $_SESSION["phone"]=$phone; > else > $phone=$_SESSION["phone"]; > > if($_POST["billeve"]) > $_SESSION["billeve"]=$billeve; > else > $billeve=$_SESSION["billeve"]; > > if($_POST["email"]) > $_SESSION["email"]=$email; > else > $email=$_SESSION["email"]; > > if($_POST["ship_to_first_name"]) > $_SESSION["ship_to_first_name"]=$ship_to_first_name; > else > $ship_to_first_name=$_SESSION["ship_to_first_name"]; > > if($_POST["ship_to_last_name"]) > $_SESSION["ship_to_last_name"]=$ship_to_last_name; > else > $ship_to_last_name=$_SESSION["ship_to_last_name"]; > > if($_POST["ship_to_address"]) > $_SESSION["ship_to_address"]=$ship_to_address; > else > $ship_to_address=$_SESSION["ship_to_address"]; > > if($_POST["ship_to_city"]) > $_SESSION["ship_to_city"]=$ship_to_city; > else > $ship_to_city=$_SESSION["ship_to_city"]; > > if($_POST["ship_to_state"]) > $_SESSION["ship_to_state"]=$ship_to_state; > else > $ship_to_state=$_SESSION["ship_to_state"]; > > if($_POST["ship_to_zip"]) > $_SESSION["ship_to_zip"]=$ship_to_zip; > else > $ship_to_zip=$_SESSION["ship_to_zip"]; > > if($_POST["shipday"]) > $_SESSION["shipday"]=$shipday; > else > $shipday=$_SESSION["shipday"]; > > if($_POST["card_num"]) > $_SESSION["card_num"]=$card_num; > else > $card_num=$_SESSION["card_num"]; > > if($_POST["exp_date"]) > $_SESSION["exp_date"]=$exp_date; > else > $exp_date=$_SESSION["exp_date"]; > > if($_POST["card_code"]) > $_SESSION["card_code"]=$card_code; > else > $card_code=$_SESSION["card_code"]; > > ?> > > Any more help?Many thanks! > > chad > >> Date: Wed, 29 Apr 2009 23:33:20 -0400 >> From: tomsartain at gmail.com >> To: talk at lists.nyphp.org >> Subject: Re: [nycphp-talk] anyone have idea about the following warning >> message? >> >> Found this from googling the first sentance: >> >> http://www.spiration.co.uk/post/1231/Your%20script%20possibly%20relies%20on%20a%20session%20side-effect >> >> Apparently you're trying to assign a global variable into the session >> directly. Of course, if you could provide some sort of code, we could >> help out a bit more. >> >> You say you've got this isolated down to one PHP page... have you >> tried working down the code line-by-line to see what ends up throwing >> the error? >> >> On 4/29/09, chad qian wrote: >> > >> > I always get this warning message on one php page: >> > >> > " >> > >> > Warning: Unknown: Your script possibly relies on a session side-effect >> > which >> > existed until PHP 4.2.3. Please be advised that the session extension >> > does >> > not consider global variables as a source of data, unless >> > register_globals >> > is enabled. You can disable this functionality and this warning by >> > setting >> > session.bug_compat_42 or session.bug_compat_warn to off, respectively. >> > in >> > Unknown on line 0 >> > >> > " >> > >> > How to fix this issue?php problem or apache web server problem?I have no >> > clue. >> > >> > >> > >> > Thanks in advance! >> > >> > >> > >> > chad >> > >> > _________________________________________________________________ >> > Rediscover Hotmail?: Get e-mail storage that grows with you. >> > >> > http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009 >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > ________________________________ > Rediscover Hotmail?: Get e-mail storage that grows with you. Check it out. > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From chsnyder at gmail.com Thu Apr 30 13:48:01 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 30 Apr 2009 13:48:01 -0400 Subject: [nycphp-talk] anyone have idea about the following warning message? In-Reply-To: <8f0676b40904301025m1733c5ffxeaea827d667e9688@mail.gmail.com> References: <20190d950904292033p68307e85n5014dce195190f1d@mail.gmail.com> <8f0676b40904301025m1733c5ffxeaea827d667e9688@mail.gmail.com> Message-ID: On Thu, Apr 30, 2009 at 1:25 PM, John Campbell wrote: > DRY! DRY! DRY! Don't repeat yourself... three times for emphasis. ;-) From danielc at analysisandsolutions.com Thu Apr 30 14:37:08 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 30 Apr 2009 14:37:08 -0400 Subject: [nycphp-talk] Help with a CakePHP View In-Reply-To: References: Message-ID: <20090430183708.GA29578@panix.com> On Thu, Apr 30, 2009 at 11:10:16AM -0400, Randal Rust wrote: > > $whereClause = '`District`.`id` = "' . > $this->mrClean->sql($this->passedArgs[0]) . '"'; > $this->set('district', $this->District->find($whereClause)); ... > If I remove $whereClause from the second line, the view works. But I > get the first record from the database. If I leave it in there, I get > a blank page. I'll bet you a beer that it's because there's no record in the database with a matching record. So that means either $this->passedArgs[0] isn't being set or is set to a value that doesn't equal a value in the District.id column of the table. --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 randalrust at gmail.com Thu Apr 30 14:46:00 2009 From: randalrust at gmail.com (Randal Rust) Date: Thu, 30 Apr 2009 14:46:00 -0400 Subject: [nycphp-talk] Help with a CakePHP View In-Reply-To: <20090430183708.GA29578@panix.com> References: <20090430183708.GA29578@panix.com> Message-ID: On Thu, Apr 30, 2009 at 2:37 PM, Daniel Convissor wrote: >> $whereClause = '`District`.`id` = "' . >> $this->mrClean->sql($this->passedArgs[0]) . '"'; >> $this->set('district', $this->District->find($whereClause)); > I'll bet you a beer that it's because there's no record in the database > with a matching record. ?So that means either $this->passedArgs[0] isn't > being set or is set to a value that doesn't equal a value in the > District.id column of the table. You owe me a beer:) I've checked all of that. What's even more strange is that I found out that for 3 of the 20 records the view will actually work. The others, no luck. I have tried all sorts of options on this and simply cannot discover why the view fails in most cases. I even tried this: $this->District->findById(35); //which works $this->District->findById(141); //which fails However, if I do this: $this->District->query("select * from districts as District where id='35'"); or: $this->District->query("select * from districts as District where id='141'"); Both of those work, but it gives me the data in an array that doesn't work with the data structure that has been set up. -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From danielc at analysisandsolutions.com Thu Apr 30 15:07:24 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 30 Apr 2009 15:07:24 -0400 Subject: [nycphp-talk] Help with a CakePHP View In-Reply-To: References: <20090430183708.GA29578@panix.com> Message-ID: <20090430190723.GA4787@panix.com> On Thu, Apr 30, 2009 at 02:46:00PM -0400, Randal Rust wrote: > > You owe me a beer:) Cool! Hey, double or nothing... > I've checked all of that. What's even more strange is that I found out > that for 3 of the 20 records the view will actually work. The others, > no luck. So chances are the data inside the table is the problem, not the query. Do a very careful comparison of a record that works vs one that doesn't. A possibility is that the query is doing an (inner) JOIN rather than a (outer) LEFT JOIN and there's no matching record in the joined table? Have you put a debug statement inside the framework at the point just before the query is actually sent to the database (you know, like a mysqli_query() call)? That way you can see the SQL the framework has composed. Then you can run that SQL manually and see what comes up. If that doesn't reveal anything, you'll need to break out a debugger and step through the code of a working district id and a non-working district id to see what the difference is. --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 randalrust at gmail.com Thu Apr 30 15:13:40 2009 From: randalrust at gmail.com (Randal Rust) Date: Thu, 30 Apr 2009 15:13:40 -0400 Subject: [nycphp-talk] Help with a CakePHP View In-Reply-To: <20090430190723.GA4787@panix.com> References: <20090430183708.GA29578@panix.com> <20090430190723.GA4787@panix.com> Message-ID: On Thu, Apr 30, 2009 at 3:07 PM, Daniel Convissor wrote: > So chances are the data inside the table is the problem, not the query. > Do a very careful comparison of a record that works vs one that doesn't. Yeah, already did that too. I even modified the *broken* record to see if I could get it to work. No luck. > A possibility is that the query is doing an (inner) JOIN rather than a > (outer) LEFT JOIN and there's no matching record in the joined table? That is what I thought as well, but I haven't been able to find any such issue. > Have you put a debug statement inside the framework at the point just > before the query is actually sent to the database That's what I need, but I've had a heck of a time figuring out just where that is. The big problem here is that the person that wrote it didn't break out the models for the data appropriately. There is one Admin model that handles several different types of data, and I'm fairly certain something is getting crossed up because of this approach. The truth is, I could rebuild this thing in my own CMS in about a day, but I wanted to keep it as is if possible. Again, this should not be that hard to figure out. -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From danielc at analysisandsolutions.com Thu Apr 30 16:17:56 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 30 Apr 2009 16:17:56 -0400 Subject: [nycphp-talk] Help with a CakePHP View In-Reply-To: References: <20090430183708.GA29578@panix.com> <20090430190723.GA4787@panix.com> Message-ID: <20090430201756.GA29081@panix.com> On Thu, Apr 30, 2009 at 03:13:40PM -0400, Randal Rust wrote: > > Yeah, already did that too. I even modified the *broken* record to see > if I could get it to work. No luck. But what's the difference between the two types of records? > > A possibility is that the query is doing an (inner) JOIN rather than a > > (outer) LEFT JOIN and there's no matching record in the joined table? > > That is what I thought as well, but I haven't been able to find any > such issue. Until you see the actual SQL, you can't really say that. > > Have you put a debug statement inside the framework at the point just > > before the query is actually sent to the database > > That's what I need, but I've had a heck of a time figuring out just > where that is. grep -r mysqli_query . Of course, adjust "mysqli_query" as needed for your given context. --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