From prusak at gmail.com Thu Aug 2 00:07:07 2007 From: prusak at gmail.com (Ophir Prusak) Date: Thu, 2 Aug 2007 00:07:07 -0400 Subject: [nycphp-talk] Oh... Interviewing In-Reply-To: <001a01c7cb44$e21a7d70$07d6f4a7@ced> References: <001201c7c819$ed88eda0$c89ac8e0$@com> <3B067702-D84F-4CF0-9B10-A6A2FD3B8B4A@jonbaer.com> <200707181158.08005.arzala@gmail.com> <5e2aaca40707182055u41896db3n1e9a92dae130124@mail.gmail.com> <001a01c7cb44$e21a7d70$07d6f4a7@ced> Message-ID: As someone who has been on both sides on the fence, a few helpful comments based on my experience: (I'm brainstorming here, so this is in no particular order) - It's totally acceptable to try to get a better understanding of a candidates "true" technical capabilities during an interview. Of course you need to let them know in advance that you'll be asking technical stuff. - A written test is *not* the best way to gauge a person's knowledge. What works best for me is a conversation between myself and the candidate. This is for a couple of reasons - (1) Many people just aren't good at written tests regardless of their knowledge (it makes them nervous, etc). (2) Ultimately, you shouldn't really care about a person's specific knowledge at a specific point in time (ie the interview) You should care about their ability to make the right decision at the right time, and in timely fashion. For me, this means that if the candidate doesn't know something, they at least know enough to fully understand the question and it's implications, and know where to find the correct answer quickly (and understand the answer as well). - I usually ask the candidate to describe a project they were recently involved with and then interweave my questions into the conversation. I'll ask why certain decisions were made and what other options they were considering. - It's also very revealing to see what questions the interviewer asks back. I'll ask something purposely vague (like "you're told to build a new web app - what language would u use?") Hope that helps. Ophir On 7/20/07, CED wrote: > I recently sat down with a candidate for a Software Management/Architect > position here is what I presented: > > Software Architecture > a.. Name 3 design patterns. > > b.. > c.. > d.. > e.. Which of the following general statements about a class are true? > > f.. Select Answer: > > g.. 1. A class represents a concept in an application domain > > h.. 2. A class defines a new data type > > i.. 3. A class contains data and operations > > j.. 4. All of the above > > k.. 5. None of the Above > > l.. What is the average anticipated load per processor (2GHz) that a web > application server can support? (in concurrency) > > m.. Name 3 Scopes. > > n.. > o.. > p.. > q.. Name 3 Aggregate SQL functions > > r.. > s.. > t.. > u.. Name 3 Network Layer protocols > > v.. > w.. > x.. > y.. Name 3 Transport Layer protocols > > z.. > aa.. > ab.. > ac.. Language agnostically describe how you would do the following: > > ad.. Switch the assignments of variable A and variable B. > > ae.. Reverse the string "apple" into "elppa". > > af.. > ag.. Describe to your best ability the following: > > ah.. Polymorphism > > ai.. Clustering > > aj.. Persistence > > ak.. > al.. Using language agnostic regular expressions how would you do the > following: > > am.. Find "apple" in "Christine's Apple pie" > > an.. Replace the 2nd "p" with "g" and change "Planned" to "Plotted" in > "Peter Piper Planned Poorly" > > Now I thought that these questions were certainly challenging yet basic > enough for an expert software architect, however, and much to my surprise > the candidate wasn't really even interested in looking at it, in fact he > refused to answer any of it. Other than being surprised, and needless to say > concerned, It made me re-visit our many emails a few weeks ago about > interviewing... and here was my conclusion: > > 1) If you're given an exam, just try your best, but don't refuse, after all, > are you or are you not confident in your abilities > 2) When administering an exam, be sure to have informed the candidate before > hand, it gives them the opportunity to prepare > 3) In the end, trust your gut. We have all been at various places of talent > throughout our respective careers, you know when someone isn't completely > up-to-speed, and when someone is simply bashful about their skills. > > Thoughts? > > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- - - - - - - - - - - - - - - - - - - - - Ophir Prusak http://www.prusak.com From mancinic at gmail.com Thu Aug 2 06:54:07 2007 From: mancinic at gmail.com (Christopher M Mancini) Date: Thu, 2 Aug 2007 06:54:07 -0400 Subject: [nycphp-talk] Oh... Interviewing In-Reply-To: References: <001201c7c819$ed88eda0$c89ac8e0$@com> <3B067702-D84F-4CF0-9B10-A6A2FD3B8B4A@jonbaer.com> <200707181158.08005.arzala@gmail.com> <5e2aaca40707182055u41896db3n1e9a92dae130124@mail.gmail.com> <001a01c7cb44$e21a7d70$07d6f4a7@ced> Message-ID: <84caf2b90708020354j5ccafa5cq4cb874c1bbbc949f@mail.gmail.com> Ophir, I greatly agree with your statement regarding the un-usefulness of written technical exams. A recruiter asked me to complete an online one recently, I felt lost and disoriented. Even though that being a developer for almost 3 years using PHP, I have never come ac crossed a problem that I couldn't FINDan answer for. But on this exam, I couldn't answer at least half of the questions. Chris On 8/2/07, Ophir Prusak wrote: > > As someone who has been on both sides on the fence, a few helpful > comments based on my experience: > (I'm brainstorming here, so this is in no particular order) > > - It's totally acceptable to try to get a better understanding of a > candidates "true" technical capabilities during an interview. Of > course you need to let them know in advance that you'll be asking > technical stuff. > > - A written test is *not* the best way to gauge a person's knowledge. > What works best for me is a conversation between myself and the > candidate. > This is for a couple of reasons - > (1) Many people just aren't good at written tests regardless of their > knowledge (it makes them nervous, etc). > (2) Ultimately, you shouldn't really care about a person's specific > knowledge at a specific point in time (ie the interview) You should > care about their ability to make the right decision at the right time, > and in timely fashion. > For me, this means that if the candidate doesn't know something, they > at least know enough to fully understand the question and it's > implications, and know where to find the correct answer quickly (and > understand the answer as well). > > - I usually ask the candidate to describe a project they were recently > involved with and then interweave my questions into the conversation. > I'll ask why certain decisions were made and what other options they > were considering. > > - It's also very revealing to see what questions the interviewer asks > back. > I'll ask something purposely vague (like "you're told to build a new > web app - what language would u use?") > > Hope that helps. > > Ophir > > > On 7/20/07, CED wrote: > > I recently sat down with a candidate for a Software Management/Architect > > position here is what I presented: > > > > Software Architecture > > a.. Name 3 design patterns. > > > > b.. > > c.. > > d.. > > e.. Which of the following general statements about a class are true? > > > > f.. Select Answer: > > > > g.. 1. A class represents a concept in an application domain > > > > h.. 2. A class defines a new data type > > > > i.. 3. A class contains data and operations > > > > j.. 4. All of the above > > > > k.. 5. None of the Above > > > > l.. What is the average anticipated load per processor (2GHz) that a > web > > application server can support? (in concurrency) > > > > m.. Name 3 Scopes. > > > > n.. > > o.. > > p.. > > q.. Name 3 Aggregate SQL functions > > > > r.. > > s.. > > t.. > > u.. Name 3 Network Layer protocols > > > > v.. > > w.. > > x.. > > y.. Name 3 Transport Layer protocols > > > > z.. > > aa.. > > ab.. > > ac.. Language agnostically describe how you would do the following: > > > > ad.. Switch the assignments of variable A and variable B. > > > > ae.. Reverse the string "apple" into "elppa". > > > > af.. > > ag.. Describe to your best ability the following: > > > > ah.. Polymorphism > > > > ai.. Clustering > > > > aj.. Persistence > > > > ak.. > > al.. Using language agnostic regular expressions how would you do the > > following: > > > > am.. Find "apple" in "Christine's Apple pie" > > > > an.. Replace the 2nd "p" with "g" and change "Planned" to "Plotted" in > > "Peter Piper Planned Poorly" > > > > Now I thought that these questions were certainly challenging yet basic > > enough for an expert software architect, however, and much to my > surprise > > the candidate wasn't really even interested in looking at it, in fact he > > refused to answer any of it. Other than being surprised, and needless to > say > > concerned, It made me re-visit our many emails a few weeks ago about > > interviewing... and here was my conclusion: > > > > 1) If you're given an exam, just try your best, but don't refuse, after > all, > > are you or are you not confident in your abilities > > 2) When administering an exam, be sure to have informed the candidate > before > > hand, it gives them the opportunity to prepare > > 3) In the end, trust your gut. We have all been at various places of > talent > > throughout our respective careers, you know when someone isn't > completely > > up-to-speed, and when someone is simply bashful about their skills. > > > > Thoughts? > > > > > > > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > > > -- > - - - - - - - - - - - - - - - - - - - - > Ophir Prusak > http://www.prusak.com > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- <------------------------- Sincerely, Christopher M Mancini mancinic at gmail.com --------------------------> -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Thu Aug 2 08:36:03 2007 From: tedd at sperling.com (tedd) Date: Thu, 2 Aug 2007 08:36:03 -0400 Subject: [nycphp-talk] Oh... Interviewing In-Reply-To: References: <001201c7c819$ed88eda0$c89ac8e0$@com> <3B067702-D84F-4CF0-9B10-A6A2FD3B8B4A@jonbaer.com> <200707181158.08005.arzala@gmail.com> <5e2aaca40707182055u41896db3n1e9a92dae130124@mail.gmail.com> <001a01c7cb44$e21a7d70$07d6f4a7@ced> Message-ID: At 12:07 AM -0400 8/2/07, Ophir Prusak wrote: >- It's totally acceptable to try to get a better understanding of a >candidates "true" technical capabilities during an interview. Of >course you need to let them know in advance that you'll be asking >technical stuff. > > - A written test is *not* the best way to gauge a person's knowledge. >What works best for me is a conversation between myself and the >candidate. >This is for a couple of reasons - >(1) Many people just aren't good at written tests regardless of their >knowledge (it makes them nervous, etc). >(2) Ultimately, you shouldn't really care about a person's specific >knowledge at a specific point in time (ie the interview) You should >care about their ability to make the right decision at the right time, >and in timely fashion. >For me, this means that if the candidate doesn't know something, they >at least know enough to fully understand the question and it's >implications, and know where to find the correct answer quickly (and >understand the answer as well). > >- I usually ask the candidate to describe a project they were recently >involved with and then interweave my questions into the conversation. >I'll ask why certain decisions were made and what other options they >were considering. > >- It's also very revealing to see what questions the interviewer asks back. >I'll ask something purposely vague (like "you're told to build a new >web app - what language would u use?") > >Ophir Ophir: I think your method is excellent, more hr people should practice it. The only problem is that the interviewer has to know what they are talking about, in many of the interviews I have taken, that's sadly not true. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From ramons at gmx.net Thu Aug 2 09:34:37 2007 From: ramons at gmx.net (David Krings) Date: Thu, 02 Aug 2007 09:34:37 -0400 Subject: [nycphp-talk] Oh... Interviewing In-Reply-To: References: <001201c7c819$ed88eda0$c89ac8e0$@com> <3B067702-D84F-4CF0-9B10-A6A2FD3B8B4A@jonbaer.com> <200707181158.08005.arzala@gmail.com> <5e2aaca40707182055u41896db3n1e9a92dae130124@mail.gmail.com> <001a01c7cb44$e21a7d70$07d6f4a7@ced> Message-ID: <46B1DD6D.6050501@gmx.net> Hi! The current edition of Computerworld has an article about interesting questions asked during interviews. Indeed, the managers came up with quite some interesting ones and they explain why they ask them. See here: http://preview.tinyurl.com/yo4f9h David From lists at zaunere.com Thu Aug 2 11:49:46 2007 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 2 Aug 2007 11:49:46 -0400 Subject: [nycphp-talk] FW: MySQL Camp II - Brooklyn - August 23-24 Message-ID: <016701c7d51c$c0277380$651ba8c0@MobileZ> All, please see below - should be a good event from MySQL. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com > Just a quick heads up about a MySQL barcamp-style event in New York in > August. MySQL Camp II is a community event -- totally free of charge > -- happening at Polytechnic University in Brooklyn. Sessions are > proposed by and for other campers on MySQL and FOSSy topics of > interest to campers. There is a limit of 200 attendees, so I figured > I would ping you to get the word out to your PHP groups who might be > interested. > > Brief rundown: > > MySQL Camp II > Polytechnic University > Brooklyn, New York > August 23-24 > > To register, email jay at mysql.com with: > > Name > Company, if appropriate > Email > Location (City/State) From wdwtest at gmail.com Sun Aug 5 09:21:24 2007 From: wdwtest at gmail.com (web dream works wdw) Date: Sun, 5 Aug 2007 06:21:24 -0700 Subject: [nycphp-talk] Files are not uploading on Windows 2003 sever using PHP code Message-ID: <78c525cd0708050621i4c016a3bk2367085f23cdc056@mail.gmail.com> Hello Friends, I have installed Windows 2003 sever and then installed PHP 4.3.4 on it. I have a problem that file is not uploading to the specified directory on the server ( locally windows 2003 ). I am using the file upload code in php like : The settings in the php.ini files are correct. Can anyone guide me what should be the problem, so that the files are not uploading to the server. Looking forward to here from you soon. Thanks Wdw. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mancinic at gmail.com Sun Aug 5 10:26:39 2007 From: mancinic at gmail.com (Christopher M Mancini) Date: Sun, 5 Aug 2007 10:26:39 -0400 Subject: [nycphp-talk] Files are not uploading on Windows 2003 sever using PHP code In-Reply-To: <78c525cd0708050621i4c016a3bk2367085f23cdc056@mail.gmail.com> References: <78c525cd0708050621i4c016a3bk2367085f23cdc056@mail.gmail.com> Message-ID: <84caf2b90708050726n48048133ibf2191507d81501c@mail.gmail.com> Do you have the correct permissions setup for the directory you are uploading to? Chris On 8/5/07, web dream works wdw wrote: > > Hello Friends, > > I have installed Windows 2003 sever and then installed PHP 4.3.4 on it. > I have a problem that file is not uploading to the specified directory on > the server ( locally windows 2003 ). I am using the file upload code in php > like : > > > @copy($_FILES['filefield']['tmp_name'],"../dir1/".$_FILES['filefield' > ]['name']); > > } > ?> > > > The settings in the php.ini files are correct. > > Can anyone guide me what should be the problem, so that the files are not > uploading to the server. > > Looking forward to here from you soon. > Thanks > Wdw. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- <------------------------- Sincerely, Christopher M Mancini mancinic at gmail.com http://blog.itrealm.net --------------------------> -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdwtest at gmail.com Sun Aug 5 10:33:45 2007 From: wdwtest at gmail.com (web dream works wdw) Date: Sun, 5 Aug 2007 07:33:45 -0700 Subject: [nycphp-talk] Files are not uploading on Windows 2003 sever using PHP code In-Reply-To: <84caf2b90708050726n48048133ibf2191507d81501c@mail.gmail.com> References: <78c525cd0708050621i4c016a3bk2367085f23cdc056@mail.gmail.com> <84caf2b90708050726n48048133ibf2191507d81501c@mail.gmail.com> Message-ID: <78c525cd0708050733y734fb87dyc69831948f19bb85@mail.gmail.com> Hello Chris, Thanks for reply yes i have set permission 777 to folder on localserver -------------- next part -------------- An HTML attachment was scrubbed... URL: From matteo.rinaudo at gmail.com Sun Aug 5 11:00:53 2007 From: matteo.rinaudo at gmail.com (Matteo Rinaudo) Date: Sun, 5 Aug 2007 11:00:53 -0400 Subject: [nycphp-talk] Files are not uploading on Windows 2003 sever using PHP code In-Reply-To: <78c525cd0708050621i4c016a3bk2367085f23cdc056@mail.gmail.com> References: <78c525cd0708050621i4c016a3bk2367085f23cdc056@mail.gmail.com> Message-ID: > @copy($_FILES['filefield']['tmp_name'],"../dir1/".$_FILES['filefield']['name']); Hi, Try to strip off the `@' before the `copy' function and see the error that PHP raises. If your php.ini configuration does not allow you to see PHP warnings or errors, make sure the PHP errors are logged into the Apache's error_log (or whatever) file and take a look at that. Matteo From j.andrew.mcentire at gmail.com Sun Aug 5 12:43:22 2007 From: j.andrew.mcentire at gmail.com (Jeremy McEntire) Date: Sun, 5 Aug 2007 12:43:22 -0400 Subject: [nycphp-talk] Files are not uploading on Windows 2003 sever using PHP code Message-ID: <7b20ad750708050943i5245b5bcw569fb6f93edfa786@mail.gmail.com> > I have installed Windows 2003 sever and then installed PHP 4.3.4 on it. > I have a problem that file is not uploading to the specified directory on > the server ( locally windows 2003 ). I am using the file upload code in php > like : > @copy($_FILES['filefield']['tmp_name'],"../dir1/".$_FILES['filefield' > ]['name']); > } > ?> You might check out: http://us.php.net/manual/en/features.file-upload.php It looks like their directory is an absolute path. I don't know how that might work in a chrooted environment, but I don't think your '../dir1' makes sense if it is expecting an absolute path. The copy doc doesn't state explicitly. But, it's probably better to use the uploaded file functions -- copy doesn't save you anything as the temp file ought to be automatically deleted at the end of the script anyway. Here's my suggestion: Good luck, Jeremy From elharo at metalab.unc.edu Sun Aug 5 13:42:41 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Sun, 05 Aug 2007 13:42:41 -0400 Subject: [nycphp-talk] Many pages: one script Message-ID: <46B60C11.2090904@metalab.unc.edu> I'm considering a simple site that I may design in PHP. PHP is probably the simplest solution except for one thing: it carries a very strong coupling between pages and scripts. As far as I've ever been able to tell PHP really, really, really wants there to be a single primary .php file for each URL that does not contain a query string (though that file may of course invoke others). For the system I'm designing that simply won't work. In Java servlet environments it's relatively trivial to map one servlet to an entire directory structure, so that it handles all requests for all pages within that hierarchy. Is there any *reasonable* way to do this in PHP? The only way I've ever seen is what WordPress does: use mod_rewrite to redirect all requests within the hierarchy to a custom dispatcher script that converts actual hierarchy components into query string variables. I am impressed by this hack, but it's way too kludgy for me to be comfortable with. For one thing, I don't want to depend on mod_rewrite if I don't have to. Surely by now there's a better way? How do I overcome the one file per URL assumption that PHP makes? -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From jakob.buchgraber at googlemail.com Sun Aug 5 13:48:31 2007 From: jakob.buchgraber at googlemail.com (Jakob Buchgraber) Date: Sun, 05 Aug 2007 19:48:31 +0200 Subject: [nycphp-talk] PDO and Prepared Statements in MySQL when using LIKE [expr] Message-ID: <46B60D6F.7040209@gmail.com> hey! I have some query with a LIKE expression e.g. "SELECT * FROM table WHERE column LIKE "$phpvar%", but I would like to use prepared statements instead of writing the variable directly into the query. So I write: $sth = $this->conn->prepare ("SELECT * FROM table WHERE column LIKE \":phpvar%\""); $sth->bindParam (":phpvar", $phpvar); $sth->execute(); var_dump ($sth->fetchAll()); Here I get an empty result set when using prepared statements. However when just using string concatenation and putting the variable directly into the query it works fine. Is this expected or a bug? Cheers, Jakob -- Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0 From edwardpotter at gmail.com Sun Aug 5 14:04:29 2007 From: edwardpotter at gmail.com (Edward Potter) Date: Sun, 5 Aug 2007 14:04:29 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B60C11.2090904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> Message-ID: hmmmm, I have never found this to be a problem. Using includes, you can pull in .php code from anywhere, even pages with a .php extension may be 99.99% html, with a just a single include('foo.php') in it. Keeps things super streamlined, and your pages are very readable. :-) ed On 8/5/07, Elliotte Harold wrote: > I'm considering a simple site that I may design in PHP. PHP is probably > the simplest solution except for one thing: it carries a very strong > coupling between pages and scripts. As far as I've ever been able to > tell PHP really, really, really wants there to be a single primary .php > file for each URL that does not contain a query string (though that file > may of course invoke others). > > For the system I'm designing that simply won't work. In Java servlet > environments it's relatively trivial to map one servlet to an entire > directory structure, so that it handles all requests for all pages > within that hierarchy. > > Is there any *reasonable* way to do this in PHP? The only way I've ever > seen is what WordPress does: use mod_rewrite to redirect all requests > within the hierarchy to a custom dispatcher script that converts actual > hierarchy components into query string variables. I am impressed by this > hack, but it's way too kludgy for me to be comfortable with. For one > thing, I don't want to depend on mod_rewrite if I don't have to. > > Surely by now there's a better way? How do I overcome the one file per > URL assumption that PHP makes? > > -- > Elliotte Rusty Harold elharo at metalab.unc.edu > Java I/O 2nd Edition Just Published! > http://www.cafeaulait.org/books/javaio2/ > http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- the Blog: http://www.utopiaparkway.com the Karma: http://www.coderswithconscience.com the Projects: http://flickr.com/photos/86842405 at N00/ the Store: http://astore.amazon.com/httpwwwutopic-20 From elharo at metalab.unc.edu Sun Aug 5 14:16:18 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Sun, 05 Aug 2007 14:16:18 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: References: <46B60C11.2090904@metalab.unc.edu> Message-ID: <46B613F2.9010904@metalab.unc.edu> Edward Potter wrote: > hmmmm, I have never found this to be a problem. Using includes, you > can pull in .php code from anywhere, even pages with a .php extension > may be 99.99% html, with a just a single include('foo.php') in it. > Keeps things super streamlined, and your pages are very readable. > You've got it backwards. I want one script to service many URLs, not many scripts to service one URL. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From jellicle at gmail.com Sun Aug 5 14:24:07 2007 From: jellicle at gmail.com (Michael Sims) Date: Sun, 5 Aug 2007 14:24:07 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B60C11.2090904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> Message-ID: <200708051424.07486.jellicle@gmail.com> On August 5, 2007, Elliotte Harold wrote: > I'm considering a simple site that I may design in PHP. PHP is probably > the simplest solution except for one thing: it carries a very strong > coupling between pages and scripts. As far as I've ever been able to > tell PHP really, really, really wants there to be a single primary .php > file for each URL that does not contain a query string (though that file > may of course invoke others). > > For the system I'm designing that simply won't work. In Java servlet > environments it's relatively trivial to map one servlet to an entire > directory structure, so that it handles all requests for all pages > within that hierarchy. You have to think of the whole file-serving hierarchy here. Apache gets a request for an URL. What will Apache do with it? Apache will find a file somewhere that matches that URL, and then Apache will either send that file off for further processing (if the file is registered as such within Apache) or Apache will just send that file off to the browser as-is. PHP doesn't even enter into the picture until the decision you're talking about has already been made by Apache. I don't know much about java servlets, but I strongly suspect it's the same - the Sun web server or whatever you're using is making that decision. It may appear to be "simpler" than the PHP/Apache combination but it really isn't. Perhaps it is better integrated because both the web server and the programming language are products of one company, but it's not any simpler when it executes. In any case the correct answer is just to tell Apache to serve file X for every URL that looks like Y or Z or W. Mod_rewrite. That's what it's there for, and it does its job well, and it can be as simple as a couple lines in an .htaccess file. No doubt one could partly handle this with PHP files: foo.com/index.php - lots of code foo.com/dir1/index.php - PHP file sends everything to foo.com/index.php foo.com/dir2/index.php - PHP file sends everything to foo.com/index.php foo.com/dir1/dir3/index.php - PHP file sends everything to foo.com/index.php but telling Apache to use foo.com/index.php for all requests is simpler and less error-prone. It can be quite simple: Contents of foo.com/yourdir/.htaccess file: ------------------------------------------------------- RewriteEngine On RewriteOptions inherit RewriteBase /yourdir RewriteRule ^([0-9A-Za-z]+)/([0-9A-Za-z]+)/ index.php?var1=$1&var2=$2 RewriteRule ^([0-9A-Za-z]+)/([0-9A-Za-z]+) index.php?var1=$1&var2=$2 RewriteRule ^([0-9A-Za-z]+)/ index.php?var1=$1 -------------------------------------------------------- Now, any request for foo.com/yourdir/anything/anythingatall will be sent to foo.com/yourdir/index.php, which will see the extra "directories" as URL variables. The user will not know what's happening - they'll continue to see the "directories" in their browser status bar. Michael Sims From dell at sala.ca Sun Aug 5 14:26:41 2007 From: dell at sala.ca (Dell Sala) Date: Sun, 5 Aug 2007 14:26:41 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B60C11.2090904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> Message-ID: <5D70B49B-E689-4387-9946-5ACB0A22529A@sala.ca> On Aug 5, 2007, at 1:42 PM, Elliotte Harold wrote: > For the system I'm designing that simply won't work. In Java > servlet environments it's relatively trivial to map one servlet to > an entire directory structure, so that it handles all requests for > all pages within that hierarchy. > > Is there any *reasonable* way to do this in PHP? Here's an example of how to do it without using mod_rewrite. The basic idea is to build a front-controller that parses the $_SERVER ['PATH_INFO'] variable, and delegates the request appropriately for your application. http://www.zend.com/zend/trick/tricks-apr-2003-urls.php * gotcha: I've had problems getting this to work when php is installed as a CGI. > The only way I've ever seen is what WordPress does: use mod_rewrite > [...] I am impressed by this hack, but it's way too kludgy for me > to be comfortable with. I agree, I'm not fond of the mod_rewrite solution. However, I've found that to be the only reliable method when php is running as a CGI. -- Dell From g.hagger at gmail.com Sun Aug 5 14:31:04 2007 From: g.hagger at gmail.com (Graham Hagger) Date: Sun, 05 Aug 2007 14:31:04 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B60C11.2090904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> Message-ID: <46B61768.5060902@gmail.com> We actually do this at my work. I don't have the details to hand, but it basically involves setting the apache document root to be your actual script, ie. index.php. That way no matter what url you request you will always hit that page. The script then examines the url that was requested to determine exactly what page it should be rendered. Sorry to not have details - but it is possible. Graham Elliotte Harold wrote: > I'm considering a simple site that I may design in PHP. PHP is > probably the simplest solution except for one thing: it carries a very > strong coupling between pages and scripts. As far as I've ever been > able to tell PHP really, really, really wants there to be a single > primary .php file for each URL that does not contain a query string > (though that file may of course invoke others). > > For the system I'm designing that simply won't work. In Java servlet > environments it's relatively trivial to map one servlet to an entire > directory structure, so that it handles all requests for all pages > within that hierarchy. > > Is there any *reasonable* way to do this in PHP? The only way I've > ever seen is what WordPress does: use mod_rewrite to redirect all > requests within the hierarchy to a custom dispatcher script that > converts actual hierarchy components into query string variables. I am > impressed by this hack, but it's way too kludgy for me to be > comfortable with. For one thing, I don't want to depend on mod_rewrite > if I don't have to. > > Surely by now there's a better way? How do I overcome the one file per > URL assumption that PHP makes? > From lists at zaunere.com Sun Aug 5 14:42:26 2007 From: lists at zaunere.com (Hans Zaunere) Date: Sun, 5 Aug 2007 14:42:26 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B60C11.2090904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> Message-ID: <000c01c7d790$5e66b400$651ba8c0@MobileZ> Elliotte Harold wrote on Sunday, August 05, 2007 1:43 PM: > I'm considering a simple site that I may design in PHP. PHP is > probably the simplest solution except for one thing: it carries a > very strong coupling between pages and scripts. As far as I've ever > been able to tell PHP really, really, really wants there to be a > single primary .php file for each URL that does not contain a query > string (though that file may of course invoke others). PHP doesn't actually care, but... > For the system I'm designing that simply won't work. In Java servlet > environments it's relatively trivial to map one servlet to an entire > directory structure, so that it handles all requests for all pages > within that hierarchy. It has to do with the way PHP reaches into the request processing stack in Apache (assuming Apache). Basically PHP doesn't reach as far up the request stack as other things do, like mod_perl, Java, etc, which of course could be argued as a good or bad thing. > Is there any *reasonable* way to do this in PHP? The only way I've > ever seen is what WordPress does: use mod_rewrite to redirect all > requests within the hierarchy to a custom dispatcher script that > converts actual hierarchy components into query string variables. I > am impressed by this hack, but it's way too kludgy for me to be > comfortable with. For one thing, I don't want to depend on > mod_rewrite if I don't have to. A lot of people use mod_rewrite, but I never was a big fan either. However, you can implement this "fuse-box" style processing quite elegantly in pure Apache. There are a number of ways, most of which are covered in these results: http://www.google.com/search?q=mediawiki+url+rewrite There are other options as well, including the ErrorDocument hack and playing with ForceType, but I'm not much of a fan of those either. I find the following to be the most elegant: Alias /support/ "/var/www/www.something.com/support/" Alias /Test/ "/var/www/www.something.com/Test/" AliasMatch /(.*) "/var/www/www.something.com/index.php" /support becomes a nice place to throw static stuff, like images, CSS, etc. /Test can be used as a test bed, to test PHP scripts outside of the fuse-box. And then index.php is where the action is, getting called on every request. Of course, the above can be adjusted as needed to have an unlimited number of fuse-boxes at different URLs, etc. Combined with things like Apache's AddType, the possibilities are endless. I think you can even use AddType for a directory (or maybe it's ForceType). I actually leave index.php empty, and use auto_prepend_file to call a PHP file that handles the heavy lifting. This typically allows for better delegation of responsbility and keeping PHP code outside of the DocumentRoot. And all of the above can be combined with various combinations of and directives in Apache, making it really flexible and dizzying. But, I generally keep it simple and use something like the above, and then have a request processor in PHP do the URL mapping in a style akin to the Java world. Straightforward, none of the PATH_INFO confusions, and setup-and-forget. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From ioplex at gmail.com Sun Aug 5 14:49:08 2007 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 5 Aug 2007 14:49:08 -0400 Subject: [nycphp-talk] Incomplete Objects, Class Definitions and require_once Message-ID: <78c6bd860708051149v2b939dc4m310530f75aaf2ce4@mail.gmail.com> Hi, Every once in a while I run into this and it takes a few hours to figure out what the right sequence of require_once statements are required to wriggle out of it: Notice: [...] The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Foo" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in [...] Can someone explain to me what I need to know about how class definitions are loaded so that I can make some sense of these errors? It's not simply a matter of including the necessary file in the right spot. Clearly there are other forces at work and I'd like to know what they are. Mike From 1j0lkq002 at sneakemail.com Sun Aug 5 16:45:50 2007 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Sun, 05 Aug 2007 13:45:50 -0700 Subject: [nycphp-talk] Many pages: one script SEO In-Reply-To: <000c01c7d790$5e66b400$651ba8c0@MobileZ> References: <46B60C11.2090904@metalab.unc.edu> <000c01c7d790$5e66b400$651ba8c0@MobileZ> Message-ID: <10700-58170@sneakemail.com> Not everyone cares about search engines indexing unique URLs, but if you do, you have to consider how the server response codes are generated for various URLs. Aliasing content under different URLs is akin to asking the search engines not to index it properly, and/or not to rank it highly for relevant searches. If you are using Apache, Micahel Sims has it correct. Apache is making the decisions about URL dispatching, and since mod_rewrite is Apache's extension for mapping URLs to dispatch, then that's the logical tool for the job. As far as search engines go, you always need to be aware of (and work around) how the default dispatching is handled (trailing slashes, file not found, etc). If you want cross-platform (server) scripts written in PHP, I'm not sure you can ever break free of the web server completely and still stay in complaince with search engine indexing best practices. Of course once you are at that level of analysis, I think some of the PHP gurus can highlight other problems you'll encounter that are more difficult than how to properly manage the URL dispatch. I think the Zend Framework is one case where they really really really would like to avoid needing apache mod rewrite. As it has evolved, they have added several rewrite routers to manage the same infrastructure issues that mod-rwrite is typically used for. The best and only one I like (for SEO purposes) is a full blown regex rewrite router, certainly no "simpler" than mod rewrite. -=john andrews Hans Zaunere lists-at-zaunere.com |nyphp dev/internal group use| wrote: >Elliotte Harold wrote on Sunday, August 05, 2007 1:43 PM: > > >>I'm considering a simple site that I may design in PHP. PHP is >>probably the simplest solution except for one thing: it carries a >>very strong coupling between pages and scripts. As far as I've ever >>been able to tell PHP really, really, really wants there to be a >>single primary .php file for each URL that does not contain a query >>string (though that file may of course invoke others). >> >> > >PHP doesn't actually care, but... > > > >>For the system I'm designing that simply won't work. In Java servlet >>environments it's relatively trivial to map one servlet to an entire >>directory structure, so that it handles all requests for all pages >>within that hierarchy. >> >> > >It has to do with the way PHP reaches into the request processing stack in >Apache (assuming Apache). Basically PHP doesn't reach as far up the request >stack as other things do, like mod_perl, Java, etc, which of course could be >argued as a good or bad thing. > > > >>Is there any *reasonable* way to do this in PHP? The only way I've >>ever seen is what WordPress does: use mod_rewrite to redirect all >>requests within the hierarchy to a custom dispatcher script that >>converts actual hierarchy components into query string variables. I >>am impressed by this hack, but it's way too kludgy for me to be >>comfortable with. For one thing, I don't want to depend on >>mod_rewrite if I don't have to. >> >> > >A lot of people use mod_rewrite, but I never was a big fan either. However, >you can implement this "fuse-box" style processing quite elegantly in pure >Apache. There are a number of ways, most of which are covered in these >results: > >http://www.google.com/search?q=mediawiki+url+rewrite > >There are other options as well, including the ErrorDocument hack and >playing with ForceType, but I'm not much of a fan of those either. I find >the following to be the most elegant: > > Alias /support/ "/var/www/www.something.com/support/" > Alias /Test/ "/var/www/www.something.com/Test/" > AliasMatch /(.*) "/var/www/www.something.com/index.php" > >/support becomes a nice place to throw static stuff, like images, CSS, etc. > >/Test can be used as a test bed, to test PHP scripts outside of the >fuse-box. > >And then index.php is where the action is, getting called on every request. >Of course, the above can be adjusted as needed to have an unlimited number >of fuse-boxes at different URLs, etc. Combined with things like Apache's >AddType, the possibilities are endless. I think you can even use AddType >for a directory (or maybe it's ForceType). > >I actually leave index.php empty, and use auto_prepend_file to call a PHP >file that handles the heavy lifting. This typically allows for better >delegation of responsbility and keeping PHP code outside of the >DocumentRoot. > >And all of the above can be combined with various combinations of > and directives in Apache, making it really flexible >and dizzying. > >But, I generally keep it simple and use something like the above, and then >have a request processor in PHP do the URL mapping in a style akin to the >Java world. Straightforward, none of the PATH_INFO confusions, and >setup-and-forget. > > > -- ------------------------------------------------------------- Your web server traffic log file is the most important source of web business information available. Do you know where your logs are right now? Do you know who else has access to your log files? When they were last archived? Where those archives are? --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com From ramons at gmx.net Sun Aug 5 19:45:05 2007 From: ramons at gmx.net (David Krings) Date: Sun, 05 Aug 2007 19:45:05 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B613F2.9010904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu> Message-ID: <46B66101.3060400@gmx.net> Elliotte Harold wrote: > Edward Potter wrote: >> hmmmm, I have never found this to be a problem. Using includes, you >> can pull in .php code from anywhere, even pages with a .php extension >> may be 99.99% html, with a just a single include('foo.php') in it. >> Keeps things super streamlined, and your pages are very readable. >> > > You've got it backwards. I want one script to service many URLs, not > many scripts to service one URL. > And that is exactly how Edward described it. You include the one script into the many URLs you want to make use of the script. I guess that isn't what you are after, it just reads that way. The other posts indicate to use a gateway script, something that I thought about using at some point as well. My home server can be accessed through different URLs and although it is the same server I want a php script to pick up the request and redirect to the designated location. This way my wife can do whatever she wants on her portion and I can do whatever I want on my portion. Since we don't have time to even start with a decent web site this is a moot point. Coming back to what you want to accomplish, maybe defining exactly what you need and giving some examples may be helpful in reducing confusion. David From brenttech at gmail.com Sun Aug 5 19:50:37 2007 From: brenttech at gmail.com (Brent Baisley) Date: Sun, 5 Aug 2007 19:50:37 -0400 Subject: [nycphp-talk] Incomplete Objects, Class Definitions and require_once In-Reply-To: <78c6bd860708051149v2b939dc4m310530f75aaf2ce4@mail.gmail.com> References: <78c6bd860708051149v2b939dc4m310530f75aaf2ce4@mail.gmail.com> Message-ID: <33C90792-E0C2-455D-B595-CC408600284D@gmail.com> I've never seen that error message before, but I think I understand what it is saying. It sounds like you are employing a technique that is generally frowned upon because of it's dependencies and complexity. Did you inherit this code from someone else? Since it's complaining about objects loading before unserialize, I'm guessing you are passing serialized objects either through a session or directly through to other objects. An object is an instance of a class, you need to load the base class definition in order to create an instance of that class. What you are doing is passing an instance of a class without having the class loaded. The only way I know of doing this is by passing a serialized instance through a session. When it is unserialized, it doesn't have the base class available to restore the class object. So, you must load (include) the class file before you try to unserialize the instance of the class. Alternatively, you can create an __autoload function that will determine what file needs to be loaded in order to create an instance of the class to be created. This can generally be done by mapping the class name be called to the file that needs to be loaded. __autoload is generally used for dynamically loading classes so you don't load anything that you don't need. You may connect to the database 90% of the time, but why load the database class before you need to, since you may not need to. Hope that helps On Aug 5, 2007, at 2:49 PM, Michael B Allen wrote: > Hi, > > Every once in a while I run into this and it takes a few hours to > figure out what the right sequence of require_once statements are > required to wriggle out of it: > > Notice: [...] The script tried to execute a method or access a > property of an incomplete object. Please ensure that the class > definition "Foo" of the object you are trying to operate on was loaded > _before_ unserialize() gets called or provide a __autoload() function > to load the class definition in [...] > > Can someone explain to me what I need to know about how class > definitions are loaded so that I can make some sense of these errors? > > It's not simply a matter of including the necessary file in the right > spot. Clearly there are other forces at work and I'd like to know what > they are. > > Mike > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From smanes at magpie.com Sun Aug 5 19:55:55 2007 From: smanes at magpie.com (Steve Manes) Date: Sun, 05 Aug 2007 19:55:55 -0400 Subject: [nycphp-talk] Oh... Interviewing In-Reply-To: References: <001201c7c819$ed88eda0$c89ac8e0$@com> <3B067702-D84F-4CF0-9B10-A6A2FD3B8B4A@jonbaer.com> <200707181158.08005.arzala@gmail.com> <5e2aaca40707182055u41896db3n1e9a92dae130124@mail.gmail.com> <001a01c7cb44$e21a7d70$07d6f4a7@ced> Message-ID: <46B6638B.7080206@magpie.com> tedd wrote: > I think your method is excellent, more hr people should practice it. > > The only problem is that the interviewer has to know what they are > talking about, in many of the interviews I have taken, that's sadly not > true. And there's the potential problem. The people doing the tech hiring may not be technical enough to maintain a meaningful discussion about the finer points of OOP and stored procedures. Of course, they could pull an overworked senior developer off the line and into the conference room to tech the candidate. But my experience here is that too many bit jockeys lack the personal skills to interview an applicant. Anecdote: at a former job (an agency) the CTO was confounded about why promising applicants would make it all the way through the process only to turn the job offer down. The package and working conditions were, after all, competitive. She brought me in to handle the tech management side of her job. For my first gig, she wanted me to sit in on the engineering interviews happening that morning. She always left this to the most senior developer in the company, who had been there Forever. He started by asking a couple of standard "how would you do this" questions. Then he suddenly got obnoxious and defensive in a sort of Comic Book Guy way. After watching several of these interviews over the next few days I saw a common MO. The techie was paranoid about losing his stature as top dog. The better the applicant the more contentious the interview became, even to the point where he'd ask the applicant arcane Java architecture questions when the job was for a Perl developer. No wonder the company was only finding junior developers willing to work there. Job interviews are information sharing events. The applicant is selling himself to you but you're also selling the company to him. In a seller's market like this, the better the applicant, the more the onus falls on the interviewer to make the candidate want to work there. After all, a really good developer usually knows he's really good and s/he probably won't have much patience with an interviewing process that feels like a grilling by homicide detectives. Relevant to nothing, I used to work for a company founded by the former head of HR at Cisco. One of his favorite interview ice-breaker questions was, "do you like dogs?" From ioplex at gmail.com Sun Aug 5 20:07:46 2007 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 5 Aug 2007 20:07:46 -0400 Subject: [nycphp-talk] Incomplete Objects, Class Definitions and require_once In-Reply-To: <33C90792-E0C2-455D-B595-CC408600284D@gmail.com> References: <78c6bd860708051149v2b939dc4m310530f75aaf2ce4@mail.gmail.com> <33C90792-E0C2-455D-B595-CC408600284D@gmail.com> Message-ID: <78c6bd860708051707l5672a1e3r4fca57d90e9a50f3@mail.gmail.com> On 8/5/07, Brent Baisley wrote: > I've never seen that error message before, but I think I understand > what it is saying. It sounds like you are employing a technique that > is generally frowned upon because of it's dependencies and > complexity. Did you inherit this code from someone else? > Since it's complaining about objects loading before unserialize, I'm > guessing you are passing serialized objects either through a session > or directly through to other objects. An object is an instance of a > class, you need to load the base class definition in order to create > an instance of that class. What you are doing is passing an instance > of a class without having the class loaded. The only way I know of > doing this is by passing a serialized instance through a session. > When it is unserialized, it doesn't have the base class available to > restore the class object. > So, you must load (include) the class file before you try to > unserialize the instance of the class. Alternatively, you can create > an __autoload function that will determine what file needs to be > loaded in order to create an instance of the class to be created. > This can generally be done by mapping the class name be called to the > file that needs to be loaded. __autoload is generally used for > dynamically loading classes so you don't load anything that you don't > need. > > You may connect to the database 90% of the time, but why load the > database class before you need to, since you may not need to. > > Hope that helps Hi Brent, Well I figured out what the problem was. I was putting an 'Auth' object in the session. I made some changes to something that invalidated the class definition of that object. As soon as I logged out the Auth object in the session was reinstantiated and the error went away. No big deal. Thanks, Mike > On Aug 5, 2007, at 2:49 PM, Michael B Allen wrote: > > > Hi, > > > > Every once in a while I run into this and it takes a few hours to > > figure out what the right sequence of require_once statements are > > required to wriggle out of it: > > > > Notice: [...] The script tried to execute a method or access a > > property of an incomplete object. Please ensure that the class > > definition "Foo" of the object you are trying to operate on was loaded > > _before_ unserialize() gets called or provide a __autoload() function > > to load the class definition in [...] > > > > Can someone explain to me what I need to know about how class > > definitions are loaded so that I can make some sense of these errors? > > > > It's not simply a matter of including the necessary file in the right > > spot. Clearly there are other forces at work and I'd like to know what > > they are. > > > > Mike From jonbaer at jonbaer.com Sun Aug 5 21:18:32 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Sun, 5 Aug 2007 21:18:32 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B60C11.2090904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> Message-ID: <1660658C-54A4-4B72-8C23-4D6D56051D0F@jonbaer.com> I have to say that after spending a long time w/ Dynamo / Tomcat / Struts and mod_rewrite that eventually I got down to learning the routing mechanism of frameworks (MVC) and find it to be extremely flexible and very well thought out + could easily replicate a servlet URI request setup. http://manual.cakephp.org/chapter/configuration http://framework.zend.com/manual/en/ zend.controller.router.html#zend.controller.router.usage - Jon On Aug 5, 2007, at 1:42 PM, Elliotte Harold wrote: > I'm considering a simple site that I may design in PHP. PHP is > probably the simplest solution except for one thing: it carries a > very strong coupling between pages and scripts. As far as I've ever > been able to tell PHP really, really, really wants there to be a > single primary .php file for each URL that does not contain a query > string (though that file may of course invoke others). > > For the system I'm designing that simply won't work. In Java > servlet environments it's relatively trivial to map one servlet to > an entire directory structure, so that it handles all requests for > all pages within that hierarchy. > > Is there any *reasonable* way to do this in PHP? The only way I've > ever seen is what WordPress does: use mod_rewrite to redirect all > requests within the hierarchy to a custom dispatcher script that > converts actual hierarchy components into query string variables. I > am impressed by this hack, but it's way too kludgy for me to be > comfortable with. For one thing, I don't want to depend on > mod_rewrite if I don't have to. > > Surely by now there's a better way? How do I overcome the one file > per URL assumption that PHP makes? > > -- > Elliotte Rusty Harold elharo at metalab.unc.edu > Java I/O 2nd Edition Just Published! > http://www.cafeaulait.org/books/javaio2/ > http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/ > cafeaulaitA/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Sun Aug 5 22:09:20 2007 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 5 Aug 2007 22:09:20 -0400 Subject: [nycphp-talk] Incomplete Objects, Class Definitions and require_once In-Reply-To: <78c6bd860708051707l5672a1e3r4fca57d90e9a50f3@mail.gmail.com> References: <78c6bd860708051149v2b939dc4m310530f75aaf2ce4@mail.gmail.com> <33C90792-E0C2-455D-B595-CC408600284D@gmail.com> <78c6bd860708051707l5672a1e3r4fca57d90e9a50f3@mail.gmail.com> Message-ID: <78c6bd860708051909p1b4ab94ct7b22b442313fd76@mail.gmail.com> > Hi Brent, > > Well I figured out what the problem was. I was putting an 'Auth' > object in the session. I made some changes to something that > invalidated the class definition of that object. As soon as I logged > out the Auth object in the session was reinstantiated and the error > went away. No big deal. Actually I've pinpointed the problem a little more. It seems you must require_once the class of the object stored in the session before calling session_start. I guess session_start is deserializing things and if the class definition isn't available it defaults to an incomplete type. Mike From wdwtest at gmail.com Mon Aug 6 01:11:12 2007 From: wdwtest at gmail.com (web dream works wdw) Date: Sun, 5 Aug 2007 22:11:12 -0700 Subject: [nycphp-talk] PDO and Prepared Statements in MySQL when using LIKE [expr] In-Reply-To: <46B60D6F.7040209@gmail.com> References: <46B60D6F.7040209@gmail.com> Message-ID: <78c525cd0708052211q1d663fe0p6fbb35dcd5162ff5@mail.gmail.com> Hi there, you can try for $$phpvar in the query. It might work. e.g $sth = $this->conn->prepare ("SELECT * FROM table WHERE column LIKE \"%$$phpvar%\""); On 8/5/07, Jakob Buchgraber wrote: > > hey! > > I have some query with a LIKE expression e.g. "SELECT * FROM table WHERE > column LIKE "$phpvar%", but I would like to use prepared statements > instead of writing the variable directly into the query. So I write: > > $sth = $this->conn->prepare ("SELECT * FROM table WHERE column LIKE > \":phpvar%\""); > $sth->bindParam (":phpvar", $phpvar); > $sth->execute(); > var_dump ($sth->fetchAll()); > > Here I get an empty result set when using prepared statements. However > when just using string concatenation and putting the variable directly > into the query it works fine. > > Is this expected or a bug? > > Cheers, > Jakob > > -- > Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0 > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From birgunjp0071 at yahoo.com Mon Aug 6 01:53:37 2007 From: birgunjp0071 at yahoo.com (birgunj birgunj) Date: Sun, 5 Aug 2007 22:53:37 -0700 (PDT) Subject: [nycphp-talk] need help regarding download bar In-Reply-To: <84caf2b90707311128j434678c8td04ede0f591068c0@mail.gmail.com> Message-ID: <902104.60417.qm@web59301.mail.re1.yahoo.com> Dear All, i want to write script to download file.how do i display download bar in php like when download file from any site, it download bar appear, it show size of file,time etc. can any body help me how to do this. thanks humayoo Christopher M Mancini wrote: I found that Oracle 9.2 client is not compatible with PHP5. Any ideas why the Instant client was not working properly? On 7/31/07, Anthony Wlodarski wrote: Rename oci8.dll to php_oci8.dll in sys32? Anthony Wlodarski aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto: talk-bounces at lists.nyphp.org] On Behalf Of Christopher M Mancini Sent: Tuesday, July 31, 2007 9:39 AM To: talk at lists.nyphp.org Subject: [nycphp-talk] Oracle PHP Install Issue Hi Everyone, I am working on Windows 2000 test and production boxes. The production was very out of date, so I began building the test box up. On the test box I have Instant Client, Apache 2.0.39, and PHP 5.2.2. It works fine. On the production I just attempted to update it to the same. It had on it, Oracle Client 9 and Webserv 1.1.3 (it is a package that has Apache, MySql, and PHP). I removed both Oracle Client 9 and Webserv. I installed Apache, PHP, and Instant Client. I could not connect to the database. I used the same tnsnames, the same httpdconf, the same php.ini from the test. I had the msvcr71.dll and oci8.dll in sys32. Couldn't connect. In frustration, and that its a production box, I tried to rollback to client 9. Then I got a PHP error, unable to load php_oci8.dll. I did not get this error when instant client is called. I can use a db utility and connect to the Oracle Database. Facts: Both boxes have Windows 2000. Production is real server hardware, test is a desktop. Database to connect to is Oracle 9i. Test box was a fresh install of OS, production was not. Production was running PHP 4, upgraded to PHP 5. If anyone would be able to provide assistance, it would be extremely appreciated. -- <------------------------- Sincerely, Christopher M Mancini mancinic at gmail.com --------------------------> _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -- <------------------------- Sincerely, Christopher M Mancini mancinic at gmail.com --------------------------> _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php --------------------------------- Shape Yahoo! in your own image. Join our Network Research Panel today! -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulcheung at tiscali.co.uk Mon Aug 6 05:39:16 2007 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Mon, 6 Aug 2007 10:39:16 +0100 Subject: [nycphp-talk] secure login/logon References: <20070701.215701.25801.0@webmail14.dca.untd.com> Message-ID: <003001c7d80d$a8182e80$0200a8c0@X9183> I just need pointing in the right direction. Does anybody know where I should be looking for in information on secure login/logon (using PHP 5 and DOES NOT USE COOKIES) with coding examples? Here is what I am trying to accomplish. I have a website where anybody may enter, except certain restricted areas where access codes are required. I suppose the nearest "real life" example would be a shopping mall where customers are able to shop ect.; But are not allowed into restricted areas without valid access codes which must be verified before before access is granted, for example the shopping mall management area. My apologies up front for the example; But this is precisely what I want to do, except on the web. Paul From lists at zaunere.com Mon Aug 6 07:55:59 2007 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 6 Aug 2007 07:55:59 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <1660658C-54A4-4B72-8C23-4D6D56051D0F@jonbaer.com> References: <46B60C11.2090904@metalab.unc.edu> <1660658C-54A4-4B72-8C23-4D6D56051D0F@jonbaer.com> Message-ID: <00e601c7d820$c16abf20$651ba8c0@MobileZ> Jon Baer wrote on Sunday, August 05, 2007 9:19 PM: > I have to say that after spending a long time w/ Dynamo / Tomcat / > Struts and mod_rewrite that eventually I got down to learning the > routing mechanism of frameworks (MVC) and find it to be extremely > flexible and very well thought out + could easily replicate a servlet > URI request setup. > > http://manual.cakephp.org/chapter/configuration > http://framework.zend.com/manual/en/zend.controller.router.html#zend.control ler.router.usage I think there is a distinction to make here, however. There are two parts to the URL routing/handling/SEO-friendly-URL-of-the-month/etc game: 1: getting the web server to relax it's by-default strict mapping of the URL space to the filesystem, and then passing whatever the request was down to the processing language 2: programming mechanisms in the processing language to intelligently deal with whatever URL it gets from the web server In PHP at least, these are two different things. At some point there was interest in apache_hooks, but it unfortunately never matured. In other technologies, #1 equates more to the processing language reaching up and grabbing what it needs from the server, and then taking over. In PHP, however, it's certainly a "top-down" approach. For #1, most frameworks, and the two mentioned above, prefer the use mod_rewrite. Then they each have their own mechanism to handle #2, with some arguably being worse than others. There's also fundamental differences in the way #1 can be handled. Rewriting is a very different thing than aliasing a handler or set of URLs to a single URL or processor. The later is more elegant - and more flexible - avoiding mucking with obtuse rewrite conditions and rules that require a testing cycle and often depend on a fixed set of extensions to ignore. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From ramons at gmx.net Mon Aug 6 08:06:19 2007 From: ramons at gmx.net (David Krings) Date: Mon, 06 Aug 2007 08:06:19 -0400 Subject: [nycphp-talk] secure login/logon In-Reply-To: <003001c7d80d$a8182e80$0200a8c0@X9183> References: <20070701.215701.25801.0@webmail14.dca.untd.com> <003001c7d80d$a8182e80$0200a8c0@X9183> Message-ID: <46B70EBB.6030109@gmx.net> PaulCheung wrote: > I just need pointing in the right direction. Does anybody know where I > should be looking for in information on secure login/logon (using PHP 5 > and DOES NOT USE COOKIES) with coding examples? > When you say "secure login", do you mean changing over to https? Do you want to use a database? Typically, you would keep track of user's logins in a session, but that means using a cookie. One way that I thought of without using a database and cookies is checking on page access against the password file of Apache, which on top forces a user name / password entry on the first access. There may be a way to get the valid user state from Apache through $_SERVER, but I don't know. In any case, you would need to reset the logged in state for a user as soon as they leave the page (means as soon as your php/html is finsihed), same as entering the secure mall area and leaving it. That is far away from ideal as I can think instantly of a whole bunch of scenarios where this falls apart, but it would be as safe or unsafe as electronic access control in a mall building. In that case, as soon as you leave the secured area and want to enter again, you have to use the credentials again. A finished page is to be considered leaving the secured area. Otherwise it will be like propping the door open. In regards to the web app, if cou do not amndate reauthentication on each page load one can login once and then leave the web browser open for everyone else to use. Using a timer comes to mind that after finishing redirects to a unsecure page or at least requires reauthentication (this is like the security guard who asks for your credentials and in case you don't have them kicks you out), but I have no idea how timers behave in connection to any links or forms on the page. Hmmm, no real answer, but maybe I just put enough crazy ideas on the table that allow you to steer into the right direction. Is this for some demo? Would be kewl if you get one of these cheap keyboard wedges that translate magcard swipes into typed characters. Then you can mimic a real access control system with card swipe plus PIN. If you need any further details on the "real" access control part let me know, I worked in the industry for almost seven years. David From ken at secdat.com Mon Aug 6 08:45:06 2007 From: ken at secdat.com (Kenneth Downs) Date: Mon, 06 Aug 2007 08:45:06 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B60C11.2090904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> Message-ID: <46B717D2.2080506@secdat.com> Elliotte Harold wrote: > I'm considering a simple site that I may design in PHP. PHP is > probably the simplest solution except for one thing: it carries a very > strong coupling between pages and scripts. This may be implied by examples, but it is simply not true. PHP, like any other generalized language, allows you to easily create any kind of structure for your code that you want and map it URLs and databases web services any way you want. A common pattern is called the "universal dispatcher", where one file, typically index.php, accepts all queries and parses the request parameters and dispatches the request to some other program. > As far as I've ever been able to tell PHP really, really, really wants > there to be a single primary .php file for each URL that does not > contain a query string (though that file may of course invoke others). Not true. I think that if you go this impression, the rest of your questions may not be valid, as they may take this false assumption as true. What do you think? > > For the system I'm designing that simply won't work. In Java servlet > environments it's relatively trivial to map one servlet to an entire > directory structure, so that it handles all requests for all pages > within that hierarchy. I don't think I can parse this statement without knowing what is in those "pages", why there is a servlet handling them, and what kind of content they are, media? interactive database table maintenance? > > Is there any *reasonable* way to do this in PHP? Again, I'm not clear on what you are trying to serve. We probably have to back up to the beginning and erase the assumption that PHP has a one-to-one correspondence between a URL (or page) and a PHP file. Having erased that, we have to ask what kind of content you are trying to serve, then we have to look at PHP examples. Then it would probably make sense to talk about whether to use mod_rewrite, talk about how PHP do its own kind of mod_rewrite, how to build libraries in PHP and so forth. The hardest part is not to relate it to what you already know, such as Java. That will really slow you down. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From rmarscher at beaffinitive.com Mon Aug 6 10:34:03 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Mon, 6 Aug 2007 10:34:03 -0400 Subject: [nycphp-talk] Incomplete Objects, Class Definitions and require_once In-Reply-To: <78c6bd860708051909p1b4ab94ct7b22b442313fd76@mail.gmail.com> References: <78c6bd860708051149v2b939dc4m310530f75aaf2ce4@mail.gmail.com> <33C90792-E0C2-455D-B595-CC408600284D@gmail.com> <78c6bd860708051707l5672a1e3r4fca57d90e9a50f3@mail.gmail.com> <78c6bd860708051909p1b4ab94ct7b22b442313fd76@mail.gmail.com> Message-ID: On Aug 5, 2007, at 10:09 PM, Michael B Allen wrote: > It seems you must require_once the class of the object stored in > the session before > calling session_start. I was recently playing around with the memcache extension to see what happens if you get something that hasn't been defined and got this error (using php 4.4.6)" "The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition user of the object you are trying to operate on was loaded _before_ the session was started in [filename] on [line number]" So that version of the error probably would have helped you more. In 5.2.3, I don't get any error, but when I print_r on the object, it shows this type: __PHP_Incomplete_Class Object -Rob From rmarscher at beaffinitive.com Mon Aug 6 10:50:10 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Mon, 6 Aug 2007 10:50:10 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <000c01c7d790$5e66b400$651ba8c0@MobileZ> References: <46B60C11.2090904@metalab.unc.edu> <000c01c7d790$5e66b400$651ba8c0@MobileZ> Message-ID: On Aug 5, 2007, at 2:42 PM, Hans Zaunere wrote: > AliasMatch /(.*) "/var/www/www.something.com/index.php" http://httpd.apache.org/docs/2.0/mod/mod_alias.html#aliasmatch I wonder why the major php frameworks don't mention this as an option? It seems from the documentation that it can't go in .htaccess - so that may be why. The frameworks are assuming most of their users are on shared servers and can't modify their httpd config. If there was an existing file... say favicon.ico... would AliasMatch know to just serve that up instead of sending through index.php? That's one thing I like about the following mod_rewrite rule - if the file or directory exists, it won't pass it to the index.php front controller: RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 -Rob From chsnyder at gmail.com Mon Aug 6 15:07:51 2007 From: chsnyder at gmail.com (csnyder) Date: Mon, 6 Aug 2007 15:07:51 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B60C11.2090904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> Message-ID: On 8/5/07, Elliotte Harold wrote: > > Surely by now there's a better way? How do I overcome the one file per > URL assumption that PHP makes? I've tried at least four different ways around this over the years, and I use mod_rewrite for everything but trivial apps. Here are the ways I'm aware of: 1) Use ErrorDocument directive to pass 404s to a php script http://httpd.apache.org/docs/2.0/mod/core.html#errordocument 2) Use Action and AddHandler directives http://httpd.apache.org/docs/2.0/mod/mod_actions.html#action 3) Use Multiviews option so that /index.php/path/to/some/virtual/resource resolves to index.php http://httpd.apache.org/docs/2.0/content-negotiation.html#multiviews 4) Use mod_rewrite to send all requests to the same script The only one I _wouldn't ever_ try again is the ErrorDocument method, because the $_SERVER environment that you end up with (and which is crucial to determining what was actually requested) is not what you'd expect. Mutliviews is always tricky for me, for some reason. I have a hard time getting it to work with my base server config. Also, I don't like to have the script name in every request. Rewrite has proven to be the most flexible and (long-term) easiest solution for me. But the Action/Handler method doesn't require any extra extensions. I see it used by other projects, notably Trac. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Mon Aug 6 15:22:10 2007 From: chsnyder at gmail.com (csnyder) Date: Mon, 6 Aug 2007 15:22:10 -0400 Subject: [nycphp-talk] secure login/logon In-Reply-To: <003001c7d80d$a8182e80$0200a8c0@X9183> References: <20070701.215701.25801.0@webmail14.dca.untd.com> <003001c7d80d$a8182e80$0200a8c0@X9183> Message-ID: On 8/6/07, PaulCheung wrote: > I just need pointing in the right direction. Does anybody know where I > should be looking for in information on secure login/logon (using PHP 5 and > DOES NOT USE COOKIES) with coding examples? Perhaps you are confused re: cookies. Session cookies (not stored cookies!) are considered the best (most secure) way to handle authentication from request to request. See PHP's session functions for details and examples. You should use HTTPS for login and for all subsequent requests to avoid transmitting the session id in plaintext. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Mon Aug 6 15:24:47 2007 From: chsnyder at gmail.com (csnyder) Date: Mon, 6 Aug 2007 15:24:47 -0400 Subject: [nycphp-talk] need help regarding download bar In-Reply-To: <902104.60417.qm@web59301.mail.re1.yahoo.com> References: <84caf2b90707311128j434678c8td04ede0f591068c0@mail.gmail.com> <902104.60417.qm@web59301.mail.re1.yahoo.com> Message-ID: On 8/6/07, birgunj birgunj wrote: > Dear All, > > i want to write script to download file.how do i display download bar in php > like when download file from any site, it download bar appear, it show > size of file,time etc. > > can any body help me how to do this. > > thanks humayoo Download is the responsibility of the client. This isn't in PHP's domain. -- Chris Snyder http://chxo.com/ From tim_lists at o2group.com Mon Aug 6 16:29:28 2007 From: tim_lists at o2group.com (Tim Lieberman) Date: Mon, 6 Aug 2007 14:29:28 -0600 Subject: [nycphp-talk] need help regarding download bar In-Reply-To: References: <84caf2b90707311128j434678c8td04ede0f591068c0@mail.gmail.com> <902104.60417.qm@web59301.mail.re1.yahoo.com> Message-ID: <02058897-E0DE-4435-A946-31C475BD6754@o2group.com> On Aug 6, 2007, at 1:24 PM, csnyder wrote: > On 8/6/07, birgunj birgunj wrote: >> Dear All, >> >> i want to write script to download file.how do i display download >> bar in php >> like when download file from any site, it download bar appear, it >> show >> size of file,time etc. >> >> can any body help me how to do this. >> >> thanks humayoo > > Download is the responsibility of the client. This isn't in PHP's > domain. > Well, if you're passing the file through a script, it helps to tell the client some things by setting proper headers. Content-type, Content-disposition and Content-length, for starters. From elharo at metalab.unc.edu Mon Aug 6 18:40:04 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Mon, 06 Aug 2007 18:40:04 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B66101.3060400@gmx.net> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu> <46B66101.3060400@gmx.net> Message-ID: <46B7A344.50104@metalab.unc.edu> David Krings wrote: > Elliotte Harold wrote: >> Edward Potter wrote: >>> hmmmm, I have never found this to be a problem. Using includes, you >>> can pull in .php code from anywhere, even pages with a .php extension >>> may be 99.99% html, with a just a single include('foo.php') in it. >>> Keeps things super streamlined, and your pages are very readable. >>> >> >> You've got it backwards. I want one script to service many URLs, not >> many scripts to service one URL. >> > > And that is exactly how Edward described it. You include the one script > into the many URLs you want to make use of the script. > I guess that isn't what you are after, it just reads that way. What you are proposing is not one script to service N URLs. It is N+1 scripts to service N URLs. It is still necessary to create N separate loader scripts and place them at the right locations. That doesn't scale, and it's an extraordinary waste of resources when a small percentage of the possible URLs will ever be reached. The goal here is to avoid having to manually create and maintain separate files for each URL. One file: many URLs. That's the goal. Imagine, for example, a site with a separate URL structure for each user, or a separate URL for each date in history. The point about this being an Apache problem rather than a PHP problem is understood, except that Java/Tomcat/mod_jk does seem able to accomplish what I'm looking for, so the real lack may not be in Apache but in now PHP connects to Apache. Overall, though, I suspect all parties (Apache, PHP, Tomcat, Rails. etc.) are still too mired in circa-1994 models of web servers serving file systems. For example, once you map /foo to a servlet you can't then map /foo/bar to something else. I'm curious if they're any web servers out there that do not start with the assumption that each URL maps to a file somewhere. What if a web server were designed to allow all URLs to be delegated to specific handlers? A file system handler need be only special case, no different from a database handler or a PHP handler. RESTful API *design* is fairly easy to do. RESTful API *implementation* is fairly hard because no servers I've seen provide sufficient flexibility. Coming up on the Web's 20th anniversary, we still haven't learned how to take HTTP on its own terms rather than by pretending its something else we're more familiar with. Revolutions take time. :-) -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From 1j0lkq002 at sneakemail.com Mon Aug 6 18:41:45 2007 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Mon, 06 Aug 2007 15:41:45 -0700 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <00e601c7d820$c16abf20$651ba8c0@MobileZ> References: <46B60C11.2090904@metalab.unc.edu> <1660658C-54A4-4B72-8C23-4D6D56051D0F@jonbaer.com> <00e601c7d820$c16abf20$651ba8c0@MobileZ> Message-ID: <25711-74437@sneakemail.com> Hans Zaunere lists-at-zaunere.com |nyphp dev/internal group use| wrote: >Jon Baer wrote on Sunday, August 05, 2007 9:19 PM: > > >>I have to say that after spending a long time w/ Dynamo / Tomcat / >>Struts and mod_rewrite that eventually I got down to learning the >>routing mechanism of frameworks (MVC) and find it to be extremely >>flexible and very well thought out + could easily replicate a servlet >>URI request setup. >> >>http://manual.cakephp.org/chapter/configuration >> >> >> >http://framework.zend.com/manual/en/zend.controller.router.html#zend.control >ler.router.usage > > >I think there is a distinction to make here, however. > >There are two parts to the URL >routing/handling/SEO-friendly-URL-of-the-month/etc game: > >1: getting the web server to relax it's by-default strict mapping of the URL >space to the filesystem, and then passing whatever the request was down to >the processing language > >2: programming mechanisms in the processing language to intelligently deal >with whatever URL it gets from the web server > >In PHP at least, these are two different things. At some point there was >interest in apache_hooks, but it unfortunately never matured. > >In other technologies, #1 equates more to the processing language reaching >up and grabbing what it needs from the server, and then taking over. In >PHP, however, it's certainly a "top-down" approach. > >For #1, most frameworks, and the two mentioned above, prefer the use >mod_rewrite. Then they each have their own mechanism to handle #2, with >some arguably being worse than others. > >There's also fundamental differences in the way #1 can be handled. >Rewriting is a very different thing than aliasing a handler or set of URLs >to a single URL or processor. > >The later is more elegant - and more flexible - avoiding mucking with obtuse >rewrite conditions and rules that require a testing cycle and often depend >on a fixed set of extensions to ignore. > >--- >Hans Zaunere / President / New York PHP > www.nyphp.org / www.nyphp.com > > > I follow you, Hans, but then what about URLs as resource locators? Your elegant "aliasing a handler or set of URLs to a single URL or processor" means URLs don't equate to (unique) information resources. Doesn't that "break" the web? -=john andrews -- ------------------------------------------------------------- Your web server traffic log file is the most important source of web business information available. Do you know where your logs are right now? Do you know who else has access to your log files? When they were last archived? Where those archives are? --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com From elharo at metalab.unc.edu Mon Aug 6 18:54:57 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Mon, 06 Aug 2007 18:54:57 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B717D2.2080506@secdat.com> References: <46B60C11.2090904@metalab.unc.edu> <46B717D2.2080506@secdat.com> Message-ID: <46B7A6C1.3010904@metalab.unc.edu> Kenneth Downs wrote: > Again, I'm not clear on what you are trying to serve. We probably have > to back up to the beginning and erase the assumption that PHP has a > one-to-one correspondence between a URL (or page) and a PHP file. > Having erased that, we have to ask what kind of content you are trying > to serve, then we have to look at PHP examples. > Here's a simple example: a news site backed by a database. URLs like http://www.example.com/news/2007/07/05 http://www.example.com/news/2007/07/06 http://www.example.com/news/2007/07/07 http://www.example.com/news/2007/07/08 ... return pages which contain that day's headlines extracted from the database. One script, no more, must handle all dates. (I don't really care if there are 2 or 3 scripts, but I do not want to have to write a separate page for each URL. The number of PHP scripts must be finite and fixed. It should not increase with the number of URLs the script services.) The only way I've ever seen this done in PHP is by using mod_rewrite, though they're a couple of other interesting suggestions in the thread I need to explore further. Do you have a suggestion? -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From ramons at gmx.net Mon Aug 6 19:23:29 2007 From: ramons at gmx.net (David Krings) Date: Mon, 06 Aug 2007 19:23:29 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B7A344.50104@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu> <46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> Message-ID: <46B7AD71.2050802@gmx.net> Elliotte Harold wrote: > David Krings wrote: >> Elliotte Harold wrote: >>> Edward Potter wrote: >>>> hmmmm, I have never found this to be a problem. Using includes, you >>>> can pull in .php code from anywhere, even pages with a .php extension >>>> may be 99.99% html, with a just a single include('foo.php') in it. >>>> Keeps things super streamlined, and your pages are very readable. >>>> >>> >>> You've got it backwards. I want one script to service many URLs, not >>> many scripts to service one URL. >>> >> >> And that is exactly how Edward described it. You include the one >> script into the many URLs you want to make use of the script. >> I guess that isn't what you are after, it just reads that way. > > What you are proposing is not one script to service N URLs. It is N+1 > scripts to service N URLs. It is still necessary to create N separate > loader scripts and place them at the right locations. That doesn't > scale, and it's an extraordinary waste of resources when a small > percentage of the possible URLs will ever be reached. > I sincerely apologize for helping out. I am convinced that my proposal would be a suitable solution (you need one script, not more), but apparently confusion and misunderstanding takes precedence. If I could I'd eradicate my posts to save you from the disgust that I must have generated. In any case, I am deeply sorry to have caused you discomfort. > Overall, though, I suspect all parties (Apache, PHP, Tomcat, Rails. etc.) are still too mired in circa-1994 models of web servers serving file systems. For example, once you map /foo to a servlet you can't then map /foo/bar to something else. Well, then use IIS and ASP if that is a better solution. As you pointed out, these are "circa-1994" models that apparently work very well in 2007. So much so that almost 2/3 of all internet sites use exactly this technology. Those folks must all be idiots for using something that so obviously doesn't work! There isn't much technology around that was created in the 90s and that still works well for today's needs. I don't see the big deal if a web server mirrors a file system structure, the problem is on how to get to the desired file - which can be done with an arbiter script that gets hit on each access and then redirects to the desired location. Since the server just has to know what to serve up it will be quite easy to structure the site based on unique IDs and use a database table to retrieve the corresponding paths. Calling mysite.gov/1234 directs to mysite.gov/foo/bar/index.php and calling mysite.gov/4321 directs to mysite.gov/bar/foo/index.php. Of course, you need to add that information to a table or a simple ini file if no db is available. With a table you got one db connection, one select query, a few lines error output in case the resource doesn't exist, and one line for the redirect. Similar approach when using some authentication. And for the case that each resource is supposed to use the same code, instrument each resource with an include. I'd use two independent script files for that, but I guess one could smush that into one file as well. And with include I mean using the PHP code word "include()", not copying the code into each resource. And even that could be automated. I have written self-replicating scripts that worked out OK unless I wanted to make changes. I apologize upfront if my comments yet again generated an intellectual distaste. In that case, I give up and you are on your own. Have a nice day, David From ramons at gmx.net Mon Aug 6 19:28:09 2007 From: ramons at gmx.net (David Krings) Date: Mon, 06 Aug 2007 19:28:09 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B7A6C1.3010904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B717D2.2080506@secdat.com> <46B7A6C1.3010904@metalab.unc.edu> Message-ID: <46B7AE89.6000503@gmx.net> Elliotte Harold wrote: > Here's a simple example: a news site backed by a database. URLs like > > http://www.example.com/news/2007/07/05 > http://www.example.com/news/2007/07/06 > http://www.example.com/news/2007/07/07 > http://www.example.com/news/2007/07/08 > ... > > return pages which contain that day's headlines extracted from the > database. Are those dates consecutive? Means, is there a newspage for each day? If yes, then this is trivial. Still trivial if they are excluding sundays or such. > One script, no more, must handle all dates. (I don't really care if > there are 2 or 3 scripts, but I do not want to have to write a separate > page for each URL. The number of PHP scripts must be finite and fixed. > It should not increase with the number of URLs the script services.) > > The only way I've ever seen this done in PHP is by using mod_rewrite, > though they're a couple of other interesting suggestions in the thread I > need to explore further. Do you have a suggestion? Yes, a db table and header("Location: ") redirects that get stuffed from what the table query returns, plus one redirect for the case the required resource isn't found. Unless I am entirely dense, this is what the other posts point to the whole time. David From 1j0lkq002 at sneakemail.com Mon Aug 6 19:28:54 2007 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Mon, 06 Aug 2007 16:28:54 -0700 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B7A6C1.3010904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B717D2.2080506@secdat.com> <46B7A6C1.3010904@metalab.unc.edu> Message-ID: <21733-19987@sneakemail.com> Elliotte Harold elharo-at-metalab.unc.edu |nyphp dev/internal group use| wrote: > Kenneth Downs wrote: > >> Again, I'm not clear on what you are trying to serve. We probably >> have to back up to the beginning and erase the assumption that PHP >> has a one-to-one correspondence between a URL (or page) and a PHP >> file. Having erased that, we have to ask what kind of content you >> are trying to serve, then we have to look at PHP examples. >> > > Here's a simple example: a news site backed by a database. URLs like > > http://www.example.com/news/2007/07/05 > http://www.example.com/news/2007/07/06 > http://www.example.com/news/2007/07/07 > http://www.example.com/news/2007/07/08 > ... > > return pages which contain that day's headlines extracted from the > database. > > One script, no more, must handle all dates. (I don't really care if > there are 2 or 3 scripts, but I do not want to have to write a > separate page for each URL. The number of PHP scripts must be finite > and fixed. It should not increase with the number of URLs the script > services.) > > The only way I've ever seen this done in PHP is by using mod_rewrite, > though they're a couple of other interesting suggestions in the thread > I need to explore further. Do you have a suggestion? > Typical MVC front controller. A "news" script like /news/index.php gets passed 2007 07 and 05 as params via the front controller, so one script handles all news/year/month/day URLs. Most frameworks provide an MVC front controller. For me (a search engine optimizer) the core questions come later... how does that MVC front controller handle "exceptions" like: /news/2007 (missing params) -> should 301 to default URL like /news/2007/01/01/ or throw a 404 /news/dfsrdf/07/06 (invalid year) -> 404 error /news/ -> either 301 to default URL like /news/2007/01/01/ or throw a 404 /news -> 301 redirect to /news/ ? Too much redirection... either 301 to default URL like /news/2007/01/01/ or throw a 404 /news/2007/07/07 (no trailing slash) -> 301 to trailing slash version /news/2007/07/07/ /news/2007/06/07/whatever (excess params) -> 404 Admittedly, not many PHP coders care about such things. Some actually think flexible dispatching is a feature! Imagine that! ;-) -=john andrews -- ------------------------------------------------------------- Your web server traffic log file is the most important source of web business information available. Do you know where your logs are right now? Do you know who else has access to your log files? When they were last archived? Where those archives are? --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com From ken at secdat.com Mon Aug 6 20:27:48 2007 From: ken at secdat.com (Kenneth Downs) Date: Mon, 06 Aug 2007 20:27:48 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B7A6C1.3010904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B717D2.2080506@secdat.com> <46B7A6C1.3010904@metalab.unc.edu> Message-ID: <46B7BC84.1040307@secdat.com> Elliotte Harold wrote: > Kenneth Downs wrote: > >> Again, I'm not clear on what you are trying to serve. We probably >> have to back up to the beginning and erase the assumption that PHP >> has a one-to-one correspondence between a URL (or page) and a PHP >> file. Having erased that, we have to ask what kind of content you >> are trying to serve, then we have to look at PHP examples. >> > > Here's a simple example: a news site backed by a database. URLs like > > http://www.example.com/news/2007/07/05 > http://www.example.com/news/2007/07/06 > http://www.example.com/news/2007/07/07 > http://www.example.com/news/2007/07/08 > ... > > return pages which contain that day's headlines extracted from the > database. > > One script, no more, must handle all dates. (I don't really care if > there are 2 or 3 scripts, but I do not want to have to write a > separate page for each URL. The number of PHP scripts must be finite > and fixed. It should not increase with the number of URLs the script > services.) > > The only way I've ever seen this done in PHP is by using mod_rewrite, > though they're a couple of other interesting suggestions in the thread > I need to explore further. Do you have a suggestion? > The way I actually did it in Andromeda was to use an .htaccess (though you could put in Apache's config of course) with these lines given to me by somebody on this list: ForceType application/x-httpd-php Now a file named "news" (a php file w/o the extension) is your universal dispatcher. The "news" file splits the query string on slash and determines which row to pull from the database. The "news" file can also make sure subscribers are paid up, stuff like that. In fact, it can load your entire framework and do anything you want. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From cliff at pinestream.com Mon Aug 6 20:47:49 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 06 Aug 2007 20:47:49 -0400 Subject: [nycphp-talk] Repeating events script Message-ID: I need a script for repeating events. I need the ability to add repeating events to a database and to retrieve repeating events for a specific day -- that?s it. No fancy day/week/month views. No multi-user groups. No alarms, approval cycles, etc. Just add/edit event & list event for a specific day. Does anyone have suggestions? Perhaps there?s some fancy sql that can pull repeating events from a db in one swoop. The closest I?ve scene is webcalendar and Horde Kronolith. But both will take a bit of work to cut down to my requirements. Using one of these as a ?front-end? to add events might be ok. But it would be nice to have a lightweight script for retrieving events to pull into my app. Thanks in advance. Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at devonianfarm.com Mon Aug 6 21:19:02 2007 From: paul at devonianfarm.com (Paul Houle) Date: Mon, 06 Aug 2007 21:19:02 -0400 Subject: [nycphp-talk] Friendly URLS... The easy way! Message-ID: <46B7C886.8080508@devonianfarm.com> There's an easy way to get 'friendly' URLs in PHP. There are two tricks involved: (1) It seems to be a bit obscure that if you have a PHP script at http://somewhere.com/myscript.php the same script is called if you visit http://somewhere.com/myscript.php/some/subdirectories.gif http://somewhere.com/myscript.php/article/2007/07/07/hello-world Try it! You can make your script display something different based on the path you enter by checking the superglobal $_SERVER["PATH_INFO"]. From simple if-then-else ladders to advanced frameworks, you can take it from there as you wish. (2) You can remove the ".php" from your scripts by putting the following in your .htaccess or apache configuration: DefaultType application/x-httpd-php Now if you have a script without an extension (say, "myscript") you can write http://somewhere.com/myscript/some/subdirectories.gif http://somewhere.com/myscript/article/2007/07/07/hello-world From rmarscher at beaffinitive.com Mon Aug 6 21:03:01 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Mon, 6 Aug 2007 21:03:01 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <21733-19987@sneakemail.com> References: <46B60C11.2090904@metalab.unc.edu> <46B717D2.2080506@secdat.com> <46B7A6C1.3010904@metalab.unc.edu> <21733-19987@sneakemail.com> Message-ID: <59C60DD1-8FED-48B1-84F7-4AC6A561B035@beaffinitive.com> On Aug 6, 2007, at 7:28 PM, inforequest wrote: > For me (a search engine optimizer) the core questions come later... > how does that MVC front controller handle "exceptions" like: > /news/2007 (missing params) -> should 301 to default URL like /news/ > 2007/01/01/ or throw a 404 Unless you have a separate virtual resource that shows an archive of news for 2007 and not the january 1 entries, right? > /news/2007/07/07 (no trailing slash) -> 301 to trailing slash > version /news/2007/07/07/ John, how important is this? I think a former discussion on the list mentioned that most search engines are ok with the trailing slash vs. no trailing slash going to the same resource. Thanks a lot, Rob From jonbaer at jonbaer.com Mon Aug 6 21:15:59 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Mon, 6 Aug 2007 21:15:59 -0400 Subject: [nycphp-talk] Repeating events script In-Reply-To: References: Message-ID: You would still need an end time of course but this is doable if you adjust the 2nd param to strtotime (ie every Wednesday, etc) http://us3.php.net/manual/en/function.strtotime.php What you really do is iterate over the call w/ your db and of course this is better to do w/ a transaction or stored proc (if you have MySQL 5+) and do some type of caching if its a public query. I would have thought this would be possible w/ PEAR Calendar but it is not. - Jon On Aug 6, 2007, at 8:47 PM, Cliff Hirsch wrote: > I need a script for repeating events. I need the ability to add > repeating events to a database and to retrieve repeating events for > a specific day -- that?s it. No fancy day/week/month views. No > multi-user groups. No alarms, approval cycles, etc. Just add/edit > event & list event for a specific day. > > Does anyone have suggestions? Perhaps there?s some fancy sql that > can pull repeating events from a db in one swoop. The closest I?ve > scene is webcalendar and Horde Kronolith. But both will take a bit > of work to cut down to my requirements. Using one of these as a > ?front-end? to add events might be ok. But it would be nice to have > a lightweight script for retrieving events to pull into my app. > > Thanks in advance. > Cliff > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Mon Aug 6 21:45:55 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Mon, 6 Aug 2007 21:45:55 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B7A6C1.3010904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B717D2.2080506@secdat.com> <46B7A6C1.3010904@metalab.unc.edu> Message-ID: Bare minimum w/ CakePHP (4 files/scripts: model, controller, view, route) + provided you have a db with a table called "articles": 1) /models/article.php public class Article extends AppModel {} 2) /controllers/news_controller.php public class NewsController extends AppController { function index($year, $month, $day) { $created = $year . "-" . $month . "-" . $day; $this->set('articles', $this->Article->findAllByCreated($date); } } 3) /config/routes.php $Route->connect ('/news', array('controller'=>'News', 'action'=>'index')); 4) /app/views/news/index.php mod_rewrite will push everything to index.php which will call a "Dispatcher" to handle the URL + follow what has been declared in the routes file. I believe this would be almost the exact mechanism found in items like DispatchServlet in Spring, etc. (although I think you can abstract more items). - Jon On Aug 6, 2007, at 6:54 PM, Elliotte Harold wrote: > Kenneth Downs wrote: > >> Again, I'm not clear on what you are trying to serve. We probably >> have to back up to the beginning and erase the assumption that PHP >> has a one-to-one correspondence between a URL (or page) and a PHP >> file. Having erased that, we have to ask what kind of content you >> are trying to serve, then we have to look at PHP examples. > > Here's a simple example: a news site backed by a database. URLs like > > http://www.example.com/news/2007/07/05 > http://www.example.com/news/2007/07/06 > http://www.example.com/news/2007/07/07 > http://www.example.com/news/2007/07/08 > ... > > return pages which contain that day's headlines extracted from the > database. > > One script, no more, must handle all dates. (I don't really care if > there are 2 or 3 scripts, but I do not want to have to write a > separate page for each URL. The number of PHP scripts must be > finite and fixed. It should not increase with the number of URLs > the script services.) > > The only way I've ever seen this done in PHP is by using > mod_rewrite, though they're a couple of other interesting > suggestions in the thread I need to explore further. Do you have a > suggestion? > > -- > Elliotte Rusty Harold elharo at metalab.unc.edu > Java I/O 2nd Edition Just Published! > http://www.cafeaulait.org/books/javaio2/ > http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/ > cafeaulaitA/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Mon Aug 6 21:46:36 2007 From: ioplex at gmail.com (Michael B Allen) Date: Mon, 6 Aug 2007 21:46:36 -0400 Subject: [nycphp-talk] preg_match (related to Many pages one script discussion) Message-ID: <78c6bd860708061846t20773276y51af14d499ba804@mail.gmail.com> Hey, It so happens I'm working on a CMS component and the 'Many pages one script' discussion has inspired me to add mod_rewrite capability. I have a catch-all RewriteRule that just sends everything through index.php at the top of which I have a "handler table" that maps the REQUEST_URI to a handler class. I'm using preg_match to do the match and collect the parameters. So an example regex looks like: '@/news/([0-9]+)/([0-9]+)/([0-9]+)@' This works fine with REQUEST_URIs like: /news/2007/10/31 but it does not match any of the following: /news/2007/10 /news/2007 /news I would like to match these. For example, if the day parameter is not provided the match array returned by preg_match should simply have one fewer elements. So how does one designate parts of a preg_match expression as optional? Mike From jonbaer at jonbaer.com Mon Aug 6 21:48:45 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Mon, 6 Aug 2007 21:48:45 -0400 Subject: [nycphp-talk] need help regarding download bar In-Reply-To: References: <84caf2b90707311128j434678c8td04ede0f591068c0@mail.gmail.com> <902104.60417.qm@web59301.mail.re1.yahoo.com> Message-ID: <22AD9319-71B7-44DC-8574-C6A0C87DBF85@jonbaer.com> There is already a download progress bar in every known browser last time I checked ;-) Why replicate? On Aug 6, 2007, at 3:24 PM, csnyder wrote: > On 8/6/07, birgunj birgunj wrote: >> Dear All, >> >> i want to write script to download file.how do i display download >> bar in php >> like when download file from any site, it download bar appear, it >> show >> size of file,time etc. >> >> can any body help me how to do this. >> >> thanks humayoo > > Download is the responsibility of the client. This isn't in PHP's > domain. > > -- > Chris Snyder > http://chxo.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From 1j0lkq002 at sneakemail.com Mon Aug 6 21:54:04 2007 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Mon, 06 Aug 2007 18:54:04 -0700 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <59C60DD1-8FED-48B1-84F7-4AC6A561B035@beaffinitive.com> References: <46B60C11.2090904@metalab.unc.edu> <46B717D2.2080506@secdat.com> <46B7A6C1.3010904@metalab.unc.edu> <21733-19987@sneakemail.com> <59C60DD1-8FED-48B1-84F7-4AC6A561B035@beaffinitive.com> Message-ID: <3416-20739@sneakemail.com> Rob Marscher rmarscher-at-beaffinitive.com |nyphp dev/internal group use| wrote: > On Aug 6, 2007, at 7:28 PM, inforequest wrote: > >> For me (a search engine optimizer) the core questions come later... >> how does that MVC front controller handle "exceptions" like: >> /news/2007 (missing params) -> should 301 to default URL like /news/ >> 2007/01/01/ or throw a 404 > > Unless you have a separate virtual resource that shows an archive of > news for 2007 and not the january 1 entries, right? > >> /news/2007/07/07 (no trailing slash) -> 301 to trailing slash >> version /news/2007/07/07/ > > John, how important is this? I think a former discussion on the list > mentioned that most search engines are ok with the trailing slash vs. > no trailing slash going to the same resource. > > Thanks a lot, > Rob > If you are consistent on your site, so you always use trailing slash or not, Google says it will handle things properly. But what if you have great indexing on /news/, and people linking to you on /news/, but /news returns the same content? Now what if I link to /news from a high power web site. Will Google decide to "value" the /news over the /news/ version? Will it drop the "duplicate" at /news/ even though it has your backlinks? Another consideration - what if half the world links to your /news/ and the other half to /news. Is your incoming "link juice" being split across the two unique URLs? Would you benefit more if the /news was a 301 redirect to /news/ (where a 301 redirect is followed by Google, including the flow of link juice?) I believe it is best to leave these matters up to the webmaster, not the webmaster's competitors nor the Google engineers. --=john -- ------------------------------------------------------------- Your web server traffic log file is the most important source of web business information available. Do you know where your logs are right now? Do you know who else has access to your log files? When they were last archived? Where those archives are? --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com From jonbaer at jonbaer.com Mon Aug 6 21:55:08 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Mon, 6 Aug 2007 21:55:08 -0400 Subject: [nycphp-talk] preg_match (related to Many pages one script discussion) In-Reply-To: <78c6bd860708061846t20773276y51af14d499ba804@mail.gmail.com> References: <78c6bd860708061846t20773276y51af14d499ba804@mail.gmail.com> Message-ID: Would be something like: @/news/([0-9]+)?/([0-9]+)?/([0-9]+)?@ But I think it should either be a completely valid date or now by default. Also isn't there a mode to preg_match or a version in which you can get named parameters? - Jon On Aug 6, 2007, at 9:46 PM, Michael B Allen wrote: > '@/news/([0-9]+)/([0-9]+)/([0-9]+)@' -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Mon Aug 6 21:56:38 2007 From: chsnyder at gmail.com (csnyder) Date: Mon, 6 Aug 2007 21:56:38 -0400 Subject: [nycphp-talk] preg_match (related to Many pages one script discussion) In-Reply-To: <78c6bd860708061846t20773276y51af14d499ba804@mail.gmail.com> References: <78c6bd860708061846t20773276y51af14d499ba804@mail.gmail.com> Message-ID: On 8/6/07, Michael B Allen wrote: > Hey, > > It so happens I'm working on a CMS component and the 'Many pages one > script' discussion has inspired me to add mod_rewrite capability. I > have a catch-all RewriteRule that just sends everything through > index.php at the top of which I have a "handler table" that maps the > REQUEST_URI to a handler class. I'm using preg_match to do the match > and collect the parameters. > > So an example regex looks like: > > '@/news/([0-9]+)/([0-9]+)/([0-9]+)@' > > This works fine with REQUEST_URIs like: > > /news/2007/10/31 > > but it does not match any of the following: > > /news/2007/10 > /news/2007 > /news > > I would like to match these. For example, if the day parameter is not > provided the match array returned by preg_match should simply have one > fewer elements. > > So how does one designate parts of a preg_match expression as optional? > > Mike How optional? Why use preg_match at all? list( $app, $year, $month, $day ) = explode( '/', $uri ); -- Chris Snyder http://chxo.com/ From elharo at metalab.unc.edu Mon Aug 6 22:16:53 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Mon, 06 Aug 2007 22:16:53 -0400 Subject: [nycphp-talk] Friendly URLS... The easy way! In-Reply-To: <46B7C886.8080508@devonianfarm.com> References: <46B7C886.8080508@devonianfarm.com> Message-ID: <46B7D615.8020009@metalab.unc.edu> Paul Houle wrote: > There's an easy way to get 'friendly' URLs in PHP. There are two tricks > involved: > > (1) It seems to be a bit obscure that if you have a PHP script at > > http://somewhere.com/myscript.php > > the same script is called if you visit > > http://somewhere.com/myscript.php/some/subdirectories.gif > http://somewhere.com/myscript.php/article/2007/07/07/hello-world > > Try it! Amazing! I did just try it and that actually works. You can use a PHP script to replace a directory. I thought there had to be something that easy, but I've never seen it done that way. I think what Ken last suggested amounts to the same thing, but I couldn't quite see how his example actually worked. It is indeed pretty obscure. I wonder if this is documented anywhere? -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From jonbaer at jonbaer.com Mon Aug 6 22:17:40 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Mon, 6 Aug 2007 22:17:40 -0400 Subject: [nycphp-talk] preg_match (related to Many pages one script discussion) In-Reply-To: References: <78c6bd860708061846t20773276y51af14d499ba804@mail.gmail.com> Message-ID: Ahh ... named patterns, how extremely ugly :-) $date = "/2007/08/06"; preg_match("/(?P[0-9]{4})\/(?P[0-9]{2})\/(?P[0-9] {2})/", $date, $match); print_r($match); - Jon On Aug 6, 2007, at 9:56 PM, csnyder wrote: > On 8/6/07, Michael B Allen wrote: >> Hey, >> >> It so happens I'm working on a CMS component and the 'Many pages one >> script' discussion has inspired me to add mod_rewrite capability. I >> have a catch-all RewriteRule that just sends everything through >> index.php at the top of which I have a "handler table" that maps the >> REQUEST_URI to a handler class. I'm using preg_match to do the match >> and collect the parameters. >> >> So an example regex looks like: >> >> '@/news/([0-9]+)/([0-9]+)/([0-9]+)@' >> >> This works fine with REQUEST_URIs like: >> >> /news/2007/10/31 >> >> but it does not match any of the following: >> >> /news/2007/10 >> /news/2007 >> /news >> >> I would like to match these. For example, if the day parameter is not >> provided the match array returned by preg_match should simply have >> one >> fewer elements. >> >> So how does one designate parts of a preg_match expression as >> optional? >> >> Mike > > How optional? Why use preg_match at all? > > list( $app, $year, $month, $day ) = explode( '/', $uri ); > > > -- > Chris Snyder > http://chxo.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From tedd at sperling.com Mon Aug 6 22:29:43 2007 From: tedd at sperling.com (tedd) Date: Mon, 6 Aug 2007 22:29:43 -0400 Subject: [nycphp-talk] Friendly URLS... The easy way! In-Reply-To: <46B7D615.8020009@metalab.unc.edu> References: <46B7C886.8080508@devonianfarm.com> <46B7D615.8020009@metalab.unc.edu> Message-ID: At 10:16 PM -0400 8/6/07, Elliotte Harold wrote: >Paul Houle wrote: >>There's an easy way to get 'friendly' URLs in PHP. There are two >>tricks involved: >> >>(1) It seems to be a bit obscure that if you have a PHP script at >> >>http://somewhere.com/myscript.php >> >>the same script is called if you visit >> >>http://somewhere.com/myscript.php/some/subdirectories.gif >>http://somewhere.com/myscript.php/article/2007/07/07/hello-world >> >>Try it! > > >Amazing! I did just try it and that actually works. You can use a >PHP script to replace a directory. I thought there had to be >something that easy, but I've never seen it done that way. > >I think what Ken last suggested amounts to the same thing, but I >couldn't quite see how his example actually worked. > >It is indeed pretty obscure. I wonder if this is documented anywhere? I still don't see it. Dumb it down a bit for me. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From ioplex at gmail.com Mon Aug 6 23:01:18 2007 From: ioplex at gmail.com (Michael B Allen) Date: Mon, 6 Aug 2007 23:01:18 -0400 Subject: [nycphp-talk] preg_match (related to Many pages one script discussion) In-Reply-To: References: <78c6bd860708061846t20773276y51af14d499ba804@mail.gmail.com> Message-ID: <78c6bd860708062001y603648c0x6499bb9168c0bf9a@mail.gmail.com> On 8/6/07, Jon Baer wrote: > > Would be something like: > > @/news/([0-9]+)?/([0-9]+)?/([0-9]+)?@ Hi Jon, That works great. Thanks. > But I think it should either be a completely valid date or now by default. Perhaps. I think it could make sense to have some parameters optional. I really just wanted to make sure I know how to make URL parameters optional. > Also isn't there a mode to preg_match or a version in which you can get > named parameters? That's no problem. I have the parameter names in a parallel array so I just loop through the matches and build a new array. Then my get_param and set_param functions get or set params from or to $_POST, $_GET and $url_params in that order of precedence. That abstraction also assists with building URLs (e.g. if a parameter came from the URL you can build a URL with URL parameters). Thanks, Mike > On Aug 6, 2007, at 9:46 PM, Michael B Allen wrote: > > > '@/news/([0-9]+)/([0-9]+)/([0-9]+)@' > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From suzerain at suzerain.com Mon Aug 6 23:47:01 2007 From: suzerain at suzerain.com (Marc Antony Vose) Date: Tue, 7 Aug 2007 11:47:01 +0800 Subject: [nycphp-talk] Friendly URLS... The easy way! In-Reply-To: <46B7C886.8080508@devonianfarm.com> References: <46B7C886.8080508@devonianfarm.com> Message-ID: Hi there: I've noticed a lot of web sites using this technique. I know this stuff always changes, but one potential caveat: the last I knew, search engines were either ignoring or ranking down anything after the xxxx.php in the URL when people use this structure. Meaning, essentially, http://www.something.com/script.php/some/other/thing is not as good as http://www.something.com/script/some/other/thing from Google's point of view. So, easier, yes, but it might give you some unwanted side effects. Again, this information might have changed, or even might have been wrong in the first place, but since mod_rewrite is so dead simple to use, IMO it's not worth the risk. Maybe someone else can either clarify or refute my claim. Cheers, Marc http://www.suzerain.com Le 7 ao?t 07 ? 09:19, Paul Houle a ?crit : > There's an easy way to get 'friendly' URLs in PHP. There are two > tricks involved: > > (1) It seems to be a bit obscure that if you have a PHP script at > > http://somewhere.com/myscript.php > > the same script is called if you visit > > http://somewhere.com/myscript.php/some/subdirectories.gif > http://somewhere.com/myscript.php/article/2007/07/07/hello-world > > Try it! You can make your script display something different based > on the path > you enter by checking the superglobal $_SERVER["PATH_INFO"]. From > simple > if-then-else ladders to advanced frameworks, you can take it from > there as you wish. > > (2) You can remove the ".php" from your scripts by putting the > following in your > .htaccess or apache configuration: > > DefaultType application/x-httpd-php > > Now if you have a script without an extension (say, "myscript") > you can write > > http://somewhere.com/myscript/some/subdirectories.gif > http://somewhere.com/myscript/article/2007/07/07/hello-world > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From birgunjp0071 at yahoo.com Tue Aug 7 02:12:24 2007 From: birgunjp0071 at yahoo.com (birgunj birgunj) Date: Mon, 6 Aug 2007 23:12:24 -0700 (PDT) Subject: [nycphp-talk] need help regarding download bar In-Reply-To: <22AD9319-71B7-44DC-8574-C6A0C87DBF85@jonbaer.com> Message-ID: <711338.57441.qm@web59311.mail.re1.yahoo.com> Dear, Thanks alot for replying.if i want to upload file, will upload bar will show in any browser or i have to write script for showing upload bar? humayoo Jon Baer wrote: There is already a download progress bar in every known browser last time I checked ;-) Why replicate? On Aug 6, 2007, at 3:24 PM, csnyder wrote: > On 8/6/07, birgunj birgunj wrote: >> Dear All, >> >> i want to write script to download file.how do i display download >> bar in php >> like when download file from any site, it download bar appear, it >> show >> size of file,time etc. >> >> can any body help me how to do this. >> >> thanks humayoo > > Download is the responsibility of the client. This isn't in PHP's > domain. > > -- > Chris Snyder > http://chxo.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php --------------------------------- Shape Yahoo! in your own image. Join our Network Research Panel today! -------------- next part -------------- An HTML attachment was scrubbed... URL: From birgunjp0071 at yahoo.com Tue Aug 7 02:17:57 2007 From: birgunjp0071 at yahoo.com (birgunj birgunj) Date: Mon, 6 Aug 2007 23:17:57 -0700 (PDT) Subject: [nycphp-talk] need help regarding download bar In-Reply-To: <02058897-E0DE-4435-A946-31C475BD6754@o2group.com> Message-ID: <105363.31918.qm@web59313.mail.re1.yahoo.com> thanks alto for replying. but how to set header for this to display correct contents. humayoo Tim Lieberman wrote: On Aug 6, 2007, at 1:24 PM, csnyder wrote: > On 8/6/07, birgunj birgunj wrote: >> Dear All, >> >> i want to write script to download file.how do i display download >> bar in php >> like when download file from any site, it download bar appear, it >> show >> size of file,time etc. >> >> can any body help me how to do this. >> >> thanks humayoo > > Download is the responsibility of the client. This isn't in PHP's > domain. > Well, if you're passing the file through a script, it helps to tell the client some things by setting proper headers. Content-type, Content-disposition and Content-length, for starters. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php --------------------------------- Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. -------------- next part -------------- An HTML attachment was scrubbed... URL: From birgunjp0071 at yahoo.com Tue Aug 7 02:18:39 2007 From: birgunjp0071 at yahoo.com (birgunj birgunj) Date: Mon, 6 Aug 2007 23:18:39 -0700 (PDT) Subject: [nycphp-talk] need help regarding download bar In-Reply-To: Message-ID: <609917.369.qm@web59305.mail.re1.yahoo.com> thanks alto for replying humayoo csnyder wrote: On 8/6/07, birgunj birgunj wrote: > Dear All, > > i want to write script to download file.how do i display download bar in php > like when download file from any site, it download bar appear, it show > size of file,time etc. > > can any body help me how to do this. > > thanks humayoo Download is the responsibility of the client. This isn't in PHP's domain. -- Chris Snyder http://chxo.com/ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php --------------------------------- Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search. -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulcheung at tiscali.co.uk Tue Aug 7 03:31:44 2007 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Tue, 7 Aug 2007 08:31:44 +0100 Subject: [nycphp-talk] secure login/logon References: <20070701.215701.25801.0@webmail14.dca.untd.com><003001c7d80d$a8182e80$0200a8c0@X9183> Message-ID: <001001c7d8c5$01c17100$0200a8c0@X9183> Thanks Chris I had confused session cookies and stored cookies Paul ----- Original Message ----- From: "csnyder" To: "NYPHP Talk" Sent: Monday, August 06, 2007 8:22 PM Subject: Re: [nycphp-talk] secure login/logon > On 8/6/07, PaulCheung wrote: >> I just need pointing in the right direction. Does anybody know where I >> should be looking for in information on secure login/logon (using PHP 5 >> and >> DOES NOT USE COOKIES) with coding examples? > > Perhaps you are confused re: cookies. Session cookies (not stored > cookies!) are considered the best (most secure) way to handle > authentication from request to request. See PHP's session functions > for details and examples. > > You should use HTTPS for login and for all subsequent requests to > avoid transmitting the session id in plaintext. > > -- > Chris Snyder > http://chxo.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ken at secdat.com Tue Aug 7 07:07:17 2007 From: ken at secdat.com (Kenneth Downs) Date: Tue, 07 Aug 2007 07:07:17 -0400 Subject: [nycphp-talk] Friendly URLS... The easy way! In-Reply-To: <46B7D615.8020009@metalab.unc.edu> References: <46B7C886.8080508@devonianfarm.com> <46B7D615.8020009@metalab.unc.edu> Message-ID: <46B85265.50601@secdat.com> Elliotte Harold wrote: > Paul Houle wrote: >> There's an easy way to get 'friendly' URLs in PHP. There are two >> tricks involved: >> >> (1) It seems to be a bit obscure that if you have a PHP script at >> >> http://somewhere.com/myscript.php >> >> the same script is called if you visit >> >> http://somewhere.com/myscript.php/some/subdirectories.gif >> http://somewhere.com/myscript.php/article/2007/07/07/hello-world >> >> Try it! > > > Amazing! I did just try it and that actually works. You can use a PHP > script to replace a directory. I thought there had to be something > that easy, but I've never seen it done that way. > > I think what Ken last suggested amounts to the same thing, but I > couldn't quite see how his example actually worked. Yes, they amount to the same thing, but one has the .php extension and one does not. It was weird to me when pointed out at first. What the .htaccess setting is doing is telling Apache to process an entry that looks like 'news' as a php script. Also, "entries" here means a file or a directory segment. The key is knowing that apache parses from left to right, not the other way around. So as soon as it finds 'news', it passes control to that file as a php script and apache itself is now finished. > > It is indeed pretty obscure. I wonder if this is documented anywhere? > > Methinks its a basic apache thing. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From jonbaer at jonbaer.com Tue Aug 7 07:55:42 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Tue, 7 Aug 2007 07:55:42 -0400 Subject: [nycphp-talk] need help regarding download bar In-Reply-To: <711338.57441.qm@web59311.mail.re1.yahoo.com> References: <711338.57441.qm@web59311.mail.re1.yahoo.com> Message-ID: Upload is a different beast since you need to ping the server for stat ... Save yourself time + use this package (or something equivalent): http://swfupload.mammon.se/ - Jon On Aug 7, 2007, at 2:12 AM, birgunj birgunj wrote: > Dear, > > Thanks alot for replying.if i want to upload file, will upload > bar will show in any browser or i have to write script for > showing upload bar? > > humayoo > > Jon Baer wrote: > There is already a download progress bar in every known browser last > time I checked ;-) Why replicate? > > On Aug 6, 2007, at 3:24 PM, csnyder wrote: > >> On 8/6/07, birgunj birgunj wrote: >>> Dear All, >>> >>> i want to write script to download file.how do i display download >>> bar in php >>> like when download file from any site, it download bar appear, it >>> show >>> size of file,time etc. >>> >>> can any body help me how to do this. >>> >>> thanks humayoo >> >> Download is the responsibility of the client. This isn't in PHP's >> domain. >> >> -- >> Chris Snyder >> http://chxo.com/ >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > > --------------------------------- > Shape Yahoo! in your own image. Join our Network Research Panel > today!_______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Tue Aug 7 08:42:12 2007 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 7 Aug 2007 08:42:12 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B7A344.50104@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> Message-ID: <031801c7d8f0$60824810$651ba8c0@MobileZ> Elliotte Harold wrote on Monday, August 06, 2007 6:40 PM: > David Krings wrote: > > Elliotte Harold wrote: > > > Edward Potter wrote: > > > > hmmmm, I have never found this to be a problem. Using > > > > includes, you can pull in .php code from anywhere, even pages > > > > with a .php extension may be 99.99% html, with a just a single > > > > include('foo.php') in it. Keeps things super streamlined, and > > > > your pages are very readable. > > > > > > > > > > You've got it backwards. I want one script to service many URLs, > > > not many scripts to service one URL. > > > > > > > And that is exactly how Edward described it. You include the one > > script into the many URLs you want to make use of the script. > > I guess that isn't what you are after, it just reads that way. > > What you are proposing is not one script to service N URLs. It is N+1 > scripts to service N URLs. It is still necessary to create N separate > loader scripts and place them at the right locations. That doesn't > scale, and it's an extraordinary waste of resources when a small > percentage of the possible URLs will ever be reached. > > The goal here is to avoid having to manually create and maintain > separate files for each URL. One file: many URLs. That's the goal. > > Imagine, for example, a site with a separate URL structure for each > user, or a separate URL for each date in history. > > The point about this being an Apache problem rather than a PHP problem > is understood, except that Java/Tomcat/mod_jk does seem able to Sure they do - because Java requires essentially it's own server to run. > accomplish what I'm looking for, so the real lack may not be in Apache > but in now PHP connects to Apache. Quite true - mod_perl can do more, but as far as I know, still not as much as Tomcat since they're linked at the hip. > Overall, though, I suspect all parties (Apache, PHP, Tomcat, Rails. > etc.) are still too mired in circa-1994 models of web servers serving > file systems. For example, once you map /foo to a servlet you can't > then map /foo/bar to something else. Hmm, interesting... > I'm curious if they're any web servers out there that do not start > with the assumption that each URL maps to a file somewhere. What if a While it seems like a good idea, it'd probably cause more grief... think of all those poor images, CSS, PDFs, JS, static HTML, etc. files out there that we assume get served directly, correctly, statically - and quickly - right from the filesystem. > web server were designed to allow all URLs to be delegated to specific > handlers? A file system handler need be only special case, no Well that essentially exists with AddHandler and friends in Apache, and is essentially the crux of many of the techniques described in this thread. > different from a database handler or a PHP handler. > > RESTful API *design* is fairly easy to do. RESTful API > *implementation* is fairly hard because no servers I've seen provide > sufficient flexibility. Coming up on the Web's 20th anniversary, we > still haven't learned how to take HTTP on its own terms rather than > by pretending its something else we're more familiar with. > Revolutions take time. :-) Agreed - I'm still waiting for XSLT to take us by storm. And I keep that Javascript turned off in my browser, since no web site should depend on it being available... right? Web's 20 ?= Web 2.0 It's just a decimal point away... H From lists at zaunere.com Tue Aug 7 08:58:39 2007 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 7 Aug 2007 08:58:39 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <25711-74437@sneakemail.com> References: <46B60C11.2090904@metalab.unc.edu> <1660658C-54A4-4B72-8C23-4D6D56051D0F@jonbaer.com><00e601c7d820$c16abf20$651ba8c0@MobileZ> <25711-74437@sneakemail.com> Message-ID: <031c01c7d8f2$aca13600$651ba8c0@MobileZ> > I follow you, Hans, but then what about URLs as resource locators? > Your elegant "aliasing a handler or set of URLs to a single URL or > processor" means URLs don't equate to (unique) information resources. > Doesn't that "break" the web? The aliasing is happening within the web server to get around direct filesystem/URL mapping - it's up to the business logic of the application to serve different resources, which is the flexibility we're after. This determination can happen in the application, dynamically and during request time, rather than being dictated by the filesystem. H From ramons at gmx.net Tue Aug 7 09:05:22 2007 From: ramons at gmx.net (David Krings) Date: Tue, 07 Aug 2007 09:05:22 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <031801c7d8f0$60824810$651ba8c0@MobileZ> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> Message-ID: <46B86E12.2060101@gmx.net> Hans Zaunere wrote: > Agreed - I'm still waiting for XSLT to take us by storm. And I keep that > Javascript turned off in my browser, since no web site should depend on it > being available... right? Both true. XSLT is indeed an awesome technology. The reason why it doesn't catch on is that XML and XSLT is designed for machines to read and not for humans. Just see how difficult it is for many to create proper HTML! > Web's 20 ?= Web 2.0 It's just a decimal point away... With broadband being very expensive and about anything Web 2.0 being created only for profit there will be a long time to go. And also, what is wrong out of a sudden with fat clients and desktop apps? David From chsnyder at gmail.com Tue Aug 7 10:23:10 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 7 Aug 2007 10:23:10 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <031801c7d8f0$60824810$651ba8c0@MobileZ> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu> <46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> Message-ID: On 8/7/07, Hans Zaunere wrote: > > While it seems like a good idea, it'd probably cause more grief... think of > all those poor images, CSS, PDFs, JS, static HTML, etc. files out there that > we assume get served directly, correctly, statically - and quickly - right > from the filesystem. > But that's what caching proxies are for! You're totally right, though, being able to mix and match gets a lot more out of a single server instance. -- Chris Snyder http://chxo.com/ From mitch.pirtle at gmail.com Tue Aug 7 13:49:27 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 7 Aug 2007 13:49:27 -0400 Subject: [nycphp-talk] Friendly URLS... The easy way! In-Reply-To: <46B85265.50601@secdat.com> References: <46B7C886.8080508@devonianfarm.com> <46B7D615.8020009@metalab.unc.edu> <46B85265.50601@secdat.com> Message-ID: <330532b60708071049x7dedaa38s924bffdbdaa106fb@mail.gmail.com> Joomla 1.5 provides that as an option, and was created for folks that were on shared hosts and didn't have access to mod_rewrite or .htaccess. For them, this is the best thing they can do - besides switching hosts, of course ;-) -- Mitch From mitch.pirtle at gmail.com Tue Aug 7 13:49:27 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 7 Aug 2007 13:49:27 -0400 Subject: [nycphp-talk] Friendly URLS... The easy way! In-Reply-To: <46B85265.50601@secdat.com> References: <46B7C886.8080508@devonianfarm.com> <46B7D615.8020009@metalab.unc.edu> <46B85265.50601@secdat.com> Message-ID: <330532b60708071049x7dedaa38s924bffdbdaa106fb@mail.gmail.com> Joomla 1.5 provides that as an option, and was created for folks that were on shared hosts and didn't have access to mod_rewrite or .htaccess. For them, this is the best thing they can do - besides switching hosts, of course ;-) -- Mitch From 1j0lkq002 at sneakemail.com Tue Aug 7 15:04:33 2007 From: 1j0lkq002 at sneakemail.com (inforequest) Date: Tue, 07 Aug 2007 12:04:33 -0700 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <031c01c7d8f2$aca13600$651ba8c0@MobileZ> References: <46B60C11.2090904@metalab.unc.edu> <1660658C-54A4-4B72-8C23-4D6D56051D0F@jonbaer.com><00e601c7d820$c16abf20$651ba8c0@MobileZ> <25711-74437@sneakemail.com> <031c01c7d8f2$aca13600$651ba8c0@MobileZ> Message-ID: <24298-82296@sneakemail.com> Hans Zaunere lists-at-zaunere.com |nyphp dev/internal group use| wrote: >>I follow you, Hans, but then what about URLs as resource locators? >>Your elegant "aliasing a handler or set of URLs to a single URL or >>processor" means URLs don't equate to (unique) information resources. >>Doesn't that "break" the web? >> >> > >The aliasing is happening within the web server to get around direct >filesystem/URL mapping - it's up to the business logic of the application to >serve different resources, which is the flexibility we're after. This >determination can happen in the application, dynamically and during request >time, rather than being dictated by the filesystem. > >H > > > okay so we are saying the same thing, as long as the app isn't neglectful -- ------------------------------------------------------------- Your web server traffic log file is the most important source of web business information available. Do you know where your logs are right now? Do you know who else has access to your log files? When they were last archived? Where those archives are? --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com From elharo at metalab.unc.edu Tue Aug 7 17:15:35 2007 From: elharo at metalab.unc.edu (Elliotte Rusty Harold) Date: Tue, 07 Aug 2007 17:15:35 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B86E12.2060101@gmx.net> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> Message-ID: <46B8E0F7.1030203@metalab.unc.edu> David Krings wrote: > Hans Zaunere wrote: >> Agreed - I'm still waiting for XSLT to take us by storm. And I keep that >> Javascript turned off in my browser, since no web site should depend >> on it >> being available... right? > > Both true. XSLT is indeed an awesome technology. The reason why it > doesn't catch on is that XML and XSLT is designed for machines to read > and not for humans. Just see how difficult it is for many to create > proper HTML! > There may not be a lot of XSLT on the web yet, but there's more than you'd think; especially if you get to look behind the curtains. Many more sites are using it internally than are exposing it publicly. And in some fields such as publishing XSLT has been an absolute godsend. It's much less heralded than PHP or Rails, but to me it's a far more powerful and productive language for the uses for which it's intended. That is, XSLT improves my productivity when doing XMLish things more than PHP improves my productivity when doing Webish things. I'm not saying XSLT is a general purpose web development language like PHP. It's definitely true that the use cases for XSLT are somewhat more specialized than the use cases for PHP. I.e. more people want to do webby things than XML things. Of course, if you really want to rock, try combining XQuery+XQueryP+APP+a native XML database. Once the tooling matures a bit, that's a stack that's going to make all previous web dev frameworks look like PowerBuilder. Hmm, need a good acronym for that one: LAXQE perhaps? (Linux+Atom Publishing Protocol+XQuery+eXist) Have to work on that a bit. :-) -- Elliotte Rusty Harold From tim_lists at o2group.com Tue Aug 7 17:25:10 2007 From: tim_lists at o2group.com (Tim Lieberman) Date: Tue, 07 Aug 2007 15:25:10 -0600 Subject: [nycphp-talk] need help regarding download bar In-Reply-To: References: <711338.57441.qm@web59311.mail.re1.yahoo.com> Message-ID: <46B8E336.2080109@o2group.com> The headers I mentioned earlier are easy to send using PHP's header() function. If I'm creating a large CSV file that I want the user to save to disk, and I want the browser to display meaningful download status, I'd do something like: For upload progress bars, swfupload, mentioned by Jon, works very well (usually). There's a fork of it that does some extra useful stuff. Read about it here: http://linebyline.blogspot.com/index.html?rn=1150 -Tim Jon Baer wrote: > Upload is a different beast since you need to ping the server for stat ... > > Save yourself time + use this package (or something equivalent): > > http://swfupload.mammon.se/ > > - Jon > > On Aug 7, 2007, at 2:12 AM, birgunj birgunj wrote: > >> Dear, >> >> Thanks alot for replying.if i want to upload file, will upload bar >> will show in any browser or i have to write script for showing >> upload bar? >> >> humayoo >> >> Jon Baer > wrote: >> There is already a download progress bar in every known browser last >> time I checked ;-) Why replicate? >> >> On Aug 6, 2007, at 3:24 PM, csnyder wrote: >> >>> On 8/6/07, birgunj birgunj wrote: >>>> Dear All, >>>> >>>> i want to write script to download file.how do i display download >>>> bar in php >>>> like when download file from any site, it download bar appear, it >>>> show >>>> size of file,time etc. >>>> >>>> can any body help me how to do this. >>>> >>>> thanks humayoo >>> >>> Download is the responsibility of the client. This isn't in PHP's >>> domain. >>> >>> -- >>> Chris Snyder >>> http://chxo.com/ >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> >> >> >> --------------------------------- >> Shape Yahoo! in your own image. Join our Network Research Panel >> today!_______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jonbaer at jonbaer.com Tue Aug 7 17:29:18 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Tue, 7 Aug 2007 17:29:18 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B8E0F7.1030203@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> Message-ID: Isn't what you described already in some type of existence with the W3C SPARQL idea ... http://www.w3.org/2001/sw/DataAccess/ Or do you have an opinion on it? - Jon On Aug 7, 2007, at 5:15 PM, Elliotte Rusty Harold wrote: > David Krings wrote: >> Hans Zaunere wrote: >>> Agreed - I'm still waiting for XSLT to take us by storm. And I >>> keep that >>> Javascript turned off in my browser, since no web site should >>> depend on it >>> being available... right? >> Both true. XSLT is indeed an awesome technology. The reason why it >> doesn't catch on is that XML and XSLT is designed for machines to >> read and not for humans. Just see how difficult it is for many to >> create proper HTML! > > There may not be a lot of XSLT on the web yet, but there's more > than you'd think; especially if you get to look behind the > curtains. Many more sites are using it internally than are exposing > it publicly. > > And in some fields such as publishing XSLT has been an absolute > godsend. It's much less heralded than PHP or Rails, but to me it's > a far more powerful and productive language for the uses for which > it's intended. That is, XSLT improves my productivity when doing > XMLish things more than PHP improves my productivity when doing > Webish things. I'm not saying XSLT is a general purpose web > development language like PHP. It's definitely true that the use > cases for XSLT are somewhat more specialized than the use cases for > PHP. I.e. more people want to do webby things than XML things. > > Of course, if you really want to rock, try combining XQuery+XQueryP > +APP+a native XML database. Once the tooling matures a bit, that's > a stack that's going to make all previous web dev frameworks look > like PowerBuilder. Hmm, need a good acronym for that one: LAXQE > perhaps? (Linux+Atom Publishing Protocol+XQuery+eXist) Have to work > on that a bit. :-) > > -- > Elliotte Rusty Harold > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From elharo at metalab.unc.edu Tue Aug 7 17:30:59 2007 From: elharo at metalab.unc.edu (Elliotte Rusty Harold) Date: Tue, 07 Aug 2007 17:30:59 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> Message-ID: <46B8E493.5070907@metalab.unc.edu> Jon Baer wrote: > Isn't what you described already in some type of existence with the W3C > SPARQL idea ... > > http://www.w3.org/2001/sw/DataAccess/ > > Or do you have an opinion on it? That's really something very different, and something I'm very skeptical of. -- Elliotte From evdo.hsdpa at gmail.com Tue Aug 7 20:07:18 2007 From: evdo.hsdpa at gmail.com (Robert Kim Wireless Internet Advisor) Date: Tue, 7 Aug 2007 17:07:18 -0700 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B60C11.2090904@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> Message-ID: <1ec620e90708071707q6378013die1e9d418612ceff6@mail.gmail.com> I had the same issue a while back. cc me on a good response willya? On 8/5/07, Elliotte Harold wrote: > I'm considering a simple site that I may design in PHP. PHP is probably > the simplest solution except for one thing: it carries a very strong > coupling between pages and scripts. As far as I've ever been able to > tell PHP really, really, really wants there to be a single primary .php > file for each URL that does not contain a query string (though that file > may of course invoke others). > > For the system I'm designing that simply won't work. In Java servlet > environments it's relatively trivial to map one servlet to an entire > directory structure, so that it handles all requests for all pages > within that hierarchy. > > Is there any *reasonable* way to do this in PHP? The only way I've ever > seen is what WordPress does: use mod_rewrite to redirect all requests > within the hierarchy to a custom dispatcher script that converts actual > hierarchy components into query string variables. I am impressed by this > hack, but it's way too kludgy for me to be comfortable with. For one > thing, I don't want to depend on mod_rewrite if I don't have to. > > Surely by now there's a better way? How do I overcome the one file per > URL assumption that PHP makes? > -- Robert Q Kim, Wireless Internet Provider http://evdo-coverage.com/satellite-wireless-internet.html http://groups.google.com/group/unpaid-overtime 2611 S. Pacific Coast Highway 101 Suite 203 Unpaid Overtime Law Breaks San Diego, CA 92007 206 984 0880 From ken at secdat.com Wed Aug 8 07:49:38 2007 From: ken at secdat.com (Kenneth Downs) Date: Wed, 08 Aug 2007 07:49:38 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B8E0F7.1030203@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> Message-ID: <46B9ADD2.1010600@secdat.com> Elliotte Rusty Harold wrote: > > > Of course, if you really want to rock, try combining > XQuery+XQueryP+APP+a native XML database. Once the tooling matures a > bit, that's a stack that's going to make all previous web dev > frameworks look like PowerBuilder. Not a chance. There is no such thing as a native XML database and there never will be because XML is a file format (oops, data format), and an extremely inefficient one at that. To have a native database you need a data model. XML uses the hierarchical model and if you're going to build a native hierarchical database you sure wouldn't use the wasteful XML format internally to store the data. And if you insist on using XML just because its so wonderful to use 17 characters to store the state NY, it will never be able to compete with even the most immature relational engines for pure speed. Maybe on example and toy sites, but never for anything that needs to scale. If I'm wrong, dinner's on me. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From ramons at gmx.net Wed Aug 8 07:59:35 2007 From: ramons at gmx.net (David Krings) Date: Wed, 08 Aug 2007 07:59:35 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B9ADD2.1010600@secdat.com> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> Message-ID: <46B9B027.9030900@gmx.net> Kenneth Downs wrote: > And if you insist on using XML just because its so wonderful to use 17 > characters to store the state NY, it will never be able > to compete with even the most immature relational engines for pure > speed. Maybe on example and toy sites, but never for anything that > needs to scale. > > If I'm wrong, dinner's on me. Don't worry! Finally someone who sees XML as what it is and that it is by far not as glorious and the key to world peace as many claim. In the end XML is an ini file on steroids. And XML without DTD is only half of the pie....so much for self-defining. I worked on projects where the project manager insisted on taking all SQL queries, converting them to XML just so that the database layer can convert them from XML back to SQL. I asked why not talk SQL directly to the database. The answer was that we have to have XML in it, just so that we can be open to third parties. Huh? That was for an embedded system and there aren't many (any?) db engines around that don't understand at least some SQL. I think XML sucks. So now let's see what we can do with XML. David From elharo at metalab.unc.edu Wed Aug 8 10:10:20 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Wed, 08 Aug 2007 10:10:20 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B9B027.9030900@gmx.net> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> Message-ID: <46B9CECC.5010207@metalab.unc.edu> David Krings wrote: > Don't worry! Finally someone who sees XML as what it is and that it is > by far not as glorious and the key to world peace as many claim. In the > end XML is an ini file on steroids. And XML without DTD is only half of > the pie....so much for self-defining. > If all you do is INI files, then all you'll use XML for is INI files. Some of us do a little more than that though. Roughly 80% of the world's data cannot plausibly be stored in a relational database. The 20% that does fit there is important enough that we've spent the last 20 years stuffing it into relational databases and doing interesting things with it. I'm still doing a lot of that. But there's a lot more data out there that doesn't look like tables than does. Much of this data fits very nicely in a native XML database like Mark Logic or eXist. There's also data that has some tabular parts and some non-tabular parts. This may work well in a hybrid XML-relational database like DB2 9. If your only place to put pegs is a table with square holes, then you're going to try pound every peg you find into a square hole. However, some of us have noticed that a lot of the pegs we encounter aren't shaped like squares, and sometimes we need to buy a different table with different shaped holes. :-) Relational databases didn't take the world by storm overnight. XML databases won't either. But they will be adopted because they do let people solve problems they have today that they cannot solve with any other tools. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From elharo at metalab.unc.edu Wed Aug 8 10:12:46 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Wed, 08 Aug 2007 10:12:46 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B9ADD2.1010600@secdat.com> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> Message-ID: <46B9CF5E.8030905@metalab.unc.edu> Kenneth Downs wrote: > Not a chance. There is no such thing as a native XML database and there > never will be because XML is a file format (oops, data format), and an > extremely inefficient one at that. To have a native database you need a > data model. XML uses the hierarchical model and if you're going to > build a native hierarchical database you sure wouldn't use the wasteful > XML format internally to store the data. > > And if you insist on using XML just because its so wonderful to use 17 > characters to store the state NY, it will never be able > to compete with even the most immature relational engines for pure > speed. Maybe on example and toy sites, but never for anything that > needs to scale. > > If I'm wrong, dinner's on me. > Which part do you have to be wrong about for me to get a free dinner? I can already give you several existence proofs demonstrating that there is such a thing as a native XML database: http://www.marklogic.com/ http://exist.sourceforge.net/ More are coming. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From ramons at gmx.net Wed Aug 8 10:24:49 2007 From: ramons at gmx.net (David Krings) Date: Wed, 08 Aug 2007 10:24:49 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46B9CECC.5010207@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> Message-ID: <46B9D231.9070706@gmx.net> Elliotte Harold wrote: > Relational databases didn't take the world by storm overnight. XML > databases won't either. But they will be adopted because they do let > people solve problems they have today that they cannot solve with any > other tools. My problem is that I don't get paid 500k/year for working 10 hours a week with full benefits and 8 weeks paid vacation. Now, show me how to fix that with XML databases and dinner is on me, twice even. ;) The best thing about XML is that it is really is just a flat file and everything in it has a beginning and an end. I cannot think of anything that one would want to store in XML that cannot be stored in a db and that also cannot be stored in a text file with way less overhead. Examples are welcome. David From ken at secdat.com Wed Aug 8 10:41:32 2007 From: ken at secdat.com (Kenneth Downs) Date: Wed, 08 Aug 2007 10:41:32 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B9CF5E.8030905@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9CF5E.8030905@metalab.unc.edu> Message-ID: <46B9D61C.5080207@secdat.com> Elliotte Harold wrote: > Kenneth Downs wrote: > >> Not a chance. There is no such thing as a native XML database and >> there never will be because XML is a file format (oops, data format), >> and an extremely inefficient one at that. To have a native database >> you need a data model. XML uses the hierarchical model and if you're >> going to build a native hierarchical database you sure wouldn't use >> the wasteful XML format internally to store the data. >> >> And if you insist on using XML just because its so wonderful to use >> 17 characters to store the state NY, it will never be >> able to compete with even the most immature relational engines for >> pure speed. Maybe on example and toy sites, but never for anything >> that needs to scale. >> >> If I'm wrong, dinner's on me. >> > > Which part do you have to be wrong about for me to get a free dinner? > I can already give you several existence proofs demonstrating that > there is such a thing as a native XML database: > > http://www.marklogic.com/ > http://exist.sourceforge.net/ A sourceforge project does not a phenomenon make. I guess when the banks and airlines have our data in the XML files, and I don't mean a few hybrid patchwork examples, I mean the hardcore permanent long-term stuff as well as the transactional support for the reservations we're making all day. When that happens, we'll start picking the restaurants. > > More are coming. > -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From jmcentire at zootoo.com Wed Aug 8 10:58:33 2007 From: jmcentire at zootoo.com (Jeremy Mcentire) Date: Wed, 8 Aug 2007 10:58:33 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <1ec620e90708071707q6378013die1e9d418612ceff6@mail.gmail.com> References: <46B60C11.2090904@metalab.unc.edu> <1ec620e90708071707q6378013die1e9d418612ceff6@mail.gmail.com> Message-ID: <6F51E577-9900-4494-B808-E47E2DE30E1E@zootoo.com> I think XML is the cleanest method to abstract not only content from design, but from code as well. If you take a look at this sample site, you can see a simple implementation. I'm working up a generic framework or CMS that will use this approach. http://jmcentire.ath.cx:8080/ If you have any suggestions, I'm happy to hear them. But most of my current websites are many pages, one script sorts of websites. I don't like Smarty or other similar solutions; but, in using XSLT, I can generate any sort of output I need -- like RSS or XHTML... or CSV. Maybe you can implement a similar solution? From mailinglists at caseysoftware.com Wed Aug 8 10:59:43 2007 From: mailinglists at caseysoftware.com (Keith Casey) Date: Wed, 8 Aug 2007 10:59:43 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46B9D231.9070706@gmx.net> References: <46B60C11.2090904@metalab.unc.edu> <46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> Message-ID: On 8/8/07, David Krings wrote: > The best thing about XML is that it is really is just a flat file and > everything in it has a beginning and an end. I cannot think of anything > that one would want to store in XML that cannot be stored in a db and > that also cannot be stored in a text file with way less overhead. > Examples are welcome. There are a number of things which are a much better fit for XML rather than a database or a flat file... such as arbitrary depth/width tree structures. For example, when I worked at the Library of Congress answering the Ultimate Geek Question, we were working with such trees in the digitization process. Handling arbitrary width in a database is basic but handling arbitrary depth quickly gets you into a table structure that looks like: tableName - id, displayOrder, parent_id While that seems simple, it gets to be quite nasty quite quickly because of the recursive database queries to pull everything back... and you need to convert it to the actual tree before you can do much with it. Using a Lazy Loader improves things a bit, but you're just spreading out the work. Alternatively, with the XML, it's already in the tree. Add in a simple recursive template and storing it as XML (in a db or native XML) and you can render it in html/whatever in one fell swoop. It's really kind of nifty when it's done right. The same applies to work breakdown structures... *cough*dotProject*cough*. One disclaimer... when I was at the LoC, Elliote's XML Bible was one of our core resources. kc -- D. Keith Casey Jr. CEO, CaseySoftware, LLC http://CaseySoftware.com From cliff at pinestream.com Wed Aug 8 11:00:49 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 08 Aug 2007 11:00:49 -0400 Subject: [nycphp-talk] What json library do you use? Message-ID: Json will be standard from php5.2 onwards. But for those of us that are a bit behind, what json library do you recommend for development, knowing that it will be phased out as we switch to the native php5.2 json extension? Best regards, Cliff Hirsch -------------- next part -------------- An HTML attachment was scrubbed... URL: From elharo at metalab.unc.edu Wed Aug 8 11:11:01 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Wed, 08 Aug 2007 11:11:01 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B9D61C.5080207@secdat.com> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9CF5E.8030905@metalab.unc.edu> <46B9D61C.5080207@secdat.com> Message-ID: <46B9DD05.9090502@metalab.unc.edu> Kenneth Downs wrote: > A sourceforge project does not a phenomenon make. I guess when the > banks and airlines have our data in the XML files, and I don't mean a > few hybrid patchwork examples, I mean the hardcore permanent long-term > stuff as well as the transactional support for the reservations we're > making all day. When that happens, we'll start picking the restaurants. > I've never said native XML databases will replace the old-school apps like banking accounts that fit relational databases very well. What they will do is enable new applications that simply cannot be built on top of a relational database, applications like Safari (the book site, not the web browser): http://safari.oreilly.com/ There are others, mostly in publishing because that's the first area where there's a large backlog of information and applications that relational database vendors have been unable to serve. However other companies will come online as they begin to realize they can manage all their data with these tools, not just the the 20% of it that fits neatly into rectangles. Expect to see more uptake in law firms, advertising, media, education, government, and other sectors that have large numbers of critical documents where order matters, duplication is a fact of life, and normalization is not just a bad idea out outright impossible. The relational model is a very powerful model, but it achieves its power at the cost of restricting what it's possible to store. Other models are needed for other applications. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From elharo at metalab.unc.edu Wed Aug 8 11:20:10 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Wed, 08 Aug 2007 11:20:10 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46B9D231.9070706@gmx.net> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> Message-ID: <46B9DF2A.3050800@metalab.unc.edu> David Krings wrote: > The best thing about XML is that it is really is just a flat file and > everything in it has a beginning and an end. I cannot think of anything > that one would want to store in XML that cannot be stored in a db and > that also cannot be stored in a text file with way less overhead. > Examples are welcome. You need to remember we're talking about XML databases that store collections of XML documents, not simply a single XML document. A single relational record can be easily stored in a tab-delimited text file with way less overhead too. But when you have millions of these things that you have to sort, search, update, backup, specify access permissions, and so forth, then the database begins to show its worth. With that in mind, consider: The Encyclopedia Britannica The collected publications of O'Reilly Media The complete work product of Skadden-Arps The New York Times The collected works of William Shakespeare and other Elizaebthan dramatists Then consider that you want to be able to make queries like, "Find all the paragraphs containing both the words 'Bush' and 'incompetent'" so you can't just shove everything into a BLOB. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From jmcentire at zootoo.com Wed Aug 8 11:40:41 2007 From: jmcentire at zootoo.com (Jeremy Mcentire) Date: Wed, 8 Aug 2007 11:40:41 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B9ADD2.1010600@secdat.com> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> Message-ID: <2EC59F72-06D7-4BD2-9DDD-05F973D07EEA@zootoo.com> >> Of course, if you really want to rock, try combining XQuery+XQueryP >> +APP+a native XML database. Once the tooling matures a bit, that's >> a stack that's going to make all previous web dev frameworks look >> like PowerBuilder. > > Not a chance. There is no such thing as a native XML database and > there never will be because XML is a file format (oops, data > format), and an extremely inefficient one at that. To have a > native database you need a data model. XML uses the hierarchical > model and if you're going to build a native hierarchical database > you sure wouldn't use the wasteful XML format internally to store > the data. > > And if you insist on using XML just because its so wonderful to use > 17 characters to store the state NY, it will never > be able to compete with even the most immature relational engines > for pure speed. Maybe on example and toy sites, but never for > anything that needs to scale. By that argument, the current RDBMS use 7 characters to store a state: StateNY. Of course, we'd use the same for an XML-based DBMS for storage with logic that constructs: NY upon request. Since, we all know that the state code requires some extra characters so that the DBMS could organize it. A file with no meta-data that said: NYMONJOKTXAZCA wouldn't make much sense, would it? From cliff at pinestream.com Wed Aug 8 11:52:29 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 08 Aug 2007 11:52:29 -0400 Subject: [nycphp-talk] What json library do you use? In-Reply-To: Message-ID: On 8/8/07 11:00 AM, "Cliff Hirsch" wrote: Json will be standard from php5.2 onwards. But for those of us that are a bit behind, what json library do you recommend for development, knowing that it will be phased out as we switch to the native php5.2 json extension? > > Best regards, > Cliff Hirsch Just answered my own question. Installing the json pecl extension (which is what?s used in PHP5.2+) is trivial. It?s in xampp or avail as a dll elsewhere, and you just need to add the extension to your php.ini file. Test: $arr = array('dog'=>1,2,3=>array(1,2,3)); echo '{"sample":'.json_encode($arr).'}'; Result: "sample":{"dog":1,"0":2,"3":[1,2,3]}} -------------- next part -------------- An HTML attachment was scrubbed... URL: From anangtt at hotmail.com Wed Aug 8 12:05:48 2007 From: anangtt at hotmail.com (anan tette-tawia) Date: Wed, 8 Aug 2007 12:05:48 -0400 Subject: [nycphp-talk] Xampp Mysql Connection Issues Message-ID: Issue I have been trying to learn php development by installing xampp on my pc. The problem i am having is that i am able to save my php scripts and run them successfully but when i started trying to write programs that have to connect to the mysql database it started giving me all kinds of errors. So my guess is that i am not being able to connect to the mysql db even though phpmyadmin seems to be connecting to it. I tried reading all these php forum tips on pinging mysql, etc but i dont seem to be making any clear headway. Can anyone please HELP me by giving me some good tips on pinging and troubleshooting my problem. Please find below a list of my environment info ; OS: Win XP Computer type: laptop Distribution: XAMPP PHP VERSION: PHP5 MYSQL: v5 System firewall: Default windows firewall Internet Security: AOL Active Shield thanks, Whatever feels, lives; whatever lives, depends on nourishment; whatever lives and depends on nourishment grows; whatever is of this nature is in the end resolved into its basic principles; whatever comes to be resolved into its basic principles is a complex; every complex has its constituent parts; whatever this is true of is a divisible body. If therefore the human mind feels, it follows that it is a divisible body. (On the ??????? of the Human Mind 2.1) Anton Wilhelm Amo =============================== "Watch your thoughts for they become words. Choose your words, for they become actions. Understand your actions, for they become habits. Study your habits, for they will become your character. Develop your character, for it becomes your destiny." -------------- next part -------------- An HTML attachment was scrubbed... URL: From anoland at indigente.net Wed Aug 8 12:40:40 2007 From: anoland at indigente.net (Adrian Noland) Date: Wed, 8 Aug 2007 12:40:40 -0400 Subject: [nycphp-talk] Xampp Mysql Connection Issues In-Reply-To: References: Message-ID: <1d8a0e930708080940g5758fb9fxe1a409bd22c25a39@mail.gmail.com> On 8/8/07, anan tette-tawia wrote: > > *Issue* > > I have been trying to learn php development by installing xampp on my pc. > The problem i am having is that i am able to save my php scripts and run > them successfully but when i started trying to write programs that have to > connect to the mysql database it started giving me all kinds of errors. > > For starters, seeing the exact errors you are getting would be helpful. Also helpful will be the snippets of code where those errors are pointing to. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Wed Aug 8 12:50:39 2007 From: ramons at gmx.net (David Krings) Date: Wed, 08 Aug 2007 12:50:39 -0400 Subject: [nycphp-talk] Xampp Mysql Connection Issues In-Reply-To: References: Message-ID: <46B9F45F.40806@gmx.net> anan tette-tawia wrote: > _*Issue*_ > > I have been trying to learn php development by installing xampp on my > pc. The problem i am having is that i am able to save my php scripts and > run them successfully but when i started trying to write programs that > have to connect to the mysql database it started giving me all kinds of > errors. > > So my guess is that i am not being able to connect to the mysql db even > though phpmyadmin seems to be connecting to it. I tried reading all > these php forum tips on pinging mysql, etc but i dont seem to be making > any clear headway. > > Can anyone please HELP me by giving me some good tips on pinging and > troubleshooting my problem. Please find below a list of my environment > info ; Your best bet is to download the tools from MySQL's website. PHPMyAdmin is a nice tool, but I am sure anyone will hit its limits after...ohhh, about five minutes. Since you can do whatever you want with your MySQL server create a database schema first, then create a user name and password, and for the time being assign that user full rights to that schema. Schemas are also called catalogs, MySQL Administrator isn't very consistent with that. Of course, adding at least one table to that schema will help a lot, otherwise you cannot do more than connect. Hope this helps, David From david at davidmintz.org Wed Aug 8 12:55:18 2007 From: david at davidmintz.org (David Mintz) Date: Wed, 8 Aug 2007 12:55:18 -0400 Subject: [nycphp-talk] Friendly URLS... The easy way! In-Reply-To: References: <46B7C886.8080508@devonianfarm.com> Message-ID: <721f1cc50708080955hfb255b4y623a263934145d4e@mail.gmail.com> Woa -- stop the presses! mod_rewrite is now "dead simple" to use! (-: On 8/6/07, Marc Antony Vose wrote: > > but since mod_rewrite is so dead simple to use... > -- 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 suzerain at suzerain.com Wed Aug 8 13:57:36 2007 From: suzerain at suzerain.com (Marc Antony Vose) Date: Thu, 9 Aug 2007 01:57:36 +0800 Subject: [nycphp-talk] Friendly URLS... The easy way! In-Reply-To: <721f1cc50708080955hfb255b4y623a263934145d4e@mail.gmail.com> References: <46B7C886.8080508@devonianfarm.com> <721f1cc50708080955hfb255b4y623a263934145d4e@mail.gmail.com> Message-ID: <99A3CA4F-9B45-46B2-B40C-1390AF641ECC@suzerain.com> Ha... OK; my apologies. Let me rephrase... "...but since mod_rewrite in this context isn't the most difficult thing in the world..." :) Marc Le 9 ao?t 07 ? 00:55, David Mintz a ?crit : > Woa -- stop the presses! mod_rewrite is now "dead simple" to use! > > (-: > > On 8/6/07, Marc Antony Vose < suzerain at suzerain.com> wrote:but > since mod_rewrite is so dead simple to use... > > -- > David Mintz > http://davidmintz.org/ > > The subtle source is clear and bright > The tributary streams flow through the darkness > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jonbaer at jonbaer.com Wed Aug 8 14:04:16 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 8 Aug 2007 14:04:16 -0400 Subject: [nycphp-talk] Xampp Mysql Connection Issues In-Reply-To: References: Message-ID: Provided you are running XP SP2 you need to deactivate the firewall (or setup 3306 separately) ... http://www.apachefriends.org/en/faq-xampp-windows.html#xpsp2 - Jon On Aug 8, 2007, at 12:05 PM, anan tette-tawia wrote: > Issue > > I have been trying to learn php development by installing xampp on > my pc. The problem i am having is that i am able to save my php > scripts and run them successfully but when i started trying to > write programs that have to connect to the mysql database it > started giving me all kinds of errors. > > So my guess is that i am not being able to connect to the mysql db > even though phpmyadmin seems to be connecting to it. I tried > reading all these php forum tips on pinging mysql, etc but i dont > seem to be making any clear headway. > > Can anyone please HELP me by giving me some good tips on pinging > and troubleshooting my problem. Please find below a list of my > environment info ; > > OS: Win XP > Computer type: laptop > Distribution: XAMPP > PHP VERSION: PHP5 > MYSQL: v5 > System firewall: Default windows firewall > Internet Security: AOL Active Shield > > > thanks, > > > Whatever feels, lives; whatever lives, depends on nourishment; > whatever lives and depends on nourishment grows; whatever is of > this nature is in the end resolved into its basic principles; > whatever comes to be resolved into its basic principles is a > complex; every complex has its constituent parts; whatever this is > true of is a divisible body. If therefore the human mind feels, it > follows that it is a divisible body. > (On the ??????? of the Human Mind 2.1) > Anton Wilhelm Amo > =============================== > "Watch your thoughts for they become words. Choose your words, for > they become actions. Understand your actions, for they become > habits. Study your habits, for they will become your character. > Develop your character, for it becomes your destiny." > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Wed Aug 8 14:09:56 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 8 Aug 2007 14:09:56 -0400 Subject: [nycphp-talk] What json library do you use? In-Reply-To: References: Message-ID: <94537D8F-92CA-4C7D-A07F-CF82A06A0FF8@jonbaer.com> What even a little more confusing is that a full package is already in the Zend Framework ... http://framework.zend.com/manual/en/zend.json.html $json = Zend_Json::encode($phpNative); $phpNative = Zend_Json::decode($encodedValue, Zend_Json::TYPE_OBJECT); - Jon On Aug 8, 2007, at 11:52 AM, Cliff Hirsch wrote: > On 8/8/07 11:00 AM, "Cliff Hirsch" wrote: > Json will be standard from php5.2 onwards. But for those of us that > are a bit behind, what json library do you recommend for > development, knowing that it will be phased out as we switch to the > native php5.2 json extension? >> >> Best regards, >> Cliff Hirsch > > Just answered my own question. Installing the json pecl extension > (which is what?s used in PHP5.2+) is trivial. It?s in xampp or > avail as a dll elsewhere, and you just need to add the extension to > your php.ini file. > > Test: > $arr = array('dog'=>1,2,3=>array(1,2,3)); > echo '{"sample":'.json_encode($arr).'}'; > > Result: > "sample":{"dog":1,"0":2,"3":[1,2,3]}} > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Wed Aug 8 14:28:45 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 8 Aug 2007 14:28:45 -0400 Subject: [nycphp-talk] What json library do you use? In-Reply-To: <94537D8F-92CA-4C7D-A07F-CF82A06A0FF8@jonbaer.com> References: <94537D8F-92CA-4C7D-A07F-CF82A06A0FF8@jonbaer.com> Message-ID: <2A274A05-4CFF-4E47-98E4-B780CF9DDB7D@beaffinitive.com> On Aug 8, 2007, at 2:09 PM, Jon Baer wrote: > What even a little more confusing is that a full package is already > in the Zend Framework ... > http://framework.zend.com/manual/en/zend.json.html > > $json = Zend_Json::encode($phpNative); > $phpNative = Zend_Json::decode($encodedValue, Zend_Json::TYPE_OBJECT); Yeah... that's a funny little class. I'm pretty sure I remember people on the Zend Framework arguing that it should have been taken out. It does abstract json encoding/decoding though so that you don't have to rely on the extension. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmcentire at zootoo.com Wed Aug 8 14:50:33 2007 From: jmcentire at zootoo.com (Jeremy Mcentire) Date: Wed, 8 Aug 2007 14:50:33 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46B9DF2A.3050800@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> Message-ID: >> The best thing about XML is that it is really is just a flat file >> and everything in it has a beginning and an end. I cannot think of >> anything that one would want to store in XML that cannot be stored >> in a db and that also cannot be stored in a text file with way >> less overhead. Examples are welcome. > > You need to remember we're talking about XML databases that store > collections of XML documents, not simply a single XML document. A > single relational record can be easily stored in a tab-delimited > text file with way less overhead too. But when you have millions of > these things that you have to sort, search, update, backup, specify > access permissions, and so forth, then the database begins to show > its worth. > > With that in mind, consider: > > The Encyclopedia Britannica > The collected publications of O'Reilly Media > The complete work product of Skadden-Arps > The New York Times > The collected works of William Shakespeare and other Elizaebthan > dramatists > > Then consider that you want to be able to make queries like, "Find > all the paragraphs containing both the words 'Bush' and > 'incompetent'" so you can't just shove everything into a BLOB. Not to mention that the utility of XML is not simply inherent in it's being small. No one is claiming that it is small. But, there is utility there that makes it worth the size. There is always a tradeoff. To complain about XML because it takes more characters to store data or lays it out in a manner that isn't the same old RDBM isn't valid. I'd entertain it if I thought you wrote code in a binary format the machine understands natively. I don't think you do. All that wasted white-space... for shame. *Grin* Seriously. With any abstraction comes overhead and a loss of flexibility or power. XML doesn't do everything perfectly. But, it fits a lot of things well-enough. *Shudder* I sound like an engineer now rather than a mathematician. Yet, it is a valid argument, I suppose. I've heard it enough times now to repeat it. Jeremy From ken at secdat.com Wed Aug 8 16:41:21 2007 From: ken at secdat.com (Kenneth Downs) Date: Wed, 08 Aug 2007 16:41:21 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <2EC59F72-06D7-4BD2-9DDD-05F973D07EEA@zootoo.com> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <2EC59F72-06D7-4BD2-9DDD-05F973D07EEA@zootoo.com> Message-ID: <46BA2A71.6090904@secdat.com> Jeremy Mcentire wrote: >>> Of course, if you really want to rock, try combining >>> XQuery+XQueryP+APP+a native XML database. Once the tooling matures a >>> bit, that's a stack that's going to make all previous web dev >>> frameworks look like PowerBuilder. >> >> Not a chance. There is no such thing as a native XML database and >> there never will be because XML is a file format (oops, data format), >> and an extremely inefficient one at that. To have a native database >> you need a data model. XML uses the hierarchical model and if you're >> going to build a native hierarchical database you sure wouldn't use >> the wasteful XML format internally to store the data. >> >> And if you insist on using XML just because its so wonderful to use >> 17 characters to store the state NY, it will never be >> able to compete with even the most immature relational engines for >> pure speed. Maybe on example and toy sites, but never for anything >> that needs to scale. > > By that argument, the current RDBMS use 7 characters to store a state: > StateNY. > > Of course, we'd use the same for an XML-based DBMS for storage with > logic that constructs: > NY upon request. Since, we all know that the state > code requires some extra characters so that the DBMS could organize > it. A file with no meta-data that said: NYMONJOKTXAZCA wouldn't make > much sense, would it? > _______________________________________________ Jeremy I'm not sure if you're serious. You do know that the entire response is, as we say, "not even wrong", it's so incorrect that it can't be corrected. OK, I fell for it, you got me.... -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From ken at secdat.com Wed Aug 8 16:42:04 2007 From: ken at secdat.com (Kenneth Downs) Date: Wed, 08 Aug 2007 16:42:04 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46B9DF2A.3050800@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> Message-ID: <46BA2A9C.2010400@secdat.com> Elliotte Harold wrote: > David Krings wrote: > >> The best thing about XML is that it is really is just a flat file and >> everything in it has a beginning and an end. I cannot think of >> anything that one would want to store in XML that cannot be stored in >> a db and that also cannot be stored in a text file with way less >> overhead. Examples are welcome. > > You need to remember we're talking about XML databases that store > collections of XML documents, not simply a single XML document. A > single relational record can be easily stored in a tab-delimited text > file with way less overhead too. But when you have millions of these > things that you have to sort, search, update, backup, specify access > permissions, and so forth, then the database begins to show its worth. > > With that in mind, consider: > > The Encyclopedia Britannica > The collected publications of O'Reilly Media > The complete work product of Skadden-Arps > The New York Times > The collected works of William Shakespeare and other Elizaebthan > dramatists > > Then consider that you want to be able to make queries like, "Find all > the paragraphs containing both the words 'Bush' and 'incompetent'" so > you can't just shove everything into a BLOB. > > Two words: text search. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From ken at secdat.com Wed Aug 8 16:43:53 2007 From: ken at secdat.com (Kenneth Downs) Date: Wed, 08 Aug 2007 16:43:53 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46B9DD05.9090502@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9CF5E.8030905@metalab.unc.edu> <46B9D61C.5080207@secdat.com> <46B9DD05.9090502@metalab.unc.edu> Message-ID: <46BA2B09.8020909@secdat.com> Elliotte Harold wrote: > Kenneth Downs wrote: > >> A sourceforge project does not a phenomenon make. I guess when the >> banks and airlines have our data in the XML files, and I don't mean a >> few hybrid patchwork examples, I mean the hardcore permanent >> long-term stuff as well as the transactional support for the >> reservations we're making all day. When that happens, we'll start >> picking the restaurants. >> > > I've never said native XML databases will replace the old-school apps > like banking accounts that fit relational databases very well. What > they will do is enable new applications that simply cannot be built on > top of a relational database, applications like Safari (the book site, > not the web browser): > > http://safari.oreilly.com/ > > There are others, mostly in publishing because that's the first area > where there's a large backlog of information and applications that > relational database vendors have been unable to serve. However other > companies will come online as they begin to realize they can manage > all their data with these tools, not just the the 20% of it that fits > neatly into rectangles. Expect to see more uptake in law firms, > advertising, media, education, government, and other sectors that have > large numbers of critical documents where order matters, duplication > is a fact of life, and normalization is not just a bad idea out > outright impossible. > > The relational model is a very powerful model, but it achieves its > power at the cost of restricting what it's possible to store. Other > models are needed for other applications. > Two words: document management. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From edwardpotter at gmail.com Wed Aug 8 17:15:56 2007 From: edwardpotter at gmail.com (Edward Potter) Date: Wed, 8 Aug 2007 17:15:56 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: <46BA2B09.8020909@secdat.com> References: <46B60C11.2090904@metalab.unc.edu> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9CF5E.8030905@metalab.unc.edu> <46B9D61C.5080207@secdat.com> <46B9DD05.9090502@metalab.unc.edu> <46BA2B09.8020909@secdat.com> Message-ID: I think the scary reality is that those banks and CC companies are generally managing all their database needs with some abstracted Cobol. It does the job. Everyone's afraid to touch it. And the folks that built it died years ago. yipes! :-) ed On 8/8/07, Kenneth Downs wrote: > Elliotte Harold wrote: > > Kenneth Downs wrote: > > > >> A sourceforge project does not a phenomenon make. I guess when the > >> banks and airlines have our data in the XML files, and I don't mean a > >> few hybrid patchwork examples, I mean the hardcore permanent > >> long-term stuff as well as the transactional support for the > >> reservations we're making all day. When that happens, we'll start > >> picking the restaurants. > >> > > > > I've never said native XML databases will replace the old-school apps > > like banking accounts that fit relational databases very well. What > > they will do is enable new applications that simply cannot be built on > > top of a relational database, applications like Safari (the book site, > > not the web browser): > > > > http://safari.oreilly.com/ > > > > There are others, mostly in publishing because that's the first area > > where there's a large backlog of information and applications that > > relational database vendors have been unable to serve. However other > > companies will come online as they begin to realize they can manage > > all their data with these tools, not just the the 20% of it that fits > > neatly into rectangles. Expect to see more uptake in law firms, > > advertising, media, education, government, and other sectors that have > > large numbers of critical documents where order matters, duplication > > is a fact of life, and normalization is not just a bad idea out > > outright impossible. > > > > The relational model is a very powerful model, but it achieves its > > power at the cost of restricting what it's possible to store. Other > > models are needed for other applications. > > > Two words: document management. > > -- > Kenneth Downs > Secure Data Software, Inc. > www.secdat.com www.andromeda-project.org > 631-689-7200 Fax: 631-689-0527 > cell: 631-379-0010 > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- the Blog: http://www.utopiaparkway.com the Karma: http://www.coderswithconscience.com the Projects: http://flickr.com/photos/86842405 at N00/ the Store: http://astore.amazon.com/httpwwwutopic-20 From elharo at metalab.unc.edu Wed Aug 8 20:31:45 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Wed, 08 Aug 2007 20:31:45 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> Message-ID: <46BA6071.7070508@metalab.unc.edu> Jeremy Mcentire wrote: > Not to mention that the utility of XML is not simply inherent in it's > being small. No one is claiming that it is small. But, there is > utility there that makes it worth the size. There is always a > tradeoff. To complain about XML because it takes more characters to > store data or lays it out in a manner that isn't the same old RDBM isn't > valid. I'd entertain it if I thought you wrote code in a binary format > the machine understands natively. I don't think you do. All that > wasted white-space... for shame. > Of course, one advantage of an XML database is that there are no rules about what the actual disk format looks like. What matters is what goes ion and what comes out. Databases are free to make optimizations for both storage space and speed, and in practice most do. The disk format is no more relevant to the XQuery data model than it is to the SQL data model. Storing a million documents in an XML database may well take a lot less space than storing them in individual files. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From elharo at metalab.unc.edu Wed Aug 8 20:38:41 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Wed, 08 Aug 2007 20:38:41 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46BA2A9C.2010400@secdat.com> References: <46B60C11.2090904@metalab.unc.edu> <46B613F2.9010904@metalab.unc.edu><46B66101.3060400@gmx.net> <46B7A344.50104@metalab.unc.edu> <031801c7d8f0$60824810$651ba8c0@MobileZ> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> <46BA2A9C.2010400@secdat.com> Message-ID: <46BA6211.3010404@metalab.unc.edu> Kenneth Downs wrote: >> Then consider that you want to be able to make queries like, "Find all >> the paragraphs containing both the words 'Bush' and 'incompetent'" so >> you can't just shove everything into a BLOB. >> >> > > Two words: text search. > Nope, not the same thing at all. Index engines like FAST and Lucene can do part of this (though they can't really take advantage of the structure of the documents they index). However those are *non-relational* systems. Of course if you want to search web-size collections, relational databases just can't handle it. Index engines are the only proven technology that can. Mark Logic claims their native XML database can search web size collections too, but I remain to be convinced of that point. Some relational databases have added non-relational, fulltext search extensions to their products just as some have added non-relational XML extensions. These are adequate for simple uses, if you don't push them too hard. However they are completely incapable of carrying out queries like, "Give me the title and first paragraph of every chapter of this book" (something Safari routinely does) because they don't see the structure of a document, only the text. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From danielc at analysisandsolutions.com Wed Aug 8 21:27:34 2007 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 8 Aug 2007 21:27:34 -0400 Subject: [nycphp-talk] What json library do you use? In-Reply-To: References: Message-ID: <20070809012734.GA4039@panix.com> On Wed, Aug 08, 2007 at 11:00:49AM -0400, Cliff Hirsch wrote: > Json will be standard from php5.2 onwards. But for those of us that are a > bit behind, what json library do you recommend for development http://pecl.php.net/package/json. Your PHP code doesn't need to change a bit: json_encode() and json_decode(). --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Wed Aug 8 21:36:23 2007 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 8 Aug 2007 21:36:23 -0400 Subject: [nycphp-talk] Xampp Mysql Connection Issues In-Reply-To: References: Message-ID: <20070809013623.GB4039@panix.com> Anan: You have to examine the error messages to figure out what's up. Check out my web page on MySQL on Windows: http://www.analysisandsolutions.com/code/mysql-tutorial.htm If this web page doesn't address the specific error message you're getting, Google for whatever the error messages say. If that doesn't turn anything useful up, post them here. --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 ioplex at gmail.com Wed Aug 8 21:43:50 2007 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 8 Aug 2007 21:43:50 -0400 Subject: [nycphp-talk] Good Font Size Control Message-ID: <78c6bd860708081843j5bf8b4d3m542e6799736b5446@mail.gmail.com> Hi Again, I'm working on a site and I'd like to give the user a little more control over the font size throughout the site. Something like those "AAAAA" controls on sites that allow the user to select x-large, large, regular, small, or x-small. How is that best done? So far I've just been using and CSS small and x-small. Relative values are nice because the user can still change font size using their browser (ctrl-+ ctrl-- in FF). But that leaves me somewhat at a loss as to how to globally affect the font size. Is there a CSS property that can globally increase and decrease the font size throughout the entire page? What is the basis for good font size control? Mike From tomsartain at gmail.com Wed Aug 8 22:19:07 2007 From: tomsartain at gmail.com (Tom Sartain) Date: Wed, 8 Aug 2007 21:19:07 -0500 Subject: [nycphp-talk] Good Font Size Control In-Reply-To: <78c6bd860708081843j5bf8b4d3m542e6799736b5446@mail.gmail.com> References: <78c6bd860708081843j5bf8b4d3m542e6799736b5446@mail.gmail.com> Message-ID: <20190d950708081919s6a357408p6bacadfc8954f42@mail.gmail.com> If you want good font size control, set the font size of your body to 62.5% This should effectively give you a starting size of 10px. Then you can use the magic of ems to scale your fonts with pixel perfection. 1.6em gives you 16px font. 1.2em gives you 12px font and so on. Even though you have font sizing to the pixel, it's still able to be changed by the browser as desired. As far as the AAA controls, the easiest way I've seen to do this is to have alternate style sheets for each font size, then use javascript to switch between them. I'm hoping you have a few sites to refer to and figure out the logistics of it all, but that's the basic concept. On 8/8/07, Michael B Allen wrote: > Hi Again, > > I'm working on a site and I'd like to give the user a little more > control over the font size throughout the site. Something like those > "AAAAA" controls on sites that allow the user to select x-large, > large, regular, small, or x-small. How is that best done? > > So far I've just been using and CSS small and x-small. > Relative values are nice because the user can still change font size > using their browser (ctrl-+ ctrl-- in FF). But that leaves me somewhat > at a loss as to how to globally affect the font size. Is there a CSS > property that can globally increase and decrease the font size > throughout the entire page? What is the basis for good font size > control? > > Mike > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From ioplex at gmail.com Wed Aug 8 23:05:21 2007 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 8 Aug 2007 23:05:21 -0400 Subject: [nycphp-talk] Good Font Size Control In-Reply-To: <20190d950708081919s6a357408p6bacadfc8954f42@mail.gmail.com> References: <78c6bd860708081843j5bf8b4d3m542e6799736b5446@mail.gmail.com> <20190d950708081919s6a357408p6bacadfc8954f42@mail.gmail.com> Message-ID: <78c6bd860708082005r10b5dedj36a0a5768c612a75@mail.gmail.com> On 8/8/07, Tom Sartain wrote: > As far as the AAA controls, the easiest way I've seen to do this is to > have alternate style sheets for each font size, then use javascript to > switch between them. I'm hoping you have a few sites to refer to and > figure out the logistics of it all, but that's the basic concept. Changing the font-size of the body has no effect on text within td elements. Changing the font-size on td elements has no effect on form input elements like buttons. Etc, etc, etc. This problem can't be *that* hard. Is there really no better way to control font-size of all page elements simultaneously? Mike From dirn at dirnonline.com Wed Aug 8 23:20:48 2007 From: dirn at dirnonline.com (Andy Dirnberger) Date: Wed, 8 Aug 2007 23:20:48 -0400 Subject: [nycphp-talk] Good Font Size Control In-Reply-To: <78c6bd860708082005r10b5dedj36a0a5768c612a75@mail.gmail.com> References: <78c6bd860708081843j5bf8b4d3m542e6799736b5446@mail.gmail.com><20190d950708081919s6a357408p6bacadfc8954f42@mail.gmail.com> <78c6bd860708082005r10b5dedj36a0a5768c612a75@mail.gmail.com> Message-ID: <007d01c7da34$498cd770$6301a8c0@dirnpc> > Changing the font-size of the body has no effect on text within td > elements. Changing the font-size on td elements has no effect on form > input elements like buttons. Etc, etc, etc. This problem can't be > *that* hard. Is there really no better way to control font-size of all > page elements simultaneously? To control font size at a global CSS level, try: * { font-size : XX; } For a JavaScript way of changing font size (using the above), I use something like (note that n is populated by clicking buttons corresponding to values 10, 12, and 14): function adjustText (n) { for (var i = 0; i < document.styleSheets.length; i++) { for (var j = 0; j < document.styleSheets [i].rules.length; j++) { if (document.styleSheets [i].rules [j].selectorText == "*" || document.styleSheets [i].rules [j].selectorText == "") { // Set new size document.styleSheets [i].rules [j].style.fontSize = (n + "pt"); return; } } } } This may not be exactly what you're looking for, but it's hopefully a good start. From dcech at phpwerx.net Wed Aug 8 23:30:03 2007 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 08 Aug 2007 23:30:03 -0400 Subject: [nycphp-talk] Good Font Size Control In-Reply-To: <78c6bd860708082005r10b5dedj36a0a5768c612a75@mail.gmail.com> References: <78c6bd860708081843j5bf8b4d3m542e6799736b5446@mail.gmail.com> <20190d950708081919s6a357408p6bacadfc8954f42@mail.gmail.com> <78c6bd860708082005r10b5dedj36a0a5768c612a75@mail.gmail.com> Message-ID: <46BA8A3B.9020907@phpwerx.net> Michael B Allen wrote: > On 8/8/07, Tom Sartain wrote: >> As far as the AAA controls, the easiest way I've seen to do this is to >> have alternate style sheets for each font size, then use javascript to >> switch between them. I'm hoping you have a few sites to refer to and >> figure out the logistics of it all, but that's the basic concept. > > Changing the font-size of the body has no effect on text within td > elements. Changing the font-size on td elements has no effect on form > input elements like buttons. Etc, etc, etc. This problem can't be > *that* hard. Is there really no better way to control font-size of all > page elements simultaneously? My personal preference is to use the following rule: * { font-size: 100%; } to reset the size of all fonts to 100% of the parent element, then set a size on the body tag as your baseline, eg: body { font-size: small; } Now everything will have the same font size, and changing the font size on the body will affect everything. Obviously some things need to have larger or smaller fonts, so you can set them up as well, eg: h1 { font-size: 150%; } At this point you can set the size of everything by overriding the font-size of the body, and everything else will scale accordingly. HTH, Dan From lists at enobrev.com Thu Aug 9 09:01:30 2007 From: lists at enobrev.com (Mark Armendariz) Date: Thu, 09 Aug 2007 09:01:30 -0400 Subject: [nycphp-talk] Incomplete Objects, Class Definitions and require_once In-Reply-To: <78c6bd860708051909p1b4ab94ct7b22b442313fd76@mail.gmail.com> References: <78c6bd860708051149v2b939dc4m310530f75aaf2ce4@mail.gmail.com> <33C90792-E0C2-455D-B595-CC408600284D@gmail.com> <78c6bd860708051707l5672a1e3r4fca57d90e9a50f3@mail.gmail.com> <78c6bd860708051909p1b4ab94ct7b22b442313fd76@mail.gmail.com> Message-ID: <46BB102A.7090503@enobrev.com> Michael B Allen wrote: >> Well I figured out what the problem was. I was putting an 'Auth' >> object in the session. I made some changes to something that >> invalidated the class definition of that object. As soon as I logged >> out the Auth object in the session was reinstantiated and the error >> went away. No big deal. >> > It seems you must require_once the class of the object stored in the session before > calling session_start. I guess session_start is deserializing things > and if the class definition isn't available it defaults to an > incomplete type. The problem has to do with serializing/unserializing objects (which sessions do in the background). When you serialize an entire class, it only saves the classes properties, not the methods within. (open up a serialized object file to see what i mean). When you unserialize it, you'll be creating a variable with all the properties of a class. If you've defined that class (in your case, by requiring the class file before unserializing it), it will instantiate the class and fill in the proper properties and then put it into your variable. Otherwise it will create an 'incomplete' class that only has the same name and all the saved properties, but no methods. Here's some other info on the subject as well http://www.php.net/manual/en/language.oop.serialization.php Mark Armendariz -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Thu Aug 9 10:11:59 2007 From: chsnyder at gmail.com (csnyder) Date: Thu, 9 Aug 2007 10:11:59 -0400 Subject: [nycphp-talk] Good Font Size Control In-Reply-To: <78c6bd860708082005r10b5dedj36a0a5768c612a75@mail.gmail.com> References: <78c6bd860708081843j5bf8b4d3m542e6799736b5446@mail.gmail.com> <20190d950708081919s6a357408p6bacadfc8954f42@mail.gmail.com> <78c6bd860708082005r10b5dedj36a0a5768c612a75@mail.gmail.com> Message-ID: On 8/8/07, Michael B Allen wrote: > On 8/8/07, Tom Sartain wrote: > > As far as the AAA controls, the easiest way I've seen to do this is to > > have alternate style sheets for each font size, then use javascript to > > switch between them. I'm hoping you have a few sites to refer to and > > figure out the logistics of it all, but that's the basic concept. > > Changing the font-size of the body has no effect on text within td > elements. Changing the font-size on td elements has no effect on form > input elements like buttons. Etc, etc, etc. This problem can't be > *that* hard. Is there really no better way to control font-size of all > page elements simultaneously? > Just make font-size jump the table boundary using: table { font-size: inherit; } Tom, your tip about 62.5% is one I've never run across before. Nice! I think the best (as in, most comprehensive) way to go about this is to put in the work and create multiple stylesheets. For all but the most simple and flexible of designs, increasing the font size will crowd or break some design elements. It's much nicer for visually-impaired users to see a properly proportioned design at the largest size, rather than giant text squeezed into standard-size columns. You can also replace images that need to be larger, tweak icon sizes, etc. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Thu Aug 9 10:37:53 2007 From: chsnyder at gmail.com (csnyder) Date: Thu, 9 Aug 2007 10:37:53 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46BA6211.3010404@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> <46BA2A9C.2010400@secdat.com> <46BA6211.3010404@metalab.unc.edu> Message-ID: On 8/8/07, Elliotte Harold wrote: > Some relational databases have added non-relational, fulltext search > extensions to their products just as some have added non-relational XML > extensions. These are adequate for simple uses, if you don't push them > too hard. However they are completely incapable of carrying out queries > like, "Give me the title and first paragraph of every chapter of this > book" (something Safari routinely does) because they don't see the > structure of a document, only the text. I'm glad we have multiple tools to bring to bear on this kind of problem, because I worry about the performance implications of querying an XML database for the average price of those books, or performing an operation that adds another field (tag?) to each book's "record". If it's not too much trouble, could you give us some other use cases for an XML database? Because title and first paragraph, if that's something a system "routinely does" could easily be stored as relational data at the time of import. -- Chris Snyder http://chxo.com/ From ken at secdat.com Thu Aug 9 11:18:25 2007 From: ken at secdat.com (Kenneth Downs) Date: Thu, 09 Aug 2007 11:18:25 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: References: <46B60C11.2090904@metalab.unc.edu> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> <46BA2A9C.2010400@secdat.com> <46BA6211.3010404@metalab.unc.edu> Message-ID: <46BB3041.2040909@secdat.com> csnyder wrote: > On 8/8/07, Elliotte Harold wrote: > > >> Some relational databases have added non-relational, fulltext search >> extensions to their products just as some have added non-relational XML >> extensions. These are adequate for simple uses, if you don't push them >> too hard. However they are completely incapable of carrying out queries >> like, "Give me the title and first paragraph of every chapter of this >> book" (something Safari routinely does) because they don't see the >> structure of a document, only the text. >> > > Select title ,SUBSTRING(text ...insert regexp here...) from chapters where book_name = 'XML in a Nutshell' Rusty, you appear to be arguing from ignorance, very unusual coming from you. The true difference between us in this argument is that I understand that I have a prejudice for relational over hierarchical, based on my knowledge and use of both, and based on judgment calls as to how to get through the day. I daresay however that you are promoting a religious favoring of XML w/o a working knowledge of the alternatives. You simply cannot defend a file format as a foundation for frameworks and databases. The best you can do is defend the model, such as the hierarchical model. Going further, you cannot defend a file format as a foundation for anything based on how it handles large text (or binary) fields. There are three issues here: -> Data model, hierarchical vs. relational. -> File format, XML vs YAML or JSON or any other format you like -> Handling of large text (and binary) columns. Finally, if we can all admit that XML is just a file format, then the entire framework crumbles as soon as somebody comes up with a better one, because let's admit it, XML is just about the worst you're going to find. In conclusion, the examples you provide appear to give advantage to XML because tools exist to handle data that has been buried in opaque formats and poorly defined structures. If the data had been structured properly in the first place and put into formats that were not so opaque, using (pardon me for saying) a *real* database, designed on solid principles, the examples you give become child's play. > I'm glad we have multiple tools to bring to bear on this kind of > problem, because I worry about the performance implications of > querying an XML database for the average price of those books, or > performing an operation that adds another field (tag?) to each book's > "record". > > If it's not too much trouble, could you give us some other use cases > for an XML database? Because title and first paragraph, if that's > something a system "routinely does" could easily be stored as > relational data at the time of import. > > -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 -------------- next part -------------- An HTML attachment was scrubbed... URL: From support at dailytechnology.net Thu Aug 9 11:34:55 2007 From: support at dailytechnology.net (Brian Dailey) Date: Thu, 09 Aug 2007 11:34:55 -0400 Subject: [nycphp-talk] Debugging Zend_Db SQL Message-ID: <46BB341F.20106@dailytechnology.net> I'm just starting to dabble with Zend's framework, and I don't see an easy way to check what the SQL output is when I'm executing a statement. I'd like to just output the whole query so I can monitor what it's sending. Does anyone know a quick & dirty way to do this? -- Thanks! - Brian Dailey Software Developer New York, NY www.dailytechnology.net -------------- next part -------------- A non-text attachment was scrubbed... Name: support.vcf Type: text/x-vcard Size: 264 bytes Desc: not available URL: From jonbaer at jonbaer.com Thu Aug 9 11:58:35 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 9 Aug 2007 11:58:35 -0400 Subject: [nycphp-talk] Good Font Size Control In-Reply-To: References: <78c6bd860708081843j5bf8b4d3m542e6799736b5446@mail.gmail.com> <20190d950708081919s6a357408p6bacadfc8954f42@mail.gmail.com> <78c6bd860708082005r10b5dedj36a0a5768c612a75@mail.gmail.com> Message-ID: <54F2FC32-48DA-419E-9653-5864D1A11254@jonbaer.com> For reference I think it refers to the "CSS Reset" methodology ... http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ -snip- font-size:62.5%; Why? All popular browsers has default font size equal 16px. If we set font size equal 62.5% then font size is equal 10px at screen (but not set 10px, IE6 not resize this rule). Now we have 1em = 10px, so 1..1em=11px etc. It is easier way to calculate font size. -snip- - Jon On Aug 9, 2007, at 10:11 AM, csnyder wrote: > On 8/8/07, Michael B Allen wrote: >> On 8/8/07, Tom Sartain wrote: >>> As far as the AAA controls, the easiest way I've seen to do this >>> is to >>> have alternate style sheets for each font size, then use >>> javascript to >>> switch between them. I'm hoping you have a few sites to refer to and >>> figure out the logistics of it all, but that's the basic concept. >> >> Changing the font-size of the body has no effect on text within td >> elements. Changing the font-size on td elements has no effect on form >> input elements like buttons. Etc, etc, etc. This problem can't be >> *that* hard. Is there really no better way to control font-size of >> all >> page elements simultaneously? >> > > Just make font-size jump the table boundary using: > > table { font-size: inherit; } > > Tom, your tip about 62.5% is one I've never run across before. Nice! > > I think the best (as in, most comprehensive) way to go about this is > to put in the work and create multiple stylesheets. For all but the > most simple and flexible of designs, increasing the font size will > crowd or break some design elements. > > It's much nicer for visually-impaired users to see a properly > proportioned design at the largest size, rather than giant text > squeezed into standard-size columns. You can also replace images that > need to be larger, tweak icon sizes, etc. > > -- > Chris Snyder > http://chxo.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From evdo.hsdpa at gmail.com Thu Aug 9 12:15:12 2007 From: evdo.hsdpa at gmail.com (Robert Kim Wireless Internet Advisor) Date: Thu, 9 Aug 2007 09:15:12 -0700 Subject: [nycphp-talk] HELP! GD Graphics Library Installer Needed Message-ID: <1ec620e90708090915n62a7874fh82209070264cfd2@mail.gmail.com> Anybody want a quick project? I need a GD Graphics Library Thingy installed. Call me directly at 310 598 1606 SEE BELOW FOR INSTALL.txt ++++++++++++++++++++++++ ======================= Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. bob evdo kim http://evdo-coverage.com http://wimax-coverage.com http://iptv-coverage.com From jonbaer at jonbaer.com Thu Aug 9 12:28:27 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 9 Aug 2007 12:28:27 -0400 Subject: [nycphp-talk] Debugging Zend_Db SQL In-Reply-To: <46BB341F.20106@dailytechnology.net> References: <46BB341F.20106@dailytechnology.net> Message-ID: <9DD06888-9072-45A9-A3BE-26FF959EA14F@jonbaer.com> From what I recall most of the framework objects should already have a __toString() overload on them so you can just echo/dump the select itself. - Jon On Aug 9, 2007, at 11:34 AM, Brian Dailey wrote: > I'm just starting to dabble with Zend's framework, and I don't see > an easy way to check what the SQL output is when I'm executing a > statement. I'd like to just output the whole query so I can monitor > what it's sending. Does anyone know a quick & dirty way to do this? > > > -- > > Thanks! > - Brian Dailey > Software Developer > New York, NY > www.dailytechnology.net__________________________________ > _____________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From cliff at pinestream.com Thu Aug 9 15:24:33 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 09 Aug 2007 15:24:33 -0400 Subject: [nycphp-talk] PHP to ajax variable passing problem Message-ID: My Ajax response handler uses this line, which is fairly typical: var output = req.responseText; >From php, I?m echoing back json. Example: {"status":1,"count":0,"data":""} But instead of var output being an object, it is a string: ?{"status":1,"count":0,"data":""}? How do I make this an object? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomsartain at gmail.com Thu Aug 9 15:32:22 2007 From: tomsartain at gmail.com (Tom Sartain) Date: Thu, 9 Aug 2007 15:32:22 -0400 Subject: [nycphp-talk] PHP to ajax variable passing problem In-Reply-To: References: Message-ID: <20190d950708091232u4abcbb01gb6af156693afc68e@mail.gmail.com> I'm not great with Javascript and I know next to nothing about Json, but I know responseText will return a string, and PHP will output a string, so you need to use javascript to use javascript to take the string and un-serialize it (I don't know if this is technically un-serializing or not, but... make an object out of a string) So... yeah.. javascript issue for sure. Hope someone else can help you more (and I'd like to know the answer too for my own education) -Tom On 8/9/07, Cliff Hirsch wrote: > > My Ajax response handler uses this line, which is fairly typical: > > var output = req.responseText; > > >From php, I'm echoing back json. Example: > {"status":1,"count":0,"data":""} > > But instead of var output being an object, it is a string: > "{"status":1,"count":0,"data":""}" > > How do I make this an object? > > Cliff > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Thu Aug 9 15:37:47 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 09 Aug 2007 15:37:47 -0400 Subject: [nycphp-talk] PHP to ajax variable passing problem In-Reply-To: <20190d950708091232u4abcbb01gb6af156693afc68e@mail.gmail.com> Message-ID: On 8/9/07, Cliff Hirsch wrote: >> My Ajax response handler uses this line, which is fairly typical: >> var output = req.responseText; >>> >From php, I'm echoing back json. Example: {"status":1,"count":0,"data":""} >> But instead of var output being an object, it is a string: >> "{"status":1,"count":0,"data":""}" >> How do I make this an object? >> >> Cliff As usual, figured it out minutes after my post. Answer for the group: From: var output = req.responseText; To: var output = eval('('+req.responseText+')'); Better answer ? don?tr try to reinvent the wheel. Yeah but we can?t help ourselves. Xajax looks very cool.... -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Thu Aug 9 15:46:03 2007 From: chsnyder at gmail.com (csnyder) Date: Thu, 9 Aug 2007 15:46:03 -0400 Subject: [nycphp-talk] PHP to ajax variable passing problem In-Reply-To: References: <20190d950708091232u4abcbb01gb6af156693afc68e@mail.gmail.com> Message-ID: On 8/9/07, Cliff Hirsch wrote: > > As usual, figured it out minutes after my post. Answer for the group: > > From: var output = req.responseText; > To: var output = eval('('+req.responseText+')'); > > Better answer ? don'tr try to reinvent the wheel. Yeah but we can't help > ourselves. Xajax looks very cool.... Yes eval(), which always makes me a little queasy, even though I know it's relatively safe. I wonder how many years we'll be waiting for a true json_decode() function to make it into general circulation? -- Chris Snyder http://chxo.com/ From emm at scriptdigital.com Thu Aug 9 15:51:22 2007 From: emm at scriptdigital.com (=?UTF-8?Q? Emmanuel_M._D=C3=A9carie ?=) Date: Thu, 09 Aug 2007 15:51:22 -0400 Subject: [nycphp-talk] simplexml xpath bug ? (long post) In-Reply-To: <20070809160403.8DB26508F2@net-pollen.com> References: <20070809160403.8DB26508F2@net-pollen.com> Message-ID: Hi there, I'm not sure if this is the way it?s supposing to work or if this is a bug. Anyway, here's the problem. I have to parse a very complex XML document where I need to do a xpath query against a previous found xpath query. I use simplexml for that. For the sake of the discussion, I wrote a script to illustrate the problem (see below or the attachment). And yes, with this example, I could use just one xpath query to get the same result. But this is an example, so bare with me. Ok let's start. * What I want to do: * Do a xpath query against a previous xpath query. * What happened: * The second xpath query is made against the whole xml tree instead of a subset of the tree found by the first xpath query. * Work-around: * You have to deference the tree. * My question * Clearly, what I see is not what I get when I use var_dump or print_r against the second xpath query. I wonder if there is a bug here. Also, why the fragment of XML that I get from the first xpath query still reference the whole tree. Thanks! ========================= * Example: The Script* $xml = << paris london harare cairo END; $obj = simplexml_load_string ($xml); $result = $obj->xpath ('//continent'); echo "----------------\n"; echo "result\n"; echo "----------------\n"; var_dump ($result); echo "\n\n"; $counter = 0; foreach ($result as $elem) { $counter++; echo "----------------\n"; echo "Counter: $counter\n"; echo "----------------\n"; echo "----------------\n"; echo "elem\n"; echo "----------------\n"; var_dump ($elem); echo "\n"; echo "----------------\n"; echo "elem->xpath('//country')\n"; echo "----------------\n"; var_dump ($elem->xpath ('//country')); $elem2 = simplexml_load_string ($elem->asXML ()); echo "----------------\n"; echo "elem2->xpath('//country')\n"; echo "----------------\n"; var_dump ($elem2->xpath ('//country')); } * The Result: * ---------------- result ---------------- array(2) { [0]=> object(SimpleXMLElement)#2 (2) { ["@attributes"]=> array(1) { ["name"]=> string(6) "europe" } ["country"]=> array(2) { [0]=> string(5) "paris" [1]=> string(6) "london" } } [1]=> object(SimpleXMLElement)#3 (2) { ["@attributes"]=> array(1) { ["name"]=> string(6) "africa" } ["country"]=> array(2) { [0]=> string(6) "harare" [1]=> string(5) "cairo" } } } ---------------- Counter: 1 ---------------- ---------------- elem ---------------- object(SimpleXMLElement)#2 (2) { ["@attributes"]=> array(1) { ["name"]=> string(6) "europe" } ["country"]=> array(2) { [0]=> string(5) "paris" [1]=> string(6) "london" } } ---------------- elem->xpath('//country') ---------------- array(4) { [0]=> object(SimpleXMLElement)#4 (2) { ["@attributes"]=> array(1) { ["name"]=> string(6) "france" } [0]=> string(5) "paris" } [1]=> object(SimpleXMLElement)#5 (2) { ["@attributes"]=> array(1) { ["name"]=> string(2) "uk" } [0]=> string(6) "london" } [2]=> object(SimpleXMLElement)#6 (2) { ["@attributes"]=> array(1) { ["name"]=> string(8) "zimbabwe" } [0]=> string(6) "harare" } [3]=> object(SimpleXMLElement)#7 (2) { ["@attributes"]=> array(1) { ["name"]=> string(5) "egypt" } [0]=> string(5) "cairo" } } ---------------- elem2->xpath('//country') ---------------- array(2) { [0]=> object(SimpleXMLElement)#6 (2) { ["@attributes"]=> array(1) { ["name"]=> string(6) "france" } [0]=> string(5) "paris" } [1]=> object(SimpleXMLElement)#5 (2) { ["@attributes"]=> array(1) { ["name"]=> string(2) "uk" } [0]=> string(6) "london" } } ---------------- Counter: 2 ---------------- ---------------- elem ---------------- object(SimpleXMLElement)#3 (2) { ["@attributes"]=> array(1) { ["name"]=> string(6) "africa" } ["country"]=> array(2) { [0]=> string(6) "harare" [1]=> string(5) "cairo" } } ---------------- elem->xpath('//country') ---------------- array(4) { [0]=> object(SimpleXMLElement)#5 (2) { ["@attributes"]=> array(1) { ["name"]=> string(6) "france" } [0]=> string(5) "paris" } [1]=> object(SimpleXMLElement)#6 (2) { ["@attributes"]=> array(1) { ["name"]=> string(2) "uk" } [0]=> string(6) "london" } [2]=> object(SimpleXMLElement)#4 (2) { ["@attributes"]=> array(1) { ["name"]=> string(8) "zimbabwe" } [0]=> string(6) "harare" } [3]=> object(SimpleXMLElement)#8 (2) { ["@attributes"]=> array(1) { ["name"]=> string(5) "egypt" } [0]=> string(5) "cairo" } } ---------------- elem2->xpath('//country') ---------------- array(2) { [0]=> object(SimpleXMLElement)#7 (2) { ["@attributes"]=> array(1) { ["name"]=> string(8) "zimbabwe" } [0]=> string(6) "harare" } [1]=> object(SimpleXMLElement)#4 (2) { ["@attributes"]=> array(1) { ["name"]=> string(5) "egypt" } [0]=> string(5) "cairo" } } -------------- next part -------------- A non-text attachment was scrubbed... Name: simplexml_xpath_example.php Type: text/php Size: 1133 bytes Desc: not available URL: -------------- next part -------------- From rotsen at gmail.com Thu Aug 9 16:36:59 2007 From: rotsen at gmail.com (=?ISO-8859-1?Q?N=E9stor?=) Date: Thu, 9 Aug 2007 13:36:59 -0700 Subject: [nycphp-talk] printing the background Message-ID: This is not a PHP question. When I print my web page, the background image does not print. What do I need to do to make sure that the background image prints? Thanks, N?stor :-) From chsnyder at gmail.com Thu Aug 9 17:00:06 2007 From: chsnyder at gmail.com (csnyder) Date: Thu, 9 Aug 2007 17:00:06 -0400 Subject: [nycphp-talk] printing the background In-Reply-To: References: Message-ID: On 8/9/07, N?stor wrote: > This is not a PHP question. > > When I print my web page, the background image does not print. > What do I need to do to make sure that the background image prints? > I hope someone else has a better answer, but... it's browser and operating system dependent. In Firefox on OSX, for instance, you go to Print, select Firefox from the unlabeled printer settings selection menu (try explaining _that_ over the phone) and check Print Background Images. -- Chris Snyder http://chxo.com/ From rotsen at gmail.com Thu Aug 9 17:08:25 2007 From: rotsen at gmail.com (=?ISO-8859-1?Q?N=E9stor?=) Date: Thu, 9 Aug 2007 14:08:25 -0700 Subject: [nycphp-talk] printing the background In-Reply-To: References: Message-ID: OK, that helped me Chris. On Firefox I went to Page Setup and I click on print Background and Images On the Internet Explorer menus of the user: Tools, Internet options, Advanced tab, scroll down to Printing, tick Print background images and colours Thanks, N?stor :-) On 8/9/07, csnyder wrote: > On 8/9/07, N?stor wrote: > > This is not a PHP question. > > > > When I print my web page, the background image does not print. > > What do I need to do to make sure that the background image prints? > > > > I hope someone else has a better answer, but... it's browser and > operating system dependent. > > In Firefox on OSX, for instance, you go to Print, select Firefox from > the unlabeled printer settings selection menu (try explaining _that_ > over the phone) and check Print Background Images. > > > -- > Chris Snyder > http://chxo.com/ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From dell at sala.ca Thu Aug 9 17:08:42 2007 From: dell at sala.ca (Dell Sala) Date: Thu, 9 Aug 2007 17:08:42 -0400 Subject: [nycphp-talk] PHP to ajax variable passing problem In-Reply-To: References: <20190d950708091232u4abcbb01gb6af156693afc68e@mail.gmail.com> Message-ID: <84794375-6A49-455A-A22A-530502668AED@sala.ca> On Aug 9, 2007, at 3:46 PM, csnyder wrote: > On 8/9/07, Cliff Hirsch wrote: >> >> As usual, figured it out minutes after my post. Answer for the >> group: >> >> From: var output = req.responseText; >> To: var output = eval('('+req.responseText+')'); > > > Yes eval(), which always makes me a little queasy, even though I know > it's relatively safe. I wonder how many years we'll be waiting for a > true json_decode() function to make it into general circulation? json.org provides a json decoder for javascript. I've always used this instead of eval. This will only parse the json subset, and will fail for other arbitrary javascript. http://www.json.org/js.html http://www.json.org/json.js -- Dell From bklos at getoffutt.com Thu Aug 9 17:16:59 2007 From: bklos at getoffutt.com (Bob Klos) Date: Thu, 9 Aug 2007 17:16:59 -0400 Subject: [nycphp-talk] Bizarre PHP putenv/getenv results Message-ID: <007301c7daca$9f7f7d90$0802a8c0@bklos> I'm wondering if anyone has seen this behavior at all The system is Unixware 7.1.1 apache 1.3.34/php 4.4.2 which uses a lot of binary cgi in the web app. In order to pass information to the cgi apps they are placed in the environment via putenv then calls the cgi app. Occasionally, the environment variables are corrupted, usually ending up with a blank page since the app has no or corrupt information to work from. a simple example would be: putenv("QUERY_STRING=$url"); putenv("HTTP_COOKIE=$HTTP_COOKIE"); $pipe = popen("./SD_disp", "r"); the only evidence I have that the environment is getting fouled up is in phpinfo() which displays things like: I can reproduce this behavior with a simple script that sets and unsets an environment variable a couple of times To further confuse things: This does not happen in Unixware 7.1.4 This does not happen when the Oracle database is localhost even though the phpinfo() environment displays corruption Any ideas or seen anything remotely similar? Any help would be appreciated TIA, Bob Klos -------------- next part -------------- An HTML attachment was scrubbed... URL: From edwardpotter at gmail.com Thu Aug 9 18:21:12 2007 From: edwardpotter at gmail.com (Edward Potter) Date: Thu, 9 Aug 2007 18:21:12 -0400 Subject: [nycphp-talk] PHP to ajax variable passing problem In-Reply-To: References: Message-ID: I have been hooked on jQuery. AMAZING JS stuff. There is an ajax/form plug in that will handle all this. Serialize, JSON, zillion options. Mixing it all up with php, and you can do pretty much anything. http://jquery.com/ Plug in examples: http://www.malsup.com/jquery/form/#code-samples :-) ed On 8/9/07, Cliff Hirsch wrote: > > My Ajax response handler uses this line, which is fairly typical: > > var output = req.responseText; > > >From php, I'm echoing back json. Example: > {"status":1,"count":0,"data":""} > > But instead of var output being an object, it is a string: > "{"status":1,"count":0,"data":""}" > > How do I make this an object? > > Cliff > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- the Blog: http://www.utopiaparkway.com the Karma: http://www.coderswithconscience.com the Projects: http://flickr.com/photos/86842405 at N00/ the Store: http://astore.amazon.com/httpwwwutopic-20 From ben at projectskyline.com Thu Aug 9 20:11:49 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Thu, 9 Aug 2007 20:11:49 -0400 Subject: [nycphp-talk] Encoding text/html for mailto: Message-ID: <02dc01c7dae3$0cf45900$6401a8c0@gamebox> Hello All, I've created a "Mail this section" option for a FAQ/Information Center type page I'm working on. It enables visitors to email themselves the contents of a particular section. But I'm running into trouble when foreign/non a-zA-Z0-9 characters are present in the code (which is being pulled from the database). Heres' a code snippet: $body .= "result['body']))) . "\"" . " class=\"email\">Email this section"; Let me reformat that, heh: $body = "Email me"; So, what can I use on $dbObject->result['body'] to clean/strip away the text? You can see I was messing with a few different options..I know & will break it, as well as " ... but lets just clear out everything (HTML, and all other characters EXCEPT aA-zZ 0-9 and maybe .,- Any help, greatly appreaciated! - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons This e-mail is confidential information intended only for the use of the individual to whom it is addressed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From support at dailytechnology.net Fri Aug 10 09:48:09 2007 From: support at dailytechnology.net (Brian Dailey) Date: Fri, 10 Aug 2007 09:48:09 -0400 Subject: [nycphp-talk] Debugging Zend_Db SQL In-Reply-To: <9DD06888-9072-45A9-A3BE-26FF959EA14F@jonbaer.com> References: <46BB341F.20106@dailytechnology.net> <9DD06888-9072-45A9-A3BE-26FF959EA14F@jonbaer.com> Message-ID: <46BC6C99.6050107@dailytechnology.net> For future reference, the easiest way (in postDispatch()) was: $dbAdapter = Zend_Registry::get( 'dbAdapter' ); $profiler = $dbAdapter->getProfiler( ); $query = $profiler->getLastQueryProfile( ); echo $query->getQuery( ); - Brian Jon Baer wrote: > From what I recall most of the framework objects should already have a > __toString() overload on them so you can just echo/dump the select itself. > > - Jon > > On Aug 9, 2007, at 11:34 AM, Brian Dailey wrote: > >> I'm just starting to dabble with Zend's framework, and I don't see an >> easy way to check what the SQL output is when I'm executing a >> statement. I'd like to just output the whole query so I can monitor >> what it's sending. Does anyone know a quick & dirty way to do this? >> >> >> -- >> >> Thanks! >> - Brian Dailey >> Software Developer >> New York, NY >> www.dailytechnology.net_______________________________________________ >> >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > -- Thanks! - Brian Dailey Software Developer New York, NY www.dailytechnology.net -------------- next part -------------- A non-text attachment was scrubbed... Name: support.vcf Type: text/x-vcard Size: 264 bytes Desc: not available URL: From dcech at phpwerx.net Fri Aug 10 10:18:34 2007 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 10 Aug 2007 10:18:34 -0400 Subject: [nycphp-talk] Encoding text/html for mailto: In-Reply-To: <02dc01c7dae3$0cf45900$6401a8c0@gamebox> References: <02dc01c7dae3$0cf45900$6401a8c0@gamebox> Message-ID: <46BC73BA.5060809@phpwerx.net> Ben Sgro (ProjectSkyLine) wrote: > Hello All, > > I've created a "Mail this section" option for a FAQ/Information Center type page I'm working on. > > It enables visitors to email themselves the contents of a particular section. But I'm running into trouble > when foreign/non a-zA-Z0-9 characters are present in the code (which is being pulled from the database). > > > Heres' a code snippet: > > > $body .= "result['body']))) . "\"" > . " class=\"email\">Email this section"; > > Let me reformat that, heh: > $body = "Email me"; > > So, what can I use on $dbObject->result['body'] to clean/strip away the text? You can see I was messing > with a few different options..I know & will break it, as well as " ... but lets just clear out everything (HTML, and all other characters EXCEPT aA-zZ 0-9 and maybe .,- > > Any help, greatly appreaciated! Personally, I think you're probably approaching this the wrong way. Not only are you going to be generating huge links (which will cause all kinds of grief), but your email will be horribly formatted and the user still has to email it to themselves manually from their own mail client...very confusing. Why not have the link trigger a server-side process to send the mail? You may need an input for the user to enter their email address, but then you can format the mail in any way you like, using whatever character set is appropriate for the content. For bonus marks, attach it as a nicely formatted pdf! As an aside, when creating any kind of url, there are 2 forms of formatting you need to consider. 1. urlencode any query strings 2. html encode the entire url to make it html-safe for example: echo 'link'; I define functions h() and u() as shortcuts for htmlspecialchars and urlencode respectively, as I use them everywhere. If you did want to make your current approach work, you would want to do something like: $body = 'Email me'; HTH, Dan From ben at projectskyline.com Fri Aug 10 10:51:46 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Fri, 10 Aug 2007 10:51:46 -0400 Subject: [nycphp-talk] Encoding text/html for mailto: References: <02dc01c7dae3$0cf45900$6401a8c0@gamebox> <46BC73BA.5060809@phpwerx.net> Message-ID: <00df01c7db5d$fa55b1b0$6401a8c0@gamebox> Hello Dan, Good point. I like your idea, but it adds a little more processing since I'd need to be handling these pages w/sessions, to thwart potential misuse/abuse. I like the attachment as a .pdf idea as well. I'll have to see if its something the client wants before I get too far with it. The code snippet you send me works for some, but doesn't work for others. Some characters are still breaking it. Or maybe, mailto has a limit for body size. Not sure. Thank you! - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Dan Cech" To: "NYPHP Talk" Sent: Friday, August 10, 2007 10:18 AM Subject: Re: [nycphp-talk] Encoding text/html for mailto: > Ben Sgro (ProjectSkyLine) wrote: >> Hello All, >> >> I've created a "Mail this section" option for a FAQ/Information Center >> type page I'm working on. >> >> It enables visitors to email themselves the contents of a particular >> section. But I'm running into trouble >> when foreign/non a-zA-Z0-9 characters are present in the code (which is >> being pulled from the database). >> >> >> Heres' a code snippet: >> >> >> $body .= "> $dbObject->result['body']))) . "\"" >> . " class=\"email\">Email this section"; >> >> Let me reformat that, heh: >> $body = "Email me"; >> >> So, what can I use on $dbObject->result['body'] to clean/strip away the >> text? You can see I was messing >> with a few different options..I know & will break it, as well as " ... >> but lets just clear out everything (HTML, and all other characters EXCEPT >> aA-zZ 0-9 and maybe .,- >> >> Any help, greatly appreaciated! > > Personally, I think you're probably approaching this the wrong way. > > Not only are you going to be generating huge links (which will cause all > kinds of grief), but your email will be horribly formatted and the user > still has to email it to themselves manually from their own mail > client...very confusing. > > Why not have the link trigger a server-side process to send the mail? > > You may need an input for the user to enter their email address, but > then you can format the mail in any way you like, using whatever > character set is appropriate for the content. > > For bonus marks, attach it as a nicely formatted pdf! > > As an aside, when creating any kind of url, there are 2 forms of > formatting you need to consider. > > 1. urlencode any query strings > > 2. html encode the entire url to make it html-safe > > for example: > > echo 'link'; > > I define functions h() and u() as shortcuts for htmlspecialchars and > urlencode respectively, as I use them everywhere. > > If you did want to make your current approach work, you would want to do > something like: > > $body = 'Email me'; > > HTH, > > Dan > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From chsnyder at gmail.com Fri Aug 10 14:41:20 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 10 Aug 2007 14:41:20 -0400 Subject: [nycphp-talk] Bizarre PHP putenv/getenv results In-Reply-To: <007301c7daca$9f7f7d90$0802a8c0@bklos> References: <007301c7daca$9f7f7d90$0802a8c0@bklos> Message-ID: On 8/9/07, Bob Klos wrote: > > Occasionally, the environment variables are corrupted, > usually ending up with a blank page since the app has > no or corrupt information to work from. > > a simple example would be: > > putenv("QUERY_STRING=$url"); > putenv("HTTP_COOKIE=$HTTP_COOKIE"); > I have near-zero experience with putenv(), but my first impression on looking at the code is that it looks like it will break if shell metacharacters or anything other than low ascii is in the php vars. Could there be stray newlines or some other characters in the values that would cause breakage? -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Fri Aug 10 14:57:42 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 10 Aug 2007 14:57:42 -0400 Subject: [nycphp-talk] PHP to ajax variable passing problem In-Reply-To: <84794375-6A49-455A-A22A-530502668AED@sala.ca> References: <20190d950708091232u4abcbb01gb6af156693afc68e@mail.gmail.com> <84794375-6A49-455A-A22A-530502668AED@sala.ca> Message-ID: On 8/9/07, Dell Sala wrote: > > json.org provides a json decoder for javascript. I've always used > this instead of eval. This will only parse the json subset, and will > fail for other arbitrary javascript. > > http://www.json.org/js.html > http://www.json.org/json.js > That script makes it _much_ safer to parse untrusted json, and if there was any way to exploit it at all, someone would have found it by now.... but it still uses eval(). -- Chris Snyder http://chxo.com/ From bklos at getoffutt.com Fri Aug 10 16:11:22 2007 From: bklos at getoffutt.com (Bob Klos) Date: Fri, 10 Aug 2007 16:11:22 -0400 Subject: [nycphp-talk] Bizarre PHP putenv/getenv results In-Reply-To: References: <007301c7daca$9f7f7d90$0802a8c0@bklos> Message-ID: <005b01c7db8a$9f7679a0$0802a8c0@bklos> I don't think that's the case because 9 times out of 10 the page loads. If you hit refresh a few times you'll catch the error, then refresh and it'll work again. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of csnyder Sent: Friday, August 10, 2007 2:41 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Bizarre PHP putenv/getenv results On 8/9/07, Bob Klos wrote: > > Occasionally, the environment variables are corrupted, usually ending > up with a blank page since the app has no or corrupt information to > work from. > > a simple example would be: > > putenv("QUERY_STRING=$url"); > putenv("HTTP_COOKIE=$HTTP_COOKIE"); > I have near-zero experience with putenv(), but my first impression on looking at the code is that it looks like it will break if shell metacharacters or anything other than low ascii is in the php vars. Could there be stray newlines or some other characters in the values that would cause breakage? -- Chris Snyder http://chxo.com/ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From ioplex at gmail.com Fri Aug 10 17:25:53 2007 From: ioplex at gmail.com (Michael B Allen) Date: Fri, 10 Aug 2007 17:25:53 -0400 Subject: [nycphp-talk] Good Font Size Control In-Reply-To: <46BA8A3B.9020907@phpwerx.net> References: <78c6bd860708081843j5bf8b4d3m542e6799736b5446@mail.gmail.com> <20190d950708081919s6a357408p6bacadfc8954f42@mail.gmail.com> <78c6bd860708082005r10b5dedj36a0a5768c612a75@mail.gmail.com> <46BA8A3B.9020907@phpwerx.net> Message-ID: <78c6bd860708101425h7ade5802kde17da99f6ff460c@mail.gmail.com> On 8/8/07, Dan Cech wrote: > My personal preference is to use the following rule: > > * { > font-size: 100%; > } > > to reset the size of all fonts to 100% of the parent element, then set a > size on the body tag as your baseline, eg: > > body { > font-size: small; > } > > Now everything will have the same font size, and changing the font size > on the body will affect everything. Hi Dan, Well this is pretty much what I did and I have to say it actually worked pretty well. No need for separate CSS files or JavaScript to go with since I can dynamically change the body tag to specify a different class. Thanks, Mike From chsnyder at gmail.com Fri Aug 10 17:29:38 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 10 Aug 2007 17:29:38 -0400 Subject: [nycphp-talk] Bizarre PHP putenv/getenv results In-Reply-To: <005b01c7db8a$9f7679a0$0802a8c0@bklos> References: <007301c7daca$9f7f7d90$0802a8c0@bklos> <005b01c7db8a$9f7679a0$0802a8c0@bklos> Message-ID: On 8/10/07, Bob Klos wrote: > I don't think that's the case because 9 times out of 10 the page loads. > If you hit refresh a few times you'll catch the error, then refresh and > it'll work again. > Oosh, that sucks. It's a little brain-breaking because computers don't generally do that. But it seems like you have a lot of moving parts there, and you mentioned something about Oracle on localhost vs. networked... could there be a timing issue, connections not getting set up, packets being dropped, a firewall taking matters into its own hands? I'm grasping at straws of course... -- Chris Snyder http://chxo.com/ From danielc at analysisandsolutions.com Fri Aug 10 20:13:25 2007 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 10 Aug 2007 20:13:25 -0400 Subject: [nycphp-talk] Bizarre PHP putenv/getenv results In-Reply-To: <007301c7daca$9f7f7d90$0802a8c0@bklos> References: <007301c7daca$9f7f7d90$0802a8c0@bklos> Message-ID: <20070811001325.GA15242@panix.com> On Thu, Aug 09, 2007 at 05:16:59PM -0400, Bob Klos wrote: > > The system is Unixware 7.1.1 apache 1.3.34/php 4.4.2 which uses a lot of > binary cgi in the web app. In order to pass information to the cgi apps they > are placed in the environment via putenv then calls the cgi app. Wouldn't it be simpler and more reliable to pipe the information between the programs via STDOUT and STDIN or pass the arguments on the command line? --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 tedd at sperling.com Sat Aug 11 11:30:34 2007 From: tedd at sperling.com (tedd) Date: Sat, 11 Aug 2007 11:30:34 -0400 Subject: [nycphp-talk] Good Font Size Control In-Reply-To: References: <78c6bd860708081843j5bf8b4d3m542e6799736b5446@mail.gmail.com> <20190d950708081919s6a357408p6bacadfc8954f42@mail.gmail.com> <78c6bd860708082005r10b5dedj36a0a5768c612a75@mail.gmail.com> Message-ID: At 10:11 AM -0400 8/9/07, csnyder wrote: >Tom, your tip about 62.5% is one I've never run across before. Nice! It's interesting how the value of 62.5 keeps cropping up in science, but that's a different topic. For what I do (see below), using 62.5% would be a nightmare. >I think the best (as in, most comprehensive) way to go about this is >to put in the work and create multiple stylesheets. For all but the >most simple and flexible of designs, increasing the font size will >crowd or break some design elements. I agree. It's a simple matter to use a php style-switch, I even provide one on my web site here: http://sperling.com/examples/styleswitch1/ From that you can tie in any number of style sheets to adjust font size to anything you want. If that doesn't ring your bell, then you can assign variables inside css to change font size as you want, see how here: http://sperling.com/examples/pcss/ >It's much nicer for visually-impaired users to see a properly >proportioned design at the largest size, rather than giant text >squeezed into standard-size columns. You can also replace images that >need to be larger, tweak icon sizes, etc. That's exactly what I do and for that exact reason. If you tie everything to em's (I don't want to argue about what's best) and use font-size: 100% (or 100.1% for some browser bugs), then it becomes a simple matter to design a site to be "zoom cooperative" (<-- my term). What this means simply is that no matter what zoom level the user uses, the site stays in the same relative configuration. I hate it when giant text is squeezed as you describe above. Now, can normal web sites be "zoom cooperative" ? But of course they can, it just takes a bit of css to make it so -- as's described here: http://sperling.com/examples/zoom/ And, if you want to see real web sites that do this, try these: http://earthstones.com http://webbytedd.com/clients/beckyscan There are many, many more. IMO, it's a good way to accommodate those with vision problems and do so without being obvious about accommodation. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From bz-gmort at beezifies.com Sat Aug 11 20:41:00 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Sat, 11 Aug 2007 20:41:00 -0400 Subject: [nycphp-talk] Joomla meetings, your feedback needed Message-ID: <46BE571C.5090009@beezifies.com> As some of you may be aware, I'm trying to get Joomla meetings going in NYC. NYPHP will be providing space for us for a monthly Thursday meeting. I've been running polls on my website(I have been setting it up lately for my independent consulting work, since I have the space there anyway, I figured might as well use it.) From the poll feedback, it looks like either the second or third week of the month is likely to be the week of choice. I will be at the NYPHP event on the 23rd of this month to meet people interested in going to monthly meetings so we can finalize a week. I have also setup a new poll, slightly longer this time, to get some feedback on what types of presentations people are interested in. For the most part, I've listed things I have done, or am in the process of doing, so if no one else wants to present I can at least plan on reviewing something of interest to the people coming to the meeting(just don't expect a "professional" presentation - I'll try to be informative and not withhold "secrets" - as I've found most Joomla books seem to do.) The polls are under NYC Joomla SIG on the menubar, and active polls are displayed in the right hand menubar. My website is http://www.beezifies.com So go ahead an give me some feedback - the only way we can do things you find interesting is if you tell me what you want. From elharo at metalab.unc.edu Sat Aug 11 22:57:17 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Sat, 11 Aug 2007 22:57:17 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46BB3041.2040909@secdat.com> References: <46B60C11.2090904@metalab.unc.edu> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> <46BA2A9C.2010400@secdat.com> <46BA6211.3010404@metalab.unc.edu> <46BB3041.2040909@secdat.com> Message-ID: <46BE770D.9030704@metalab.unc.edu> Kenneth Downs wrote: > Select title > ,SUBSTRING(text ...insert regexp here...) > from chapters > where book_name = 'XML in a Nutshell' > Regexps can't do that though. Regular expression are an insufficiently powerful tool for processing XML. Trying to do that is just a world of pain. > Rusty, you appear to be arguing from ignorance, very unusual coming from > you. Funny how you confuse different experiences with ignorance. Have you ever worked in publishing? Or in library science? Or on anything that operates at web scale like Yahoo or Google? There are many use cases where a couple of months of hard labor will rapidly disabuse anyone of the belief that relational databases are the one true solution to all problems. Your career just happens not to have taken you down those paths yet. > The true difference between us in this argument is that I understand > that I have a prejudice for relational over hierarchical, based on my > knowledge and use of both, and based on judgment calls as to how to get > through the day. I daresay however that you are promoting a religious > favoring of XML w/o a working knowledge of the alternatives. Ken, you know me. Do you really think I don't know the relational model or what it's good for? I use relational databases all the time, and I'm using them now. However unlike you I've hit their limits. While I'm sure many people can profitably spend their life doing nothing but relational databases, I happen to be working on applications where neither the relational model nor the actual SQL databases out there can come close to managing my data. I've never said that all applications should use XML databases or other non-relational systems, You keep trying to put those words into my mouth. I do say that some applications, especially in publishing and web publishing, do not fit the relational model well and can better served by XML databases. > You simply cannot defend a file format as a foundation for frameworks > and databases. The best you can do is defend the model, such as the > hierarchical model. XML is not a file format. We've been down this road before. A native XML database is no more based ona file format than MySQL is based on tab delimited text. > Going further, you cannot defend a file format as a foundation for > anything based on how it handles large text (or binary) fields. There > are three issues here: > > -> Data model, hierarchical vs. relational. > -> File format, XML vs YAML or JSON or any other format you like > -> Handling of large text (and binary) columns. > > Finally, if we can all admit that XML is just a file format, then the > entire framework crumbles as soon as somebody comes up with a better > one, because let's admit it, XML is just about the worst you're going to > find. Troll. Troll. Troll. > In conclusion, the examples you provide appear to give advantage to XML > because tools exist to handle data that has been buried in opaque > formats and poorly defined structures. If the data had been structured > properly in the first place and put into formats that were not so > opaque, using (pardon me for saying) a *real* database, designed on > solid principles, the examples you give become child's play. LOL. Seriously, try storing a book or an encyclopedia in a relational database with anything approximating 1NF, not even 2NF. Then try and make it perform adequately. Not all data fits neatly into tables. > > >> I'm glad we have multiple tools to bring to bear on this kind of >> problem, because I worry about the performance implications of >> querying an XML database for the average price of those books, or >> performing an operation that adds another field (tag?) to each book's >> "record". Average prices, or adding a field, can be done pretty fast. I don't know if it's as fast as oracle or MySQL. I don't much care. Sales systems are exactly the sort of apps that relational databases fit well. But actually publishing the books? That's a very different story. >> If it's not too much trouble, could you give us some other use cases >> for an XML database? Because title and first paragraph, if that's >> something a system "routinely does" could easily be stored as >> relational data at the time of import. >> Just surf around Safari sometime. Think about what it's doing. Then try to imagine doing that on top of a relational database. Think about combining individual chapters, sections, and even smaller divisions to make new on-off books like Safari U does. Consider the generation of tables of contents and indexes for these books. Closer to home, think about a blogging system or a content management system. Now imagine what you could do if the page structure were actually queryable, and not just an opaque blob in MySQL somewhere. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From elharo at metalab.unc.edu Sat Aug 11 23:07:02 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Sat, 11 Aug 2007 23:07:02 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: References: <46B60C11.2090904@metalab.unc.edu> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> <46BA2A9C.2010400@secdat.com> <46BA6211.3010404@metalab.unc.edu> Message-ID: <46BE7956.7080306@metalab.unc.edu> csnyder wrote: > If it's not too much trouble, could you give us some other use cases > for an XML database? Because title and first paragraph, if that's > something a system "routinely does" could easily be stored as > relational data at the time of import. > Storing books, web pages, and the like in a relational database has only two basic approaches: make it a blob or cut it into tiny little pieces. The first eliminates search capabilities; the second performs like a dog. You're right that if grabbing the title and the first paragraph is all you need to do, then these two pieces could be stored separately (and normalization be damned.) Now suppose the editor comes along and tells you they really want to show the first two paragraphs of text to non-logged in users instead of just the first one. If you know the queries in advance, you can layout the data to optimize them, but using the data's own structure will give you much more flexibility for unexpected uses. Here's another common use case: extract the links from a web site. Do a Google-like reverse index that finds all the pages linking to this one. The only way to make that happen in a relational DB is to chop the content into so many trivially small pieces that putting them back together again is prohibitively expensive. And even once you've done that, the SQL to pull the result is ungodly ugly. The XQuery is a lot simpler because it matches the natural structure of the documents rather than treating everything as a table. Some data wants to live in tables. Some doesn't. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From joshmccormack at travelersdiary.com Sat Aug 11 23:27:05 2007 From: joshmccormack at travelersdiary.com (Josh McCormack) Date: Sat, 11 Aug 2007 22:27:05 -0500 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46BE770D.9030704@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> <46BA2A9C.2010400@secdat.com> <46BA6211.3010404@metalab.unc.edu> <46BB3041.2040909@secdat.com> <46BE770D.9030704@metalab.unc.edu> Message-ID: On 8/11/07, Elliotte Harold wrote: > Closer to home, think about a blogging system or a content management > system. Now imagine what you could do if the page structure were > actually queryable, and not just an opaque blob in MySQL somewhere. > > -- > Elliotte Rusty Harold elharo at metalab.unc.edu > Java I/O 2nd Edition Just Published! > http://www.cafeaulait.org/books/javaio2/ > http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ Do you have any recommended reading on XML CMS? Do you know of any that are open source and in a useful state? -- Josh McCormack Owner, InteractiveQA Web testing & development http://www.interactiveqa.com 917.620.4902 From smanes at magpie.com Sun Aug 12 00:17:04 2007 From: smanes at magpie.com (Steve Manes) Date: Sun, 12 Aug 2007 00:17:04 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46BE770D.9030704@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> <46BA2A9C.2010400@secdat.com> <46BA6211.3010404@metalab.unc.edu> <46BB3041.2040909@secdat.com> <46BE770D.9030704@metalab.unc.edu> Message-ID: <46BE89C0.6080804@magpie.com> Elliotte Harold wrote: > Closer to home, think about a blogging system or a content management > system. Now imagine what you could do if the page structure were > actually queryable, and not just an opaque blob in MySQL somewhere. This is a fascinating discussion. I can see how an NXD might be a very good fit for medical information systems where a logic encounter record might encompass dozens of normalized relational model tables. What are some of the stable, production-worthy open source servers out there? From selyah1 at yahoo.com Sun Aug 12 20:15:09 2007 From: selyah1 at yahoo.com (selyah) Date: Sun, 12 Aug 2007 17:15:09 -0700 (PDT) Subject: [nycphp-talk] insert goto command Message-ID: <67401.87913.qm@web30803.mail.mud.yahoo.com> Hello: Is there a command that is used to open a page after performing an action? I created a php script that will add items to a database and would like to be able to open a view page that would show the newly added item. I am not able to use the insertgoto command and would like to know if there is another command that can be used? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim_lists at o2group.com Sun Aug 12 20:18:12 2007 From: tim_lists at o2group.com (Tim Lieberman) Date: Sun, 12 Aug 2007 18:18:12 -0600 Subject: [nycphp-talk] insert goto command In-Reply-To: <67401.87913.qm@web30803.mail.mud.yahoo.com> References: <67401.87913.qm@web30803.mail.mud.yahoo.com> Message-ID: <46BFA344.1030904@o2group.com> Send a redirect header? query("INSERT ..... "); header("Location: viewpage.php?id=$id"); ?> selyah wrote: > Hello: > Is there a command that is used to open a page after performing an action? > I created a php script that will add items to a database and would > like to be able to open a view page that would show the newly added item. > I am not able to use the insertgoto command and would like to know if > there is another command that can be used? > thanks > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From bklos at getoffutt.com Mon Aug 13 09:19:42 2007 From: bklos at getoffutt.com (Bob Klos) Date: Mon, 13 Aug 2007 09:19:42 -0400 Subject: [nycphp-talk] Bizarre PHP putenv/getenv results In-Reply-To: <20070811001325.GA15242@panix.com> References: <007301c7daca$9f7f7d90$0802a8c0@bklos> <20070811001325.GA15242@panix.com> Message-ID: <000801c7ddac$9c692b80$6602a8c0@bklos> Absolutely it would. Had the program been written after '95 it might have been done that way :) -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Daniel Convissor Sent: Friday, August 10, 2007 8:13 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Bizarre PHP putenv/getenv results On Thu, Aug 09, 2007 at 05:16:59PM -0400, Bob Klos wrote: > > The system is Unixware 7.1.1 apache 1.3.34/php 4.4.2 which uses a lot > of binary cgi in the web app. In order to pass information to the cgi > apps they are placed in the environment via putenv then calls the cgi app. Wouldn't it be simpler and more reliable to pipe the information between the programs via STDOUT and STDIN or pass the arguments on the command line? --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 Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From cliff at pinestream.com Mon Aug 13 09:23:34 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 13 Aug 2007 09:23:34 -0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: Message-ID: So I need to apply an upgrade, but have no idea what changes I?ve made to the original software. Paranoia keeps me from applying the patch ? don?t want to lose any of my changes. I?d like to have a complete printout of my changed files before I apply the upgrade patch so I know where to look when the inevitable problems crop up. But hey, I use Subversion, so I?m doing something right. This is what I have done as a start: I used ?compare with working copy? in the Tortoise SVN log window, which gave me a list of changed files from my current rev and the original very dated sw install. This produced a list of files (in a file window) in TortoiseMerge that can be viewed individually for diffs. But how do I print/capture this file list and associated diff? I don?t see any way to print the changed files other than writing them by hand. And I don?t see any way to view the changes other than file by file. Is the diff or file list stored locally? Suggestions? Cliff Hirsch -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.ananyev at gmail.com Mon Aug 13 09:33:14 2007 From: d.ananyev at gmail.com (Dmitry Ananyev) Date: Mon, 13 Aug 2007 17:33:14 +0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: References: Message-ID: <5ee48e770708130633w6d80d3a1u840b2b333c999149@mail.gmail.com> You better install console version of svn tools and just use # svn diff -x -wu /path/to/trunk > mydiffs.txt -- WBR, Dmitry Ananyev d.ananyev at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Mon Aug 13 09:39:40 2007 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 13 Aug 2007 09:39:40 -0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: References: Message-ID: <46C05F1C.2030008@phpwerx.net> Cliff Hirsch wrote: > So I need to apply an upgrade, but have no idea what changes I?ve made to > the original software. Paranoia keeps me from applying the patch ? don?t > want to lose any of my changes. I?d like to have a complete printout of my > changed files before I apply the upgrade patch so I know where to look when > the inevitable problems crop up. > > But hey, I use Subversion, so I?m doing something right. This is what I have > done as a start: Subversion is great, and can help you with this task (and many others). I would first suggest that you read the svn book: http://svnbook.red-bean.com/ Basically, you're trying to solve a non-problem. Because you're using svn, you can retrieve any revision of your code at any time, so you can always pull the latest revision before you apply the patches from upstream. If you have any problems you can a) revert your working copy and try again (if you haven't committed anything yet), or b) roll back the repository to the latest un-broken revision (if you committed broken code). You may also want to check out vendor branches: http://svnbook.red-bean.com/en/1.2/svn.advanced.vendorbr.html I have used this strategy in the past to maintain codebases coming from upstream authors, and it works very well. Basically you create a branch with the upstream release you are currently using, then apply patches from upstream to that branch to keep it in sync with the upstream version. At any time you can then merge those changes into your development branch, taking advantage of svn's built-in conflict resolution system to handle any issues, rather than just getting stuck with patches that won't apply cleanly. Dan From cliff at pinestream.com Mon Aug 13 09:55:18 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 13 Aug 2007 09:55:18 -0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: <5ee48e770708130633w6d80d3a1u840b2b333c999149@mail.gmail.com> Message-ID: On 8/13/07 9:33 AM, "Dmitry Ananyev" wrote: > > You better install console version of svn tools and just use > # svn diff -x -wu /path/to/trunk > mydiffs.txt Thanks! I was thinking there must be something along those lines! -------------- next part -------------- An HTML attachment was scrubbed... URL: From anoland at indigente.net Mon Aug 13 10:00:33 2007 From: anoland at indigente.net (Adrian Noland) Date: Mon, 13 Aug 2007 10:00:33 -0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: References: Message-ID: <1d8a0e930708130700h17ab92der38e97ee0a5c49735@mail.gmail.com> On 8/13/07, Cliff Hirsch wrote: > > So I need to apply an upgrade, but have no idea what changes I've made to > the original software. Paranoia keeps me from applying the patch ? don't > want to lose any of my changes. I'd like to have a complete printout of my > changed files before I apply the upgrade patch so I know where to look when > the inevitable problems crop up. > > But hey, I use Subversion, so I'm doing something right. This is what I > have done as a start: > > I used "compare with working copy" in the Tortoise SVN log window, which > gave me a list of changed files from my current rev and the original very > dated sw install. > > This produced a list of files (in a file window) in TortoiseMerge that can > be viewed individually for diffs. > > But how do I print/capture this file list and associated diff? I don't see > any way to print the changed files other than writing them by hand. And I > don't see any way to view the changes other than file by file. Is the diff > or file list stored locally? Suggestions? > > > Cliff Hirsch > Cliff, I haven't come across anything that does what you are trying to do. But, may I ask why? You are trying to keep track of something that svn already keeps track of for you. I say use the tool like it was intended. If you are that unsure of the commit, make a note of the current revision as a baseline. You can use the log viewer (in both CLI and Tortise) to see the diffs between any revision, at any point in the future. If you have to, you can go back to the baseline. Either by specific file, or the whole commit. I think of it as "reverse merge" because you are merging the old revision changes in to a new revision file. The closest I can come to answering your question is the revision graph. It will produce a hierarchical representation of all the major changes to a file., but might not tell you what you are looking for. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Mon Aug 13 10:05:54 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 13 Aug 2007 10:05:54 -0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: <46C05F1C.2030008@phpwerx.net> Message-ID: > Basically you create a branch with the upstream release you are > currently using, then apply patches from upstream to that branch to keep > it in sync with the upstream version. > > At any time you can then merge those changes into your development > branch, taking advantage of svn's built-in conflict resolution system to > handle any issues, rather than just getting stuck with patches that > won't apply cleanly. I think I got the message. So this is the appropriate time to create a branch. My current base become trunk and perhaps tag it as V1; make a V2 branch of this; make my working copy point to the new branch, apply the vendor's upgrade, then -- when I'm ready, merge the branch into the trunk? Is that the jist of it? Use a repository structure like this? http://svn.collab.net/viewvc/svn/ From cliff at pinestream.com Mon Aug 13 10:14:05 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 13 Aug 2007 10:14:05 -0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: <1d8a0e930708130700h17ab92der38e97ee0a5c49735@mail.gmail.com> Message-ID: Cliff, > I haven't come across anything that does what you are trying to do. But, may I > ask why? You are trying to keep track of something that svn already keeps > track of for you. I say use the tool like it was intended. If you are that > unsure of the commit, make a note of the current revision as a baseline. You > can use the log viewer (in both CLI and Tortise) to see the diffs between any > revision, at any point in the future. If you have to, you can go back to the > baseline. Either by specific file, or the whole commit. I think of it as > "reverse merge" because you are merging the old revision changes in to a new > revision file. > > The closest I can come to answering your question is the revision graph. It > will produce a hierarchical representation of all the major changes to a > file., but might not tell you what you are looking for. > I guess I need to learn more about the patch process. Here?s what I?m thinking. The vendor?s upgrade will attempt to patch hundreds of files. Yet, I?m only concerned about the 100 or so that I have changed. So when things fail, where do I look? A diff post-upgrade will show hundreds of file changes, yet I?m only concerned about the files I previously changed. Now I have heard that patches will fail if I have made changes. The diff file is the diff between the vendor?s new code and the original code, not the code with my changes. If this is the case, it will be simple to see where the patches fail. This would make life a lot easier. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Mon Aug 13 10:24:12 2007 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 13 Aug 2007 10:24:12 -0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: References: Message-ID: <46C0698C.8020107@phpwerx.net> Cliff Hirsch wrote: >> Basically you create a branch with the upstream release you are >> currently using, then apply patches from upstream to that branch to keep >> it in sync with the upstream version. >> >> At any time you can then merge those changes into your development >> branch, taking advantage of svn's built-in conflict resolution system to >> handle any issues, rather than just getting stuck with patches that >> won't apply cleanly. > > I think I got the message. So this is the appropriate time to create a > branch. My current base become trunk and perhaps tag it as V1; make a V2 > branch of this; make my working copy point to the new branch, apply the > vendor's upgrade, then -- when I'm ready, merge the branch into the trunk? > Is that the jist of it? > > Use a repository structure like this? > http://svn.collab.net/viewvc/svn/ Cliff, I would strongly recommend that you read the svn book (http://svnbook.red-bean.com/), which will answer many of your questions. By using the vendor branch mechanism outlined in chapter 7, you can solve the problem you are facing the right way and avoid future headaches. A vendor branch is not the same thing as a 'normal' branch used for feature development, and you will need to have a solid grasp of svn fundamentals to avoid getting yourself into trouble. Dan From cliff at pinestream.com Mon Aug 13 10:46:07 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 13 Aug 2007 10:46:07 -0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: <46C0698C.8020107@phpwerx.net> Message-ID: > Cliff, > > I would strongly recommend that you read the svn book > (http://svnbook.red-bean.com/), which will answer many of your questions. > > By using the vendor branch mechanism outlined in chapter 7, you can > solve the problem you are facing the right way and avoid future > headaches. A vendor branch is not the same thing as a 'normal' branch > used for feature development, and you will need to have a solid grasp of > svn fundamentals to avoid getting yourself into trouble. Thanks. Printing it out now. From evdo.hsdpa at gmail.com Mon Aug 13 11:52:31 2007 From: evdo.hsdpa at gmail.com (Robert Kim Wireless Internet Advisor) Date: Mon, 13 Aug 2007 08:52:31 -0700 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: <5ee48e770708130633w6d80d3a1u840b2b333c999149@mail.gmail.com> References: <5ee48e770708130633w6d80d3a1u840b2b333c999149@mail.gmail.com> Message-ID: <1ec620e90708130852q58ef2f74x842a400e815d07b4@mail.gmail.com> Dmitry, Perfect.. this is something i've forgotten to do recently. thanks! On 8/13/07, Dmitry Ananyev wrote: > > You better install console version of svn tools and just use > # svn diff -x -wu /path/to/trunk > mydiffs.txt > -- > WBR, Dmitry Ananyev > d.ananyev at gmail.com -- Robert Q Kim, Wireless Internet Provider http://evdo-coverage.com/satellite-wireless-internet.html http://iptv-coverage.com http://wimax-coverage.com unpaid overtime http://znitch.com laws 2611 S. Pacific Coast Highway 101 Suite 203 Cardiff by the Sea, CA 92007 206 984 0880 From krook at us.ibm.com Mon Aug 13 12:48:30 2007 From: krook at us.ibm.com (Daniel Krook) Date: Mon, 13 Aug 2007 12:48:30 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46BE89C0.6080804@magpie.com> Message-ID: Steve, > Elliotte Harold wrote: > > > Closer to home, think about a blogging system or a > content management > > system. Now imagine what you could do if the page structure were > > actually queryable, and not just an opaque blob in MySQLsomewhere. > > This is a fascinating discussion. I can see how an NXD > might be a very > good fit for medical information systems where a logic > encounter record > might encompass dozens of normalized relational model > tables. What are > some of the stable, production-worthy open source servers out there? Here's a press release put out today on a healthcare provider that appears to be using XML in DB9 v9 for that sort of thing. Express-C is free (not open source though) and comes with the pureXML feature. http://www.ibm.com/press/us/en/pressrelease/22131.wss DB2 9 w/ PHP info http://www.ibm.com/software/data/db2/ad/php.html Daniel Krook Content Tools Developer - SCSA, SCJP, SCWCD, ZCE, ICDAssoc. Global Solutions, ibm.com From rolan at omnistep.com Mon Aug 13 13:03:05 2007 From: rolan at omnistep.com (Rolan Yang) Date: Mon, 13 Aug 2007 13:03:05 -0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: <5ee48e770708130633w6d80d3a1u840b2b333c999149@mail.gmail.com> References: <5ee48e770708130633w6d80d3a1u840b2b333c999149@mail.gmail.com> Message-ID: <46C08EC9.8020500@omnistep.com> What does the "-wu" do? ~Rolan Dmitry Ananyev wrote: > > You better install console version of svn tools and just use > # svn diff -x -wu /path/to/trunk > mydiffs.txt > -- > WBR, Dmitry Ananyev > d.ananyev at gmail.com > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From chsnyder at gmail.com Mon Aug 13 13:03:55 2007 From: chsnyder at gmail.com (csnyder) Date: Mon, 13 Aug 2007 13:03:55 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46BE7956.7080306@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> <46BA2A9C.2010400@secdat.com> <46BA6211.3010404@metalab.unc.edu> <46BE7956.7080306@metalab.unc.edu> Message-ID: On 8/11/07, Elliotte Harold wrote: > Here's another common use case: extract the links from a web site. Do a > Google-like reverse index that finds all the pages linking to this one. > The only way to make that happen in a relational DB is to chop the > content into so many trivially small pieces that putting them back > together again is prohibitively expensive. And even once you've done > that, the SQL to pull the result is ungodly ugly. The XQuery is a lot > simpler because it matches the natural structure of the documents rather > than treating everything as a table. Some data wants to live in tables. > Some doesn't. > Ah, now _that's_ a great example, and something that CMS developers often need to do after the fact (as in link-checking, or generating a graph of sites you link to for SEO purposes). My first instinct would be to look for XPath support in my relational db, and indeed MySQL does this: http://dev.mysql.com/tech-resources/articles/mysql-5.1-xml.html But if a native-XML database can do it better or much more efficiently for large datasets, then it is certainly worth investigating. -- Chris Snyder http://chxo.com/ From anoland at indigente.net Mon Aug 13 15:52:10 2007 From: anoland at indigente.net (Adrian Noland) Date: Mon, 13 Aug 2007 15:52:10 -0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: <46C08EC9.8020500@omnistep.com> References: <5ee48e770708130633w6d80d3a1u840b2b333c999149@mail.gmail.com> <46C08EC9.8020500@omnistep.com> Message-ID: <1d8a0e930708131252h48de7aa9k4650c22e4962e80b@mail.gmail.com> Seconded, I get: svn: '-wu' is not supported On 8/13/07, Rolan Yang wrote: > > What does the "-wu" do? > > ~Rolan > > Dmitry Ananyev wrote: > > > > You better install console version of svn tools and just use > > # svn diff -x -wu /path/to/trunk > mydiffs.txt > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Mon Aug 13 17:26:46 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Mon, 13 Aug 2007 17:26:46 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: References: <46B60C11.2090904@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> <46BA2A9C.2010400@secdat.com> <46BA6211.3010404@metalab.unc.edu> <46BE7956.7080306@metalab.unc.edu> Message-ID: <016FE73A-575B-4AA6-9CAE-D9E3D8DF6B40@jonbaer.com> Immediately following this conversation I stopped by B&N to pick up this book: http://www.amazon.com/o/ASIN/0596006349 XQuery by Priscilla Walmsley It mainly goes over XPath 2.0 vs. 1.0 for most of the book, but overall it is a *great* insight into the topic. Also very good examples on FLWOR (http://en.wikipedia.org/wiki/FLWOR). - Jon On Aug 13, 2007, at 1:03 PM, csnyder wrote: > > My first instinct would be to look for XPath support in my relational > db, and indeed MySQL does this: > http://dev.mysql.com/tech-resources/articles/mysql-5.1-xml.html > > But if a native-XML database can do it better or much more efficiently > for large datasets, then it is certainly worth investigating. > > -- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elharo at metalab.unc.edu Mon Aug 13 19:36:00 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Mon, 13 Aug 2007 19:36:00 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: References: <46B60C11.2090904@metalab.unc.edu> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> <46BA2A9C.2010400@secdat.com> <46BA6211.3010404@metalab.unc.edu> <46BB3041.2040909@secdat.com> <46BE770D.9030704@metalab.unc.edu> Message-ID: <46C0EAE0.2000102@metalab.unc.edu> Josh McCormack wrote: > Do you have any recommended reading on XML CMS? Do you know of any > that are open source and in a useful state? > Several people asked me this so rather than responding individually I just wrote up some thogughts and put them here: http://cafe.elharo.com/xml/the-state-of-native-xml-databases/ The final word on this subject has not yet been written, but I think this is a decent summary of what's available in the native XML DB space as of August, 2007. Roughly I think we're where SQL was in 1995: some good payware products and some iffy but promising open source options. I expect the open source options will improve into production worthy systems with time, just as MySQL and PostgresQL did over the last decade. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From mfran1952 at yahoo.com Tue Aug 14 00:57:52 2007 From: mfran1952 at yahoo.com (michael francis) Date: Mon, 13 Aug 2007 21:57:52 -0700 (PDT) Subject: [nycphp-talk] I WOULD LIKE TO UNSUBSCRIBE In-Reply-To: <46C0EAE0.2000102@metalab.unc.edu> Message-ID: <788308.85279.qm@web43141.mail.sp1.yahoo.com> Elliotte Harold wrote: Josh McCormack wrote: > Do you have any recommended reading on XML CMS? Do you know of any > that are open source and in a useful state? > Several people asked me this so rather than responding individually I just wrote up some thogughts and put them here: http://cafe.elharo.com/xml/the-state-of-native-xml-databases/ The final word on this subject has not yet been written, but I think this is a decent summary of what's available in the native XML DB space as of August, 2007. Roughly I think we're where SQL was in 1995: some good payware products and some iffy but promising open source options. I expect the open source options will improve into production worthy systems with time, just as MySQL and PostgresQL did over the last decade. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php --------------------------------- Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen at capellic.com Tue Aug 14 10:01:37 2007 From: stephen at capellic.com (Stephen Musgrave) Date: Tue, 14 Aug 2007 10:01:37 -0400 Subject: [nycphp-talk] fgetcsv and German characters Message-ID: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> Oh, how I love character encoding problems! ;-) I have a file upload utility whereby the user uploads a CSV document. The file is saved to a temporary folder. I open that document, use fgetcsv() to pull the values and then insert them into a database. The problem is that German characters such as ? and ? are being translated to ? and ? respectively when I echo the values to the browser and when inserted into the DB. I wrote the values to the error log and they come out to \x9f and \x8a respectively. I learned that I should use the setlocale() function for German: $loc_de = setlocale(LC_ALL, 'de_DE'); But that didn't do anything for me. I even tried as shown in the example for setlocale() on php.net: $loc_de = setlocale(LC_ALL, 'de_DE at euro', 'de_DE', 'de', 'ge'); When I echo $loc_de, both say "de_DE" as expected, but it doesn't fix my import problem. I've checked the uploaded file contents and it looks fine. Any suggestions would be appreciated. Thanks, Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Tue Aug 14 10:45:45 2007 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 14 Aug 2007 10:45:45 -0400 Subject: [nycphp-talk] I WOULD LIKE TO UNSUBSCRIBE In-Reply-To: <788308.85279.qm@web43141.mail.sp1.yahoo.com> References: <46C0EAE0.2000102@metalab.unc.edu> <788308.85279.qm@web43141.mail.sp1.yahoo.com> Message-ID: <042801c7de81$cb9f4a30$651ba8c0@MobileZ> Good - then see the footer of every message: > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk H From chsnyder at gmail.com Tue Aug 14 11:20:12 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 14 Aug 2007 11:20:12 -0400 Subject: [nycphp-talk] fgetcsv and German characters In-Reply-To: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> References: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> Message-ID: On 8/14/07, Stephen Musgrave wrote: > Oh, how I love character encoding problems! ;-) > > I have a file upload utility whereby the user uploads a CSV document. The > file is saved to a temporary folder. I open that document, use fgetcsv() to > pull the values and then insert them into a database. > > The problem is that German characters such as ? and ? are being translated > to ? and ? respectively when I echo the values to the browser and when > inserted into the DB. I wrote the values to the error log and they come out > to \x9f and \x8a respectively. > > I learned that I should use the setlocale() function for German: > > $loc_de = setlocale(LC_ALL, 'de_DE'); > > But that didn't do anything for me. I even tried as shown in the example > for setlocale() on php.net: > > $loc_de = setlocale(LC_ALL, 'de_DE at euro', 'de_DE', 'de', 'ge'); > When I echo $loc_de, both say "de_DE" as expected, but it doesn't fix my > import problem. > > I've checked the uploaded file contents and it looks fine. > > Any suggestions would be appreciated. > > Thanks, > > Stephen Locale wouldn't matter in this case; that's primarily useful when generating content (such as formatted dates or gettext translations). You need to figure out what encoding was used on the original csv document, and then use iconv functions or similar to convert it to utf-8 or whatever encoding is being used by your system for storage and display. How to do that? I would open the csv file in a web browser and play with the character encodings until it looked right--View>Character Encoding in Firefox--but there might be a more systematic way... -- Chris Snyder http://chxo.com/ From smanes at magpie.com Tue Aug 14 11:22:05 2007 From: smanes at magpie.com (Steve Manes) Date: Tue, 14 Aug 2007 11:22:05 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: References: Message-ID: <46C1C89D.6030701@magpie.com> Daniel Krook wrote: > Here's a press release put out today on a healthcare provider that appears > to be using XML in DB9 v9 for that sort of thing. Express-C is free (not > open source though) and comes with the pureXML feature. > http://www.ibm.com/press/us/en/pressrelease/22131.wss The health care industry has embraced XML probably more than any other. It's virtually impossible to build EHR/EMR software without XML support and still be compliant. I believe eClinicalWorks stores its data in XML too. From jcampbell1 at gmail.com Tue Aug 14 11:32:44 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Tue, 14 Aug 2007 11:32:44 -0400 Subject: [nycphp-talk] fgetcsv and German characters In-Reply-To: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> References: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> Message-ID: <8f0676b40708140832k7af22d4aw994b1b5d0d030908@mail.gmail.com> Interesting... \x9f and \x8a are not valid Latin-1/8895 characters. My guess is that the CSV's are UTF-8 and your database is Latin-1. If that is the case, try converting the csv to 8859-1 with utf8_decode(). It is a bit of a hack, but it should work if the only languages you support are german/spanish/french/english. If you want your code to work with all languages, you need to change the db encoding to utf8, and make sure all input and output is UTF8. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Tue Aug 14 11:43:17 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 14 Aug 2007 11:43:17 -0400 Subject: XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46C1C89D.6030701@magpie.com> References: <46C1C89D.6030701@magpie.com> Message-ID: On 8/14/07, Steve Manes wrote: > Daniel Krook wrote: > > Here's a press release put out today on a healthcare provider that appears > > to be using XML in DB9 v9 for that sort of thing. Express-C is free (not > > open source though) and comes with the pureXML feature. > > http://www.ibm.com/press/us/en/pressrelease/22131.wss > > The health care industry has embraced XML probably more than any other. > It's virtually impossible to build EHR/EMR software without XML > support and still be compliant. I believe eClinicalWorks stores its > data in XML too. Let's not forget MS embracing XML all over the place, too. I just ran across this in a vCard, which means that directory software and crm systems would also benefit from queryable XML support... http://schemas.microsoft.com/office/outlook/12/electronicbusinesscards -- Chris Snyder http://chxo.com/ From stephen at capellic.com Tue Aug 14 13:03:02 2007 From: stephen at capellic.com (Stephen Musgrave) Date: Tue, 14 Aug 2007 13:03:02 -0400 Subject: [nycphp-talk] fgetcsv and German characters In-Reply-To: References: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> Message-ID: > Locale wouldn't matter in this case; that's primarily useful when > generating content (such as formatted dates or gettext translations). That's odd, because they have examples in the comments in the documentation on php.net that it does. However, my experience is in line with your statement. ;-) > You need to figure out what encoding was used on the original csv > document, and then use iconv functions or similar to convert it to > utf-8 or whatever encoding is being used by your system for storage > and display. > > How to do that? I would open the csv file in a web browser and play > with the character encodings until it looked right--View>Character > Encoding in Firefox--but there might be a more systematic way... I am not on Windows, so Office documents don't open in my browser. Any other suggestions? From stephen at capellic.com Tue Aug 14 13:26:12 2007 From: stephen at capellic.com (Stephen Musgrave) Date: Tue, 14 Aug 2007 13:26:12 -0400 Subject: [nycphp-talk] fgetcsv and German characters In-Reply-To: <8f0676b40708140832k7af22d4aw994b1b5d0d030908@mail.gmail.com> References: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> <8f0676b40708140832k7af22d4aw994b1b5d0d030908@mail.gmail.com> Message-ID: > Interesting... \x9f and \x8a are not valid Latin-1/8895 > characters. My guess is that the CSV's are UTF-8 and your > database is Latin-1. If that is the case, try converting the csv > to 8859-1 with utf8_decode(). I've tried to use utf8_decode() as well as using iconv to translate between UTF-8 AND ISO-8859-1 with no luck. I guess that leads me to believe that the file is encoded in neither of the standards? Is there any way to tell what the encoding is from within Excel? (I didn't see anything in Excel and Google didn't have anything to offer.) I have the original Excel file. > It is a bit of a hack, but it should work if the only languages you > support are german/spanish/french/english. If you want your code > to work with all languages, you need to change the db encoding to > utf8, and make sure all input and output is UTF8. I am not even at the DB layer yet. From jcampbell1 at gmail.com Tue Aug 14 14:03:48 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Tue, 14 Aug 2007 14:03:48 -0400 Subject: [nycphp-talk] fgetcsv and German characters In-Reply-To: References: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> <8f0676b40708140832k7af22d4aw994b1b5d0d030908@mail.gmail.com> Message-ID: <8f0676b40708141103j2d249f16ya222ca6ecf3c16e5@mail.gmail.com> > Is there any way to tell what the encoding is from within Excel? (I > didn't see anything in Excel and Google didn't have anything to > offer.) I have the original Excel file. You will never be able to figure out what is going on from within Excel. Microsoft uses a lot of character set conversion/autodetection magic across their products (heuristic determination of character set). You need to open the csv with a text editor that let's you change the display encoding. Once you know what the source encoding is, and the destination encoding you want, you can use mb_convert_encoding() in most cases. I did some searching and \x9f and \x8a represent ? and ? in MS-1252. From david at davidmintz.org Tue Aug 14 14:23:40 2007 From: david at davidmintz.org (David Mintz) Date: Tue, 14 Aug 2007 14:23:40 -0400 Subject: [nycphp-talk] Debugging Zend_Db SQL In-Reply-To: <46BC6C99.6050107@dailytechnology.net> References: <46BB341F.20106@dailytechnology.net> <9DD06888-9072-45A9-A3BE-26FF959EA14F@jonbaer.com> <46BC6C99.6050107@dailytechnology.net> Message-ID: <721f1cc50708141123k329624cbu11b6af9fcb2b6b6e@mail.gmail.com> And you will want 'profiler' => true in your db config. On 8/10/07, Brian Dailey wrote: > > For future reference, the easiest way (in postDispatch()) was: > > $dbAdapter = Zend_Registry::get( 'dbAdapter' ); > $profiler = $dbAdapter->getProfiler( ); > $query = $profiler->getLastQueryProfile( ); > echo $query->getQuery( ); > > - Brian > > > Jon Baer wrote: > > From what I recall most of the framework objects should already have a > > __toString() overload on them so you can just echo/dump the select > itself. > > > > - Jon > > > > On Aug 9, 2007, at 11:34 AM, Brian Dailey wrote: > > > >> I'm just starting to dabble with Zend's framework, and I don't see an > >> easy way to check what the SQL output is when I'm executing a > >> statement. I'd like to just output the whole query so I can monitor > >> what it's sending. Does anyone know a quick & dirty way to do this? > >> > >> > >> -- > >> > >> Thanks! > >> - Brian Dailey > >> Software Developer > >> New York, NY > >> www.dailytechnology.net >_______________________________________________ > >> > >> New York PHP Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> NYPHPCon 2006 Presentations Online > >> http://www.nyphpcon.com > >> > >> Show Your Participation in New York PHP > >> http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > > > > -- > > Thanks! > - Brian Dailey > Software Developer > New York, NY > www.dailytechnology.net > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > -- 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 lists at zaunere.com Tue Aug 14 15:08:24 2007 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 14 Aug 2007 15:08:24 -0400 Subject: [nycphp-talk] Many pages: one script In-Reply-To: References: <46B60C11.2090904@metalab.unc.edu><000c01c7d790$5e66b400$651ba8c0@MobileZ> Message-ID: <04ff01c7dea6$7d3d5f60$651ba8c0@MobileZ> Rob Marscher wrote on Monday, August 06, 2007 10:50 AM: > On Aug 5, 2007, at 2:42 PM, Hans Zaunere wrote: > > AliasMatch /(.*) "/var/www/www.something.com/index.php" > > http://httpd.apache.org/docs/2.0/mod/mod_alias.html#aliasmatch > > I wonder why the major php frameworks don't mention this as an > option? It seems from the documentation that it can't go > in .htaccess - so that may be why. The frameworks are assuming most > of their users are on shared servers and can't modify their httpd > config. Yeah, that's probably why. We only ever work in large deployments, which of course have dedicated servers. .htaccess is thus evil, and slower. Neither clients nor I ever intend to support free-hosting-of-the-month-club.com for our applications. > If there was an existing file... say favicon.ico... would AliasMatch > know to just serve that up instead of sending through index.php? Yes - Apache is already aware of the extensions of files for which to process through PHP. The /support/ alias in my example is really just for convenience and to keep developers in line. Apache already knows how to serve files correctly because of AddType (or even ForceType) and their extension. Thus, a .php file will trigger the auto_prepend to fire, and startup the application framework. > That's one thing I like about the following mod_rewrite rule - if the > file or directory exists, it won't pass it to the index.php front > controller: > RewriteCond %{SCRIPT_FILENAME} !-f > RewriteCond %{SCRIPT_FILENAME} !-d > RewriteRule ^(.*)$ index.php/$1 So using a rewrite rule is redundant, and a hack in my opinion. This is the fundamental difference between rewriting and aliasing. --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From aw at sap8.com Tue Aug 14 15:01:37 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Tue, 14 Aug 2007 15:01:37 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? Message-ID: <00a801c7dea5$8a388b00$9ea9a100$@com> I have been staring at this for about a week and it is turning into a mind bender. Here is the code excerpt: // pre: none // post: displays our controls for . function displayControls() { if($_POST['editjob']) { $query = "SELECT * FROM `jobsdb` WHERE `id` =".$_POST['id'].""; $result = mysql_query($query) or die("Error editing data."); $row = mysql_fetch_assoc($result, MYSQL_ASSOC); echo "Debug: ".$_POST['id']." - ".$row['id']."\n"; // display all our form data echo "
Edit a job\n". "
\n". "Recruiter:
". " Job ID:
". " Position:
". " Position Link:
". " Additional Info:
". " Salary:
". " Hiring Manager:
". " Company:
". " Status:
". " Postings:
". " Job Color: \n". "\n". "". "". "
". "
\n"; } ... Rest of application. Now the big problem are the three PHP statements after the "if" statement. When I click edit job nothing appears even in the debug statement, I am not returning a valid id from $row['id'] nor does any of the data appear in the form(which is just an integer). I have scrutinized the SQL query a million times, even tried to qualify it with the database name using `foobar`.`jobsdb` and that still not do anything. I know the $_POST['id'] variable is passing the right id based on the echo command. Is this a SQL issue or a PHP issue? I have looked at my databases in phpMyAdmin and even checked them using the command line on our box and they have the right permissions for the users that can access them. If this is a SQL issue can you guys point me in the right direction? I was thinking of pulling my data base handle code and the SQL queries and just throwing them into a bare script to see what happens. If anyone needs to see the HTML output I can get that as well. Any help is appreciated. Thanks, Anthony -------------- next part -------------- An HTML attachment was scrubbed... URL: From gatzby3jr at gmail.com Tue Aug 14 15:25:44 2007 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Tue, 14 Aug 2007 15:25:44 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <00a801c7dea5$8a388b00$9ea9a100$@com> References: <00a801c7dea5$8a388b00$9ea9a100$@com> Message-ID: <29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com> Hmm, have you tried outputting the results of $_POST['editjob']? It might not be set to something that evaluates to true, which would cause none of the information you're looking for to be processed. On 8/14/07, Anthony Wlodarski wrote: > > I have been staring at this for about a week and it is turning into a > mind bender. Here is the code excerpt: > > > > // pre: none > > // post: displays our controls for ? > > function displayControls() > > { > > if($_POST['editjob']) > > { > > $query = "SELECT * FROM `jobsdb` WHERE `id` > =".$_POST['id'].""; > > $result = mysql_query($query) or die("Error editing > data."); > > $row = mysql_fetch_assoc($result, MYSQL_ASSOC); > > > > echo "Debug: ".$_POST['id']." - ".$row['id']."\n"; > > > > // display all our form data > > echo "
Edit a > job\n". > > "
method='post'>\n". > > "Recruiter: type='text' value='".$row['recruiter']."'>
". > > " Job ID: value='".$row['jobid']."'>
". > > " Position: type='text' value='".$row['position']."'>
". > > " Position Link: type='text' value='".$row['link']."'>
". > > " Additional Info: name='additionalinfo' type='text' value='".$row['additionalinfo']."'>
". > > " Salary: value='".$row['salary']."'>
". > > " Hiring Manager: name='hiringmanager' type='text' value='".$row['hiringmanager']."''>
". > > " Company: type='text' value='".$row['company']."'>
". > > " Status: value='".$row['status']."'>
". > > " Postings: type='text' value='".$row['postings']."'>
". > > " Job Color: \n". > > "\n". > > " value='Save Edit'>". > > " value='Cancel'>". > > "
". > > "
\n"; > > } > > > > ??. Rest of application. > > > > Now the big problem are the three PHP statements after the "if" > statement. When I click edit job nothing appears even in the debug > statement, I am not returning a valid id from $row['id'] nor does any of the > data appear in the form(which is just an integer). I have scrutinized the > SQL query a million times, even tried to qualify it with the database name > using `foobar`.`jobsdb` and that still not do anything. I know the > $_POST['id'] variable is passing the right id based on the echo command. Is > this a SQL issue or a PHP issue? I have looked at my databases in > phpMyAdmin and even checked them using the command line on our box and they > have the right permissions for the users that can access them. If this is > a SQL issue can you guys point me in the right direction? I was thinking of > pulling my data base handle code and the SQL queries and just throwing them > into a bare script to see what happens. If anyone needs to see the HTML > output I can get that as well. > > > > Any help is appreciated. > > > > Thanks, > > > > *Anthony* > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From cahoyos at us.ibm.com Tue Aug 14 15:37:12 2007 From: cahoyos at us.ibm.com (Carlos A Hoyos) Date: Tue, 14 Aug 2007 15:37:12 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <00a801c7dea5$8a388b00$9ea9a100$@com> Message-ID: > I have been staring at this for about a week and it is turning into > a mind bender. Here is the code excerpt: I'm sure you'll get plenty of comments on not directly passing a posted variable to your query, as you're app is open to sql injection, so I'll leave it at that. On quick inspection, function mysql_fetch_assoc only takes one parameter... this might be a problem. mysql_fetch_assoc If not, you can try echoing the whole query (echo $query).. that way you'll know what command is being passed to mysql... run it on the command line and see if it is returning anything. Carlos Hoyos From aw at sap8.com Tue Aug 14 15:44:25 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Tue, 14 Aug 2007 15:44:25 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com> References: <00a801c7dea5$8a388b00$9ea9a100$@com> <29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com> Message-ID: <00da01c7deab$852f4530$8f8dcf90$@com> It does evaluate to true every time, as I wouldn't get to the debug echo statement in the application. I put it in its own script and added a few lines, here is the test script: "; echo "Debug data
"; echo "id ".$row['id'].""; // close our database handle mysql_close($dbh); ?> I gave it the id of 1 because I know it does exist in the database, this is the output: Resource id #3 Debug data id Nothing in $row and since I have never echoed a raw result ($result) from the query can anyone explain what it might possibly be? Anthony From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Brian O'Connor Sent: Tuesday, August 14, 2007 3:26 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Is there something wrong with this SQL query in PHP? Hmm, have you tried outputting the results of $_POST['editjob']? It might not be set to something that evaluates to true, which would cause none of the information you're looking for to be processed. On 8/14/07, Anthony Wlodarski wrote: I have been staring at this for about a week and it is turning into a mind bender. Here is the code excerpt: // pre: none // post: displays our controls for . function displayControls() { if($_POST['editjob']) { $query = "SELECT * FROM `jobsdb` WHERE `id` =".$_POST['id'].""; $result = mysql_query($query) or die("Error editing data."); $row = mysql_fetch_assoc($result, MYSQL_ASSOC); echo "Debug: ".$_POST['id']." - ".$row['id']."\n"; // display all our form data echo "
Edit a job\n". "
\n". "Recruiter:
". " Job ID:
". " Position:
". " Position Link:
". " Additional Info:
". " Salary:
". " Hiring Manager:
". " Company:
". " Status:
". " Postings:
". " Job Color: \n". "\n". "". "". "
". "
\n"; } ... Rest of application. Now the big problem are the three PHP statements after the "if" statement. When I click edit job nothing appears even in the debug statement, I am not returning a valid id from $row['id'] nor does any of the data appear in the form(which is just an integer). I have scrutinized the SQL query a million times, even tried to qualify it with the database name using `foobar`.`jobsdb` and that still not do anything. I know the $_POST['id'] variable is passing the right id based on the echo command. Is this a SQL issue or a PHP issue? I have looked at my databases in phpMyAdmin and even checked them using the command line on our box and they have the right permissions for the users that can access them. If this is a SQL issue can you guys point me in the right direction? I was thinking of pulling my data base handle code and the SQL queries and just throwing them into a bare script to see what happens. If anyone needs to see the HTML output I can get that as well. Any help is appreciated. Thanks, Anthony _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From support at dailytechnology.net Tue Aug 14 15:52:34 2007 From: support at dailytechnology.net (Brian Dailey) Date: Tue, 14 Aug 2007 15:52:34 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <00a801c7dea5$8a388b00$9ea9a100$@com> References: <00a801c7dea5$8a388b00$9ea9a100$@com> Message-ID: <46C20802.2090708@dailytechnology.net> I would take Brian O'Connor's suggestion, first... make sure you're getting the expected values in $_POST. Use var_dump($_POST) to get all of the values. Also, I don't know if you're already checking this or not, but given the SQL statement you provided your application is definitely open for SQL injection. If I post a value where id = [1=1;DROP TABLE jobsdb] I could create some massive headaches for you. Make sure you're clearly defining datavalues by using either prepared statements or some sort of mysql_real_escape function (wrapping each value in slashes in the query itself, too, even if it's an integer). - Brian D. Anthony Wlodarski wrote: > I have been staring at this for about a week and it is turning into a > mind bender. Here is the code excerpt: > > > > // pre: none > > // post: displays our controls for ? > > function displayControls() > > { > > if($_POST['editjob']) > > { > > $query = "SELECT * FROM `jobsdb` WHERE `id` > =".$_POST['id']."?; > > $result = mysql_query($query) or die("Error editing data."); > > $row = mysql_fetch_assoc($result, MYSQL_ASSOC); > > > > echo "Debug: ".$_POST['id']." - ".$row['id']."\n"; > > > > // display all our form data > > echo "
Edit a > job\n". > > "
method='post'>\n". > > "Recruiter: type='text' value='".$row['recruiter']."'>
". > > " Job ID: type='text' value='".$row['jobid']."'>
". > > " Position: type='text' value='".$row['position']."'>
". > > " Position Link: type='text' value='".$row['link']."'>
". > > " Additional Info: name='additionalinfo' type='text' value='".$row['additionalinfo']."'>
". > > " Salary: type='text' value='".$row['salary']."'>
". > > " Hiring Manager: name='hiringmanager' type='text' value='".$row['hiringmanager']."''>
". > > " Company: type='text' value='".$row['company']."'>
". > > " Status: type='text' value='".$row['status']."'>
". > > " Postings: type='text' value='".$row['postings']."'>
". > > " Job Color: \n". > > "\n". > > " value='Save Edit'>". > > " value='Cancel'>". > > "
". > > "
\n"; > > } > > > > ??. Rest of application. > > > > Now the big problem are the three PHP statements after the ?if? > statement. When I click edit job nothing appears even in the debug > statement, I am not returning a valid id from $row[?id?] nor does any of > the data appear in the form(which is just an integer). I have > scrutinized the SQL query a million times, even tried to qualify it with > the database name using `foobar`.`jobsdb` and that still not do > anything. I know the $_POST[?id?] variable is passing the right id > based on the echo command. Is this a SQL issue or a PHP issue? I have > looked at my databases in phpMyAdmin and even checked them using the > command line on our box and they have the right permissions for the > users that can access them. If this is a SQL issue can you guys point > me in the right direction? I was thinking of pulling my data base > handle code and the SQL queries and just throwing them into a bare > script to see what happens. If anyone needs to see the HTML output I > can get that as well. > > > > Any help is appreciated. > > > > Thanks, > > > > /Anthony/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Thanks! - Brian Dailey Software Developer New York, NY www.dailytechnology.net -------------- next part -------------- A non-text attachment was scrubbed... Name: support.vcf Type: text/x-vcard Size: 264 bytes Desc: not available URL: From aw at sap8.com Tue Aug 14 15:56:55 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Tue, 14 Aug 2007 15:56:55 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <00da01c7deab$852f4530$8f8dcf90$@com> References: <00a801c7dea5$8a388b00$9ea9a100$@com> <29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com> <00da01c7deab$852f4530$8f8dcf90$@com> Message-ID: <00ed01c7dead$44251d60$cc6f5820$@com> Ran the query from the command line this was the output: mysql> SELECT * FROM `jobsdb`.`jobsdb` WHERE `id` =1; +----+-----------+---------+----------+---------+----------------+--------+- --------------+---------+--------+----------+---------+ | id | recruiter | jobid | position | link | additionalinfo | salary | hiringmanager | company | status | postings | color | +----+-----------+---------+----------+---------+----------------+--------+- --------------+---------+--------+----------+---------+ | 1 | lskdfj | lsdkjfl | lskdjf | slkdjfl | sldkfjsl | lskdjf | sldkfj | dlskfj | lskdjf | sldkfj | #ff0000 | +----+-----------+---------+----------+---------+----------------+--------+- --------------+---------+--------+----------+---------+ 1 row in set (0.00 sec) It is correct since I only put in garbage data to test it. And here is the results of the script when I echoed the $query variable: SELECT * FROM `jobsdb`.`jobsdb` WHERE `id` =1; Resource id #3 Debug data id So I will definitely in the future keep an out for direct $_POST variables directly in a SQL query (I will just save a local copy from now on and use that.). Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Anthony Wlodarski Sent: Tuesday, August 14, 2007 3:44 PM To: 'NYPHP Talk' Subject: RE: [nycphp-talk] Is there something wrong with this SQL query in PHP? It does evaluate to true every time, as I wouldn't get to the debug echo statement in the application. I put it in its own script and added a few lines, here is the test script: "; echo "Debug data
"; echo "id ".$row['id'].""; // close our database handle mysql_close($dbh); ?> I gave it the id of 1 because I know it does exist in the database, this is the output: Resource id #3 Debug data id Nothing in $row and since I have never echoed a raw result ($result) from the query can anyone explain what it might possibly be? Anthony From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Brian O'Connor Sent: Tuesday, August 14, 2007 3:26 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Is there something wrong with this SQL query in PHP? Hmm, have you tried outputting the results of $_POST['editjob']? It might not be set to something that evaluates to true, which would cause none of the information you're looking for to be processed. On 8/14/07, Anthony Wlodarski wrote: I have been staring at this for about a week and it is turning into a mind bender. Here is the code excerpt: // pre: none // post: displays our controls for . function displayControls() { if($_POST['editjob']) { $query = "SELECT * FROM `jobsdb` WHERE `id` =".$_POST['id'].""; $result = mysql_query($query) or die("Error editing data."); $row = mysql_fetch_assoc($result, MYSQL_ASSOC); echo "Debug: ".$_POST['id']." - ".$row['id']."\n"; // display all our form data echo "
Edit a job\n". "
\n". "Recruiter:
". " Job ID:
". " Position:
". " Position Link:
". " Additional Info:
". " Salary:
". " Hiring Manager:
". " Company:
". " Status:
". " Postings:
". " Job Color: \n". "\n". "". "". "
". "
\n"; } ... Rest of application. Now the big problem are the three PHP statements after the "if" statement. When I click edit job nothing appears even in the debug statement, I am not returning a valid id from $row['id'] nor does any of the data appear in the form(which is just an integer). I have scrutinized the SQL query a million times, even tried to qualify it with the database name using `foobar`.`jobsdb` and that still not do anything. I know the $_POST['id'] variable is passing the right id based on the echo command. Is this a SQL issue or a PHP issue? I have looked at my databases in phpMyAdmin and even checked them using the command line on our box and they have the right permissions for the users that can access them. If this is a SQL issue can you guys point me in the right direction? I was thinking of pulling my data base handle code and the SQL queries and just throwing them into a bare script to see what happens. If anyone needs to see the HTML output I can get that as well. Any help is appreciated. Thanks, Anthony _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From shaijudavis at gmail.com Tue Aug 14 16:07:51 2007 From: shaijudavis at gmail.com (shaiju davis) Date: Wed, 15 Aug 2007 01:37:51 +0530 Subject: [nycphp-talk] Problem with popup in Internet Explorer Message-ID: <30ce306c0708141307l6150fec3gcf31b361a0583732@mail.gmail.com> Hi All, When I try to call some javascript function for the popup window, it shows a message(popup blocked..To see this popup click here) in IE. I dont want to do any change in the brower settings. The problem comes while I call the function from AJAX request. When I try with href="javascript:popup("")", it works fine. IF any one has idea please reply ASAP.. Thanks in advance, Shaiju -------------- next part -------------- An HTML attachment was scrubbed... URL: From cahoyos at us.ibm.com Tue Aug 14 16:07:46 2007 From: cahoyos at us.ibm.com (Carlos A Hoyos) Date: Tue, 14 Aug 2007 16:07:46 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <00ed01c7dead$44251d60$cc6f5820$@com> Message-ID: In case this wasn't clear... > On quick inspection, function mysql_fetch_assoc only takes one parameter... > this might be a problem. mysql_fetch_assoc Try Removing the second parameter from function mysql_fetch_assoc, i.e. take out the MYSQL_ASSOC to read $row = mysql_fetch_assoc($result); Carlos Hoyos From aw at sap8.com Tue Aug 14 16:24:37 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Tue, 14 Aug 2007 16:24:37 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: References: <00ed01c7dead$44251d60$cc6f5820$@com> Message-ID: <00fe01c7deb1$228f68f0$67ae3ad0$@com> TADA! We have a winner! The function was bogging down on the second parameter. I think I copied the code from an earlier project and forgot to check the function syntax and now the echo statement is returning a 1 so we know it is right on now (also made changes in the main application and it is correctly working). Some things I will work on in regards to future development are this SQL injection and correct checking before the query is ran. Thanks everyone! Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Carlos A Hoyos Sent: Tuesday, August 14, 2007 4:08 PM To: NYPHP Talk Subject: RE: [nycphp-talk] Is there something wrong with this SQL query in PHP? In case this wasn't clear... > On quick inspection, function mysql_fetch_assoc only takes one parameter... > this might be a problem. mysql_fetch_assoc Try Removing the second parameter from function mysql_fetch_assoc, i.e. take out the MYSQL_ASSOC to read $row = mysql_fetch_assoc($result); Carlos Hoyos _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From rmarscher at beaffinitive.com Tue Aug 14 16:59:40 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Tue, 14 Aug 2007 16:59:40 -0400 Subject: [nycphp-talk] fgetcsv and German characters In-Reply-To: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> References: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> Message-ID: On Aug 14, 2007, at 10:01 AM, Stephen Musgrave wrote: > Oh, how I love character encoding problems! ;-) Indeed... there's so many levels where they can get messed up -- the way the text was originally encoded, anything that php might do to it, the database column character encoding, the database client connection encoding, anything php might do to it again, the way apache serves it, the encoding specified in the html, and finally the browser character encoding setting. > The problem is that German characters such as ? and ? are being > translated to ? and ? respectively when I echo the values to the > browser and when inserted into the DB. I wrote the values to the > error log and they come out to \x9f and \x8a respectively. Maybe you should publicly post a stripped down file that demonstrates the problem so that we can pull it down and take a look. If you create your own csv with those characters (vs. the ones your user(s) have uploaded), can you reproduce the problem? [tip... on osx, press option-u and then u to create ? and option-u and then a to create ?] Do you have the mbstring extension? If so, what does running the text through mb_detect_encoding give you? When can we all agree that the extra disk space needed for every app to use utf8 is worth it? :) Rob From chsnyder at gmail.com Tue Aug 14 17:00:16 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 14 Aug 2007 17:00:16 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <00ed01c7dead$44251d60$cc6f5820$@com> References: <00a801c7dea5$8a388b00$9ea9a100$@com> <29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com> <00da01c7deab$852f4530$8f8dcf90$@com> <00ed01c7dead$44251d60$cc6f5820$@com> Message-ID: On 8/14/07, Anthony Wlodarski wrote: > > So I will definitely in the future keep an out for direct $_POST variables > directly in a SQL query (I will just save a local copy from now on and use > that.). No, you're missing the point. It isn't direct use of the variable from $_POST, it's that the value might contain quotes or other characters that can cause the database to execute SQL that you don't expect. Use the mysql_real_escape_string() function on all values before including them in a query: $query = "SELECT * FROM `jobsdb` WHERE `id` =".mysql_real_escape_string($_POST['id']).""; -- Chris Snyder http://chxo.com/ From ben at projectskyline.com Tue Aug 14 17:14:37 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Tue, 14 Aug 2007 17:14:37 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? References: <00a801c7dea5$8a388b00$9ea9a100$@com><29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com><00da01c7deab$852f4530$8f8dcf90$@com><00ed01c7dead$44251d60$cc6f5820$@com> Message-ID: <00f801c7deb8$1fdd1600$6401a8c0@gamebox> Hello, I just did a security audit for a site. This was a huge problem they had: doing, "...where id = $_POST['id']" Not only can you run sql commands you could update all the records where id=1 or id > 1 via SQL injection. The larger problem they had was that all the sql was being hardcoded, no use of a function anywhere. We had to go back and remove all the SQL to be called from a function, then have that function do the proper validation. They had the exact same problems w/XSS, no input validation. Chris, nice book btw, my #1 reference for PHP Security. - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "csnyder" To: "NYPHP Talk" Sent: Tuesday, August 14, 2007 5:00 PM Subject: Re: [nycphp-talk] Is there something wrong with this SQL query in PHP? > On 8/14/07, Anthony Wlodarski wrote: >> >> So I will definitely in the future keep an out for direct $_POST >> variables >> directly in a SQL query (I will just save a local copy from now on and >> use >> that.). > > No, you're missing the point. It isn't direct use of the variable from > $_POST, it's that the value might contain quotes or other characters > that can cause the database to execute SQL that you don't expect. > > Use the mysql_real_escape_string() function on all values before > including them in a query: > > $query = "SELECT * FROM `jobsdb` WHERE `id` > =".mysql_real_escape_string($_POST['id']).""; > > > -- > Chris Snyder > http://chxo.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From paulcheung at tiscali.co.uk Tue Aug 14 17:20:16 2007 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Tue, 14 Aug 2007 22:20:16 +0100 Subject: [nycphp-talk] queuing data References: <10280-70933@sneakemail.com> Message-ID: <000601c7deb8$e8e61510$0300a8c0@X9183> Can anybody help I am not sure if this is PHP or MySQL. I query a MySQL table for example - $sql = "SELECT * FROM school_table WHERE class = '2005' ORDER BY students"; and 24 records are returned. I then want to view each record individually in an HTML form formatted to look like the HTML form that the data was originally written to the table in. This is not the problem. The problem is how do I queue the returned records and then back each record individually, one by one, view, get next record and so on until all the returned records have been read? From michael.southwell at nyphp.com Tue Aug 14 17:29:35 2007 From: michael.southwell at nyphp.com (Michael Southwell) Date: Tue, 14 Aug 2007 17:29:35 -0400 Subject: [nycphp-talk] queuing data In-Reply-To: <000601c7deb8$e8e61510$0300a8c0@X9183> References: <10280-70933@sneakemail.com> <000601c7deb8$e8e61510$0300a8c0@X9183> Message-ID: <6.2.3.4.2.20070814172623.02919fa8@pop.nyphp.com> >The problem is how do I queue the returned records and then back >each record individually, one by one, view, get next record and so >on until all the returned records have been read? save what is returned in a session, along with a total count of rows. redirect to a display page where you can step through the records with a calculated pointer to current/previous/next Michael Southwell, Vice President for Education New York PHP http://www.nyphp.com/training - In-depth PHP Training Courses From chsnyder at gmail.com Tue Aug 14 17:29:27 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 14 Aug 2007 17:29:27 -0400 Subject: [nycphp-talk] fgetcsv and German characters In-Reply-To: References: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> Message-ID: On 8/14/07, Rob Marscher wrote: > > When can we all agree that the extra disk space needed for every app > to use utf8 is worth it? :) > Sometime around 2003... ;-) -- Chris Snyder http://chxo.com/ From jcampbell1 at gmail.com Tue Aug 14 20:31:12 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Tue, 14 Aug 2007 20:31:12 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <00f801c7deb8$1fdd1600$6401a8c0@gamebox> References: <00a801c7dea5$8a388b00$9ea9a100$@com> <29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com> <00da01c7deab$852f4530$8f8dcf90$@com> <00ed01c7dead$44251d60$cc6f5820$@com> <00f801c7deb8$1fdd1600$6401a8c0@gamebox> Message-ID: <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> > They had the exact same problems w/XSS, no input validation. Input validation? Don't you mean output escaping? You must not allow uber leet usernames like |<33|>. :) -john cambpell From ben at projectskyline.com Tue Aug 14 21:15:09 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Tue, 14 Aug 2007 21:15:09 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? References: <00a801c7dea5$8a388b00$9ea9a100$@com><29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com><00da01c7deab$852f4530$8f8dcf90$@com><00ed01c7dead$44251d60$cc6f5820$@com><00f801c7deb8$1fdd1600$6401a8c0@gamebox> <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> Message-ID: <017201c7ded9$b9964110$6401a8c0@gamebox> heh, Yeah I guess. They weren't validating the users input. = ] - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons ----- Original Message ----- From: "John Campbell" To: "NYPHP Talk" Sent: Tuesday, August 14, 2007 8:31 PM Subject: Re: [nycphp-talk] Is there something wrong with this SQL query in PHP? >> They had the exact same problems w/XSS, no input validation. > > Input validation? Don't you mean output escaping? You must not allow > uber leet usernames like |<33|>. :) > > -john cambpell > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From aw at sap8.com Wed Aug 15 08:24:51 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 15 Aug 2007 08:24:51 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <017201c7ded9$b9964110$6401a8c0@gamebox> References: <00a801c7dea5$8a388b00$9ea9a100$@com><29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com><00da01c7deab$852f4530$8f8dcf90$@com><00ed01c7dead$44251d60$cc6f5820$@com><00f801c7deb8$1fdd1600$6401a8c0@gamebox> <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> <017201c7ded9$b9964110$6401a8c0@gamebox> Message-ID: <001b01c7df37$4769a650$d63cf2f0$@com> I ran a test (just added a SQL command, harmless one in a text field) to see what happens on SQL injection, without proper slashing or escaping (addslashes/mysql_real_escape_string). I like mysql_real... cause it takes the guess work out of making the data safe. Thanks everyone for the brief lesson on the dangers of this (now I get to go back to all my INSERT/UPDATE queries and add this functionality, better safe than sorry). Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Ben Sgro (ProjectSkyLine) Sent: Tuesday, August 14, 2007 9:15 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Is there something wrong with this SQL query in PHP? heh, Yeah I guess. They weren't validating the users input. = ] - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons ----- Original Message ----- From: "John Campbell" To: "NYPHP Talk" Sent: Tuesday, August 14, 2007 8:31 PM Subject: Re: [nycphp-talk] Is there something wrong with this SQL query in PHP? >> They had the exact same problems w/XSS, no input validation. > > Input validation? Don't you mean output escaping? You must not allow > uber leet usernames like |<33|>. :) > > -john cambpell > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From gatzby3jr at gmail.com Wed Aug 15 08:34:58 2007 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Wed, 15 Aug 2007 08:34:58 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <001b01c7df37$4769a650$d63cf2f0$@com> References: <00a801c7dea5$8a388b00$9ea9a100$@com> <29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com> <00da01c7deab$852f4530$8f8dcf90$@com> <00ed01c7dead$44251d60$cc6f5820$@com> <00f801c7deb8$1fdd1600$6401a8c0@gamebox> <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> <017201c7ded9$b9964110$6401a8c0@gamebox> <001b01c7df37$4769a650$d63cf2f0$@com> Message-ID: <29da5d150708150534s6bc6be55j14ca338573f53d47@mail.gmail.com> >From what I understand, it's all queries that need this protection, not just INSERT/UPDATE. One example that Brian Dailey gave was with your original query $query = "SELECT * FROM `jobsdb` WHERE `id` =".$_POST['id'].""; Someone could supply in $_POST['id']: 1; DROP `jobsdb`; This could easily be transferred to: SELECT * FROM `jobsdb` WHERE `id` = ".$_POST['id'].""; and $_POST['id'] could still contain 1; DROP `jobsdb` thus the full query would result in SELECT * FROM `jobsdb` WHERE `id`=1; DROP `jobsdb` This is my understanding however, and I could be wrong. Any clarification on the subject would be nice. On 8/15/07, Anthony Wlodarski wrote: > > I ran a test (just added a SQL command, harmless one in a text field) to > see > what happens on SQL injection, without proper slashing or escaping > (addslashes/mysql_real_escape_string). I like mysql_real... cause it > takes > the guess work out of making the data safe. Thanks everyone for the brief > lesson on the dangers of this (now I get to go back to all my > INSERT/UPDATE > queries and add this functionality, better safe than sorry). > > Anthony Wlodarski > Senior Technical Recruiter > Shulman Fleming & Partners > 646-285-0500 x230 > aw at sap8.com > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On > Behalf Of Ben Sgro (ProjectSkyLine) > Sent: Tuesday, August 14, 2007 9:15 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Is there something wrong with this SQL query in > PHP? > > heh, > > Yeah I guess. They weren't validating the users input. = ] > > - Ben > > Ben Sgro, Chief Engineer > ProjectSkyLine - Defining New Horizons > > ----- Original Message ----- > From: "John Campbell" > To: "NYPHP Talk" > Sent: Tuesday, August 14, 2007 8:31 PM > Subject: Re: [nycphp-talk] Is there something wrong with this SQL query in > PHP? > > > >> They had the exact same problems w/XSS, no input validation. > > > > Input validation? Don't you mean output escaping? You must not allow > > uber leet usernames like |<33|>. :) > > > > -john cambpell > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From aw at sap8.com Wed Aug 15 08:42:45 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 15 Aug 2007 08:42:45 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <29da5d150708150534s6bc6be55j14ca338573f53d47@mail.gmail.com> References: <00a801c7dea5$8a388b00$9ea9a100$@com> <29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com> <00da01c7deab$852f4530$8f8dcf90$@com> <00ed01c7dead$44251d60$cc6f5820$@com> <00f801c7deb8$1fdd1600$6401a8c0@gamebox> <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> <017201c7ded9$b9964110$6401a8c0@gamebox> <001b01c7df37$4769a650$d63cf2f0$@com> <29da5d150708150534s6bc6be55j14ca338573f53d47@mail.gmail.com> Message-ID: <002201c7df39$c763b9c0$562b2d40$@com> That would be horrendous if someone did that. Alright all my queries get updated then. I didn't know that a SQL query string in PHP could contain more than one command (I am so new to PHP/MySQL) but I guess as long as there is a delimiter (";") any number of commands could be run, malicious or not. Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Brian O'Connor Sent: Wednesday, August 15, 2007 8:35 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Is there something wrong with this SQL query in PHP? >From what I understand, it's all queries that need this protection, not just INSERT/UPDATE. One example that Brian Dailey gave was with your original query $query = "SELECT * FROM `jobsdb` WHERE `id` =".$_POST['id'].""; Someone could supply in $_POST['id']: 1; DROP `jobsdb`; This could easily be transferred to: SELECT * FROM `jobsdb` WHERE `id` = ".$_POST['id'].""; and $_POST['id'] could still contain 1; DROP `jobsdb` thus the full query would result in SELECT * FROM `jobsdb` WHERE `id`=1; DROP `jobsdb` This is my understanding however, and I could be wrong. Any clarification on the subject would be nice. On 8/15/07, Anthony Wlodarski wrote: I ran a test (just added a SQL command, harmless one in a text field) to see what happens on SQL injection, without proper slashing or escaping (addslashes/mysql_real_escape_string). I like mysql_real... cause it takes the guess work out of making the data safe. Thanks everyone for the brief lesson on the dangers of this (now I get to go back to all my INSERT/UPDATE queries and add this functionality, better safe than sorry). Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Ben Sgro (ProjectSkyLine) Sent: Tuesday, August 14, 2007 9:15 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Is there something wrong with this SQL query in PHP? heh, Yeah I guess. They weren't validating the users input. = ] - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons ----- Original Message ----- From: "John Campbell" To: "NYPHP Talk" Sent: Tuesday, August 14, 2007 8:31 PM Subject: Re: [nycphp-talk] Is there something wrong with this SQL query in PHP? >> They had the exact same problems w/XSS, no input validation. > > Input validation? Don't you mean output escaping? You must not allow > uber leet usernames like |<33|>. :) > > -john cambpell > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From aw at sap8.com Wed Aug 15 09:06:39 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 15 Aug 2007 09:06:39 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <002201c7df39$c763b9c0$562b2d40$@com> References: <00a801c7dea5$8a388b00$9ea9a100$@com> <29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com> <00da01c7deab$852f4530$8f8dcf90$@com> <00ed01c7dead$44251d60$cc6f5820$@com> <00f801c7deb8$1fdd1600$6401a8c0@gamebox> <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> <017201c7ded9$b9964110$6401a8c0@gamebox> <001b01c7df37$4769a650$d63cf2f0$@com> <29da5d150708150534s6bc6be55j14ca338573f53d47@mail.gmail.com> <002201c7df39$c763b9c0$562b2d40$@com> Message-ID: <002d01c7df3d$1dfd7f20$59f87d60$@com> So I was doing some reading on magic quotes and wrote a simple check to see if it is on or not. On our box magic quotes are disabled (which is the way I would prefer it, I would rather manually add my own slashes to sequences that need it) but my shared hosting has magic quotes enabled. Now I know the admin of the shared hosting is not going to turn off magic quotes because not everyone that uses the services are diligent programmers. So let us say magic quotes are on and I have a string like so. $str = "You're didn't dood it."; So if that is passed to a different script in say a $_POST['str'] variable would then the string look like "You\'re didn\'t dood it."? Now even if magic quotes are enabled and I use mysql_real_escape_str($_POST['str']) would the string then look like "You\\\'re didn\\\'t dood it."? I am just trying to find a safe practice for every time I have to use a SQL query. Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen at capellic.com Wed Aug 15 09:13:16 2007 From: stephen at capellic.com (Stephen Musgrave) Date: Wed, 15 Aug 2007 09:13:16 -0400 Subject: [nycphp-talk] fgetcsv and German characters In-Reply-To: References: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> Message-ID: <575AAAD6-98AD-40F0-B010-C598F531DE23@capellic.com> All - Thanks for your suggestions. We ran out of time on addressing this issue (technically), so we decided to "Romanize" (boooo!) the input. I know, I do feel like a defeatist, but it's not my budget! I did not use mb_detect_encoding, but that sounds like something that would help. And the chant goes up: UTF-8! UTF-8! UTF-8! On Aug 14, 2007, at 4:59 PM, Rob Marscher wrote: > On Aug 14, 2007, at 10:01 AM, Stephen Musgrave wrote: >> Oh, how I love character encoding problems! ;-) > Indeed... there's so many levels where they can get messed up -- > the way the text was originally encoded, anything that php might do > to it, the database column character encoding, the database client > connection encoding, anything php might do to it again, the way > apache serves it, the encoding specified in the html, and finally > the browser character encoding setting. > >> The problem is that German characters such as ? and ? are being >> translated to ? and ? respectively when I echo the values to the >> browser and when inserted into the DB. I wrote the values to the >> error log and they come out to \x9f and \x8a respectively. > Maybe you should publicly post a stripped down file that > demonstrates the problem so that we can pull it down and take a look. > > If you create your own csv with those characters (vs. the ones your > user(s) have uploaded), can you reproduce the problem? [tip... on > osx, press option-u and then u to create ? and option-u and then a > to create ?] > > Do you have the mbstring extension? If so, what does running the > text through mb_detect_encoding function.mb-detect-encoding.php> give you? > > When can we all agree that the extra disk space needed for every > app to use utf8 is worth it? :) > Rob > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From chsnyder at gmail.com Wed Aug 15 09:31:51 2007 From: chsnyder at gmail.com (csnyder) Date: Wed, 15 Aug 2007 09:31:51 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <002d01c7df3d$1dfd7f20$59f87d60$@com> References: <00a801c7dea5$8a388b00$9ea9a100$@com> <00ed01c7dead$44251d60$cc6f5820$@com> <00f801c7deb8$1fdd1600$6401a8c0@gamebox> <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> <017201c7ded9$b9964110$6401a8c0@gamebox> <001b01c7df37$4769a650$d63cf2f0$@com> <29da5d150708150534s6bc6be55j14ca338573f53d47@mail.gmail.com> <002201c7df39$c763b9c0$562b2d40$@com> <002d01c7df3d$1dfd7f20$59f87d60$@com> Message-ID: On 8/15/07, Anthony Wlodarski wrote: > > So I was doing some reading on magic quotes and wrote a simple check to see > if it is on or not. On our box magic quotes are disabled (which is the way > I would prefer it, I would rather manually add my own slashes to sequences > that need it) but my shared hosting has magic quotes enabled. Now I know > the admin of the shared hosting is not going to turn off magic quotes > because not everyone that uses the services are diligent programmers. See http://us3.php.net/manual/en/security.magicquotes.disabling.php -- you can either disable it in an .htaccess file at the web root, or you can use get_magic_quotes_gpc() to check for it and, if on, apply stripslashes() to input values. The standard mysql_x() functions do not allow multiple queries, so you're not so worried about someone injecting drop table statements. Nevertheless, plenty of damage and/or disclosure can be performed with just a single query. The UN website was recently compromised due to SQL injection, by the way, very embarassing for them. -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Wed Aug 15 09:35:49 2007 From: chsnyder at gmail.com (csnyder) Date: Wed, 15 Aug 2007 09:35:49 -0400 Subject: [nycphp-talk] fgetcsv and German characters In-Reply-To: References: <5F2DACEE-5A0B-4946-B352-3FB06102A182@capellic.com> Message-ID: On 8/14/07, Stephen Musgrave wrote: > > I am not on Windows, so Office documents don't open in my browser. > Any other suggestions? I know this issue is no longer moot, but you can of course open a csv file in any browser, because it is just text. The excel file, not so much... :-) From bz-gmort at beezifies.com Wed Aug 15 09:55:55 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Wed, 15 Aug 2007 09:55:55 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: References: <00a801c7dea5$8a388b00$9ea9a100$@com> <00ed01c7dead$44251d60$cc6f5820$@com> <00f801c7deb8$1fdd1600$6401a8c0@gamebox> <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> <017201c7ded9$b9964110$6401a8c0@gamebox> <001b01c7df37$4769a650$d63cf2f0$@com> <29da5d150708150534s6bc6be55j14ca338573f53d47@mail.gmail.com> <002201c7df39$c763b9c0$562b2d40$@com> <002d01c7df3d$1dfd7f20$59f87d60$@com> Message-ID: <46C305EB.9090803@beezifies.com> csnyder wrote: > On 8/15/07, Anthony Wlodarski wrote: > >> So I was doing some reading on magic quotes and wrote a simple check to see >> if it is on or not. On our box magic quotes are disabled (which is the way >> I would prefer it, I would rather manually add my own slashes to sequences >> that need it) but my shared hosting has magic quotes enabled. Now I know >> the admin of the shared hosting is not going to turn off magic quotes >> because not everyone that uses the services are diligent programmers. >> > > See http://us3.php.net/manual/en/security.magicquotes.disabling.php -- > you can either disable it in an .htaccess file at the web root, or you > can use get_magic_quotes_gpc() to check for it and, if on, apply > stripslashes() to input values. > > Oh, doh. the C in GPC stands for cookie, so yeah you can strip it off the cookies and request variable as well. From bz-gmort at beezifies.com Wed Aug 15 09:56:22 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Wed, 15 Aug 2007 09:56:22 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <002d01c7df3d$1dfd7f20$59f87d60$@com> References: <00a801c7dea5$8a388b00$9ea9a100$@com> <29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com> <00da01c7deab$852f4530$8f8dcf90$@com> <00ed01c7dead$44251d60$cc6f5820$@com> <00f801c7deb8$1fdd1600$6401a8c0@gamebox> <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> <017201c7ded9$b9964110$6401a8c0@gamebox> <001b01c7df37$4769a650$d63cf2f0$@com> <29da5d150708150534s6bc6be55j14ca338573f53d47@mail.gmail.com> <002201c7df39$c763b9c0$562b2d40$@com> <002d01c7df3d$1dfd7f20$59f87d60$@com> Message-ID: <46C30606.8030409@beezifies.com> Anthony Wlodarski wrote: > > So if that is passed to a different script in say a $_POST[?str?] > variable would then the string look like ?You\?re didn\?t dood it.?? > Now even if magic quotes are enabled and I use > mysql_real_escape_str($_POST[?str?]) would the string then look like > ?You\\\?re didn\\\?t dood it.?? I am just trying to find a safe > practice for every time I have to use a SQL query. > Why not just remove the slashes from any posted variables if it's on. IE if you know you have a list of variables, than do the following: | ||if (get_magic_quotes_gpc()) { //if magic quotes is off, get rid of them! ||$str = ||stripslashes($str); || $str2 = ||stripslashes($str2); || $str3 = ||stripslashes($str3);| |||} ||Than your assured that all your variables are magic quoteless. You could also do the following, since these are variables, at the very top: || ||if (get_magic_quotes_gpc()) { //if magic quotes is off, get rid of them! || foreach($_GET as $key => $value) { || ||$_GET[$key] = ||stripslashes($_GET[$value]);||| ||| ||$_POST[$key] = ||stripslashes($_POST[$value]);||| | } | |||} Unfortunately, you can't do the same thing for $_REQUEST since it contains cookies as well, you would have to do some extra checking there. Also, you can minimize the following by using an htaccess file, place: ||php_value magic_quotes_gpc 0 php_value magic_quotes_runtime 0 php_value magic_quotes_sybase 0| | in any the htaccess file and it will disable magic quotes(if the provider's server allows it) http://drupal.org/node/4395 ||| | | From michael.southwell at nyphp.com Wed Aug 15 10:14:26 2007 From: michael.southwell at nyphp.com (Michael Southwell) Date: Wed, 15 Aug 2007 10:14:26 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: References: <00a801c7dea5$8a388b00$9ea9a100$@com> <00ed01c7dead$44251d60$cc6f5820$@com> <00f801c7deb8$1fdd1600$6401a8c0@gamebox> <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> <017201c7ded9$b9964110$6401a8c0@gamebox> <001b01c7df37$4769a650$d63cf2f0$@com> <29da5d150708150534s6bc6be55j14ca338573f53d47@mail.gmail.com> <002201c7df39$c763b9c0$562b2d40$@com> <002d01c7df3d$1dfd7f20$59f87d60$@com> Message-ID: <6.2.3.4.2.20070815095605.0292e0a0@pop.nyphp.com> At 09:31 AM 8/15/2007, you wrote: >The standard mysql_x() functions do not allow multiple queries, so >you're not so worried about someone injecting drop table statements. >Nevertheless, plenty of damage and/or disclosure can be performed with >just a single query. Just to emphasize and elaborate on Chris's point here, a query like this: SELECT * FROM `jobsdb` WHERE `id`=1; DROP `jobsdb` when it is sent to MySQL via mysql_query() or one of the other mysql functions, will NOT execute the command following the semicolon. It will however of course work if you are submitting it in the MySQL Monitor or phpMyAdmin, because it is in fact a valid MySQL instruction (actually, two of them). But consider a query like this: DELETE FROM `jobsdb` WHERE `id`=1 OR 1=1 where the 1 OR 1=1 is user input (rather than the expected 1 or 2 or whatever). In this case, Chris's "plenty of damage" is possibly an understatement, since this query will in fact be executed and all rows will be deleted. In a case like this, you need to be checking that your user is entering an expected kind of value, that is (in this case), an integer, with the is_int() function, or (in other cases) however you can. The point is that you can't just rely on mysql_real_escape_string for protection. Michael Southwell, Vice President for Education New York PHP http://www.nyphp.com/training - In-depth PHP Training Courses From dcech at phpwerx.net Wed Aug 15 10:27:59 2007 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 15 Aug 2007 10:27:59 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <002d01c7df3d$1dfd7f20$59f87d60$@com> References: <00a801c7dea5$8a388b00$9ea9a100$@com> <29da5d150708141225h5f05428ayfb86ce61a4ef7776@mail.gmail.com> <00da01c7deab$852f4530$8f8dcf90$@com> <00ed01c7dead$44251d60$cc6f5820$@com> <00f801c7deb8$1fdd1600$6401a8c0@gamebox> <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> <017201c7ded9$b9964110$6401a8c0@gamebox> <001b01c7df37$4769a650$d63cf2f0$@com> <29da5d150708150534s6bc6be55j14ca338573f53d47@mail.gmail.com> <002201c7df39$c763b9c0$562b2d40$@com> <002d01c7df3d$1dfd7f20$59f87d60$@com> Message-ID: <46C30D6F.3070500@phpwerx.net> Anthony Wlodarski wrote: > So I was doing some reading on magic quotes and wrote a simple check to see > if it is on or not. On our box magic quotes are disabled (which is the way > I would prefer it, I would rather manually add my own slashes to sequences > that need it) but my shared hosting has magic quotes enabled. Now I know > the admin of the shared hosting is not going to turn off magic quotes > because not everyone that uses the services are diligent programmers. > > So let us say magic quotes are on and I have a string like so. > > $str = "You're didn't dood it."; > > So if that is passed to a different script in say a $_POST['str'] variable > would then the string look like "You\'re didn\'t dood it."? Now even if > magic quotes are enabled and I use mysql_real_escape_str($_POST['str']) > would the string then look like "You\\\'re didn\\\'t dood it."? I am just > trying to find a safe practice for every time I have to use a SQL query. My recommendation is to use the following lines in the .htaccess file of your web root: php_flag magic_quotes_gpc off php_flag magic_quotes_runtime off php_flag magic_quotes_sybase off Then use the function shown in the relevant PHundamentals article [http://www.nyphp.org/phundamentals/storingretrieving.php] at the beginning of your core php file which will detect and correct the settings if the .htaccess is accidentally mangled/deleted or if you run the code on a server that doesn't honor the .htaccess (very rare). Dan From jcampbell1 at gmail.com Wed Aug 15 12:58:26 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 15 Aug 2007 12:58:26 -0400 Subject: [nycphp-talk] Is there something wrong with this SQL query in PHP? In-Reply-To: <46C30D6F.3070500@phpwerx.net> References: <00a801c7dea5$8a388b00$9ea9a100$@com> <00f801c7deb8$1fdd1600$6401a8c0@gamebox> <8f0676b40708141731p368bad5bi3388ce88472a0735@mail.gmail.com> <017201c7ded9$b9964110$6401a8c0@gamebox> <001b01c7df37$4769a650$d63cf2f0$@com> <29da5d150708150534s6bc6be55j14ca338573f53d47@mail.gmail.com> <002201c7df39$c763b9c0$562b2d40$@com> <002d01c7df3d$1dfd7f20$59f87d60$@com> <46C30D6F.3070500@phpwerx.net> Message-ID: <8f0676b40708150958r5163a9fbyf0a5ac007d672ecf@mail.gmail.com> I think the function arrray_walk_recursive, and array_map are very useful for dealing with escaping. For instance: if(get_magic_quotes_gpc()) { array_walk_recursive($_POST,"stripslashes"); array_walk_recursive($_GET,"stripslashes"); array_walk_recursive($_COOKIE,"stripslashes"); } You also probably don't want to load up your code with "mysql_real_escape_string()," so here is an alternative. This is a good method for fixing bad code because it can be implemented without a major rewrite. $sql = prepare("SELECT * FROM users WHERE username='%s' AND password='%s' ",$POST['username'],$POST['password']); function prepare() { $args_array = func_get_args(); for ($i=1;$i I installed Subversion and now Xampp Apache no longer starts. Even after uninstalling Subversion. Any ideas other tha reinstalling xampp? Cliff From spangia at redcent.net Wed Aug 15 13:23:55 2007 From: spangia at redcent.net (Sean Pangia) Date: Wed, 15 Aug 2007 13:23:55 -0400 Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <200612082148.10778.arzala@gmail.com> References: <45797D28.3020103@fdcx.net> <200612082148.10778.arzala@gmail.com> Message-ID: <46C336AB.3070605@redcent.net> please pardon the off-topic post, but if anyone's looking for a pretty decent space: Shared Office Space Available in Great Location - Flatiron District Share office space with a technology firm in an 1100 square foot loft-like space starting SEPTEMBER 1st. Office is located in an elevator building with 24X7 access and guard service. Available Space includes: - Semi-Private windowed office with room for 2 people - Furnished ?Bullpen? space that can seat up to 5 people - Conference room. - Storage area - Kitchenette w/ refrigerator and microwave $3600 per month includes: - Rent - Electric/AC - 24/7 Guard Service - Cleaning Service Contact Adam at 212-929-4270 or adam at perryconsulting.com From chsnyder at gmail.com Wed Aug 15 13:32:12 2007 From: chsnyder at gmail.com (csnyder) Date: Wed, 15 Aug 2007 13:32:12 -0400 Subject: [nycphp-talk] Subversion killed Xampp Apache In-Reply-To: <20070815170324.M86668@pinestream.com> References: <20070815170324.M86668@pinestream.com> Message-ID: On 8/15/07, Cliff Hirsch wrote: > I installed Subversion and now Xampp Apache no longer starts. Even after > uninstalling Subversion. Any ideas other tha reinstalling xampp? > > Cliff What does the Apache error log have to say about it? -- Chris Snyder http://chxo.com/ From dcech at phpwerx.net Wed Aug 15 13:43:00 2007 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 15 Aug 2007 13:43:00 -0400 Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <46C336AB.3070605@redcent.net> References: <45797D28.3020103@fdcx.net> <200612082148.10778.arzala@gmail.com> <46C336AB.3070605@redcent.net> Message-ID: <46C33B24.2000104@phpwerx.net> Sean Pangia wrote: > please pardon the off-topic post, but if anyone's looking for a pretty > decent space: 1. Please refrain from posting OT topics to this (or any) list. There are any number of venues you can use for this. 2. When starting a new topic please don't do so by replying to an unrelated email, and especially not one 8 months old. Is it so much effort to type an email address in the To: field? 3. While I'm at it, I see that when you do post to this list you invariably top-post. Don't do that either ;) Dan From rmarscher at beaffinitive.com Wed Aug 15 14:11:04 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 15 Aug 2007 14:11:04 -0400 Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <46C33B24.2000104@phpwerx.net> References: <45797D28.3020103@fdcx.net> <200612082148.10778.arzala@gmail.com> <46C336AB.3070605@redcent.net> <46C33B24.2000104@phpwerx.net> Message-ID: <3BF44AC4-9255-467B-A55C-82B7A9F36FAA@beaffinitive.com> On Aug 15, 2007, at 1:43 PM, Dan Cech wrote: > 2. When starting a new topic please don't do so by replying to an > unrelated email, and especially not one 8 months old. Is it so much > effort to type an email address in the To: field? It seems to me that this is a new topic... at least it shows up separately in my threaded email view in Mac Mail. It also shows as a new topic in the list archive threaded view: http://lists.nyphp.org/ pipermail/talk/2007-August/thread.html From ajai at bitblit.net Wed Aug 15 14:22:53 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 15 Aug 2007 14:22:53 -0400 (EDT) Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <3BF44AC4-9255-467B-A55C-82B7A9F36FAA@beaffinitive.com> Message-ID: On Wed, 15 Aug 2007, Rob Marscher wrote: > On Aug 15, 2007, at 1:43 PM, Dan Cech wrote: > > 2. When starting a new topic please don't do so by replying to an > > unrelated email, and especially not one 8 months old. Is it so much > > effort to type an email address in the To: field? > It seems to me that this is a new topic... at least it shows up > separately in my threaded email view in Mac Mail. It also shows as a > new topic in the list archive threaded view: http://lists.nyphp.org/ > pipermail/talk/2007-August/thread.html Some email programs dont thread properly: for example, Pine will thread by Subject rather than looking at messages ids. Mutt is the same unless you switch in strict_threads. So it depends on your mail reader... -- Aj. From spangia at redcent.net Wed Aug 15 14:28:10 2007 From: spangia at redcent.net (Sean Pangia) Date: Wed, 15 Aug 2007 14:28:10 -0400 Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <46C33B24.2000104@phpwerx.net> References: <45797D28.3020103@fdcx.net> <200612082148.10778.arzala@gmail.com> <46C336AB.3070605@redcent.net> <46C33B24.2000104@phpwerx.net> Message-ID: <46C345BA.6060901@redcent.net> Dan Cech wrote: > Sean Pangia wrote: > >> please pardon the off-topic post, but if anyone's looking for a pretty >> decent space: >> > > 1. Please refrain from posting OT topics to this (or any) list. There > are any number of venues you can use for this. > > 2. When starting a new topic please don't do so by replying to an > unrelated email, and especially not one 8 months old. Is it so much > effort to type an email address in the To: field? > > 3. While I'm at it, I see that when you do post to this list you > invariably top-post. Don't do that either ;) > > Dan > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > mea culpa. i've been on the list for a couple years and had no idea i was breaking so many rules. -sean -------------- next part -------------- An HTML attachment was scrubbed... URL: From aw at sap8.com Wed Aug 15 14:34:15 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 15 Aug 2007 14:34:15 -0400 Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: References: <3BF44AC4-9255-467B-A55C-82B7A9F36FAA@beaffinitive.com> Message-ID: <009301c7df6a$e33383c0$a99a8b40$@com> Outlook 2007 doesn't thread at all, but while we are on it the most useless view in the history of man, Microsoft Timeline: http://www.anthonyw.net/images/useless.gif Not for the easily disoriented (100% safe for work). Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Ajai Khattri Sent: Wednesday, August 15, 2007 2:23 PM To: NYPHP Talk Subject: Re: [nycphp-talk] [OT]: flatiron office sublet available On Wed, 15 Aug 2007, Rob Marscher wrote: > On Aug 15, 2007, at 1:43 PM, Dan Cech wrote: > > 2. When starting a new topic please don't do so by replying to an > > unrelated email, and especially not one 8 months old. Is it so much > > effort to type an email address in the To: field? > It seems to me that this is a new topic... at least it shows up > separately in my threaded email view in Mac Mail. It also shows as a > new topic in the list archive threaded view: http://lists.nyphp.org/ > pipermail/talk/2007-August/thread.html Some email programs dont thread properly: for example, Pine will thread by Subject rather than looking at messages ids. Mutt is the same unless you switch in strict_threads. So it depends on your mail reader... -- Aj. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From dcech at phpwerx.net Wed Aug 15 14:37:01 2007 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 15 Aug 2007 14:37:01 -0400 Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <3BF44AC4-9255-467B-A55C-82B7A9F36FAA@beaffinitive.com> References: <45797D28.3020103@fdcx.net> <200612082148.10778.arzala@gmail.com> <46C336AB.3070605@redcent.net> <46C33B24.2000104@phpwerx.net> <3BF44AC4-9255-467B-A55C-82B7A9F36FAA@beaffinitive.com> Message-ID: <46C347CD.4040004@phpwerx.net> Rob Marscher wrote: > On Aug 15, 2007, at 1:43 PM, Dan Cech wrote: >> 2. When starting a new topic please don't do so by replying to an >> unrelated email, and especially not one 8 months old. Is it so much >> effort to type an email address in the To: field? > It seems to me that this is a new topic... at least it shows up > separately in my threaded email view in Mac Mail. It also shows as a > new topic in the list archive threaded view: > http://lists.nyphp.org/pipermail/talk/2007-August/thread.html >From the original message: > To: NYPHP Talk > References: <45797D28.3020103 at fdcx.net> <200612082148.10778.arzala at gmail.com> > In-Reply-To: <200612082148.10778.arzala at gmail.com> The OT post was created by opening a reply to a message posted on 12/8/2006 by Anirudh Zala on an unrelated topic, then deleting the subject and all content. Sadly, this does not clear out the References and In-Reply-To headers shown above. While there are no doubt many clients and applications which are not affected by these headers, the fact is that many modern mail clients (eg Thunderbird) do use them to track conversations though the subject may change, as well as following individual threads within a conversation. The simple fix is to create a new message when you are creating a new thread, rather than trying to 'recycle' an old one. Dan From dcech at phpwerx.net Wed Aug 15 14:45:19 2007 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 15 Aug 2007 14:45:19 -0400 Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <46C345BA.6060901@redcent.net> References: <45797D28.3020103@fdcx.net> <200612082148.10778.arzala@gmail.com> <46C336AB.3070605@redcent.net> <46C33B24.2000104@phpwerx.net> <46C345BA.6060901@redcent.net> Message-ID: <46C349BF.2050102@phpwerx.net> Sean Pangia wrote: > Dan Cech wrote: >> Sean Pangia wrote: >>> please pardon the off-topic post, but if anyone's looking for a pretty >>> decent space: >> >> 1. Please refrain from posting OT topics to this (or any) list. There >> are any number of venues you can use for this. >> >> 2. When starting a new topic please don't do so by replying to an >> unrelated email, and especially not one 8 months old. Is it so much >> effort to type an email address in the To: field? >> >> 3. While I'm at it, I see that when you do post to this list you >> invariably top-post. Don't do that either ;) > > mea culpa. i've been on the list for a couple years and had no idea i > was breaking so many rules. Always happy to help ;) My apologies for the somewhat terse reply. Hopefully this thread can now progress into a PHP-related discussion on the use of References and In-Reply-To headers when sending mail from PHP. Dan From dsteplight at gmail.com Wed Aug 15 14:45:36 2007 From: dsteplight at gmail.com (Darryle steplight) Date: Wed, 15 Aug 2007 14:45:36 -0400 Subject: [nycphp-talk] Need Help Using SOAP with PHP 4... Message-ID: <47f4c4570708151145s4eb2ffc6u6b2ef00f5d849171@mail.gmail.com> Hi Everyone, I am very new to the concept of SOAP. Yesterday I bought a book of Amazon on PHP Web Services and today my ATG/JSP savvy project manger asked me to write a SOAP request using PHP :) The PHP program needs to grab an XML file (generated by a JAR file on an APP servlet ) via a POST method; then the program I need to write will pass the XML information via a post method to another application on our server. Since we mainly deal with JSP. I'm working with PHP 4.3 and it doesn't look like my job will upgrade to PHP 5 anytime in the future. I'm currently looking into NuSoap as I write this email, but any other suggestions or tutorial links will be highly appreciated. p.s. PEAR isn't an option in this particular scenario :( -Darryle -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Aug 15 14:55:17 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 15 Aug 2007 14:55:17 -0400 (EDT) Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <46C347CD.4040004@phpwerx.net> Message-ID: On Wed, 15 Aug 2007, Dan Cech wrote: > The simple fix is to create a new message when you are creating a new > thread, rather than trying to 'recycle' an old one. Of course, Im not disagreeing with you. Also, quoting just enough to make context clear (like here) helps - most people are too lazy to do that. Oh, and bottom posting too (yes, I know Gmail top posts by default - I can only assume it was written by younger programmers that dont know any better ;-) -- Aj. From tomsartain at gmail.com Wed Aug 15 14:58:34 2007 From: tomsartain at gmail.com (Tom Sartain) Date: Wed, 15 Aug 2007 14:58:34 -0400 Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: References: <46C347CD.4040004@phpwerx.net> Message-ID: <20190d950708151158u3bbba99cv8b1b1c22c5e502f7@mail.gmail.com> Can someone explain bottom posting vs top posting to this younger programmer (who did not work on Gmail) On 8/15/07, Ajai Khattri wrote: > Oh, and bottom posting too (yes, I know Gmail top posts by default - I can > only assume it was written by younger programmers that dont know any > better ;-) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Wed Aug 15 15:06:03 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Wed, 15 Aug 2007 15:06:03 -0400 Subject: [nycphp-talk] Subversion killed Xampp Apache In-Reply-To: Message-ID: On 8/15/07 1:32 PM, "csnyder" wrote: > On 8/15/07, Cliff Hirsch wrote: >> I installed Subversion and now Xampp Apache no longer starts. Even after >> uninstalling Subversion. Any ideas other tha reinstalling xampp? >> >> Cliff > > What does the Apache error log have to say about it? Chris: Very interesting. You have a habit of pointing me in the right direction. The log files haven't changes since the problem appeared, meaning that Apache never started. BUT...I realize I have never looked at my log files before and the access log was 35Mbytes! So...what do we do with log files? How do we flush them? Cron? Probably time to learn a bit about Apache management...or should I let my ISP worry abut that? Digging deeper, the Xampp gui console beautifully hides the problem. Starting Apache from the command line made the problem obvious. I simply commented out the following lines in the httpf.conf file and everything is fine now. #LoadModule dav_svn_module "C:/Program Files/Subversion/bin/mod_dav_svn.so" #LoadModule authz_svn_module "C:/Program Files/Subversion/bin/mod_authz_svn.so" Life is good again.... And next week this Bostonian will code in Amagansett -- life gets better. Of course, no coding in Amagansett would be even better. Cliff From ajai at bitblit.net Wed Aug 15 15:13:16 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 15 Aug 2007 15:13:16 -0400 (EDT) Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <20190d950708151158u3bbba99cv8b1b1c22c5e502f7@mail.gmail.com> Message-ID: On Wed, 15 Aug 2007, Tom Sartain wrote: > Can someone explain bottom posting vs top posting to this younger programmer http://en.wikipedia.org/wiki/Posting_style -- Aj. From dcech at phpwerx.net Wed Aug 15 15:14:33 2007 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 15 Aug 2007 15:14:33 -0400 Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <20190d950708151158u3bbba99cv8b1b1c22c5e502f7@mail.gmail.com> References: <46C347CD.4040004@phpwerx.net> <20190d950708151158u3bbba99cv8b1b1c22c5e502f7@mail.gmail.com> Message-ID: <46C35099.5000800@phpwerx.net> Tom, When you top post like this, you ruin the flow of the text, as the thread of conversation begins somewhere in the middle,goes down, jumps back up to somewhere else, goes down again, jumps to the top of the text and back down again. Dan Tom Sartain wrote: > Can someone explain bottom posting vs top posting to this younger programmer > (who did not work on Gmail) > > On 8/15/07, Ajai Khattri wrote: >> Oh, and bottom posting too (yes, I know Gmail top posts by default - I can >> only assume it was written by younger programmers that dont know any >> better ;-) From jonbaer at jonbaer.com Wed Aug 15 15:27:28 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 15 Aug 2007 15:27:28 -0400 Subject: [nycphp-talk] Subversion killed Xampp Apache In-Reply-To: References: Message-ID: <2C144AEA-9ED3-43C6-A8D9-CD43034785AF@jonbaer.com> Your ISP should already be setup to use logrotate (a cron job for the purpose) ... http://www.debian-administration.org/articles/117 BTW, on the topic, Im about to upgrade a box and have been looking if its possible to "merge" those logs across machines so they will show up in stat reports. The new box will start w/ fresh logs, Im wondering if just renaming the logs w/ hostname will do ... - Jon On Aug 15, 2007, at 3:06 PM, Cliff Hirsch wrote: > Very interesting. You have a habit of pointing me in the right > direction. > The log files haven't changes since the problem appeared, meaning that > Apache never started. BUT...I realize I have never looked at my log > files > before and the access log was 35Mbytes! So...what do we do with log > files? > How do we flush them? Cron? Probably time to learn a bit about Apache > management...or should I let my ISP worry abut that? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Aug 15 16:11:07 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 15 Aug 2007 16:11:07 -0400 (EDT) Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <46C35099.5000800@phpwerx.net> Message-ID: A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? ;-) -- Aj. From ajai at bitblit.net Wed Aug 15 16:15:43 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 15 Aug 2007 16:15:43 -0400 (EDT) Subject: [nycphp-talk] Subversion killed Xampp Apache In-Reply-To: <2C144AEA-9ED3-43C6-A8D9-CD43034785AF@jonbaer.com> Message-ID: On Wed, 15 Aug 2007, Jon Baer wrote: > Your ISP should already be setup to use logrotate (a cron job for the > purpose) ... > > http://www.debian-administration.org/articles/117 I use cronolog and configure Apache to pipe into it. http://cronolog.org/ This gives me log files with datestamp in the filename (so, one log file per day) and no rotation needed at all. -- Aj. From krook at us.ibm.com Wed Aug 15 17:05:56 2007 From: krook at us.ibm.com (Daniel Krook) Date: Wed, 15 Aug 2007 17:05:56 -0400 Subject: [nycphp-talk] State of XML databases presentation? Message-ID: Elliotte, It seems your review of XML databases has picked up a lot of comments. It's doing well on the social bookmarking circuit too. http://cafe.elharo.com/xml/the-state-of-native-xml-databases/ The topic in general seems to be garnering a lot of interest lately. Would you be willing to do a presentation this fall on the state of XML databases [in general|for PHP developers]. Maybe some comments on where the Zend Framework XML Content Store/Zend_Db_Xml fits in? List, If anyone else has suggestions for an October or November meeting topic please let us know, I know there was some talk on presentation topics earlier this summer but I can't seem to find it at the moment. http://www.nyphp.org/presentations.php Thanks, -Dan Daniel Krook Content Tools Developer - SCSA, SCJP, SCWCD, ZCE, ICDAssoc. Global Solutions, ibm.com From elharo at metalab.unc.edu Wed Aug 15 17:53:57 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Wed, 15 Aug 2007 17:53:57 -0400 Subject: [nycphp-talk] State of XML databases presentation? In-Reply-To: References: Message-ID: <46C375F5.3070401@metalab.unc.edu> Daniel Krook wrote: > Elliotte, > > It seems your review of XML databases has picked up a lot of comments. > It's doing well on the social bookmarking circuit too. > http://cafe.elharo.com/xml/the-state-of-native-xml-databases/ > > The topic in general seems to be garnering a lot of interest lately. Would > you be willing to do a presentation this fall on the state of XML > databases [in general|for PHP developers]. Maybe some comments on where > the Zend Framework XML Content Store/Zend_Db_Xml fits in? > My time is extremely constrained, but I can probably fit something in since you're local. I should warn you though that I don't actually know squat about the Zend Framework XML Content Store/Zend_Db_Xml (not that that's ever stopped me from spouting off at the mouth before :-) -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From lists at zaunere.com Wed Aug 15 17:56:33 2007 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 15 Aug 2007 17:56:33 -0400 Subject: [nycphp-talk] State of XML databases presentation? In-Reply-To: <46C375F5.3070401@metalab.unc.edu> References: <46C375F5.3070401@metalab.unc.edu> Message-ID: <004001c7df87$24b59f10$651ba8c0@MobileZ> Elliotte Harold wrote on Wednesday, August 15, 2007 5:54 PM: > Daniel Krook wrote: > > Elliotte, > > > > It seems your review of XML databases has picked up a lot of > > comments. It's doing well on the social bookmarking circuit too. > > http://cafe.elharo.com/xml/the-state-of-native-xml-databases/ > > > > The topic in general seems to be garnering a lot of interest > > lately. Would you be willing to do a presentation this fall on the > > state of XML databases [in general|for PHP developers]. Maybe > > some comments on where the Zend Framework XML Content > > Store/Zend_Db_Xml fits in? > > > > My time is extremely constrained, but I can probably fit something in > since you're local. I should warn you though that I don't actually > know squat about the Zend Framework XML Content Store/Zend_Db_Xml > (not that that's ever stopped me from spouting off at the mouth > before :-) That's ok - if you're up to it, send us the typical blurb/bio/etc and what month works (always the 4th Tuesday). H From david at davidmintz.org Wed Aug 15 18:54:31 2007 From: david at davidmintz.org (David Mintz) Date: Wed, 15 Aug 2007 18:54:31 -0400 Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? Message-ID: <721f1cc50708151554y206742ecs4402e2bf6feeb438@mail.gmail.com> Hey everyone I am about to move, and considering dumping Speakeasy DSL for the sake of economy, and because the installation (involving Verizon, Covad) is a total f$@#ing nightmare. Does anyone care to share an opinion about Comcast? How's the speed and reliability? Have you been able to work around the dynamic IP and expose ssh and http to the world? (I know there are ways. e.g,. with dyndyns.org, but I'd be interested in knowing how well it works). Thanks! -- 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 david at davidmintz.org Wed Aug 15 19:01:00 2007 From: david at davidmintz.org (David Mintz) Date: Wed, 15 Aug 2007 19:01:00 -0400 Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: References: <46C35099.5000800@phpwerx.net> Message-ID: <721f1cc50708151601p45bbfe48ibf85db876c61d57d@mail.gmail.com> I didn't know OT was a crime, if you prepend your subject with [OT]. If it is, I am guilty but I still would like to know what anybody thinks of Comcast's internet service (-: I thought top-posting was preferred because there's a presumption that you start by reading post 1. Post 2 replies to post 1 so let's get right to the reply rather than scrolling through screens of crap that -- now, my pet peeve -- a lot of people are too lazy to snip, and which you have (probably) already read. On 8/15/07, Ajai Khattri wrote: > > > > A: Because it messes up the order in which people normally read text. > Q: Why is top-posting such a bad thing? > A: Top-posting. > Q: What is the most annoying thing in e-mail? > > ;-) > > -- > Aj. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- 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 cliff at pinestream.com Thu Aug 16 06:30:02 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 16 Aug 2007 06:30:02 -0400 Subject: [nycphp-talk] Eliminating namespace conflicts between scripts? Message-ID: I am tying a large open source ap into my main ap. This ap has numerous global variable and countless includes and classless functions. Thus, the chances for a namespace conflict with my primary application are high. Yet it needs to be tightly coupled with my ap. What do you suggest for achieving this? The safest approach might be to use curl, although it seems a bit silly to curl into your own project. And its probably slow, although I can cache the result so performance shouldn?t be an issue. Thoughts? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From brenttech at gmail.com Thu Aug 16 09:40:11 2007 From: brenttech at gmail.com (Brent Baisley) Date: Thu, 16 Aug 2007 09:40:11 -0400 Subject: [nycphp-talk] Eliminating namespace conflicts between scripts? In-Reply-To: References: Message-ID: <5d515c620708160640t47548f17k92b1dae27c6c5ea5@mail.gmail.com> Well, that's part of what classes are for, to manage namespaces. Since you are probably not going to redo the open source app to use classes, you'll have to minimize the name spaces your app uses. Although you may just want to resolve conflicts as they come up. You can put all your global variables into a single global variable that can be an associative array. Then you are using only 1 global name. So this: $var1 = 'xyz'; $var2 = 'abc'; becomes: $myvars['var1'] = 'xyz'; $myvars['var2'] = 'abc'; You can put your functions into a class (or classes) and reference the class "statically", so you just need to prefix your functions with the class name. Statically referencing the function will give global scope without having to declare global variables. class MyFuncs { function a {} function b{} ... } To call function "a" you would change a() to MyFuncs::a(); Those are some ideas. Curl will add a lot of overhead, but I admit I have gone that route before. On 8/16/07, Cliff Hirsch wrote: > > I am tying a large open source ap into my main ap. This ap has numerous > global variable and countless includes and classless functions. Thus, the > chances for a namespace conflict with my primary application are high. > > Yet it needs to be tightly coupled with my ap. What do you suggest for > achieving this? The safest approach might be to use curl, although it seems > a bit silly to curl into your own project. And its probably slow, although I > can cache the result so performance shouldn't be an issue. > > Thoughts? > > Cliff > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From agfische at email.smith.edu Thu Aug 16 10:17:10 2007 From: agfische at email.smith.edu (Aaron Fischer) Date: Thu, 16 Aug 2007 10:17:10 -0400 Subject: [nycphp-talk] Search of directories and files on my web server Message-ID: Greetings, I am working on a little script that will start at a specified directory on my web server and then proceed to look through all files and sub-folders for an instance of text located in a file. (This is a follow-up of sorts to a previous post of mine from a week or two ago.) I got the code to work fine for searching through one directory. However, my thought was that in order to drill down through an undefined number of sub-folders I would need to implement a recursive function. The recursive "depth first" search function I made is not working as expected and so far I haven't been able to figure out what or how I need to tweak it. I'm completely squeezed for time at work so I'll continue to bang away at it but I thought I would post it here in the hopes that some of our rockets scientists can show me the error of my ways. I'm guessing this will be a rather simple problem for some folks on the list. So here goes. Listed below are my algorithm and code. I'm looking forward to finding out where I'm going wrong. =) My algorithm: 1) Set the directory that the script will start in. 2) Open that directory and read all files and folders in that directory. 3) While each item is being read, check it. If the item is a directory, call the recursive search in order to drill down further. If the item is a file, open the file and search for the text string that I am trying to locate. My code (with comments): '; } } } } closedir($dir); } ?> Cheers, -Aaron From cliff at pinestream.com Thu Aug 16 10:18:10 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 16 Aug 2007 10:18:10 -0400 Subject: [nycphp-talk] Eliminating namespace conflicts between scripts? In-Reply-To: <5d515c620708160640t47548f17k92b1dae27c6c5ea5@mail.gmail.com> Message-ID: On 8/16/07 9:40 AM, "Brent Baisley" wrote: > Well, that's part of what classes are for, to manage namespaces. Since > you are probably not going to redo the open source app to use classes, > you'll have to minimize the name spaces your app uses. Although you > may just want to resolve conflicts as they come up. ... > > Those are some ideas. Curl will add a lot of overhead, but I admit I > have gone that route before. That's a lot of work...and testing. I probably have less than a dozen global variables and functions in my app, but there's always "but".... A curl call every hour or so...or even once a day with good caching seems so much easier and safer. What about issuing a command line call? Although opening up this functionality adds so many security risks. From ajai at bitblit.net Thu Aug 16 10:31:36 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 16 Aug 2007 10:31:36 -0400 (EDT) Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? In-Reply-To: <721f1cc50708151554y206742ecs4402e2bf6feeb438@mail.gmail.com> Message-ID: On Wed, 15 Aug 2007, David Mintz wrote: > I am about to move, and considering dumping Speakeasy DSL for the sake of > economy, and because the installation (involving Verizon, Covad) is a total > f$@#ing nightmare. Until we have a real choice in local telephone providers, ALL DSL providers have to deal directly or indirectly with Verizon - no way around it. > Does anyone care to share an opinion about Comcast? How's the speed and > reliability? Have you been able to work around the dynamic IP and expose ssh > and http to the world? (I know there are ways. e.g,. with dyndyns.org, but > I'd be interested in knowing how well it works). Even with dyndns setups, I wouldn't be suprised if there's some other problem that will come back to bite you... -- Aj. From ben at projectskyline.com Thu Aug 16 10:34:31 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Thu, 16 Aug 2007 10:34:31 -0400 Subject: [nycphp-talk] XML Manipulation Message-ID: <016701c7e012$8f8f8810$6401a8c0@gamebox> Hello all, After the XML vs SQL conversation, I started to rethink a product I'm working on. I had been having a lot of trouble modeling the data into SQL. It was starting to look very complicated. So, I decided I would try to store it in XML. The data I am storing is messages w/in a thread, timestamp, body and subject. On the SQL side, we create a table that has the user id, and a row per message/thread which contains a path to the xml file. The reason XML seemed better is that I store the data top down and that is the true order of the thread. Messages within the thread can come from email or html page response, so its important to insert items into the thread via the timestamp. Using XML just made it simpler for me to wrap my head around, than trying to model it in SQL. Anyways, my question is about which XML parser package to use. I'm sure PEAR has one, and I like PEAR stuff. I'm sure PHP Classes has something as well. Maybe YOU have a library that's open source. What are some pros/cons of XML parser librarys. I'll need to read and write XML, plus easily convert the xml into php arrays so I can manipulate them in PHP. My codebase is OOP 5, so I'm willing to extend an existing class if need be. Thanks! - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons -------------- next part -------------- An HTML attachment was scrubbed... URL: From aw at sap8.com Thu Aug 16 10:38:37 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Thu, 16 Aug 2007 10:38:37 -0400 Subject: [nycphp-talk] Search of directories and files on my web server In-Reply-To: References: Message-ID: <004f01c7e013$21aaa360$64ffea20$@com> I wrote this file browser of mine a long time ago, non recursive version. Take a look at the code and hopefully it will help you think of parsing directories in a different way (but if you had to do it recursively think of it as traversing a tree structure). Place this in the root directory and that is all. // This php program is a file browser with an upload utility built at the top just in case you don't have ftp access. // Anthony W. 1/30/07 // Use at own risk function printDirectory() { if(isset($_GET['currwd'])) { $currwd = $_GET['currwd']; } else { // we are starting from the top most directory $currwd = "."; } //fieldset for our current working directory echo "
\n"; echo "Current working directory\n"; echo "

".$currwd."

\n"; echo "
\n"; //fieldset for our directory listing echo "
\n"; echo "Directory Listing\n"; echo "\n"; // now we output the directory information including how to recursively use this script if need be // create a directory handle $dh = dir($currwd); // how to properly traverse a directory while(false !== ($fh = $dh->read())) { echo "\n"; // now if it is a file or directory we view file and travers directories. if(is_dir($currwd."/".$fh)) //$fh alone will not suffice we must concatenate with the full path { echo "\n"; } else { echo "\n"; } echo "\n"; }// end of while // close our table echo "
".$fh."".$fh."
\n"; // close our fieldset echo "
"; // close the directory handle $dh->close(); }// end of funtion printDirectory // main part of our application printDirectory(); Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Aaron Fischer Sent: Thursday, August 16, 2007 10:17 AM To: NYPHP-Talk Subject: [nycphp-talk] Search of directories and files on my web server Greetings, I am working on a little script that will start at a specified directory on my web server and then proceed to look through all files and sub-folders for an instance of text located in a file. (This is a follow-up of sorts to a previous post of mine from a week or two ago.) I got the code to work fine for searching through one directory. However, my thought was that in order to drill down through an undefined number of sub-folders I would need to implement a recursive function. The recursive "depth first" search function I made is not working as expected and so far I haven't been able to figure out what or how I need to tweak it. I'm completely squeezed for time at work so I'll continue to bang away at it but I thought I would post it here in the hopes that some of our rockets scientists can show me the error of my ways. I'm guessing this will be a rather simple problem for some folks on the list. So here goes. Listed below are my algorithm and code. I'm looking forward to finding out where I'm going wrong. =) My algorithm: 1) Set the directory that the script will start in. 2) Open that directory and read all files and folders in that directory. 3) While each item is being read, check it. If the item is a directory, call the recursive search in order to drill down further. If the item is a file, open the file and search for the text string that I am trying to locate. My code (with comments): '; } } } } closedir($dir); } ?> Cheers, -Aaron _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From aw at sap8.com Thu Aug 16 10:41:10 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Thu, 16 Aug 2007 10:41:10 -0400 Subject: [nycphp-talk] Search of directories and files on my web server In-Reply-To: <004f01c7e013$21aaa360$64ffea20$@com> References: <004f01c7e013$21aaa360$64ffea20$@com> Message-ID: <005001c7e013$7cc25720$76470560$@com> Disregard, I thought you meant file browser, not a search script to parse through the directories. But maybe this will apply in the while look to discern directories from files. Sorry for any confusion. Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Anthony Wlodarski Sent: Thursday, August 16, 2007 10:39 AM To: 'NYPHP Talk' Subject: RE: [nycphp-talk] Search of directories and files on my web server I wrote this file browser of mine a long time ago, non recursive version. Take a look at the code and hopefully it will help you think of parsing directories in a different way (but if you had to do it recursively think of it as traversing a tree structure). Place this in the root directory and that is all. // This php program is a file browser with an upload utility built at the top just in case you don't have ftp access. // Anthony W. 1/30/07 // Use at own risk function printDirectory() { if(isset($_GET['currwd'])) { $currwd = $_GET['currwd']; } else { // we are starting from the top most directory $currwd = "."; } //fieldset for our current working directory echo "
\n"; echo "Current working directory\n"; echo "

".$currwd."

\n"; echo "
\n"; //fieldset for our directory listing echo "
\n"; echo "Directory Listing\n"; echo "\n"; // now we output the directory information including how to recursively use this script if need be // create a directory handle $dh = dir($currwd); // how to properly traverse a directory while(false !== ($fh = $dh->read())) { echo "\n"; // now if it is a file or directory we view file and travers directories. if(is_dir($currwd."/".$fh)) //$fh alone will not suffice we must concatenate with the full path { echo "\n"; } else { echo "\n"; } echo "\n"; }// end of while // close our table echo "
".$fh."".$fh."
\n"; // close our fieldset echo "
"; // close the directory handle $dh->close(); }// end of funtion printDirectory // main part of our application printDirectory(); Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Aaron Fischer Sent: Thursday, August 16, 2007 10:17 AM To: NYPHP-Talk Subject: [nycphp-talk] Search of directories and files on my web server Greetings, I am working on a little script that will start at a specified directory on my web server and then proceed to look through all files and sub-folders for an instance of text located in a file. (This is a follow-up of sorts to a previous post of mine from a week or two ago.) I got the code to work fine for searching through one directory. However, my thought was that in order to drill down through an undefined number of sub-folders I would need to implement a recursive function. The recursive "depth first" search function I made is not working as expected and so far I haven't been able to figure out what or how I need to tweak it. I'm completely squeezed for time at work so I'll continue to bang away at it but I thought I would post it here in the hopes that some of our rockets scientists can show me the error of my ways. I'm guessing this will be a rather simple problem for some folks on the list. So here goes. Listed below are my algorithm and code. I'm looking forward to finding out where I'm going wrong. =) My algorithm: 1) Set the directory that the script will start in. 2) Open that directory and read all files and folders in that directory. 3) While each item is being read, check it. If the item is a directory, call the recursive search in order to drill down further. If the item is a file, open the file and search for the text string that I am trying to locate. My code (with comments): '; } } } } closedir($dir); } ?> Cheers, -Aaron _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From dcech at phpwerx.net Thu Aug 16 10:42:45 2007 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 16 Aug 2007 10:42:45 -0400 Subject: [nycphp-talk] Search of directories and files on my web server In-Reply-To: References: Message-ID: <46C46265.8070908@phpwerx.net> Aaron Fischer wrote: > Greetings, > > I am working on a little script that will start at a specified directory > on my web server and then proceed to look through all files and > sub-folders for an instance of text located in a file. (This is a > follow-up of sorts to a previous post of mine from a week or two ago.) > > I got the code to work fine for searching through one directory. > However, my thought was that in order to drill down through an undefined > number of sub-folders I would need to implement a recursive function. > The recursive "depth first" search function I made is not working as > expected and so far I haven't been able to figure out what or how I need > to tweak it. Aaron, First up, why not just use grep? Anyway, your problem is that you are not addressing the items by the full path, so the script can't find them. Here is a modified example which may help, and includes some output so you can see what is haoppening. Dan '; } } } } closedir($dir); echo 'Done searching '. $path ."\n"; } // end of script From dcech at phpwerx.net Thu Aug 16 10:53:31 2007 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 16 Aug 2007 10:53:31 -0400 Subject: [nycphp-talk] XML Manipulation In-Reply-To: <016701c7e012$8f8f8810$6401a8c0@gamebox> References: <016701c7e012$8f8f8810$6401a8c0@gamebox> Message-ID: <46C464EB.6060704@phpwerx.net> Ben Sgro (ProjectSkyLine) wrote: > Hello all, > > After the XML vs SQL conversation, I started to rethink a product I'm working on. > I had been having a lot of trouble modeling the data into SQL. It was starting to > look very complicated. > > So, I decided I would try to store it in XML. The data I am storing is messages w/in a thread, > timestamp, body and subject. On the SQL side, we create a table that has the user id, > and a row per message/thread which contains a path to the xml file. > > The reason XML seemed better is that I store the data top down and that is the true > order of the thread. Messages within the thread can come from email or html page response, > so its important to insert items into the thread via the timestamp. Using XML just made it > simpler for me to wrap my head around, than trying to model it in SQL. This sounds awfully messy to me, and will most likely be very slow. I'm all for XML, but this kind of thing is what databases are meant for. All you need are 2 tables, one for each thread and one for messages. threads: thread_id,subject,ts,activity messages: msg_id,thread_id,user_id,ts,subject,body SQL: SELECT * FROM threads ORDER BY activity DESC SELECT * FROM messages WHERE thread_id=? ORDER BY ts ASC Couldn't be easier, if you want to store extra data about each thread or message just add fields to the relevant table. I just wrapped up a complete rewrite of a system that used one table for threads and messages, and I would strongly suggest advise against it. If you're looking for ideas, here is a proof-of-concept I put together back in 2004 for a system using a modified preorder traversal tree for threaded messages. http://clew.phpwerx.net/ Dan From ajai at bitblit.net Thu Aug 16 10:56:28 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 16 Aug 2007 10:56:28 -0400 (EDT) Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: <721f1cc50708151601p45bbfe48ibf85db876c61d57d@mail.gmail.com> Message-ID: On Wed, 15 Aug 2007, David Mintz wrote: > now, my pet > peeve -- a lot of people are too lazy to snip Which is the crux of the problem: if you're too lazy to snip then you're more likely to top-post because your reply will get lost at the bottom after a few emails have been exchanged. This is also why (laziness) people still use Outlook and IE7 :-) -- Aj. From ben at projectskyline.com Thu Aug 16 11:01:13 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Thu, 16 Aug 2007 11:01:13 -0400 Subject: [nycphp-talk] XML Manipulation References: <016701c7e012$8f8f8810$6401a8c0@gamebox> <46C464EB.6060704@phpwerx.net> Message-ID: <01c201c7e016$4a1ebfe0$6401a8c0@gamebox> Hello, Hey, thanks alot. I'm going to print this out and give it a thorough read. I'm sure your correct, as I have minimal experiance in this. I take a look at the POC as well. Thanks! - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons ----- Original Message ----- From: "Dan Cech" To: "NYPHP Talk" Sent: Thursday, August 16, 2007 10:53 AM Subject: Re: [nycphp-talk] XML Manipulation > Ben Sgro (ProjectSkyLine) wrote: >> Hello all, >> >> After the XML vs SQL conversation, I started to rethink a product I'm >> working on. >> I had been having a lot of trouble modeling the data into SQL. It was >> starting to >> look very complicated. >> >> So, I decided I would try to store it in XML. The data I am storing is >> messages w/in a thread, >> timestamp, body and subject. On the SQL side, we create a table that has >> the user id, >> and a row per message/thread which contains a path to the xml file. >> >> The reason XML seemed better is that I store the data top down and that >> is the true >> order of the thread. Messages within the thread can come from email or >> html page response, >> so its important to insert items into the thread via the timestamp. Using >> XML just made it >> simpler for me to wrap my head around, than trying to model it in SQL. > > This sounds awfully messy to me, and will most likely be very slow. > > I'm all for XML, but this kind of thing is what databases are meant for. > > All you need are 2 tables, one for each thread and one for messages. > > threads: > > thread_id,subject,ts,activity > > messages: > > msg_id,thread_id,user_id,ts,subject,body > > SQL: > > SELECT * FROM threads ORDER BY activity DESC > > SELECT * FROM messages WHERE thread_id=? ORDER BY ts ASC > > Couldn't be easier, if you want to store extra data about each thread or > message just add fields to the relevant table. > > I just wrapped up a complete rewrite of a system that used one table for > threads and messages, and I would strongly suggest advise against it. > > If you're looking for ideas, here is a proof-of-concept I put together > back in 2004 for a system using a modified preorder traversal tree for > threaded messages. > > http://clew.phpwerx.net/ > > Dan > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From aw at sap8.com Thu Aug 16 11:05:51 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Thu, 16 Aug 2007 11:05:51 -0400 Subject: [nycphp-talk] [OT]: flatiron office sublet available In-Reply-To: References: <721f1cc50708151601p45bbfe48ibf85db876c61d57d@mail.gmail.com> Message-ID: <005101c7e016$efcfbde0$cf6f39a0$@com> Hey I have no choice in using Outlook, my calendar is synced to it and I can't get around that... Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Ajai Khattri Sent: Thursday, August 16, 2007 10:56 AM To: NYPHP Talk Subject: Re: [nycphp-talk] [OT]: flatiron office sublet available On Wed, 15 Aug 2007, David Mintz wrote: > now, my pet > peeve -- a lot of people are too lazy to snip Which is the crux of the problem: if you're too lazy to snip then you're more likely to top-post because your reply will get lost at the bottom after a few emails have been exchanged. This is also why (laziness) people still use Outlook and IE7 :-) -- Aj. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From chuck at horde.org Thu Aug 16 11:18:55 2007 From: chuck at horde.org (Chuck Hagenbuch) Date: Thu, 16 Aug 2007 11:18:55 -0400 Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? In-Reply-To: References: Message-ID: <20070816111855.om4f8aybcwkkcs0o@technest.org> >> I am about to move, and considering dumping Speakeasy DSL for the sake of >> economy, and because the installation (involving Verizon, Covad) is a total >> f$@#ing nightmare. I'm considering moving away from Speakeasy for the same reason - I had an outage recently, caused by a Verizon problem, and it was a minor miracle that it only lasted three days. >> Does anyone care to share an opinion about Comcast? How's the speed and >> reliability? Have you been able to work around the dynamic IP and expose ssh >> and http to the world? (I know there are ways. e.g,. with dyndyns.org, but >> I'd be interested in knowing how well it works). I don't know if you can get RCN where you are, but they sell static IPs as an add-on to residential accounts, which comes with all ports being unblocked. If you're stuck with Comcast, they have recently dropped prices on their commercial packages (at least according to the sales person I got a quote and contract from; their website still says $95/month but I was quoted $65 with a static IP). They're happy to sell commercial service to a residence (as a "home office" package) and commercial service has no port blocking. -chuck From SHalter at ThorntonTomasetti.com Thu Aug 16 11:10:57 2007 From: SHalter at ThorntonTomasetti.com (Halter, Shari) Date: Thu, 16 Aug 2007 11:10:57 -0400 Subject: [nycphp-talk] [OT]: Posting Message-ID: <20070816151930.CE8D4BC8265@gatekeeper.thettgroup.com> Subject: Re: [nycphp-talk] [OT]: flatiron office sublet available On Wed, 15 Aug 2007, David Mintz wrote: > now, my pet > peeve -- a lot of people are too lazy to snip Which is the crux of the problem: if you're too lazy to snip then you're more likely to top-post because your reply will get lost at the bottom after a few emails have been exchanged. This is also why (laziness) people still use Outlook and IE7 :-) -- Aj. I'm with David Mintz, on this one and, at best, this posting argument strikes me as a preference, rather than an absolute. Granted, it may be a community preference here, and if so, should be heeded, but it seems silly to argue in terms of "right" and "wrong." Reasonable people may also differ on how much context or content is relevant. I notice an off-thread subject line here, too. Should this be scolded, too? Shari _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> The information in this email and any attachments may contain confidential information that is intended solely for the attention and use of the named addressee(s). This message or any part thereof must not be disclosed, copied, distributed or retained by any person without authorization from the addressee. If you are not the intended addressee, please notify the sender immediately, and delete this message. <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> From agfische at email.smith.edu Thu Aug 16 13:36:03 2007 From: agfische at email.smith.edu (Aaron Fischer) Date: Thu, 16 Aug 2007 13:36:03 -0400 Subject: [nycphp-talk] Search of directories and files on my web server In-Reply-To: <46C46265.8070908@phpwerx.net> References: <46C46265.8070908@phpwerx.net> Message-ID: <390893E4-4A25-4C25-9902-DD7ECB3FC0BA@email.smith.edu> Dan, thanks that did the trick. I had various echo statements in my original script but took them out for purposes of posting succinct code to the list. I didn't use grep because I don't have any exposure or experience with it. It was mentioned as an option during my original post but I was hesitant to try the unknown path given the duress I was under from time constraints. Any suggestions for a good grep tutorial/resource on the web? I'm interested in adding it to my tool belt for future use. In going back and looking at the one or two grep examples, it seems that it might be a much simpler and more efficient way of solving this problem. Cheers, -Aaron > > Aaron, > > First up, why not just use grep? > > Anyway, your problem is that you are not addressing the items by the > full path, so the script can't find them. > > Here is a modified example which may help, and includes some output so > you can see what is haoppening. > > Dan > > > $path='.'; > search($path); > > function search($path) > { > echo 'Searching '. $path ."\n"; > $dir=opendir($path); > // browse all files and folders in the current directory > while (false !== ($item=readdir($dir))) { > if ($item == '.' | $item == '..') { > continue; > } > > $item = $path .'/'. $item; > > echo $item."\n"; > // if the item is a directory, drill down using a > // recursive call to the search function > if (is_dir($item) && $item !='.' && $item!='..') { > search($item); > } > if (is_file($item)) { > $file=file($item); > $lines=count($file); > for ($i=0; $i<$lines; $i++) { > if (strstr(($file[$i]), 'text to search for')) { > echo 'Search string found on line ' . $i > . ' in file ' . $item . '
'; > } > } > } > } > closedir($dir); > echo 'Done searching '. $path ."\n"; > } > > // end of script From aw at sap8.com Thu Aug 16 13:48:45 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Thu, 16 Aug 2007 13:48:45 -0400 Subject: [nycphp-talk] Login schemes. Message-ID: <000e01c7e02d$b147eea0$13d7cbe0$@com> I was thinking about login schemes so I had an idea about using a form on the front page which would authenticate against a database (already done this part) but I am having problems getting people to the members/lobby area. One way of doing it is to use the $_SERVER['PHP_SELF'] variable and when index.php calls itself the checks for cookie data would tell them that they have successfully logged in and maybe use an include statement. The other alternative is that as soon as the checks against the SQL database are complete I could use a header ("Location: ./foobar.php") statement to move them to the right page and then pull data based on the user id that is stored in a session/cookie, but the problem is that once I send a HTML header (stylesheets for the form) I can't use the header function as it burps an error. How do you guys handle events like this? Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Thu Aug 16 13:48:52 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 16 Aug 2007 13:48:52 -0400 Subject: [nycphp-talk] Eliminating namespace conflicts between scripts? In-Reply-To: References: Message-ID: On Aug 16, 2007, at 10:18 AM, Cliff Hirsch wrote: > What about issuing a command line call? Although opening up this > functionality adds so many security risks. I was thinking that might be reasonable and avoids the http connection overhead. As long as the call is totally controlled by you and doesn't include user input, I don't see any security risks. Does the other app need access to your web server environment - aka $_SERVER? If so, that would throw out both options and you'd have to figure out how to rework your app to play nice with it. FYI, an old version of one of our apps used curl to tickle a mail queue every 5 minutes and worked fine. -Rob From tomsartain at gmail.com Thu Aug 16 13:53:52 2007 From: tomsartain at gmail.com (Tom Sartain) Date: Thu, 16 Aug 2007 13:53:52 -0400 Subject: [nycphp-talk] Login schemes. In-Reply-To: <000e01c7e02d$b147eea0$13d7cbe0$@com> References: <000e01c7e02d$b147eea0$13d7cbe0$@com> Message-ID: <20190d950708161053u1ffd3c34p28281ca24c0f2d0a@mail.gmail.com> On 8/16/07, Anthony Wlodarski wrote: > > I was thinking about login schemes so I had an idea about using a form on > the front page which would authenticate against a database (already done > this part) but I am having problems getting people to the members/lobby > area. One way of doing it is to use the $_SERVER['PHP_SELF'] variable and > when index.php calls itself the checks for cookie data would tell them > that they have successfully logged in and maybe use an include statement. > The other alternative is that as soon as the checks against the SQL database > are complete I could use a header ("Location: ./foobar.php") statement to > move them to the right page and then pull data based on the user id that is > stored in a session/cookie, but the problem is that once I send a HTML > header (stylesheets for the form) I can't use the header function as it > burps an error. > > > > How do you guys handle events like this? > > Output buffering. It's fantastic. http://us3.php.net/ob_start You can change the headers anywhere you like in your script, and not have to worry about it tossing errors. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Thu Aug 16 14:37:31 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 16 Aug 2007 14:37:31 -0400 Subject: [nycphp-talk] Eliminating namespace conflicts between scripts? In-Reply-To: Message-ID: On 8/16/07 1:48 PM, "Rob Marscher" wrote: > On Aug 16, 2007, at 10:18 AM, Cliff Hirsch wrote: >> What about issuing a command line call? Although opening up this >> functionality adds so many security risks. > I was thinking that might be reasonable and avoids the http > connection overhead. As long as the call is totally controlled by > you and doesn't include user input, I don't see any security risks. > Does the other app need access to your web server environment - aka > $_SERVER? If so, that would throw out both options and you'd have to > figure out how to rework your app to play nice with it. Why does access to $_SERVER matter for call originating from call? Curl is just simulating a http request. From brian at realm3.com Thu Aug 16 14:40:53 2007 From: brian at realm3.com (Brian D.) Date: Thu, 16 Aug 2007 14:40:53 -0400 Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? In-Reply-To: <20070816111855.om4f8aybcwkkcs0o@technest.org> References: <20070816111855.om4f8aybcwkkcs0o@technest.org> Message-ID: I would like to +1 the RCN mention. I did have some trouble with them installing an unrequested cable television set, but once we got that worked out I've not much had much of a problem with them. I can't speak about hosting, though, as I don't host anything business-wise from the RCN line. On 8/16/07, Chuck Hagenbuch wrote: > >> I am about to move, and considering dumping Speakeasy DSL for the sake of > >> economy, and because the installation (involving Verizon, Covad) is a total > >> f$@#ing nightmare. > > I'm considering moving away from Speakeasy for the same reason - I had > an outage recently, caused by a Verizon problem, and it was a minor > miracle that it only lasted three days. > > >> Does anyone care to share an opinion about Comcast? How's the speed and > >> reliability? Have you been able to work around the dynamic IP and expose ssh > >> and http to the world? (I know there are ways. e.g,. with dyndyns.org, but > >> I'd be interested in knowing how well it works). > > I don't know if you can get RCN where you are, but they sell static > IPs as an add-on to residential accounts, which comes with all ports > being unblocked. If you're stuck with Comcast, they have recently > dropped prices on their commercial packages (at least according to the > sales person I got a quote and contract from; their website still says > $95/month but I was quoted $65 with a static IP). They're happy to > sell commercial service to a residence (as a "home office" package) > and commercial service has no port blocking. > > -chuck > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From jcampbell1 at gmail.com Thu Aug 16 14:58:50 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 16 Aug 2007 14:58:50 -0400 Subject: [nycphp-talk] Login schemes. In-Reply-To: <000e01c7e02d$b147eea0$13d7cbe0$@com> References: <000e01c7e02d$b147eea0$13d7cbe0$@com> Message-ID: <8f0676b40708161158s56a3283en8045f12687a6e766@mail.gmail.com> > How do you guys handle events like this? The right solution is to *always* process POST data before sending any data back to the user. Why not just move the form processing code to the top of the script? There is no reason that you need to send the html head section before you do something with the POST data. From rmarscher at beaffinitive.com Thu Aug 16 14:59:40 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 16 Aug 2007 14:59:40 -0400 Subject: [nycphp-talk] Eliminating namespace conflicts between scripts? In-Reply-To: References: Message-ID: <7FE32740-7022-4B9D-97A0-4E35E609EDBD@beaffinitive.com> On Aug 16, 2007, at 2:37 PM, Cliff Hirsch wrote: > Why does access to $_SERVER matter for call originating from call? > Curl is > just simulating a http request. What I meant is if the other app needed access to the user's cookies, ip, user agent, etc. Sorry, I didn't really phrase it very well. -Rob From rmarscher at beaffinitive.com Thu Aug 16 15:02:18 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 16 Aug 2007 15:02:18 -0400 Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? In-Reply-To: <721f1cc50708151554y206742ecs4402e2bf6feeb438@mail.gmail.com> References: <721f1cc50708151554y206742ecs4402e2bf6feeb438@mail.gmail.com> Message-ID: <695E7BE2-AFB7-4916-936B-D27E54B8041F@beaffinitive.com> On Aug 15, 2007, at 6:54 PM, David Mintz wrote: > I am about to move, and considering dumping Speakeasy DSL for the > sake of economy If your new place has access to Verizon FiOS, I'd recommend that. It's so fast!! A friend of mine runs a server successfully through it using dyndns.org. From cliff at pinestream.com Thu Aug 16 15:20:51 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Thu, 16 Aug 2007 15:20:51 -0400 Subject: [nycphp-talk] Eliminating namespace conflicts between scripts? In-Reply-To: <7FE32740-7022-4B9D-97A0-4E35E609EDBD@beaffinitive.com> Message-ID: On 8/16/07 2:59 PM, "Rob Marscher" wrote: > On Aug 16, 2007, at 2:37 PM, Cliff Hirsch wrote: >> Why does access to $_SERVER matter for call originating from call? >> Curl is >> just simulating a http request. > What I meant is if the other app needed access to the user's cookies, > ip, user agent, etc. Sorry, I didn't really phrase it very well. Ah, got it. I like the curl idea for starters. It's a really clean separation of applications and sure beats spending time looking for conflicts. One other though for those following, although a different usage model, is an iframe. From aw at sap8.com Thu Aug 16 15:33:19 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Thu, 16 Aug 2007 15:33:19 -0400 Subject: [nycphp-talk] Login schemes. In-Reply-To: <8f0676b40708161158s56a3283en8045f12687a6e766@mail.gmail.com> References: <000e01c7e02d$b147eea0$13d7cbe0$@com> <8f0676b40708161158s56a3283en8045f12687a6e766@mail.gmail.com> Message-ID: <000001c7e03c$4cfce450$e6f6acf0$@com> Since I am from the old school I always think of applications a driven event model. I guess all form processing can happen at the top and then the header information can be thrown at the user after. Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of John Campbell Sent: Thursday, August 16, 2007 2:59 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Login schemes. > How do you guys handle events like this? The right solution is to *always* process POST data before sending any data back to the user. Why not just move the form processing code to the top of the script? There is no reason that you need to send the html head section before you do something with the POST data. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From edwardpotter at gmail.com Thu Aug 16 17:48:29 2007 From: edwardpotter at gmail.com (Edward Potter) Date: Thu, 16 Aug 2007 17:48:29 -0400 Subject: [nycphp-talk] Search of directories and files on my web server In-Reply-To: References: Message-ID: Yipes, grep -r 'foo' * [or something like that!] :-) ed On 8/16/07, Aaron Fischer wrote: > Greetings, > > I am working on a little script that will start at a specified > directory on my web server and then proceed to look through all files > and sub-folders for an instance of text located in a file. (This is > a follow-up of sorts to a previous post of mine from a week or two ago.) > > I got the code to work fine for searching through one directory. > However, my thought was that in order to drill down through an > undefined number of sub-folders I would need to implement a recursive > function. The recursive "depth first" search function I made is not > working as expected and so far I haven't been able to figure out what > or how I need to tweak it. > > I'm completely squeezed for time at work so I'll continue to bang > away at it but I thought I would post it here in the hopes that some > of our rockets scientists can show me the error of my ways. I'm > guessing this will be a rather simple problem for some folks on the > list. > > So here goes. Listed below are my algorithm and code. I'm looking > forward to finding out where I'm going wrong. =) > > My algorithm: > 1) Set the directory that the script will start in. > 2) Open that directory and read all files and folders in that directory. > 3) While each item is being read, check it. If the item is a > directory, call the recursive search in order to drill down further. > If the item is a file, open the file and search for the text string > that I am trying to locate. > > My code (with comments): > > $path='/home/usr/account'; > search($path); > > function search($path) > { > $dir=opendir($path); > // browse all files and folders in the current directory > while (false !== ($item=readdir($dir))) { > // if the item is a directory, drill down using a recursive call to > the search function > if (is_dir($item) && $item !='.' && $item!='..') { > search($path . '/' . $item); > } > if (is_file($item)) { > $file=file($item); > $lines=count($file); > for ($i=0; $i<$lines; $i++) { > if (strstr(($file[$i]), 'text to search for')) { > echo 'Search string found on line ' . $i . ' in file ' . $path . > '/' . $item . '
'; > } > } > } > } > closedir($dir); > } > ?> > > Cheers, > > -Aaron > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- the Blog: http://www.utopiaparkway.com the Karma: http://www.coderswithconscience.com the Projects: http://flickr.com/photos/86842405 at N00/ the Store: http://astore.amazon.com/httpwwwutopic-20 From edwardpotter at gmail.com Thu Aug 16 17:49:24 2007 From: edwardpotter at gmail.com (Edward Potter) Date: Thu, 16 Aug 2007 17:49:24 -0400 Subject: [nycphp-talk] Search of directories and files on my web server In-Reply-To: References: Message-ID: sorry, did not see that second post. man grep :-) On 8/16/07, Edward Potter wrote: > Yipes, grep -r 'foo' * [or something like that!] > > :-) ed > > On 8/16/07, Aaron Fischer wrote: > > Greetings, > > > > I am working on a little script that will start at a specified > > directory on my web server and then proceed to look through all files > > and sub-folders for an instance of text located in a file. (This is > > a follow-up of sorts to a previous post of mine from a week or two ago.) > > > > I got the code to work fine for searching through one directory. > > However, my thought was that in order to drill down through an > > undefined number of sub-folders I would need to implement a recursive > > function. The recursive "depth first" search function I made is not > > working as expected and so far I haven't been able to figure out what > > or how I need to tweak it. > > > > I'm completely squeezed for time at work so I'll continue to bang > > away at it but I thought I would post it here in the hopes that some > > of our rockets scientists can show me the error of my ways. I'm > > guessing this will be a rather simple problem for some folks on the > > list. > > > > So here goes. Listed below are my algorithm and code. I'm looking > > forward to finding out where I'm going wrong. =) > > > > My algorithm: > > 1) Set the directory that the script will start in. > > 2) Open that directory and read all files and folders in that directory. > > 3) While each item is being read, check it. If the item is a > > directory, call the recursive search in order to drill down further. > > If the item is a file, open the file and search for the text string > > that I am trying to locate. > > > > My code (with comments): > > > > > $path='/home/usr/account'; > > search($path); > > > > function search($path) > > { > > $dir=opendir($path); > > // browse all files and folders in the current directory > > while (false !== ($item=readdir($dir))) { > > // if the item is a directory, drill down using a recursive call to > > the search function > > if (is_dir($item) && $item !='.' && $item!='..') { > > search($path . '/' . $item); > > } > > if (is_file($item)) { > > $file=file($item); > > $lines=count($file); > > for ($i=0; $i<$lines; $i++) { > > if (strstr(($file[$i]), 'text to search for')) { > > echo 'Search string found on line ' . $i . ' in file ' . $path . > > '/' . $item . '
'; > > } > > } > > } > > } > > closedir($dir); > > } > > ?> > > > > Cheers, > > > > -Aaron > > _______________________________________________ > > New York PHP Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > NYPHPCon 2006 Presentations Online > > http://www.nyphpcon.com > > > > Show Your Participation in New York PHP > > http://www.nyphp.org/show_participation.php > > > > > -- > the Blog: http://www.utopiaparkway.com > the Karma: http://www.coderswithconscience.com > the Projects: http://flickr.com/photos/86842405 at N00/ > the Store: http://astore.amazon.com/httpwwwutopic-20 > -- the Blog: http://www.utopiaparkway.com the Karma: http://www.coderswithconscience.com the Projects: http://flickr.com/photos/86842405 at N00/ the Store: http://astore.amazon.com/httpwwwutopic-20 From jonbaer at jonbaer.com Thu Aug 16 19:52:06 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 16 Aug 2007 19:52:06 -0400 Subject: [nycphp-talk] Search of directories and files on my web server In-Reply-To: <46C46265.8070908@phpwerx.net> References: <46C46265.8070908@phpwerx.net> Message-ID: <9A5DEFC7-A0B1-4C11-B146-95AE07B046D9@jonbaer.com> Don't forget, there are good options in PEAR as well. http://pear.php.net/package/File_Find - Jon On Aug 16, 2007, at 10:42 AM, Dan Cech wrote: > Aaron Fischer wrote: >> Greetings, >> >> I am working on a little script that will start at a specified >> directory >> on my web server and then proceed to look through all files and >> sub-folders for an instance of text located in a file. (This is a >> follow-up of sorts to a previous post of mine from a week or two >> ago.) >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Thu Aug 16 19:59:37 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Thu, 16 Aug 2007 19:59:37 -0400 Subject: [nycphp-talk] Measuring Test Coverage + BDD for PHP Message-ID: <74236455-71C3-4B2A-A9CD-20450A7A7078@jonbaer.com> So the two tools I have come to respect in Ruby world are both Rspec and Rcov and am looking for what the equivalents in PHP and notice there is a nice "documentation coverage" page on PEAR now ... http://pear.php.net/package/QA_Peardoc_Coverage So what would be used for BDD in PHP (in terms of what Rspec does) and what tool would do something like a QA_Test_Coverage type of analysis into PHP code? Im starting to refactor some old code in a project and moving everything into a PEAR package + would like to include these 2 ideas ... - Jon -------------- next part -------------- An HTML attachment was scrubbed... URL: From smanes at magpie.com Thu Aug 16 19:59:45 2007 From: smanes at magpie.com (Steve Manes) Date: Thu, 16 Aug 2007 19:59:45 -0400 Subject: [nycphp-talk] Search of directories and files on my web server In-Reply-To: References: Message-ID: <46C4E4F1.30408@magpie.com> Aaron Fischer wrote: > if (is_dir($item) && $item !='.' && $item!='..') { > search($path . '/' . $item); > } > if (is_file($item)) { > $file=file($item); ... Don't forget that since you're not doing a chdir() before recursing that you're still looking at files in the context of your original working directory. Change it to: $filepath = "${path}/${item}"; if (is_file($filepath)) { $file=file($filepath); and it should work. From danielc at analysisandsolutions.com Thu Aug 16 20:21:36 2007 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 16 Aug 2007 20:21:36 -0400 Subject: [nycphp-talk] Any Subversion and/or Tortoise SVN experts out there? In-Reply-To: References: Message-ID: <20070817002136.GA27591@panix.com> On Mon, Aug 13, 2007 at 09:23:34AM -0400, Cliff Hirsch wrote: > > But how do I print/capture this file list and associated diff? The "Create Patch" menu option in Tortoise. It will run and then let you save the output to a file or copy it to the clipboard. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Thu Aug 16 20:33:45 2007 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 16 Aug 2007 20:33:45 -0400 Subject: [nycphp-talk] Eliminating namespace conflicts between scripts? In-Reply-To: References: Message-ID: <20070817003344.GB27591@panix.com> On Thu, Aug 16, 2007 at 06:30:02AM -0400, Cliff Hirsch wrote: > I am tying a large open source ap into my main ap. This ap has numerous > global variable and countless includes and classless functions. Thus, the > chances for a namespace conflict with my primary application are high. So, why not add a prefix to your functions and global variable names? Search, replace, fixed. --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 rick at click-rick.net Thu Aug 16 21:41:06 2007 From: rick at click-rick.net (Rick Retzko) Date: Thu, 16 Aug 2007 21:41:06 -0400 Subject: [nycphp-talk] PECL Install ERRORs Message-ID: <00f601c7e06f$af3de7d0$6600a8c0@adam> Hi All - I'm working through an installation of PHP-GTK2 on Windows XP system. Everything's going OK up to the install of pecl bcompiler and pdflib packages. When I install either of these I get the following: $>pecl install channel://pecl.php.net/bcompiler-0.8 downloading bcompiler-0.8.tgz ... Starting to download bcompiler-0.8.tgz (46,667 bytes) .........done: 46,667 bytes 10 source files, building running: msdev bcompiler.dsp /MAKE "bcompiler - Release" ERROR: There were errors during compilation. The pdflib similarly bombs after the /MAKE command. All help is appreciated. Small words and short sentences work best. Thanks! Best Regards - Rick ============ MFR Holdings, LLC rick at click-rick.net 201.755.4083 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Fri Aug 17 09:24:18 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Fri, 17 Aug 2007 09:24:18 -0400 Subject: [nycphp-talk] Good Crediting Practices Message-ID: <46C5A182.1090506@beezifies.com> I'm planning on some major rewrites to an existing GPL application. I'd say that of the application, I will be extending, enhancing, or changing between 30 and 60 % of the application, including the program name for compatible reasons(the two modules must be able to be run in the same master program simultaneously, so a lot of classes and functions need to be changed to differentiate them) What is the best way to note my code and provide the proper credit? The current header has the program name, filename, version, and identifcation information of the current author(all GPL). My own tendency would be to place my header underneath the existing one, however the version information would be different, so I want to give prominent credit to the original author, while still maintaining identification information. The current header is as follows: // // Copyright (C) 2006 Thomas Papin // http://www.gnu.org/copyleft/gpl.html GNU/GPL // This file is part of the AdsManager Component, // a Joomla! Classifieds Component by Thomas Papin // Email: thomas.papin at free.fr // I'm thinking the best course would be: // Adsmanager Extended // Based on: //-------------- // // Copyright (C) 2006 Thomas Papin // http://www.gnu.org/copyleft/gpl.html GNU/GPL // This file is part of the AdsManager Component, // a Joomla! Classifieds Component by Thomas Papin // Email: thomas.papin at free.fr //-------------- // Changes and Extentions // Copyright (C) 2007 Gary Mort // http://www.gnu.org/copyleft/gpl.html GNU/GPL // This file extends and enhances the AdsManager Component, // it can be installed stand alone, or alongside AdsManager But that looks confusing to me. Should I just stick all my new text below the existing notice? Obviously, throughout the program I can mark my changes to the code where appropriate. Just wondering what is considered best/common practice. From chsnyder at gmail.com Fri Aug 17 09:45:40 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 17 Aug 2007 09:45:40 -0400 Subject: [nycphp-talk] Good Crediting Practices In-Reply-To: <46C5A182.1090506@beezifies.com> References: <46C5A182.1090506@beezifies.com> Message-ID: On 8/17/07, Gary Mort wrote: > I'm planning on some major rewrites to an existing GPL application. > > I'd say that of the application, I will be extending, enhancing, or > changing between 30 and 60 % of the application, including the program > name for compatible reasons(the two modules must be able to be run in > the same master program simultaneously, so a lot of classes and > functions need to be changed to differentiate them) > > What is the best way to note my code and provide the proper credit? 30-60% is pretty major. As far as credit goes, the GPL basically says that you shouldn't try to pass off your work as the original author's--to protect the author in case your modifications break something. You have a responsibility to provide credit and a link back to the original project, but the copyright belongs to you (or your employer) alone. /** Copyright (C) 2007 Gary Mort This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License: http://www.gnu.org/copyleft/gpl.html This file extends and enhances Thomas Papin's AdsManager Component (http://usr/of/adsmanager/) It can be installed stand alone, or alongside AdsManager. **/ Personally, I would also stick a NO WARRANTY clause in there, but technically that's part of the GPL. -- Chris Snyder http://chxo.com/ From cliff at pinestream.com Fri Aug 17 09:53:37 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 17 Aug 2007 09:53:37 -0400 Subject: [nycphp-talk] Cache package suggestions Message-ID: I?m reviewing caching packages and am looking for suggestions. If you have seen one of my prior threads, I just want to cache the results of a curl operation, since that?s very slow. My choices so far seem to be: Smarty cache ? since I use Smarty anyway. I?ll probably use Smarty cache for general page result caching, but perhaps not for lower layer objects? PEAR cachelite ? looks simple and efficient. Could be good for caching small ?widgets?, misc paramters, etc. ZendFramework Zend_Cache ? multiple backend storage options is nice, but may be overkill for my needs ? until I realize I need memcached of course. Ez components cache class -- unknown Others? Also... All packages generally store cache results based on a lifetime. But what if I want to store results using a date, not a lifetime. An example would be something that changes once per day. Ideally, I?d like this updated for the first hit after midnight each day. Suggestions? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From donnamarievincent at yahoo.com Fri Aug 17 10:35:52 2007 From: donnamarievincent at yahoo.com (Donna Marie Vincent) Date: Fri, 17 Aug 2007 07:35:52 -0700 (PDT) Subject: [nycphp-talk] Webserver file access Message-ID: <241777.64891.qm@web35611.mail.mud.yahoo.com> Does this sound unreasonable, or is it just me? In order to upload files to the website, I have to do this: 1. Use WinSCP to log in to the server as myself and transfer files from my PC to my home directory on the server. 2. Use PuTTY to log in to the server as myself, then su as root, and from the command line move the files from my home directory to the website's directory. Seems like a very tedious process to update files, especially when you're modifying files in this subdirectory and that subdirectory. It's set up this way for security -- no ftp access and no logging in as root. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Fri Aug 17 10:37:44 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Fri, 17 Aug 2007 10:37:44 -0400 Subject: [nycphp-talk] Good Crediting Practices In-Reply-To: References: <46C5A182.1090506@beezifies.com> Message-ID: <46C5B2B8.6030407@beezifies.com> csnyder wrote: > 30-60% is pretty major. I swear, I was only going to change one little thing. Well, ok, maybe 2.. 3....4...and why is this program passing large table results to functions directly(aka copying them) instead of by reference..... oh the heck with it, I'll just rewrite the dang thing. :-) From aw at sap8.com Fri Aug 17 10:47:57 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Fri, 17 Aug 2007 10:47:57 -0400 Subject: [nycphp-talk] Webserver file access In-Reply-To: <241777.64891.qm@web35611.mail.mud.yahoo.com> References: <241777.64891.qm@web35611.mail.mud.yahoo.com> Message-ID: <005e01c7e0dd$99d66f70$cd834e50$@com> I use Eclipse to upload to a staging folder and then move them using a SSH session as well. Not absurd but is tedious. Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Donna Marie Vincent Sent: Friday, August 17, 2007 10:36 AM To: talk at lists.nyphp.org Subject: [nycphp-talk] Webserver file access Does this sound unreasonable, or is it just me? In order to upload files to the website, I have to do this: 1. Use WinSCP to log in to the server as myself and transfer files from my PC to my home directory on the server. 2. Use PuTTY to log in to the server as myself, then su as root, and from the command line move the files from my home directory to the website's directory. Seems like a very tedious process to update files, especially when you're modifying files in this subdirectory and that subdirectory. It's set up this way for security -- no ftp access and no logging in as root. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri Aug 17 11:21:04 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 17 Aug 2007 11:21:04 -0400 Subject: [nycphp-talk] Webserver file access In-Reply-To: <241777.64891.qm@web35611.mail.mud.yahoo.com> References: <241777.64891.qm@web35611.mail.mud.yahoo.com> Message-ID: On 8/17/07, Donna Marie Vincent wrote: > > Does this sound unreasonable, or is it just me? > > In order to upload files to the website, I have to do this: > > 1. Use WinSCP to log in to the server as myself and transfer files from my > PC to my home directory on the server. > > 2. Use PuTTY to log in to the server as myself, then su as root, and from > the command line move the files from my home directory to the website's > directory. > > Seems like a very tedious process to update files, especially when you're > modifying files in this subdirectory and that subdirectory. > > It's set up this way for security -- no ftp access and no logging in as > root. In projects directory on your workstation: $ svn commit -m "Important bugfixes" myproject Now ssh to webserver: $ su - # cd /usr/local/myproject # svn up The part about no ftp access and no root login is not unreasonable, it's standard practice for many production systems. The part where you move files around rather than using version control is a recipe for disaster. -- Chris Snyder http://chxo.com/ From lists at enobrev.com Fri Aug 17 11:53:06 2007 From: lists at enobrev.com (Mark Armendariz) Date: Fri, 17 Aug 2007 11:53:06 -0400 Subject: [nycphp-talk] Webserver file access In-Reply-To: References: <241777.64891.qm@web35611.mail.mud.yahoo.com> Message-ID: <46C5C462.4050808@enobrev.com> csnyder wrote: > On 8/17/07, Donna Marie Vincent wrote: > >> In order to upload files to the website, I have to do this: >> >> 1. Use WinSCP to log in to the server as myself and transfer files from my >> PC to my home directory on the server. >> >> 2. Use PuTTY to log in to the server as myself, then su as root, and from >> the command line move the files from my home directory to the website's >> directory. >> > $ svn commit -m "Important bugfixes" myproject > > Now ssh to webserver: > > $ su - > # cd /usr/local/myproject > # svn up > > The part about no ftp access and no root login is not unreasonable, > it's standard practice for many production systems. The part where you > move files around rather than using version control is a recipe for > disaster. > Couldn't agree more. Consider looking into Bazaar (distributed version control). Once you've set it up on your desktop and server, you can: $ bzr -ci -m "Important bugfixes" $ bzr push // which will use your 'remembered' sftp address // and then on the server, # bzr pull // which grabs the latest from the 'remembered' home directory Bazaar: http://bazaar-vcs.org/ Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From wkamm at rvyriptide.org Fri Aug 17 12:07:22 2007 From: wkamm at rvyriptide.org (wkamm at rvyriptide.org) Date: Fri, 17 Aug 2007 12:07:22 -0400 (EDT) Subject: [nycphp-talk] Webserver file access In-Reply-To: <241777.64891.qm@web35611.mail.mud.yahoo.com> References: <241777.64891.qm@web35611.mail.mud.yahoo.com> Message-ID: <54089.192.128.167.68.1187366842.squirrel@rvyriptide.org> Can your userid have access to the web site's directory? You can then use WinSCP to copy the files there directly, and avoid using PuTTY. Bill > Does this sound unreasonable, or is it just me? > > In order to upload files to the website, I have to do this: > > 1. Use WinSCP to log in to the server as myself and transfer files from my > PC to my home directory on the server. > > 2. Use PuTTY to log in to the server as myself, then su as root, and from > the command line move the files from my home directory to the website's > directory. > > Seems like a very tedious process to update files, especially when you're > modifying files in this subdirectory and that subdirectory. > > It's set up this way for security -- no ftp access and no logging in as > root. > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From kenneth at ylayali.net Fri Aug 17 12:45:14 2007 From: kenneth at ylayali.net (Kenneth Dombrowski) Date: Fri, 17 Aug 2007 12:45:14 -0400 Subject: [nycphp-talk] Webserver file access In-Reply-To: <241777.64891.qm@web35611.mail.mud.yahoo.com> References: <241777.64891.qm@web35611.mail.mud.yahoo.com> Message-ID: <20070817164514.GP5853@ylayali.net> On 07-08-17 07:35 -0700, Donna Marie Vincent wrote: > Does this sound unreasonable, or is it just me? updating a web site should not require root but, since you do have root on the server, you can do this: 1. if your site is not owned by a dedicated user + group, I would recommend setting it up; it is easy to do. Start by creating a non-system user & group (this varies with different OSes), on most linux distros this should do it: $ sudo useradd -d /var/www/example.com example then: $ sudo chown -R example:example /var/www/example.com i don't give my site users (e.g. "example") passwords, they have no need to log in interactively. the -d flag to useradd sets the directory to use for the user's $HOME, and the -R flag to the chmod command recursively sets owner:group properties of all files & directories below the path specified 2. add yourself to the website user's primary group $ sudo vi /etc/group add your username to the "example" group: example:x:1001:donna 3. make sure your website files are group writeable $ sudo find /var/www/example.com -type d -exec chmod 2775 '{}' \; $ sudo find /var/www/example.com -type f -exec chmod 0664 '{}' \; the first command recursively makes all directories group writable, and traversable + readable by everyone (incl. the user your apache runs as), and sets the "sticky group" bit, I think it's called, so new files and directories will be owned by the containing directory's gid (rather than the gid of the user doing the writing) the second command recursively makes all files group writable and readable by everyone. if you have any command line or cgi scripts which need to be executable, you will have to restore the -x bit $ sudo chmod 0775 /var/www/example.com/scripts/myscript.pl note all users with an account on the machine will be able to read the files as well, but since apache must have access in any case, there's really no way around that; at least for the files that make up your site. for files apache does not need access to, replace the last bit with zero in any of the octets above $ sudo chmod 2770 /var/www/example.com/privatedir 3. you can now upload directly to the file's final destination. you can create a symlink from your $HOME to the site's root directory if it makes it easier $ cd && ln -s /var/www/example.com you now also have a mechanism in place to allow other developers to update the site without giving away root: just add them to the group finally, I agree with Chris that anybody doing serious work should be using version control, but that is the next step, first you should have your file permissions in order , and a reasonably good understanding of what the commands above do, and why you want to do it. also, use sudo. hth, kenneth From anoland at indigente.net Fri Aug 17 12:47:34 2007 From: anoland at indigente.net (Adrian Noland) Date: Fri, 17 Aug 2007 12:47:34 -0400 Subject: [nycphp-talk] Webserver file access In-Reply-To: <54089.192.128.167.68.1187366842.squirrel@rvyriptide.org> References: <241777.64891.qm@web35611.mail.mud.yahoo.com> <54089.192.128.167.68.1187366842.squirrel@rvyriptide.org> Message-ID: <1d8a0e930708170947i51109372tf06450b08f55c8d4@mail.gmail.com> On 8/17/07, wkamm at rvyriptide.org wrote: > > Can your userid have access to the web site's directory? You can then use > WinSCP to copy the files there directly, and avoid using PuTTY. > Another way to do essentially the same noted above: Have your administrator add you to the group for the web root directory, in my case the apache group, as well as g+w perms. Add the line 'newgrp apache' to your profile and presto, permissions to move and delete files around. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Fri Aug 17 12:57:23 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 17 Aug 2007 12:57:23 -0400 Subject: [nycphp-talk] Cache package suggestions In-Reply-To: References: Message-ID: > I?m reviewing caching packages and am looking for suggestions. > Smarty cache ? since I use Smarty anyway. I?ll probably use Smarty > cache for general page result caching, but perhaps not for lower > layer objects? > PEAR cachelite ? looks simple and efficient. Could be good for > caching small ?widgets?, misc paramters, etc. Both of these are file based, so you have some disk i/o overhead. I've used both. Smarty is oriented a bit more towards page output caching, but I don't see why it wouldn't be possible to store anything else... you just need to appropriately serialize the data to a string. Cache_Lite has more methods for dealing with other types of data. > ZendFramework Zend_Cache ? multiple backend storage options is > nice, but may be overkill for my needs ? until I realize I need > memcached of course. This one gets my vote because of the multiple backend options - APC, Memcache, ZendPlatform, SQLite, and file based. Only SQLite and file- based backends support the "tag" grouping - but it's not that important a feature. I would say don't use tagging so you can easily switch the backends. Also, I don't really see how it's anymore overkill than PEAR. You don't need to include the whole framework as demonstrated in this article. http://devzone.zend.com/node/view/id/1221 > Also... All packages generally store cache results based on a > lifetime. But what if I want to store results using a date, not a > lifetime. An example would be something that changes once per day. > Ideally, I?d like this updated for the first hit after midnight > each day. Suggestions? Use a lifetime of 86400 and manually invalidate it sometime after midnight. It's not reliable that it would stay always at the same time. You could set no expire time for the cache (or a really huge expire time if your cache system requires an expiration) and then have a cron process that runs after midnight and updates the cache programmatically. That's probably better. -Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri Aug 17 13:07:16 2007 From: chsnyder at gmail.com (csnyder) Date: Fri, 17 Aug 2007 13:07:16 -0400 Subject: [nycphp-talk] XML Manipulation In-Reply-To: <46C464EB.6060704@phpwerx.net> References: <016701c7e012$8f8f8810$6401a8c0@gamebox> <46C464EB.6060704@phpwerx.net> Message-ID: On 8/16/07, Dan Cech wrote: > > If you're looking for ideas, here is a proof-of-concept I put together > back in 2004 for a system using a modified preorder traversal tree for > threaded messages. > > http://clew.phpwerx.net/ > The Clew meme dates back to 2003, when NYPHP was experimenting with ways to re-implement Mailman as an OO-PHP solution. There's an overview at http://www.nyphp.org/content/presentations/nyphp/, but very little interest remained after that presentation, and we all went on to do other things. The nice thing about using some sort of tree (we called it a nested-set model) for messages is that you get true threading--this is a reply to that--rather than just a flat chronological list of replies. Very often, people just want the flat list as it is easier to follow. -- Chris Snyder http://chxo.com/ From cliff at pinestream.com Fri Aug 17 13:24:19 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 17 Aug 2007 13:24:19 -0400 Subject: [nycphp-talk] Cache package suggestions In-Reply-To: Message-ID: On 8/17/07 12:57 PM, "Rob Marscher" wrote: >> I?m reviewing caching packages and am looking for suggestions. >> Smarty cache ? since I use Smarty anyway... >> PEAR cachelite ? looks simple and efficient. Could be good for caching small >> ?widgets?, misc paramters, etc. > > Both of these are file based, so you have some disk i/o overhead.? I've used > both.? Smarty is oriented a bit more towards page output caching, but I don't > see why it wouldn't be possible to store anything else... you just need to > appropriately serialize the data to a string.? Cache_Lite has more methods for > dealing with other types of data. > >> ZendFramework Zend_Cache ? multiple backend storage options is nice, but may >> be overkill for my needs ? until I realize I need memcached of course. > This one gets my vote because of the multiple backend options - APC, Memcache, > ZendPlatform, SQLite, and file based.? Only SQLite and file-based backends > support the "tag" grouping - but it's not that important a feature. I would > say don't use tagging so you can easily switch the backends.? Also, I don't > really see how it's anymore overkill than PEAR.? You don't need to include the > whole framework as demonstrated in this article. > http://devzone.zend.com/node/view/id/1221 > >> Also... All packages generally store cache results based on a lifetime. But >> what if I want to store results using a date, not a lifetime. An example >> would be something that changes once per day. Ideally, I?d like this updated >> for the first hit after midnight each day. Suggestions? > Use a lifetime of 86400 and manually invalidate it sometime after midnight.? > It's not reliable that it would stay always at the same time.? You could set > no expire time for the cache (or a really huge expire time if your cache > system requires an expiration) and then have a cron process that runs after > midnight and updates the cache programmatically.? That's probably better. > > -Rob Great suggestions. Time to dig more deeply into ZendCache. Another suggestion I received offline regarding the midnight issue is to dynamically calculate the lifetime to midnight for each request. But this does add some calculation overhead for each request. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at enobrev.com Fri Aug 17 13:33:40 2007 From: lists at enobrev.com (Mark Armendariz) Date: Fri, 17 Aug 2007 13:33:40 -0400 Subject: [nycphp-talk] XML Manipulation In-Reply-To: References: <016701c7e012$8f8f8810$6401a8c0@gamebox> <46C464EB.6060704@phpwerx.net> Message-ID: <46C5DBF4.2080901@enobrev.com> csnyder wrote: > On 8/16/07, Dan Cech wrote: > >> If you're looking for ideas, here is a proof-of-concept I put together >> back in 2004 for a system using a modified preorder traversal tree for >> threaded messages. >> >> http://clew.phpwerx.net/ > he nice thing about using some sort of tree (we called it a > nested-set model) for messages is that you get true threading--this is > a reply to that--rather than just a flat chronological list of > replies. > > Very often, people just want the flat list as it is easier to follow. > Nested-set grows rather hairy in no time, especially with data that needs to be changed often. After some reading (thanks to Elliotte's compass - thank you sir), it seems to me XML could definitely prove a better means of tracking hierarchal information, which especially includes threaded conversation. It seems to me that flattening tree data is far easier than branching flat data (and meta fields in my rel db makes me queasy). Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Fri Aug 17 13:56:31 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Fri, 17 Aug 2007 13:56:31 -0400 Subject: [nycphp-talk] Cache package suggestions In-Reply-To: References: Message-ID: <8f0676b40708171056m6e6fdc46uf84fd5f77839e72a@mail.gmail.com> > I received offline regarding the midnight issue is to dynamically > calculate the lifetime to midnight for each request. But this does add some > calculation overhead for each request. A common solution to this class of problem, is to only run the routine if the request draws the unlucky lottery number... for example the default PHP session garbage collection routine operates like: if(rand(0,100) == 42) { cleanup_expired_sessions(); } -John Campbell From cliff at pinestream.com Fri Aug 17 14:07:57 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 17 Aug 2007 14:07:57 -0400 Subject: [nycphp-talk] Cache package suggestions In-Reply-To: <8f0676b40708171056m6e6fdc46uf84fd5f77839e72a@mail.gmail.com> Message-ID: On 8/17/07 1:56 PM, "John Campbell" wrote: >> I received offline regarding the midnight issue is to dynamically >> calculate the lifetime to midnight for each request. But this does add some >> calculation overhead for each request. > > A common solution to this class of problem, is to only run the routine > if the request draws the unlucky lottery number... for example the > default PHP session garbage collection routine operates like: > > if(rand(0,100) == 42) { > cleanup_expired_sessions(); > } How about setting the cache lifetime for each request to: mktime(0, 0, 0, date("m"), date("d")+1, date("Y")) - time(); From aw at sap8.com Fri Aug 17 14:25:23 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Fri, 17 Aug 2007 14:25:23 -0400 Subject: [nycphp-talk] Webserver file access In-Reply-To: <1d8a0e930708170947i51109372tf06450b08f55c8d4@mail.gmail.com> References: <241777.64891.qm@web35611.mail.mud.yahoo.com> <54089.192.128.167.68.1187366842.squirrel@rvyriptide.org> <1d8a0e930708170947i51109372tf06450b08f55c8d4@mail.gmail.com> Message-ID: <002a01c7e0fb$f9d29890$ed77c9b0$@com> Let us talk about theoretical here. If the owner of the web root folder is "root" (/var/www/html), should it be changed to the Apache group that is created normally. I did a few checks in the /etc/group file and the apache group does exist as well my account on the box is part of that group, should the web root group be changed apache to make sure that only users of the Apache group have controls? Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Adrian Noland Sent: Friday, August 17, 2007 12:48 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Webserver file access On 8/17/07, wkamm at rvyriptide.org wrote: Can your userid have access to the web site's directory? You can then use WinSCP to copy the files there directly, and avoid using PuTTY. Another way to do essentially the same noted above: Have your administrator add you to the group for the web root directory, in my case the apache group, as well as g+w perms. Add the line 'newgrp apache' to your profile and presto, permissions to move and delete files around. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken at secdat.com Fri Aug 17 14:24:50 2007 From: ken at secdat.com (Kenneth Downs) Date: Fri, 17 Aug 2007 14:24:50 -0400 Subject: [nycphp-talk] XML Manipulation In-Reply-To: <46C5DBF4.2080901@enobrev.com> References: <016701c7e012$8f8f8810$6401a8c0@gamebox> <46C464EB.6060704@phpwerx.net> <46C5DBF4.2080901@enobrev.com> Message-ID: <46C5E7F2.5020907@secdat.com> Mark Armendariz wrote: > csnyder wrote: >> On 8/16/07, Dan Cech wrote: >> >>> If you're looking for ideas, here is a proof-of-concept I put together >>> back in 2004 for a system using a modified preorder traversal tree for >>> threaded messages. >>> >>> http://clew.phpwerx.net/ >> he nice thing about using some sort of tree (we called it a >> nested-set model) for messages is that you get true threading--this is >> a reply to that--rather than just a flat chronological list of >> replies. >> >> Very often, people just want the flat list as it is easier to follow. >> > Nested-set grows rather hairy in no time, especially with data that > needs to be changed often. After some reading (thanks to Elliotte's > compass - thank you sir), it seems to me XML could definitely prove a > better means of tracking hierarchal information, which especially > includes threaded conversation. It seems to me that flattening tree > data is far easier than branching flat data (and meta fields in my rel > db makes me queasy). What is generally called "adjacent pair" is easiest, thats the record_id, record_id_parent scenario you see in many places. The bit of SQL you need to make it child's play is the "WITH RECURSE" feature, which is sadly not widely supported: SELECT record_id, text_of_message FROM messages chd JOIN messages par ON chd.record_id_par = par.record_id WITH RECURSE WHERE chd.record_id = $x This construct does the Right Thing. But as I said, it is almost completely unsupported. It is a true black eye IMHO that nearly all big dbms vendors have ignored this incredibly useful extension. Also, don't confuse the nature of the data with its presentation. In terms of structure, all messaging systems are storing the same structure, be it emails, blogs with responses, usenet, or message boards. All of them are storing a root message with replies and replies-to-replies and so forth. It is a //hierarchy of like items//. It terms of presentation you can go treeview, flattened (i think phpbb does that), or indented (like some blogging systems), but the matter of presentation can even be made a user option and its child's play to support any presentation if the data is structured well to begin with. The best way to decide between files (as in XML, JSON, or YAML or plaintext) and table-based dbms is overhead. How much down payment do you have to make to get the result? > > Mark > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken at secdat.com Fri Aug 17 14:26:44 2007 From: ken at secdat.com (Kenneth Downs) Date: Fri, 17 Aug 2007 14:26:44 -0400 Subject: [nycphp-talk] Cache package suggestions In-Reply-To: References: Message-ID: <46C5E864.100@secdat.com> As I understand it, memcached is the bomb, this is the one we are probably going to tie in. Cliff Hirsch wrote: > I'm reviewing caching packages and am looking for suggestions. If you > have seen one of my prior threads, I just want to cache the results of > a curl operation, since that's very slow. My choices so far seem to be: > > Smarty cache --- since I use Smarty anyway. I'll probably use Smarty > cache for general page result caching, but perhaps not for lower layer > objects? > PEAR cachelite --- looks simple and efficient. Could be good for > caching small "widgets", misc paramters, etc. > ZendFramework Zend_Cache --- multiple backend storage options is nice, > but may be overkill for my needs --- until I realize I need memcached > of course. > Ez components cache class -- unknown > Others? > > Also... All packages generally store cache results based on a > lifetime. But what if I want to store results using a date, not a > lifetime. An example would be something that changes once per day. > Ideally, I'd like this updated for the first hit after midnight each > day. Suggestions? > > Cliff > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 -------------- next part -------------- An HTML attachment was scrubbed... URL: From smanes at magpie.com Fri Aug 17 15:32:45 2007 From: smanes at magpie.com (Steve Manes) Date: Fri, 17 Aug 2007 15:32:45 -0400 Subject: [nycphp-talk] XML Manipulation In-Reply-To: <46C5E7F2.5020907@secdat.com> References: <016701c7e012$8f8f8810$6401a8c0@gamebox> <46C464EB.6060704@phpwerx.net> <46C5DBF4.2080901@enobrev.com> <46C5E7F2.5020907@secdat.com> Message-ID: <46C5F7DD.5040001@magpie.com> Kenneth Downs wrote: > The bit of SQL you need to make it child's play is the "WITH RECURSE" > feature, which is sadly not widely supported: > > SELECT record_id, text_of_message > FROM messages chd > JOIN messages par ON chd.record_id_par = par.record_id WITH RECURSE > WHERE chd.record_id = $x The Oracle alternative is CONNECT BY/START WITH. PostgreSQL has a similar package in contribs/tablefunc. Here's a PostgreSQL stored procedure I used to dump a pre-order twalk trace of a tree-structured message base. ------------------------------------------------------------------------------ -- TRACE_MESSAGE -- -- Return the ordered thread below msgnum -- ------------------------------------------------------------------------------ CREATE OR REPLACE FUNCTION trace_message (REFCURSOR, TEXT, INTEGER, INTEGER) RETURNS REFCURSOR AS $$ DECLARE v_curmsg ALIAS FOR $2; v_who_id ALIAS FOR $3; v_trace_depth ALIAS FOR $4; BEGIN OPEN $1 FOR SELECT TREE.*, who.user_name AS author, message.subject, message.author_id, message.forum_id, message.is_invisible, message.is_one_liner, message.is_forum_header FROM connectby('tree', 'message_id', 'parent_id', 'sibling_order', v_curmsg, v_trace_depth) AS TREE (message_id INT, parent_id INT, level INT, sibling_order INT) LEFT JOIN message ON message.message_id = TREE.message_id LEFT JOIN who ON who.who_id = message.author_id WHERE -- various froo-froo filters ORDER BY TREE.sibling_order; RETURN $1; END; $$ LANGUAGE 'plpgsql'; From dorgan at optonline.net Fri Aug 17 16:46:07 2007 From: dorgan at optonline.net (Donald Organ) Date: Fri, 17 Aug 2007 16:46:07 -0400 Subject: [nycphp-talk] UPS Shipping Calculator Message-ID: <1187383567.6005.19.camel@dorgan-mobile2> Any ever mad a UPS Shipping calculator using the API that UPS offers?? From nyphp at dynamicink.com Fri Aug 17 17:51:39 2007 From: nyphp at dynamicink.com (Dynamic Ink) Date: Fri, 17 Aug 2007 17:51:39 -0400 Subject: [nycphp-talk] UPS Shipping Calculator References: <1187383567.6005.19.camel@dorgan-mobile2> Message-ID: <003501c7e118$d322dad0$0401a8c0@e6300> There is a detailed UPS shipping calculator example along with a full explanation in an article that I wrote for PHP Architect: The Ultimate PHP 5 Shopping Cart, spanning Aug. and Sept. 2004 ----- Original Message ----- From: "Donald Organ" To: "NYPHP Talk" Sent: Friday, August 17, 2007 4:46 PM Subject: [nycphp-talk] UPS Shipping Calculator > Any ever mad a UPS Shipping calculator using the API that UPS offers?? > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From sean712 at gmail.com Fri Aug 17 17:52:50 2007 From: sean712 at gmail.com (Sean) Date: Fri, 17 Aug 2007 17:52:50 -0400 Subject: [nycphp-talk] MCrypt problems decrypting data Message-ID: I am having issues with encryption/decryption. I am attempting to encrypt an integer (61663) when i decrypt it I get the following appended to my decrypted value. 61663\357\277\275\357\277\275\357\277\275 $td = mcrypt_module_open('blowfish', '', 'cbc, ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); $decrypted_data = mdecrypt_generic($td, base64_decode($input)); BTW I base 64 encode the encypted integer(61663) and store it in a cookie Any Help would be greatly appreciated Thanks, Sean -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Fri Aug 17 20:37:21 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Fri, 17 Aug 2007 20:37:21 -0400 Subject: [nycphp-talk] Auto Form Generation Message-ID: <46C63F41.3070109@beezifies.com> Just curious how many people have used form generation/templating systems like http://www.phpclasses.org/browse/package/1.html and what your opinions of them are? From kenneth at ylayali.net Fri Aug 17 20:36:49 2007 From: kenneth at ylayali.net (Kenneth Dombrowski) Date: Fri, 17 Aug 2007 20:36:49 -0400 Subject: [nycphp-talk] Webserver file access In-Reply-To: <002a01c7e0fb$f9d29890$ed77c9b0$@com> References: <241777.64891.qm@web35611.mail.mud.yahoo.com> <54089.192.128.167.68.1187366842.squirrel@rvyriptide.org> <1d8a0e930708170947i51109372tf06450b08f55c8d4@mail.gmail.com> <002a01c7e0fb$f9d29890$ed77c9b0$@com> Message-ID: <20070818003649.GQ5853@ylayali.net> On 07-08-17 14:25 -0400, Anthony Wlodarski wrote: > Let us talk about theoretical here. If the owner of the web root folder is > "root" (/var/www/html), should it be changed to the Apache group that is > created normally. I did a few checks in the /etc/group file and the apache > group does exist as well my account on the box is part of that group, should > the web root group be changed apache to make sure that only users of the > Apache group have controls? generally, you only want the apache user to have read access to your files, and read + traverse (execute) access to your directories, the exception is cgi scripts & the like, where it also needs +x on files i tend to leave /var/www/html alone because if you use a package manager, it will think it owns it (it is where it puts the "congratulations, apache works!" page). in my /var/www root also owns the default webalizer directory & a bunch of other installed apps for user-installed sites, i always use VirtualHosts, and i always create a custom user and group to own them, for the access control benefits i described. most distros make this easy by including /etc/httpd/conf.d/* from the system-installed httpd.conf From elharo at metalab.unc.edu Sat Aug 18 07:36:30 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Sat, 18 Aug 2007 07:36:30 -0400 Subject: [nycphp-talk] XML Manipulation In-Reply-To: <46C5DBF4.2080901@enobrev.com> References: <016701c7e012$8f8f8810$6401a8c0@gamebox> <46C464EB.6060704@phpwerx.net> <46C5DBF4.2080901@enobrev.com> Message-ID: <46C6D9BE.4020804@metalab.unc.edu> Mark Armendariz wrote: > Nested-set grows rather hairy in no time, especially with data that > needs to be changed often. After some reading (thanks to Elliotte's > compass - thank you sir), it seems to me XML could definitely prove a > better means of tracking hierarchal information, which especially > includes threaded conversation. It seems to me that flattening tree > data is far easier than branching flat data (and meta fields in my rel > db makes me queasy). That's certainly true. The performance issues are also real though. What you need is the best of both worlds: a database that stores XML. Neither a SQL database nor XML in a file system is optimal for this problem. Of course, you can make both work and people have indeed done so, but why not get the best of both worlds? The problem is this essentially a current research project. While both XMl and SQL are proven technologies, using a native XML database integrated with PHP would be blazing new territory. You need to decide whether you're ready to take on that task or not. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From chsnyder at gmail.com Sat Aug 18 09:12:37 2007 From: chsnyder at gmail.com (csnyder) Date: Sat, 18 Aug 2007 09:12:37 -0400 Subject: [nycphp-talk] MCrypt problems decrypting data In-Reply-To: References: Message-ID: On 8/17/07, Sean wrote: > I am having issues with encryption/decryption. > > I am attempting to encrypt an integer (61663) > > when i decrypt it I get the following appended to my decrypted value. > > 61663\357\277\275\357\277\275\357\277\275 > > $td = mcrypt_module_open('blowfish', '', 'cbc, ''); > $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); > mcrypt_generic_init($td, $key, $iv); > $decrypted_data = mdecrypt_generic($td, base64_decode($input)); > > > BTW I base 64 encode the encypted integer(61663) and store it in a cookie > > Any Help would be greatly appreciated > > Thanks, > > Sean > I can see two potential problems: You need to use the same initialization vector (IV) to decrypt as you did to encrypt. Typically, after encryption, you prepend the iv to the ciphertext value and store the whole thing (iv+encrypted). When you're ready to decrypt, you chop the iv off the front and use it to decrypt the ciphertext. Second, how are you generating the key? Is it a multiple of 32 characters long? -- Chris Snyder http://chxo.com/ From chsnyder at gmail.com Sat Aug 18 09:17:43 2007 From: chsnyder at gmail.com (csnyder) Date: Sat, 18 Aug 2007 09:17:43 -0400 Subject: [nycphp-talk] MCrypt problems decrypting data In-Reply-To: References: Message-ID: On 8/18/07, csnyder wrote: > > You need to use the same initialization vector (IV) to decrypt as you > did to encrypt. Typically, after encryption, you prepend the iv to the > ciphertext value and store the whole thing (iv+encrypted). When you're > ready to decrypt, you chop the iv off the front and use it to decrypt > the ciphertext. > > Second, how are you generating the key? Is it a multiple of 32 characters long? > There's a nifty little class that will do this for you in the source code for Pro PHP Security. See ch06-encryption/mcrypt.php: http://www.apress.com/book/supplementDownload.html?bID=437&sID=2888 From cliff at pinestream.com Sat Aug 18 09:42:17 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Sat, 18 Aug 2007 09:42:17 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: <20070817164514.GP5853@ylayali.net> Message-ID: On 8/17/07 12:45 PM, "Kenneth Dombrowski" wrote: > finally, I agree with Chris that anybody doing serious work should be > using version control, but that is the next step, first you should have > your file permissions in order , and a reasonably good understanding of > what the commands above do, and why you want to do it. also, use sudo. Are there any issues related to having the version control hidden files and folders on a production site? Does the Subversion .svn folder need to be protected on a production site? Is the best practice to do ongoing updates on a production site using version control or to export specific tagged versions to a production site (which would remove al the version control specific hidden files)? From tedd at sperling.com Sat Aug 18 09:42:00 2007 From: tedd at sperling.com (tedd) Date: Sat, 18 Aug 2007 09:42:00 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: <003501c7e118$d322dad0$0401a8c0@e6300> References: <1187383567.6005.19.camel@dorgan-mobile2> <003501c7e118$d322dad0$0401a8c0@e6300> Message-ID: At 5:51 PM -0400 8/17/07, Dynamic Ink wrote: >There is a detailed UPS shipping calculator example along with a >full explanation in an article that I wrote for PHP Architect: > >The Ultimate PHP 5 Shopping Cart, spanning Aug. and Sept. 2004 That's good. Do you think you might provide a link for an easier look-up? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From paulcheung at tiscali.co.uk Sat Aug 18 17:42:58 2007 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Sat, 18 Aug 2007 22:42:58 +0100 Subject: [nycphp-talk] queuing data References: <10280-70933@sneakemail.com> <000601c7deb8$e8e61510$0300a8c0@X9183> <6.2.3.4.2.20070814172623.02919fa8@pop.nyphp.com> Message-ID: <002f01c7e1e0$be411a50$0200a8c0@X9183> I have to finally admit it. Having looked at it for days, I am totally lost and clueless I am really sorry for being so thick, but can anybody please point me in the right direction for some coding examples. Paul >The problem is how do I queue the returned records and then read >each record individually, one by one, view, get next record and so >on until all the returned records have been read? > save what is returned in a session, along with a total count of rows. > redirect to a display page where you can step through the records > with a calculated pointer to current/previous/next > > > Michael Southwell, Vice President for Education > New York PHP > http://www.nyphp.com/training - In-depth PHP Training Courses > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Sun Aug 19 13:11:07 2007 From: tedd at sperling.com (tedd) Date: Sun, 19 Aug 2007 13:11:07 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: <003501c7e118$d322dad0$0401a8c0@e6300> References: <1187383567.6005.19.camel@dorgan-mobile2> <003501c7e118$d322dad0$0401a8c0@e6300> Message-ID: At 5:51 PM -0400 8/17/07, Dynamic Ink wrote: >There is a detailed UPS shipping calculator example along with a >full explanation in an article that I wrote for PHP Architect: > >The Ultimate PHP 5 Shopping Cart, spanning Aug. and Sept. 2004 I'm having difficulty finding that article -- do you have a link to your example? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From brian at realm3.com Sun Aug 19 16:56:26 2007 From: brian at realm3.com (Brian D.) Date: Sun, 19 Aug 2007 16:56:26 -0400 Subject: [nycphp-talk] Article on IT outsourcing Message-ID: I saw this on programming.reddit.com and wondered if the NYPHP mailing list had any thoughts on the subject. Particularly: "The mailing lists were never easy to read through but if a man put his mind to it and used the delete button swiftly enough you could actually get something out of them and maybe even find a reason to stay on. But ever since everybody in North America cheaped out and started sending all the work to India the mailing lists of every major product have been polluted with the Sanjays and Prashants of this world asking questions that make me wonder why the he[ck] we're sending out our prized projects to these seemingly incompetent people." http://arsenalist.com/2007/08/14/outsourcing-is-killing-it/ There are a lot of over-generalizations made by this blogger, but some of what he says is true (at least, in 100% of the mailing lists I'm subscribed to, especially PHP-related lists). Reddit thread: http://programming.reddit.com/info/2gjux/comments I know I myself have been slightly frustrated by the volume of mail on the NYPHP list that makes me wonder if the submitter even bothered to make a trip to Google before asking questions on the list. - B.D. From maxarbos at yahoo.com Sun Aug 19 20:07:08 2007 From: maxarbos at yahoo.com (Bill P.) Date: Sun, 19 Aug 2007 17:07:08 -0700 (PDT) Subject: [nycphp-talk] PEAR::MDB2, MS Sql , IIS Encrypted Connection String In-Reply-To: Message-ID: <304698.85007.qm@web90601.mail.mud.yahoo.com> Hello, I have a project coming up that I will be running on IIS with MS Sql. Orginally, it was going to run on linux with apache and mysql, but as things go, that changed. So I will still be using Pear::MDB2 and Pear::Auth .The DB will be mssql on a seperate machine. My question is: Is anyone familiar with how to create an encrypted connection string while using MDB2 while connecting to the db? I have been using mdb2 for a while on linux, but havent used IIS too often. Any feedback or suggestions would be great. Thank you. Bill --------------------------------- Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anoland at indigente.net Sun Aug 19 21:04:04 2007 From: anoland at indigente.net (Adrian Noland) Date: Sun, 19 Aug 2007 21:04:04 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: References: <20070817164514.GP5853@ylayali.net> Message-ID: <1d8a0e930708191804l5d807620x474015334d466149@mail.gmail.com> On 8/18/07, Cliff Hirsch wrote: > > On 8/17/07 12:45 PM, "Kenneth Dombrowski" wrote: > > finally, I agree with Chris that anybody doing serious work should be > > using version control, but that is the next step, first you should have > > your file permissions in order , and a reasonably good understanding of > > what the commands above do, and why you want to do it. also, use sudo. > > Are there any issues related to having the version control hidden files > and > folders on a production site? Does the Subversion .svn folder need to be > protected on a production site? Is the best practice to do ongoing updates > on a production site using version control or to export specific tagged > versions to a production site (which would remove al the version control > specific hidden files)? > > In general, it is considered bad form to have your web root the same as your repository sandbox. If you break something and have to revert, what happens to your production site? If you can, separate them. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anoland at indigente.net Sun Aug 19 21:07:33 2007 From: anoland at indigente.net (Adrian Noland) Date: Sun, 19 Aug 2007 21:07:33 -0400 Subject: [nycphp-talk] queuing data In-Reply-To: <002f01c7e1e0$be411a50$0200a8c0@X9183> References: <10280-70933@sneakemail.com> <000601c7deb8$e8e61510$0300a8c0@X9183> <6.2.3.4.2.20070814172623.02919fa8@pop.nyphp.com> <002f01c7e1e0$be411a50$0200a8c0@X9183> Message-ID: <1d8a0e930708191807v5b334735q2e48f65fd3170ddd@mail.gmail.com> On 8/18/07, PaulCheung wrote: > > > I have to finally admit it. Having looked at it for days, I am totally > lost and clueless > I am really sorry for being so thick, but can anybody please point me in > the right direction for some coding examples. > > Paul > I think you are probably trying to do pagination: http://www.google.com/search?hl=en&safe=on&q=php+paginated+records&btnG=Search -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth at ylayali.net Mon Aug 20 06:49:09 2007 From: kenneth at ylayali.net (Kenneth Dombrowski) Date: Mon, 20 Aug 2007 06:49:09 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: References: <20070817164514.GP5853@ylayali.net> Message-ID: <20070820104909.GT5853@ylayali.net> On 07-08-18 09:42 -0400, Cliff Hirsch wrote: > On 8/17/07 12:45 PM, "Kenneth Dombrowski" wrote: > > finally, I agree with Chris that anybody doing serious work should be > > using version control, but that is the next step, first you should have > > your file permissions in order , and a reasonably good understanding of > > what the commands above do, and why you want to do it. also, use sudo. > > Are there any issues related to having the version control hidden files and > folders on a production site? Does the Subversion .svn folder need to be > protected on a production site? Is the best practice to do ongoing updates > on a production site using version control or to export specific tagged > versions to a production site (which would remove al the version control > specific hidden files)? Hi Cliff, I would never release a production site as a working directory; I only agree that version control is important for serious projects. I do check out my dev sites as working directories, and typically set up cvs to trigger an update of the dev site for every commit for moving to testing & production, I use shell scripts which operate on specifically tagged versions & perform an export, like you describe Kenneth From cliff at pinestream.com Mon Aug 20 07:29:56 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 20 Aug 2007 07:29:56 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: <20070820104909.GT5853@ylayali.net> Message-ID: On 8/20/07 6:49 AM, "Kenneth Dombrowski" wrote: > I would never release a production site as a working directory; I only > agree that version control is important for serious projects. I do > check out my dev sites as working directories, and typically set up cvs > to trigger an update of the dev site for every commit > > for moving to testing & production, I use shell scripts which operate on > specifically tagged versions & perform an export, like you describe > > Kenneth Ah, got it. That's what I figured, but I wanted to be sure. The working directory "trick" for updating a production site sounds so easy, but it makes me queasy. Exporting specific tagged releases sounds much more controlled. Now I just need to write some Subversion export shell scripts.... From bz-gmort at beezifies.com Mon Aug 20 10:53:12 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Mon, 20 Aug 2007 10:53:12 -0400 Subject: [nycphp-talk] Article on IT outsourcing In-Reply-To: References: Message-ID: <46C9AAD8.9070104@beezifies.com> Brian D. wrote: > I saw this on programming.reddit.com and wondered if the NYPHP mailing > list had any thoughts on the subject. > > Particularly: > "The mailing lists were never easy to read through but if a man put > his mind to it and used the delete button swiftly enough you could > actually get something out of them and maybe even find a reason to > stay on. But ever since everybody in North America cheaped out and > started sending all the work to India the mailing lists of every major > product have been polluted with the Sanjays and Prashants of this > world asking questions that make me wonder why the he[ck] we're > sending out our prized projects to these seemingly incompetent > people." > I honestly don't see much difference between this and when students would flood a list with questions when their final projects where due. Nor was there much difference between this and the late spring/summer flood of new graduates trying to figure out what their doing. It is slightly worse in that due to poor english skills, you have a much lower percentage of noobs who actually will graduate to supplying advice. OTOH, maybe they go off and do so on their own lists. From tboyden at supercoups.com Mon Aug 20 11:04:17 2007 From: tboyden at supercoups.com (Timothy Boyden) Date: Mon, 20 Aug 2007 11:04:17 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: References: <1187383567.6005.19.camel@dorgan-mobile2><003501c7e118$d322dad0$0401a8c0@e6300> Message-ID: Unfortunately the author "Dynamic Ink" has decided that his code (an adaptation of a UPS copyrighted API open to registered users) is only available via a pay for article on PHP | Architect. Obviously this is his choice to make but goes against the spirit of open help of this list. I did purchase the articles in question as I needed the code as a reference to complete a project at work. The articles are available as a back copy on the PHP | Architect web site. I would post my code adaptation, but I am unfamiliar with the legal implications of doing so. At best it's a gray area as the code doesn't work without the copyrighted API. I appreciate the help that I received (even though had to pay for it) when I asked the same question, but I would call upon future posters to post the code examples they reference or refrain from "advertising" on this list. This was obviously a blatant plug to get PHP | Architect subscription money that the author most likely received a royalty from, and this list didn't get any part of that revenue despite that it enabled any purchases that may have been made as a result of my post or this post. I'm guessing others feel as I do about this issue, and I respect anyone else's opinion who may disagree. Just my $.02 Cheers, Tim Boyden -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of tedd Sent: Sunday, August 19, 2007 1:11 PM To: NYPHP Talk Subject: Re: [nycphp-talk] UPS Shipping Calculator At 5:51 PM -0400 8/17/07, Dynamic Ink wrote: >There is a detailed UPS shipping calculator example along with a full >explanation in an article that I wrote for PHP Architect: > >The Ultimate PHP 5 Shopping Cart, spanning Aug. and Sept. 2004 I'm having difficulty finding that article -- do you have a link to your example? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From agfische at email.smith.edu Mon Aug 20 11:16:41 2007 From: agfische at email.smith.edu (Aaron Fischer) Date: Mon, 20 Aug 2007 11:16:41 -0400 Subject: [nycphp-talk] Reading an excel file with PHP Message-ID: I've been googling around this morning looking for a good way to read in an excel file with PHP. I found PHP-Excel Reader and MS-Excel Stream Handler but haven't had success getting either one running. =( Any recommendations on an available class to use or PHP functions to go about this? Thanks, -Aaron From ben at projectskyline.com Mon Aug 20 11:19:44 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Mon, 20 Aug 2007 11:19:44 -0400 Subject: [nycphp-talk] Reading an excel file with PHP References: Message-ID: <021801c7e33d$8a687440$6401a8c0@gamebox> Hello Aaron, I convert .xls files to .csv files and then do parsing/manipulation. I can include source if you want it. - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Aaron Fischer" To: "NYPHP-Talk" Sent: Monday, August 20, 2007 11:16 AM Subject: [nycphp-talk] Reading an excel file with PHP > I've been googling around this morning looking for a good way to read in > an excel file with PHP. I found PHP-Excel Reader and MS-Excel Stream > Handler but haven't had success getting either one running. =( > > Any recommendations on an available class to use or PHP functions to go > about this? > > Thanks, > > -Aaron > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ben at projectskyline.com Mon Aug 20 11:20:44 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Mon, 20 Aug 2007 11:20:44 -0400 Subject: [nycphp-talk] Reading an excel file with PHP References: Message-ID: <022001c7e33d$ae0cc090$6401a8c0@gamebox> Too fast, I use the xls2csv utility for Linux: $tmpCSV = shell_exec("xls2csv $directory${value}"); Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Aaron Fischer" To: "NYPHP-Talk" Sent: Monday, August 20, 2007 11:16 AM Subject: [nycphp-talk] Reading an excel file with PHP > I've been googling around this morning looking for a good way to read in > an excel file with PHP. I found PHP-Excel Reader and MS-Excel Stream > Handler but haven't had success getting either one running. =( > > Any recommendations on an available class to use or PHP functions to go > about this? > > Thanks, > > -Aaron > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From agfische at email.smith.edu Mon Aug 20 11:28:15 2007 From: agfische at email.smith.edu (Aaron Fischer) Date: Mon, 20 Aug 2007 11:28:15 -0400 Subject: [nycphp-talk] Reading an excel file with PHP In-Reply-To: <021801c7e33d$8a687440$6401a8c0@gamebox> References: <021801c7e33d$8a687440$6401a8c0@gamebox> Message-ID: <3F0E5032-BF20-4C2D-B78A-4AA25750C638@email.smith.edu> Hi Ben, I've been looking into working with csv. That seems like a nice way to go. Do you use PHP to convert the .xls files to .csv? Yes, I'd be interested in source. Thanks Ben. -Aaron On Aug 20, 2007, at 11:19 AM, Ben Sgro ((ProjectSkyLine)) wrote: > Hello Aaron, > > I convert .xls files to .csv files and then do parsing/manipulation. > > I can include source if you want it. > > - Ben > From cliff at pinestream.com Mon Aug 20 11:29:28 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 20 Aug 2007 11:29:28 -0400 Subject: [nycphp-talk] Htaccess question for blocking directories Message-ID: I have been researching various method for blocking directories and dir listings. Many versions seem to be implemented poorly or just overkill, using fancy rewrites and performance killing regex for everything. Can anyone tell me if there are any issues with my solution: 1. Use ?Deny from all? for the dir to be protected. In local .htaccess or higher level .htaccess for better performance. 2. Place ErrorDocument 403 http://lwww.domainnam.com in a root-level (or other appropriate level) .htaccess file. No need for Rewrites, Rewritematches, index.php files in every folder, etc. This blocks the directory while taking care of the ugly 403 message. A redirect to the home page seems reasonable. But are there any SEO, etc. issues? Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at projectskyline.com Mon Aug 20 11:48:57 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Mon, 20 Aug 2007 11:48:57 -0400 Subject: [nycphp-talk] Reading an excel file with PHP References: <021801c7e33d$8a687440$6401a8c0@gamebox> <3F0E5032-BF20-4C2D-B78A-4AA25750C638@email.smith.edu> Message-ID: <025701c7e341$9f983400$6401a8c0@gamebox> Hello Aaron, Yes, I'm doing the conversion in php, calling the CL utility xls2csv and taking its output and writing it to file. Code included. I removed my processing on the data, since I don't know what you want to do with it. This partial script goes through each file in the target director and converts from .xls to /converted/.csv You can do as you please after. Its got libs that aren't open source though. If you need access to particular function calls or classes, let me know. So, yeah, this script isn't of much use to you I guess. Sorry. - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Aaron Fischer" To: "NYPHP Talk" Sent: Monday, August 20, 2007 11:28 AM Subject: Re: [nycphp-talk] Reading an excel file with PHP > Hi Ben, > > I've been looking into working with csv. That seems like a nice way to > go. Do you use PHP to convert the .xls files to .csv? Yes, I'd be > interested in source. Thanks Ben. > > -Aaron > > > On Aug 20, 2007, at 11:19 AM, Ben Sgro ((ProjectSkyLine)) wrote: > >> Hello Aaron, >> >> I convert .xls files to .csv files and then do parsing/manipulation. >> >> I can include source if you want it. >> >> - Ben >> > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: sifter.txt URL: From nyphp at dynamicink.com Mon Aug 20 11:48:03 2007 From: nyphp at dynamicink.com (Dynamic Ink) Date: Mon, 20 Aug 2007 11:48:03 -0400 Subject: [nycphp-talk] UPS Shipping Calculator References: <1187383567.6005.19.camel@dorgan-mobile2><003501c7e118$d322dad0$0401a8c0@e6300> Message-ID: <004f01c7e341$98c6e720$0401a8c0@e6300> Timothy, I am sorry that you feel unhappy for having to pay a few dollars for an article that successfully solved your issue. Considering that you appear to be employed (at SuperCoups) and the typical hourly PHP wage is well over $30, if this article saved you 18 minutes of effort seeking a solution then you have made a fine investment ($8.78/($30/60) = 17.56 minutes). If a magazine publishes your work it is unethical to then give the article away for free. You should know that I do not receive royalties; you asked for assistance with a topic and so I let you know that the solution existed in the article. In the future if you seek support and then accept the help, please refrain from then ranting negatively about the means in which it was given. ----- Original Message ----- From: "Timothy Boyden" To: "NYPHP Talk" Sent: Monday, August 20, 2007 11:04 AM Subject: RE: [nycphp-talk] UPS Shipping Calculator Unfortunately the author "Dynamic Ink" has decided that his code (an adaptation of a UPS copyrighted API open to registered users) is only available via a pay for article on PHP | Architect. Obviously this is his choice to make but goes against the spirit of open help of this list. I did purchase the articles in question as I needed the code as a reference to complete a project at work. The articles are available as a back copy on the PHP | Architect web site. I would post my code adaptation, but I am unfamiliar with the legal implications of doing so. At best it's a gray area as the code doesn't work without the copyrighted API. I appreciate the help that I received (even though had to pay for it) when I asked the same question, but I would call upon future posters to post the code examples they reference or refrain from "advertising" on this list. This was obviously a blatant plug to get PHP | Architect subscription money that the author most likely received a royalty from, and this list didn't get any part of that revenue despite that it enabled any purchases that may have been made as a result of my post or this post. I'm guessing others feel as I do about this issue, and I respect anyone else's opinion who may disagree. Just my $.02 Cheers, Tim Boyden -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of tedd Sent: Sunday, August 19, 2007 1:11 PM To: NYPHP Talk Subject: Re: [nycphp-talk] UPS Shipping Calculator At 5:51 PM -0400 8/17/07, Dynamic Ink wrote: >There is a detailed UPS shipping calculator example along with a full >explanation in an article that I wrote for PHP Architect: > >The Ultimate PHP 5 Shopping Cart, spanning Aug. and Sept. 2004 I'm having difficulty finding that article -- do you have a link to your example? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From jcampbell1 at gmail.com Mon Aug 20 12:23:15 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 20 Aug 2007 12:23:15 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: <004f01c7e341$98c6e720$0401a8c0@e6300> References: <1187383567.6005.19.camel@dorgan-mobile2> <003501c7e118$d322dad0$0401a8c0@e6300> <004f01c7e341$98c6e720$0401a8c0@e6300> Message-ID: <8f0676b40708200923s25e19d52xd9f02597fa9a3549@mail.gmail.com> > I am sorry that you feel unhappy for having to pay a few dollars for an > article that successfully solved your issue. Considering that you appear to > be employed (at SuperCoups) and the typical hourly PHP wage is well over > $30, if this article saved you 18 minutes of effort seeking a solution then > you have made a fine investment ($8.78/($30/60) = 17.56 minutes). > > If a magazine publishes your work it is unethical to then give the article > away for free. You should know that I do not receive royalties; you asked > for assistance with a topic and so I let you know that the solution existed > in the article. In the future if you seek support and then accept the help, > please refrain from then ranting negatively about the means in which it was > given. That is a troll. You referenced a solution and didn't bother to mention that it required a paid subscription. That is deceptive, no matter how valuable the article. Rather than just apologizing for doing that, you chose to give the rest of us a finance and ethics lesson. -John Campbell From tboyden at supercoups.com Mon Aug 20 12:42:34 2007 From: tboyden at supercoups.com (Timothy Boyden) Date: Mon, 20 Aug 2007 12:42:34 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: <8f0676b40708200923s25e19d52xd9f02597fa9a3549@mail.gmail.com> References: <1187383567.6005.19.camel@dorgan-mobile2><003501c7e118$d322dad0$0401a8c0@e6300><004f01c7e341$98c6e720$0401a8c0@e6300> <8f0676b40708200923s25e19d52xd9f02597fa9a3549@mail.gmail.com> Message-ID: Like John and Ted mention, it's not about the money, I paid and I was helped and I am grateful, it's about the ethics of full disclosure. Besides, it's your work and you own the copyright on your design of the solution, so you alone have the "opportunity" to help others in the spirit of open source by providing the source code so others may freely benefit from your work. If you choose not to do so it is your right, but you should be forthwith and say so. PHP is open source as well as this list. Share the code! BTW I guess I'm in the wrong business as a Sys Admin, cause I don't nearly make $30 an hour... -Tim -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of John Campbell Sent: Monday, August 20, 2007 12:23 PM To: NYPHP Talk Subject: Re: [nycphp-talk] UPS Shipping Calculator > I am sorry that you feel unhappy for having to pay a few dollars for > an article that successfully solved your issue. Considering that you > appear to be employed (at SuperCoups) and the typical hourly PHP wage > is well over $30, if this article saved you 18 minutes of effort > seeking a solution then you have made a fine investment ($8.78/($30/60) = 17.56 minutes). > > If a magazine publishes your work it is unethical to then give the > article away for free. You should know that I do not receive > royalties; you asked for assistance with a topic and so I let you know > that the solution existed in the article. In the future if you seek > support and then accept the help, please refrain from then ranting > negatively about the means in which it was given. That is a troll. You referenced a solution and didn't bother to mention that it required a paid subscription. That is deceptive, no matter how valuable the article. Rather than just apologizing for doing that, you chose to give the rest of us a finance and ethics lesson. -John Campbell _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From paul at gubavision.com Mon Aug 20 13:03:22 2007 From: paul at gubavision.com (paul at gubavision.com) Date: Mon, 20 Aug 2007 13:03:22 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: <8f0676b40708200923s25e19d52xd9f02597fa9a3549@mail.gmail.com> References: <1187383567.6005.19.camel@dorgan-mobile2> <003501c7e118$d322dad0$0401a8c0@e6300> <004f01c7e341$98c6e720$0401a8c0@e6300> <8f0676b40708200923s25e19d52xd9f02597fa9a3549@mail.gmail.com> Message-ID: <20070820130322.1ctikr3bg50gcskw@mail.fluidhosting.com> Pure nonsense. Your asking for help if you don't like the answer thats your problem not someone else's. You are free to do what you want no one is making you do anything here. They could have just of easily said nothing and let you continue you to search. Perhaps a little gratitude is in order that this list is here and you can get help if needed. Thanks to all who have helped me in the past when I asked. Paul Guba > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From ramons at gmx.net Mon Aug 20 13:10:11 2007 From: ramons at gmx.net (David Krings) Date: Mon, 20 Aug 2007 13:10:11 -0400 Subject: [nycphp-talk] Article on IT outsourcing In-Reply-To: References: Message-ID: <46C9CAF3.8030704@gmx.net> Brian D. wrote: > I saw this on programming.reddit.com and wondered if the NYPHP mailing > list had any thoughts on the subject. > > Particularly: > "The mailing lists were never easy to read through but if a man put > his mind to it and used the delete button swiftly enough you could > actually get something out of them and maybe even find a reason to > stay on. But ever since everybody in North America cheaped out and > started sending all the work to India the mailing lists of every major > product have been polluted with the Sanjays and Prashants of this > world asking questions that make me wonder why the he[ck] we're > sending out our prized projects to these seemingly incompetent > people." > You have to see that those who are experienced in a particular topic are an elite. Just think back when you or some of the other experts started off knowing nothing about the subject. Asking questions and asking many of them is just are smart thing to do. On the outsourcing issue, I have encountered many incompetent people who were US based. Just see how many US citizens can't even master their own language or even two or more! Those who ask many questions just want to get to the goal as quick as possible. Although it may be annoying for some, it isn't really anything wrong with that. > I know I myself have been slightly frustrated by the volume of mail on > the NYPHP list that makes me wonder if the submitter even bothered to > make a trip to Google before asking questions on the list. In order to get something useful out of Google you need to know what you are looking for. I once needed something that rotates images using PHP. As soon as you google for something with PHP as keyword you get bazillion results back just because the URL ends in .php. I asked the same question on this list and got the best answer possible in no time. That is why people like mailing lists and that is why many come back and ask more questions. Further, it is much easier to ask an expert than to figure stuff out on your own running into all the traps along the way. In my opinion that is sole and pure reason for having such an email list. If you are really frustrated by the load of mails from people asking questions then stop helping out. People will eventually go away when you keep ignoring them. David David From bz-gmort at beezifies.com Mon Aug 20 15:14:28 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Mon, 20 Aug 2007 15:14:28 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: References: <1187383567.6005.19.camel@dorgan-mobile2><003501c7e118$d322dad0$0401a8c0@e6300> Message-ID: <46C9E814.2040700@beezifies.com> Timothy Boyden wrote: > Unfortunately the author "Dynamic Ink" has decided that his code (an > adaptation of a UPS copyrighted API open to registered users) is only > available via a pay for article on PHP | Architect. Obviously this is > his choice to make but goes against the spirit of open help of this > list. > I don't see the problem, I often will reply to a question on a list with a reference to an article or chapter of a book. If it is in a book by someone else it would be rude in the extreme to post it elsewhere. From tboyden at supercoups.com Mon Aug 20 15:40:34 2007 From: tboyden at supercoups.com (Timothy Boyden) Date: Mon, 20 Aug 2007 15:40:34 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: <46C9E814.2040700@beezifies.com> References: <1187383567.6005.19.camel@dorgan-mobile2><003501c7e118$d322dad0$0401a8c0@e6300> <46C9E814.2040700@beezifies.com> Message-ID: I guess the difference is an insignificant matter. To me, and I think to others who feel the same way, there is a difference between saying - "a good example is this (including possibly a code snippet) from PHP in a Nutshell by O'Reilly Publishing" - where it is obvious that you need to go to a library or buy the book, and a response like - "Yeah, I did that, but you have to go pay for my code that some magazine published to find out how to do it". The first example is helpful, informative and courteous, while the second example - though ultimately helpful if you choose to pay for the articles - is nothing more than an advertising plug that only benefits the magazine. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Gary Mort Sent: Monday, August 20, 2007 3:14 PM To: NYPHP Talk Subject: Re: [nycphp-talk] UPS Shipping Calculator Timothy Boyden wrote: > Unfortunately the author "Dynamic Ink" has decided that his code (an > adaptation of a UPS copyrighted API open to registered users) is only > available via a pay for article on PHP | Architect. Obviously this is > his choice to make but goes against the spirit of open help of this > list. > I don't see the problem, I often will reply to a question on a list with a reference to an article or chapter of a book. If it is in a book by someone else it would be rude in the extreme to post it elsewhere. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From chsnyder at gmail.com Mon Aug 20 15:45:59 2007 From: chsnyder at gmail.com (csnyder) Date: Mon, 20 Aug 2007 15:45:59 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: References: <20070817164514.GP5853@ylayali.net> Message-ID: On 8/18/07, Cliff Hirsch wrote: > > Are there any issues related to having the version control hidden files and > folders on a production site? Does the Subversion .svn folder need to be > protected on a production site? Is the best practice to do ongoing updates > on a production site using version control or to export specific tagged > versions to a production site (which would remove al the version control > specific hidden files)? Hey, nice catch Cliff. Order allow,deny Deny from all Convenience over security can come back to bite you, I guess. To reiterate the point, if you use subversion to manage web directories, you need to make sure that the .svn metadata will not be served by apache. -- Chris Snyder http://chxo.com/ From cliff at pinestream.com Mon Aug 20 15:59:59 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 20 Aug 2007 15:59:59 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: Message-ID: > Hey, nice catch Cliff. > > > Order allow,deny > Deny from all > > > Convenience over security can come back to bite you, I guess. > > To reiterate the point, if you use subversion to manage web > directories, you need to make sure that the .svn metadata will not be > served by apache. Convenience sure makes me want to use this approach. And you could even update the production "working copy" to a specific branch or tag, not just the main trunk. But...it's still an update and conflicts would be a bear to deal with in a production environment. Although there shouldn't be any conflicts if the prod. Working copy isn't touched. From lists at enobrev.com Mon Aug 20 16:05:15 2007 From: lists at enobrev.com (Mark Armendariz) Date: Mon, 20 Aug 2007 16:05:15 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: References: <1187383567.6005.19.camel@dorgan-mobile2><003501c7e118$d322dad0$0401a8c0@e6300> <46C9E814.2040700@beezifies.com> Message-ID: <46C9F3FB.8040301@enobrev.com> Timothy Boyden wrote: > while the > second example - though ultimately helpful if you choose to pay for the > articles - is nothing more than an advertising plug that only benefits > the magazine. > I do agree that the post was a plug, but a helpful plug that aided you in solving your problem. As a list full of mature professionals, it's generally assumed that a commercial resource for information will cost money. Disclaimers aren't specifically needed. Especially considering a great deal of the contributors to the popular and, as proven, helpful php publications are regulars here. You were in no way forced to cough up the cash. You could have come back here and asked the community if any other resources were available. You could have done more research, including checking the open source applications available like oscommerce and phpshop. You could have read the thorough UPS tracking / rating specs, which are fairly thorough, and come up with your own library, but instead, accepted information from a commercial resource and then came to complain about having to pay for it, which is fairly useless to the rest of us. Mark From tboyden at supercoups.com Mon Aug 20 16:51:00 2007 From: tboyden at supercoups.com (Timothy Boyden) Date: Mon, 20 Aug 2007 16:51:00 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: <46C9F3FB.8040301@enobrev.com> References: <1187383567.6005.19.camel@dorgan-mobile2><003501c7e118$d322dad0$0401a8c0@e6300> <46C9E814.2040700@beezifies.com> <46C9F3FB.8040301@enobrev.com> Message-ID: It's sad you and others like you choose to focus your attacks on me rather than assist the original poster with their question. I would gladly help except my hands are tied by copyright. So much for the professionalism. At no time did I complain about having had to pay, instead I said I was thankful for the help now, and before when I received the help (you can check the archives and see for yourself), all I mentioned is that it had to be paid for before it could be useful. There was no preview or code snippets provided that would of indicated that it would be useful or even relevant to my needs, but instead I took a leap of faith, paid for the articles and luckily it worked out for me. I was left with that option as no one else came to my assistance as you would suggest, and for that much I am again grateful to "Digital Ink". If you're so sure those open source apps provide the solution, why don't you help out and post the code, it's open source so you wouldn't be violating any copyright. I for one couldn't find the code that would lead to a solution for me that wasn't embedded in a number of modules to obscurity. My main point of contention was not about cost, but about freely sharing ideas and solutions - the real point of this list. You want pay for solutions, head on over to www.experts-exchange.com Those same contributors you mention don't come on here and ask you to buy their book in order to get help either. They are very generous and offer code help directly and freely. In return those who they've helped (like me) return the favor and purchase their books to support their efforts. There is a difference. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mark Armendariz Sent: Monday, August 20, 2007 4:05 PM To: NYPHP Talk Subject: Re: [nycphp-talk] UPS Shipping Calculator Timothy Boyden wrote: > while the > second example - though ultimately helpful if you choose to pay for > the articles - is nothing more than an advertising plug that only > benefits the magazine. > I do agree that the post was a plug, but a helpful plug that aided you in solving your problem. As a list full of mature professionals, it's generally assumed that a commercial resource for information will cost money. Disclaimers aren't specifically needed. Especially considering a great deal of the contributors to the popular and, as proven, helpful php publications are regulars here. You were in no way forced to cough up the cash. You could have come back here and asked the community if any other resources were available. You could have done more research, including checking the open source applications available like oscommerce and phpshop. You could have read the thorough UPS tracking / rating specs, which are fairly thorough, and come up with your own library, but instead, accepted information from a commercial resource and then came to complain about having to pay for it, which is fairly useless to the rest of us. Mark _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From jbaltz at altzman.com Mon Aug 20 16:54:44 2007 From: jbaltz at altzman.com (Jerry B. Altzman) Date: Mon, 20 Aug 2007 16:54:44 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: References: Message-ID: <46C9FF94.7080701@altzman.com> on 2007-08-20 15:59 Cliff Hirsch said the following: >> Hey, nice catch Cliff. >> To reiterate the point, if you use subversion to manage web >> directories, you need to make sure that the .svn metadata will not be >> served by apache. > Convenience sure makes me want to use this approach. And you could even > update the production "working copy" to a specific branch or tag, not just > the main trunk. But...it's still an update and conflicts would be a bear to > deal with in a production environment. Although there shouldn't be any > conflicts if the prod. Working copy isn't touched. I manage several (>10) sites that are done in exactly this way -- the webroot is a subversion working copy, and the webserver is instructed to not serve up .svn directories. (You can also do this for applications, but it is a bit trickier.) It works wonderfully! The key is to be as disciplined with the use of subversion in updating the website as you would be if you did it using other shellscripts. There are a few things you can do to help out: 1) Always do a dry run first. You'll catch any conflicts that arise (there shouldn't be, if you don't edit files in the production area independently). Also, you'll find out if one of your developers accidentally committed a file that should be environment-independent (for example, he added a config.php that would overwrite your production area configuration with the test area, etc.) If you've got people changing files in your production area in an uncontrolled fashion, that's a bigger problem with which you must deal--although you can mitigate it with subversion by committing BACK to the repository from production :-) 2) If you have to make several concurrent changes (for example, you need to make database changes or restart processes at the same time) you'll need to do a bit of scripting to make things happen "atomically"--but you'd have to do this ANYWAY, regardless of how you moved your files into place. The nice thing about subversion (or any good VCS) is that, theoretically, if all you have to do is move files into place, you can rollback to a last-known-good in the event of something horribly wrong happening (and yes it's happened) in a relatively straightforward fashion. Of course, YMMV. //jbaltz -- jerry b. altzman jbaltz at altzman.com www.jbaltz.com thank you for contributing to the heat death of the universe. From tim_lists at o2group.com Mon Aug 20 17:02:05 2007 From: tim_lists at o2group.com (Tim Lieberman) Date: Mon, 20 Aug 2007 15:02:05 -0600 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: References: Message-ID: <46CA014D.1080701@o2group.com> Cliff Hirsch wrote: >> Hey, nice catch Cliff. >> >> >> Order allow,deny >> Deny from all >> >> >> Convenience over security can come back to bite you, I guess. >> >> To reiterate the point, if you use subversion to manage web >> directories, you need to make sure that the .svn metadata will not be >> served by apache. >> > > Convenience sure makes me want to use this approach. And you could even > update the production "working copy" to a specific branch or tag, not just > the main trunk. But...it's still an update and conflicts would be a bear to > deal with in a production environment. Although there shouldn't be any > conflicts if the prod. Working copy isn't touched. > It goes the other way. Making a release should always be a fresh check out of a (brand new) branch that got tagged on the testing server. If any serious but easy to fix bugs appear on the production system, you just fix them, commit the changes back to the branch, and then merge those changes back to the trunk on your development system. -Tim From bz-gmort at beezifies.com Mon Aug 20 17:02:11 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Mon, 20 Aug 2007 17:02:11 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: References: <1187383567.6005.19.camel@dorgan-mobile2><003501c7e118$d322dad0$0401a8c0@e6300> <46C9E814.2040700@beezifies.com> <46C9F3FB.8040301@enobrev.com> Message-ID: <46CA0153.70009@beezifies.com> Timothy Boyden wrote: > It's sad you and others like you choose to focus your attacks on me > rather than assist the original poster with their question. I would > gladly help except my hands are tied by copyright. > I'm not so sure, someone here posted insinuation that the author gets royalites for every back article that sells. I think when you make those sort of accusations based on little more than guesswork, you have lost the right to complain about being "attacked" when others merely correct the statements and point out the alternatives. UPS is rather annoying, they require you to create a shipping account in order to access their API. If their true to most companies, I'm willing to bet there is a PHP API example there, along with enough ASP examples to work out what you need to do(though I have found ProStores to be very skimpy on their non-Java examples). Checking Virtuemart, I note that there is no GPL UPS module. Which is a general indicator that UPS is persnickety enough to justify paying for working models. From tboyden at supercoups.com Mon Aug 20 19:00:24 2007 From: tboyden at supercoups.com (Timothy Boyden) Date: Mon, 20 Aug 2007 19:00:24 -0400 Subject: [nycphp-talk] UPS Shipping Calculator In-Reply-To: <46CA0153.70009@beezifies.com> Message-ID: Hmmm, from PHP | Architect's website: Re: php|architect's Author Guide (#110) By Chad R. Smith on 2006-06-02 08:23:29 Yeah, I can vouch that it's really easy to write for them. Their people are wonderful and will walk you through each step it takes. Their payments are on time and good right off the bat. I in fact am trying to think of another article to write for them! Talking about accusations! Do you really think I would of asked for help in the first place, let alone pay for help, if there was a PHP example on UPS's web site? The fact that UPS offers an API at all, let alone one that allows an XML interface that enables interoperability with any programming language that supports it, pretty much sums up their credibility and intent. Most companies would require you to use a COM plug-in or ActiveX control to use their site features so I'm not sure where you are coming from here. A free registration to use a feature is a far cry from having to pay for the same thing, something they could easily justify. Again most people "disagreeing" (happy now) with me are doing so on the presumed pretext of complaining to pay for help, one which if you read the full thread and past threads regarding this subject you would know to be not true. I thank everyone who has ever given me assistance and I return the favor by helping others with no strings attached whenever I can. I must say I'm surprised that no open source advocate has chosen to step up in support of what my main argument is and continues to be, that if you intend to provide assistance, on an open forum, for an open source programming language, for the very thing that enables us to do what we do, then you shouldn't ask someone to pay before assistance is even offered. We're not talking about commercial support here, we're talking about helping the little guy and the novice programmer learn about our chosen programming language and encouraging them to take up the principles of Free (as in freedom) Software and partake in our community. I guess we're only for open source when it benefits us...and that's a shame on all of us. -Tim > From: Gary Mort > Organization: Beezifies Consulting > Reply-To: NYPHP Talk > Date: Mon, 20 Aug 2007 17:02:11 -0400 > To: NYPHP Talk > Subject: Re: [nycphp-talk] UPS Shipping Calculator > > Timothy Boyden wrote: >> It's sad you and others like you choose to focus your attacks on me >> rather than assist the original poster with their question. I would >> gladly help except my hands are tied by copyright. >> > I'm not so sure, someone here posted insinuation that the author gets > royalites for every back article that sells. I think when you make > those sort of accusations based on little more than guesswork, you have > lost the right to complain about being "attacked" when others merely > correct the statements and point out the alternatives. > > UPS is rather annoying, they require you to create a shipping account in > order to access their API. If their true to most companies, I'm willing > to bet there is a PHP API example there, along with enough ASP examples > to work out what you need to do(though I have found ProStores to be very > skimpy on their non-Java examples). > > Checking Virtuemart, I note that there is no GPL UPS module. Which is a > general indicator that UPS is persnickety enough to justify paying for > working models. > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From nelly at cgim.com Mon Aug 20 22:40:35 2007 From: nelly at cgim.com (Nelly Yusupova) Date: Mon, 20 Aug 2007 22:40:35 -0400 Subject: [nycphp-talk] Ideas on how to speed up search process Message-ID: <200708210240.l7L2eir2021553@ms-smtp-01.rdc-nyc.rr.com> Hello Everyone, I have a table that contains about 40,000 rows of job posting data. There is a script that allows users to search for jobs using numerous search criteria. Because of all the criteria, the search process is very slow...an average query takes about 10 seconds to display in a browser, which is way too long. I tried optimizing the queries and indexed the table, which is very hard because of all the search criteria. I'm trying to figure out a solution to speed up the searching process. One idea that I have is to create an XML document of all of the job posts and write a search script that searches the XML document. I'm not even sure if this is possible as I haven't found any information about it on the web. Has anyone tried to do this? Does anyone have any examples/resources of search scripts that search XML documents? Does anyone have any other ideas about speeding up the search process? Thank you in advance. Sincerely, Nelly Yusupova DigitalWoman.com http://www.digitalwoman.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From smanes at magpie.com Mon Aug 20 23:35:52 2007 From: smanes at magpie.com (Steve Manes) Date: Mon, 20 Aug 2007 23:35:52 -0400 Subject: [nycphp-talk] Ideas on how to speed up search process In-Reply-To: <200708210240.l7L2eir2021553@ms-smtp-01.rdc-nyc.rr.com> References: <200708210240.l7L2eir2021553@ms-smtp-01.rdc-nyc.rr.com> Message-ID: <46CA5D98.5000208@magpie.com> Nelly Yusupova wrote: > I have a table that contains about 40,000 rows of job posting data. > There is a script that allows users to search for jobs using > numerous search criteria. Because of all the criteria, the search > process is very slow...an average query takes about 10 seconds to > display in a browser, which is way too long. > > I tried optimizing the queries and indexed the table, which is very hard Without seeing your data model or even knowing what database you're using that question is almost impossible to answer. Bear in mind however that indexed columns aren't a magic bullet, especially if you have lots of repeating data in them. Use your query plan analyzer to figure out where the sluggishness is, paying close attention to "full table scan" or scans where the index file is being tossed. If your database supports partitioning you can get quite a bit of improvement there. Adding a second mirrored database just for job searches is another idea. Minimize text searches; normalize common elements like start date, industry, category, job position, etc. I've written four job boards and each employed different techniques specific to the business requirements. One thing you might try however is to dump the jobs as text and let local search engine software index them several times a day. There are a lot of API tricks you can use to specialize those searches. From jcampbell1 at gmail.com Mon Aug 20 23:45:34 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 20 Aug 2007 23:45:34 -0400 Subject: [nycphp-talk] Ideas on how to speed up search process In-Reply-To: <200708210240.l7L2eir2021553@ms-smtp-01.rdc-nyc.rr.com> References: <200708210240.l7L2eir2021553@ms-smtp-01.rdc-nyc.rr.com> Message-ID: <8f0676b40708202045h42f98c93v8d53eacceb5fcba0@mail.gmail.com> > I have a table that contains about 40,000 rows of job posting data. There > is a script that allows users to search for jobs using numerous search > criteria. Because of all the criteria, the search process is very slow...an > average query takes about 10 seconds to display in a browser, which is way > too long. What database are you using? Are there any wildcards in the query of the form "LIKE '%$term"? If so, you should try full text indexes on those columns and use MATCH/AGAINST assuming you are using mysql. > One idea that I have is to create an XML document of all > of the job posts and write a search script that searches the XML document. XML is going to be a dead-end unless you have a tool to index the XML. Creating a search engine for 40k records should be doable with just SQL/ full text indexes. You shouldn't need anything specialized until you hit about 0.5M records, in which case you should probably use specialized software (e.g. Lucene). -John Campbell From selyah1 at yahoo.com Tue Aug 21 00:40:38 2007 From: selyah1 at yahoo.com (selyah) Date: Mon, 20 Aug 2007 21:40:38 -0700 (PDT) Subject: [nycphp-talk] table image display In-Reply-To: <8f0676b40708200923s25e19d52xd9f02597fa9a3549@mail.gmail.com> Message-ID: <546361.46749.qm@web30806.mail.mud.yahoo.com> Php Version: 4.3.10 mysql version: 4.19 I need assistance in displaying images from a database into a table. The script is successfully getting the image from the database in placing them int he table that i created. The problem is, each row is repeating the same image, ie, item one is shown in column 1, column 2, column3 , and column 4 in row 1. The item 2 is shown in column 1, column 2, column3 , and column 4 in row 2, and so on. I am at a lost on how to display the images so that each item is displayed in consectively rows and columns as needed without repeating themselves. I will copy the script below. If any one can see my error, i would appriciate the input. Thanks: 0) { while($row=mysql_fetch_array($result)) echo ' '; } echo '
cAclOm'.$row['modelnum'].' '.$row['name'].'


'.$row['description'].''.$row['price'].'
cAclOm'.$row['modelnum'].' '.$row['name'].'


'.$row['description'].''.$row['price'].'
cAclOm'.$row['modelnum'].' '.$row['name'].'


'.$row['description'].''.$row['price'].'
cAclOm'.$row['modelnum'].' '.$row['name'].'


'.$row['description'].''.$row['price'].'
'; -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Tue Aug 21 01:02:36 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Tue, 21 Aug 2007 01:02:36 -0400 Subject: [nycphp-talk] table image display In-Reply-To: <546361.46749.qm@web30806.mail.mud.yahoo.com> References: <8f0676b40708200923s25e19d52xd9f02597fa9a3549@mail.gmail.com> <546361.46749.qm@web30806.mail.mud.yahoo.com> Message-ID: <8f0676b40708202202m3ea459dcv53c82348152d57f3@mail.gmail.com> The "" should be before the while loop, and you are missing some brackets around the while loop. From aw at sap8.com Tue Aug 21 08:30:03 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Tue, 21 Aug 2007 08:30:03 -0400 Subject: [nycphp-talk] table image display In-Reply-To: <8f0676b40708202202m3ea459dcv53c82348152d57f3@mail.gmail.com> References: <8f0676b40708200923s25e19d52xd9f02597fa9a3549@mail.gmail.com> <546361.46749.qm@web30806.mail.mud.yahoo.com> <8f0676b40708202202m3ea459dcv53c82348152d57f3@mail.gmail.com> Message-ID: <001801c7e3ef$0033c470$009b4d50$@com> I think John hit the nail on the head but for your mysql_fetch_array($result), I like to use mysql_fetch_array($result, MYSQL_ASSOC) just to qualify that the array returned is associative. Or for short you can use mysql_fetch_assoc($result). That way only an associative array is returned. Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of John Campbell Sent: Tuesday, August 21, 2007 1:03 AM To: NYPHP Talk Subject: Re: [nycphp-talk] table image display The "
" should be before the while loop, and you are missing some brackets around the while loop. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From jeffmailings99 at verizon.net Tue Aug 21 09:39:47 2007 From: jeffmailings99 at verizon.net (jeff mailings) Date: Tue, 21 Aug 2007 09:39:47 -0400 Subject: [nycphp-talk] PHP 5.3 Problem - Object Creation problem Message-ID: Anyone know the best way to handle this error? "PHP Catchable fatal error: Object of class Database could not be converted to string" I've got some old class modules that I'm trying to run under PHP 5.3. Jeff Siegel From jmcgraw1 at gmail.com Tue Aug 21 10:01:14 2007 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Tue, 21 Aug 2007 10:01:14 -0400 Subject: [nycphp-talk] PHP 5.3 Problem - Object Creation problem In-Reply-To: References: Message-ID: Create a public __toString() function within your Database class. It can be something as simple as: public function __toString() { return 'Object'; } This is a new as of 5.2 - for some reason they've removed implicit object-to-string conversion. You must provide explicit __toString if you're printing or concatenating your objects. - jake On 8/21/07, jeff mailings wrote: > > Anyone know the best way to handle this error? "PHP Catchable fatal error: > Object of class Database could not be converted to string" > > I've got some old class modules that I'm trying to run under PHP 5.3. > > > Jeff Siegel > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffmailings99 at verizon.net Tue Aug 21 10:21:35 2007 From: jeffmailings99 at verizon.net (Jeff Siegel) Date: Tue, 21 Aug 2007 10:21:35 -0400 Subject: [nycphp-talk] PHP 5.3 Problem - Object Creation problem In-Reply-To: Message-ID: Jake, Thank you! That worked like a charm! Jeff =========================== -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Jake McGraw Sent: Tuesday, August 21, 2007 10:01 AM To: NYPHP Talk Subject: Re: [nycphp-talk] PHP 5.3 Problem - Object Creation problem Create a public __toString() function within your Database class. It can be something as simple as: public function __toString() { return 'Object'; } This is a new as of 5.2 - for some reason they've removed implicit object-to-string conversion. You must provide explicit __toString if you're printing or concatenating your objects. - jake From rmarscher at beaffinitive.com Tue Aug 21 12:41:41 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Tue, 21 Aug 2007 12:41:41 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: References: Message-ID: <8C2B2B14-AABA-4134-B570-076A9E790C41@beaffinitive.com> On Aug 20, 2007, at 3:59 PM, Cliff Hirsch wrote: > But...it's still an update and conflicts would be a bear to > deal with in a production environment You should check out Capistrano some time. It pulls down the whole app from subversion into a new directory. It then symlinks the current webroot to the new directory pulled from subversion. You also keep files - like things users have uploaded - in a separate directory and symlink to that from your docroot too. That way they're outside of the app directories. What I like about this approach is that all the files still exist from the previous working state and if anything is wrong, you just switch the docroot symlink to point to the old directory - very quick recovery. Capistrano is a ruby app the allows automated scripting and parallel updates on multiple servers at the same. Worth looking into before rolling out your own custom shell scripts. http://manuals.rubyonrails.com/read/chapter/97#page256 http://www.capify.org/getting-started/basics http://www.simplisticcomplexity.com/2006/8/16/automated-php- deployment-with-capistrano From jonbaer at jonbaer.com Tue Aug 21 12:48:31 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Tue, 21 Aug 2007 12:48:31 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: <8C2B2B14-AABA-4134-B570-076A9E790C41@beaffinitive.com> References: <8C2B2B14-AABA-4134-B570-076A9E790C41@beaffinitive.com> Message-ID: <65B26F8C-5E47-40D7-B48B-8E18D017C331@jonbaer.com> +1 for Capistrano, it saves so much time ... But if you need something else even more lightweight ... Vlad the Deployer (yes, that is the name, no typo) ... http://www.infoq.com/news/2007/08/vlad-the-deployer :-) On Aug 21, 2007, at 12:41 PM, Rob Marscher wrote: > On Aug 20, 2007, at 3:59 PM, Cliff Hirsch wrote: >> But...it's still an update and conflicts would be a bear to >> deal with in a production environment > > You should check out Capistrano some time. It pulls down the whole > app from subversion into a new directory. It then symlinks the > current webroot to the new directory pulled from subversion. You > also keep files - like things users have uploaded - in a separate > directory and symlink to that from your docroot too. That way > they're outside of the app directories. > > What I like about this approach is that all the files still exist > from the previous working state and if anything is wrong, you just > switch the docroot symlink to point to the old directory - very > quick recovery. > > Capistrano is a ruby app the allows automated scripting and > parallel updates on multiple servers at the same. Worth looking > into before rolling out your own custom shell scripts. > > http://manuals.rubyonrails.com/read/chapter/97#page256 > http://www.capify.org/getting-started/basics > http://www.simplisticcomplexity.com/2006/8/16/automated-php- > deployment-with-capistrano > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Tue Aug 21 13:56:38 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 21 Aug 2007 13:56:38 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: <8C2B2B14-AABA-4134-B570-076A9E790C41@beaffinitive.com> Message-ID: On 8/21/07 12:41 PM, "Rob Marscher" wrote: > Capistrano is a ruby app the allows automated scripting and parallel > updates on multiple servers at the same. Worth looking into before > rolling out your own custom shell scripts. > > http://manuals.rubyonrails.com/read/chapter/97#page256 > http://www.capify.org/getting-started/basics > http://www.simplisticcomplexity.com/2006/8/16/automated-php- > deployment-with-capistrano Looks great, but: "The assumptions made by the default tasks are more specific, but are either configurable or overridable. Some of them are: * You are deploying a web application -- check * You are using Ruby on Rails to develop your application -- bit of a problem for us php developers * You are using subversion to manage your source code -- check * You are deploying your application to ?/u/apps/#{appname}? on every machine -- easy enough * You are using FastCGI to power your application -- ? * You are fronting your app with either lighttpd or apache -- check From jonbaer at jonbaer.com Tue Aug 21 14:36:45 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Tue, 21 Aug 2007 14:36:45 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: References: Message-ID: The only thing that pertains to that you are developing a Rails application is that you have a "config" folder @ the root level so that a "deply.rb" script can be set there. (old method) In fact the new method is just to have a Capfile in your root + describe tasks. From there you would run your tasks. The FastCGI you can skip, instead you would do something like restart Apache if you needed to. Id say the real PHP equivalent of the entire process would be Phing (http://phing.info/trac/) but w/ deployment recipes. - Jon On Aug 21, 2007, at 1:56 PM, Cliff Hirsch wrote: > On 8/21/07 12:41 PM, "Rob Marscher" > wrote: >> Capistrano is a ruby app the allows automated scripting and parallel >> updates on multiple servers at the same. Worth looking into before >> rolling out your own custom shell scripts. >> >> http://manuals.rubyonrails.com/read/chapter/97#page256 >> http://www.capify.org/getting-started/basics >> http://www.simplisticcomplexity.com/2006/8/16/automated-php- >> deployment-with-capistrano > > Looks great, but: > > "The assumptions made by the default tasks are more specific, but > are either > configurable or overridable. Some of them are: > > * You are deploying a web application -- check > * You are using Ruby on Rails to develop your application -- > bit of a > problem for us php developers > * You are using subversion to manage your source code -- check > * You are deploying your application to ?/u/apps/#{appname}? on > every > machine -- easy enough > * You are using FastCGI to power your application -- ? > * You are fronting your app with either lighttpd or apache -- > check > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From david at davidmintz.org Tue Aug 21 15:13:17 2007 From: david at davidmintz.org (David Mintz) Date: Tue, 21 Aug 2007 15:13:17 -0400 Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? In-Reply-To: <695E7BE2-AFB7-4916-936B-D27E54B8041F@beaffinitive.com> References: <721f1cc50708151554y206742ecs4402e2bf6feeb438@mail.gmail.com> <695E7BE2-AFB7-4916-936B-D27E54B8041F@beaffinitive.com> Message-ID: <721f1cc50708211213g12453c56hdda5a5fea291b2a3@mail.gmail.com> FiOS isn't available to me yet but I will keep watching. What's RCN? In any case it looks like Comcast has a monopoly on all non-DSL, consumer-type broadband in my area. F... Fooie. Many thanks to all. On 8/16/07, Rob Marscher wrote: > > On Aug 15, 2007, at 6:54 PM, David Mintz wrote: > > I am about to move, and considering dumping Speakeasy DSL for the > > sake of economy > If your new place has access to Verizon FiOS, I'd recommend that. > It's so fast!! A friend of mine runs a server successfully through > it using dyndns.org. > > > > -- 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 aw at sap8.com Tue Aug 21 16:03:57 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Tue, 21 Aug 2007 16:03:57 -0400 Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? In-Reply-To: <721f1cc50708211213g12453c56hdda5a5fea291b2a3@mail.gmail.com> References: <721f1cc50708151554y206742ecs4402e2bf6feeb438@mail.gmail.com> <695E7BE2-AFB7-4916-936B-D27E54B8041F@beaffinitive.com> <721f1cc50708211213g12453c56hdda5a5fea291b2a3@mail.gmail.com> Message-ID: <003d01c7e42e$687009b0$39501d10$@com> I happen to live in an area where FiOS is in direct competition with my Comcast line, good news for me I got a good bump in connection speed. I maxed out at about 64mbps the other day, insanely fast just to browse the web. I know other people in the community also got a bump in speed as well from Comcast as they don't want anyone to leave (so for the same price I get a bump in speed, go consumerism!). But I have also heard good things about FiOS but make sure your neighborhood has access to it. Also in regards to your friends server David, I tried to do that once with Verizon, they saw the bandwidth traffic and blocked the port 80 incoming requests, that's when I called up and they said I was violating my TOS when I decided to host a web server at a residential IP address. Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Mintz Sent: Tuesday, August 21, 2007 3:13 PM To: NYPHP Talk Subject: Re: [nycphp-talk] [0T] Comcast as ISP -- opinions? FiOS isn't available to me yet but I will keep watching. What's RCN? In any case it looks like Comcast has a monopoly on all non-DSL, consumer-type broadband in my area. F... Fooie. Many thanks to all. On 8/16/07, Rob Marscher wrote: On Aug 15, 2007, at 6:54 PM, David Mintz wrote: > I am about to move, and considering dumping Speakeasy DSL for the > sake of economy If your new place has access to Verizon FiOS, I'd recommend that. It's so fast!! A friend of mine runs a server successfully through it using dyndns.org. -- 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 ramons at gmx.net Tue Aug 21 17:41:05 2007 From: ramons at gmx.net (David Krings) Date: Tue, 21 Aug 2007 17:41:05 -0400 Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? In-Reply-To: <003d01c7e42e$687009b0$39501d10$@com> References: <721f1cc50708151554y206742ecs4402e2bf6feeb438@mail.gmail.com> <695E7BE2-AFB7-4916-936B-D27E54B8041F@beaffinitive.com> <721f1cc50708211213g12453c56hdda5a5fea291b2a3@mail.gmail.com> <003d01c7e42e$687009b0$39501d10$@com> Message-ID: <46CB5BF1.2050507@gmx.net> Anthony Wlodarski wrote: > But I have also heard good things about FiOS but make sure your > neighborhood has access to it. Also in regards to your friends server > David, I tried to do that once with Verizon, they saw the bandwidth > traffic and blocked the port 80 incoming requests, that?s when I called > up and they said I was violating my TOS when I decided to host a web > server at a residential IP address? That is when you change the server over to a different port and use a webhop. At least that is how I got it to work...pssssst. David From rmarscher at beaffinitive.com Tue Aug 21 17:52:00 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Tue, 21 Aug 2007 17:52:00 -0400 Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? In-Reply-To: <003d01c7e42e$687009b0$39501d10$@com> References: <721f1cc50708151554y206742ecs4402e2bf6feeb438@mail.gmail.com> <695E7BE2-AFB7-4916-936B-D27E54B8041F@beaffinitive.com> <721f1cc50708211213g12453c56hdda5a5fea291b2a3@mail.gmail.com> <003d01c7e42e$687009b0$39501d10$@com> Message-ID: <53D804C2-3F12-457B-ADCD-9AD05BB84D4C@beaffinitive.com> On Aug 21, 2007, at 4:03 PM, Anthony Wlodarski wrote: > Also in regards to your friends server David, I tried to do that > once with Verizon, they saw the bandwidth traffic and blocked the > port 80 incoming requests, that?s when I called up and they said I > was violating my TOS when I decided to host a web server at a > residential IP address? Guess it is in there. "Any type of server" - that's a little harsh. I guess it's not reasonable for them to list what is acceptable (like having a svn port open for personal use) because people will find some loophole for running their illegal file sharing server. http://www.verizon.net/policies/vzcom/tos_popup.asp 3.7.5 You may not use the Broadband Service to host any type of server whether personal or commercial in nature. -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve.francia at gmail.com Tue Aug 21 18:15:54 2007 From: steve.francia at gmail.com (Steve Francia) Date: Tue, 21 Aug 2007 18:15:54 -0400 Subject: [nycphp-talk] Auto Form Generation In-Reply-To: <46C63F41.3070109@beezifies.com> References: <46C63F41.3070109@beezifies.com> Message-ID: On 8/17/07, Gary Mort wrote: > > Just curious how many people have used form generation/templating > systems like http://www.phpclasses.org/browse/package/1.html and what > your opinions of them are? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > I have used similar ones, Actually this one is loosely based on the on in the Zoop Framework called forms which predates it about half a year. Zoop's Forms interface is a decent amount simplier and the validation is a better integrated, but of course it only works inside of the framework. Such systems are useful for dominately CRUD applications. They aren't as scalable as hand made forms, unless you use make use of caching (I don't know if this system supports caching, Zoop's does). They are much more efficient on the programmer side. -Steve -- -- Steve Francia http://zoopframework.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Tue Aug 21 20:18:21 2007 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 21 Aug 2007 20:18:21 -0400 Subject: [nycphp-talk] Ideas on how to speed up search process In-Reply-To: <200708210240.l7L2eir2021553@ms-smtp-01.rdc-nyc.rr.com> References: <200708210240.l7L2eir2021553@ms-smtp-01.rdc-nyc.rr.com> Message-ID: <20070822001821.GA3711@panix.com> On Mon, Aug 20, 2007 at 10:40:35PM -0400, Nelly Yusupova wrote: > > I have a table that contains about 40,000 rows of job posting data. ... snip ... > average query takes about 10 seconds to display in a browser, which is way > too long. 40k rows is small. Searching is what databases excel at. Using XML is crazy. Use the EXPLAIN / DESCRIBE query keywords to get some very useful information. Also read up on how indexes work in the DBMS you're using. The MySQL manual has a very good section on it, for example. --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 greg.rundlett at gmail.com Tue Aug 21 21:53:06 2007 From: greg.rundlett at gmail.com (Greg Rundlett) Date: Tue, 21 Aug 2007 21:53:06 -0400 Subject: [nycphp-talk] Webserver file access (and version control) In-Reply-To: References: Message-ID: <5e2aaca40708211853g22c2c6ddx420aa1f119272c54@mail.gmail.com> I wanted to add a few cents about the role of a version control system in managing websites. Release Engineering is a complex subject worthy of it's own profession. I say that because I've worked in a Release Engineering team supporting multiple software products and distributed teams numbering in the hundreds. If you have complex software that you need to release or distribute, then you will invariably use tools like Phing, Ant etc. That said, releasing website code, even 'application' code can easily be handled by using a 'working copy' checkout from a Subversion repository. I would consider it 'good form' to use this approach. In fact this makes it incredibly easy to release code through dev to staging to production. And it is easy to revert (with or without tags). Tags are just a convenience (and generally recommended when you have an actual QA or test process.) For people using this approach, do an 'svn status -u' to show what would be updated prior to doing an 'svn up'. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting annoying in email? From aw at sap8.com Wed Aug 22 09:21:43 2007 From: aw at sap8.com (Anthony Wlodarski) Date: Wed, 22 Aug 2007 09:21:43 -0400 Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? In-Reply-To: <46CB5BF1.2050507@gmx.net> References: <721f1cc50708151554y206742ecs4402e2bf6feeb438@mail.gmail.com> <695E7BE2-AFB7-4916-936B-D27E54B8041F@beaffinitive.com> <721f1cc50708211213g12453c56hdda5a5fea291b2a3@mail.gmail.com> <003d01c7e42e$687009b0$39501d10$@com> <46CB5BF1.2050507@gmx.net> Message-ID: <000001c7e4bf$61ab9630$2502c290$@com> Oh I did that, but then I had to go to managed hosting cause I needed something dedicated, if it broke hardware wise. Anthony Wlodarski Senior Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 aw at sap8.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Krings Sent: Tuesday, August 21, 2007 5:41 PM To: NYPHP Talk Subject: Re: [nycphp-talk] [0T] Comcast as ISP -- opinions? Anthony Wlodarski wrote: > But I have also heard good things about FiOS but make sure your > neighborhood has access to it. Also in regards to your friends server > David, I tried to do that once with Verizon, they saw the bandwidth > traffic and blocked the port 80 incoming requests, that's when I called > up and they said I was violating my TOS when I decided to host a web > server at a residential IP address. That is when you change the server over to a different port and use a webhop. At least that is how I got it to work...pssssst. David _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From paul at gubavision.com Wed Aug 22 10:04:44 2007 From: paul at gubavision.com (paul at gubavision.com) Date: Wed, 22 Aug 2007 10:04:44 -0400 Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? In-Reply-To: <000001c7e4bf$61ab9630$2502c290$@com> References: <721f1cc50708151554y206742ecs4402e2bf6feeb438@mail.gmail.com> <695E7BE2-AFB7-4916-936B-D27E54B8041F@beaffinitive.com> <721f1cc50708211213g12453c56hdda5a5fea291b2a3@mail.gmail.com> <003d01c7e42e$687009b0$39501d10$@com> <46CB5BF1.2050507@gmx.net> <000001c7e4bf$61ab9630$2502c290$@com> Message-ID: <20070822100444.g0g8dowcgw40scg8@mail.fluidhosting.com> I had a home server for quite a while with comcast. They never blocked any ports on me since you get a dynamic ip address I would think that would be hard to do. I did find myself booted off the network about once a month and I would have to reset my router to get back on. With hosting so affordable it didn't make sense to invest the time to do it after a while. To many work arounds to do it and then keeping up with security issues. My server was probed constantly for attacks. It was a good learning experience though. Paul Guba > Oh I did that, but then I had to go to managed hosting cause I needed > something dedicated, if it broke hardware wise. > > Anthony Wlodarski > Senior Technical Recruiter > Shulman Fleming & Partners > 646-285-0500 x230 > aw at sap8.com > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On > Behalf Of David Krings > Sent: Tuesday, August 21, 2007 5:41 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] [0T] Comcast as ISP -- opinions? > > Anthony Wlodarski wrote: > > But I have also heard good things about FiOS but make sure your >> neighborhood has access to it. Also in regards to your friends server >> David, I tried to do that once with Verizon, they saw the bandwidth >> traffic and blocked the port 80 incoming requests, that's when I called >> up and they said I was violating my TOS when I decided to host a web >> server at a residential IP address. > > That is when you change the server over to a different port and use a > webhop. At least that is how I got it to work...pssssst. > > David > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > From ben at projectskyline.com Wed Aug 22 10:50:54 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 22 Aug 2007 10:50:54 -0400 Subject: [nycphp-talk] Tuning MySQL Full Text Search Message-ID: <01cb01c7e4cb$d855bca0$6401a8c0@gamebox> Hello All, I've got search for very small database working fine. However, I'd like to tune this to have different weights for words, because I'm not happy with the search results. Are there any good books or whitepapers on tuning mysql for fulltext search? Here's the query: $dbObject->DatabaseQuery('SELECT id, title, body, links_to,' . ' MATCH(title, body)' . ' AGAINST (' . $dbObject->Safe($searchStr) . ' IN BOOLEAN MODE)' . ' AS score FROM ' . DATABASE_TABLE_CONTENT . ' WHERE MATCH (title, body)' . ' AGAINST (' . $dbObject->Safe($searchStr) . ' IN BOOLEAN MODE)' . ' ORDER BY score DESC', constReturnArray, LOG_LEVEL_DEBUG); And here's the index code: $dbObject->DatabaseQuery('CREATE FULLTEXT INDEX skillings_index ON ' . DATABASE_TABLE_CONTENT . ' (title, body);', constReturnNone, LOG_LEVEL_DEBUG); - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Wed Aug 22 12:18:02 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 22 Aug 2007 12:18:02 -0400 Subject: [nycphp-talk] Tuning MySQL Full Text Search In-Reply-To: <01cb01c7e4cb$d855bca0$6401a8c0@gamebox> References: <01cb01c7e4cb$d855bca0$6401a8c0@gamebox> Message-ID: <4EDA3EE6-55AD-48D7-B53F-6290A7DCC318@jonbaer.com> I would say build an index if its items which will rarely change. There is real power in using a Lucene-based index for full text search that a DB does not really focus on and would meet your requirements better. Ive recently put a 200k record set thorough Zend_Search and the clients were pretty happy w/ how results could be tuned and refined. Also remember the fulltext parser is pluggable, example ... http://www.mnogosearch.org/doc/msearch-udmstemmer.html Has anyone written one for Zend_Search? Id love to figure out how to cross the 2 w/o the need to configure my updates ... - Jon On Aug 22, 2007, at 10:50 AM, Ben Sgro ((ProjectSkyLine)) wrote: > Hello All, > > I've got search for very small database working fine. However, I'd > like to tune this to have > different weights for words, because I'm not happy with the search > results. > > Are there any good books or whitepapers on tuning mysql for > fulltext search? > > Here's the query: > > $dbObject->DatabaseQuery('SELECT id, title, body, links_to,' > . ' MATCH(title, body)' > . ' AGAINST (' . $dbObject->Safe > ($searchStr) > . ' IN BOOLEAN MODE)' > . ' AS score FROM ' . > DATABASE_TABLE_CONTENT > . ' WHERE MATCH (title, body)' > . ' AGAINST (' . $dbObject->Safe > ($searchStr) > . ' IN BOOLEAN MODE)' > . ' ORDER BY score DESC', > constReturnArray, LOG_LEVEL_DEBUG); > > And here's the index code: > $dbObject->DatabaseQuery('CREATE FULLTEXT INDEX > skillings_index ON ' . > DATABASE_TABLE_CONTENT . ' (title, body);', > constReturnNone, LOG_LEVEL_DEBUG); > > - Ben > > > Ben Sgro, Chief Engineer > ProjectSkyLine - Defining New Horizons > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use > of the individual to whom it is addressed. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Wed Aug 22 12:31:00 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 22 Aug 2007 12:31:00 -0400 Subject: [nycphp-talk] Tuning MySQL Full Text Search In-Reply-To: <01cb01c7e4cb$d855bca0$6401a8c0@gamebox> References: <01cb01c7e4cb$d855bca0$6401a8c0@gamebox> Message-ID: <135F96AB-D20F-40E1-9012-09F47326F9EE@beaffinitive.com> On Aug 22, 2007, at 10:50 AM, Ben Sgro ((ProjectSkyLine)) wrote: > I'd like to tune this to have different weights for words, because > I'm not happy with the search results. > $dbObject->DatabaseQuery('SELECT id, title, body, links_to,' > . ' MATCH(title, body)' > . ' AGAINST (' . $dbObject->Safe > ($searchStr) > . ' IN BOOLEAN MODE)' > . ' AS score FROM ' . > DATABASE_TABLE_CONTENT > . ' WHERE MATCH (title, body)' > . ' AGAINST (' . $dbObject->Safe > ($searchStr) > . ' IN BOOLEAN MODE)' > . ' ORDER BY score DESC', > constReturnArray, LOG_LEVEL_DEBUG); Hey Ben, Are you not happy with the relevance sorting? Or is it not returning rows that you think should match... or return too many rows? What's an example of how you could weight the words? You should test this to see if it's true... but I've seen it mentioned that the score returned by "IN BOOLEAN MODE" is an integer with the number of terms matched. Without "IN BOOLEAN MODE", it gives a floating point number that " is computed based on the number of words in the row, the number of unique words in that row, the total number of words in the collection, and the number of documents (rows) that contain a particular word." Actually... do you need the "IN BOOLEAN MODE"? Otherwise, results are automatically sorted on relevance. Also... you could put a higher weight on title matches over body matches: ( (3 * MATCH(title) AGAINST ('term')) + (1 * MATCH(body) AGAINST ('term')) ) -Rob From ben at projectskyline.com Wed Aug 22 12:39:50 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 22 Aug 2007 12:39:50 -0400 Subject: [nycphp-talk] Tuning MySQL Full Text Search References: <01cb01c7e4cb$d855bca0$6401a8c0@gamebox> <4EDA3EE6-55AD-48D7-B53F-6290A7DCC318@jonbaer.com> Message-ID: <022c01c7e4db$0fa34ec0$6401a8c0@gamebox> Hello Jon, A lot of what you said went over my head. I no zero experiance with Zend, and I dont know what "Lucene" is. I'll look into Zend_Search, and the link provided. Thanks! Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: Jon Baer To: NYPHP Talk Sent: Wednesday, August 22, 2007 12:18 PM Subject: Re: [nycphp-talk] Tuning MySQL Full Text Search I would say build an index if its items which will rarely change. There is real power in using a Lucene-based index for full text search that a DB does not really focus on and would meet your requirements better. Ive recently put a 200k record set thorough Zend_Search and the clients were pretty happy w/ how results could be tuned and refined. Also remember the fulltext parser is pluggable, example ... http://www.mnogosearch.org/doc/msearch-udmstemmer.html Has anyone written one for Zend_Search? Id love to figure out how to cross the 2 w/o the need to configure my updates ... - Jon On Aug 22, 2007, at 10:50 AM, Ben Sgro ((ProjectSkyLine)) wrote: Hello All, I've got search for very small database working fine. However, I'd like to tune this to have different weights for words, because I'm not happy with the search results. Are there any good books or whitepapers on tuning mysql for fulltext search? Here's the query: $dbObject->DatabaseQuery('SELECT id, title, body, links_to,' . ' MATCH(title, body)' . ' AGAINST (' . $dbObject->Safe($searchStr) . ' IN BOOLEAN MODE)' . ' AS score FROM ' . DATABASE_TABLE_CONTENT . ' WHERE MATCH (title, body)' . ' AGAINST (' . $dbObject->Safe($searchStr) . ' IN BOOLEAN MODE)' . ' ORDER BY score DESC', constReturnArray, LOG_LEVEL_DEBUG); And here's the index code: $dbObject->DatabaseQuery('CREATE FULLTEXT INDEX skillings_index ON ' . DATABASE_TABLE_CONTENT . ' (title, body);', constReturnNone, LOG_LEVEL_DEBUG); - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at projectskyline.com Wed Aug 22 12:42:45 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 22 Aug 2007 12:42:45 -0400 Subject: [nycphp-talk] Tuning MySQL Full Text Search References: <01cb01c7e4cb$d855bca0$6401a8c0@gamebox> <135F96AB-D20F-40E1-9012-09F47326F9EE@beaffinitive.com> Message-ID: <023201c7e4db$7807b410$6401a8c0@gamebox> Hello Rob, I'm happy w/the relevance, but the order isn't right, and too many results are being returned (which is my own issue to fix). > ( (3 * MATCH(title) AGAINST ('term')) + (1 * MATCH(body) AGAINST > ('term')) ) That's really cool. I didn't realize you could do that, and that is something I'd like to do. Without the BOOLEAN, the results were really off, minimal results and not that accurate. Once I added BOOLEAN, the results got a lot better. There is also the problem where common words, aren't returning anything, such as a search for "water". It should however, since the water keyword is very frequent throughout the site. - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Rob Marscher" To: "NYPHP Talk" Sent: Wednesday, August 22, 2007 12:31 PM Subject: Re: [nycphp-talk] Tuning MySQL Full Text Search > On Aug 22, 2007, at 10:50 AM, Ben Sgro ((ProjectSkyLine)) wrote: >> I'd like to tune this to have different weights for words, because I'm >> not happy with the search results. >> $dbObject->DatabaseQuery('SELECT id, title, body, links_to,' >> . ' MATCH(title, body)' >> . ' AGAINST (' . $dbObject->Safe >> ($searchStr) >> . ' IN BOOLEAN MODE)' >> . ' AS score FROM ' . >> DATABASE_TABLE_CONTENT >> . ' WHERE MATCH (title, body)' >> . ' AGAINST (' . $dbObject->Safe >> ($searchStr) >> . ' IN BOOLEAN MODE)' >> . ' ORDER BY score DESC', >> constReturnArray, LOG_LEVEL_DEBUG); > > Hey Ben, > > Are you not happy with the relevance sorting? Or is it not returning > rows that you think should match... or return too many rows? What's an > example of how you could weight the words? > > You should test this to see if it's true... but I've seen it mentioned > that the score returned by "IN BOOLEAN MODE" is an integer with the > number of terms matched. Without "IN BOOLEAN MODE", it gives a floating > point number that " is computed based on the number of words in the row, > the number of unique words in that row, the total number of words in the > collection, and the number of documents (rows) that contain a particular > word." > > Actually... do you need the "IN BOOLEAN MODE"? Otherwise, results are > automatically sorted on relevance. > > Also... you could put a higher weight on title matches over body matches: > ( (3 * MATCH(title) AGAINST ('term')) + (1 * MATCH(body) AGAINST > ('term')) ) > > -Rob > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ben at projectskyline.com Wed Aug 22 12:53:20 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 22 Aug 2007 12:53:20 -0400 Subject: [nycphp-talk] Frameworks - Which best fits my development style? Message-ID: <024701c7e4dc$f2981660$6401a8c0@gamebox> Hello all, I know there has been a ton of discussion about frameworks. So far, I've looked into: 1) Cake 2) Zend 3) Joomla 4) Symfony 5) Drupal I've looked at tutorials, books and online how-tos'. Let me explain my development environment. I use smarty templates for all my HTML. My php is 5w/OOP. I have many libraries from everything from database access, sitemap creation, html (textboxes, drop downs), simple ajax, error logging, session handling, (all created by myself) and I use PEAR SOMETIMES as to not reinvent the wheel for a single project. When I design sites & applications, I have an index.php and pass "actions=WHATEVER" on the URL to change the action of the program. I dont use seperate files for different things EXCEPT for all the libs and auxiliary functions. I use SVN for revision control. I guess I don't see the compelling reason to switch to a framework. Will it really speed up my development time, even if I have all these libs (and still expanding) already created? The JSON stuff looks cool, but I dont use that much js and if I do, I just write it myself. Applications I build are powered by PHP/MYSQL, HTML/CSS. There are forms to fillout, emailing, login, account creation, etc. Some are more complicated than others. Maybe I could use one framework for making simple websites, and another for applications? I'm really looking for success stories or terros from switching from no framework to using one, which one, how long it took to be effecient with it, how easy it was to expand/modify, the userbase and user support, scalability, ease of use, organization of codebase, etc. Also, I LOVE books, so any that have good paperback book or white paper/tutorials is a BIG plus. Any feedback is helpful, and please provide pros/cons. Thanks so much! - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Wed Aug 22 13:12:55 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 22 Aug 2007 13:12:55 -0400 Subject: [nycphp-talk] Tuning MySQL Full Text Search In-Reply-To: <023201c7e4db$7807b410$6401a8c0@gamebox> References: <01cb01c7e4cb$d855bca0$6401a8c0@gamebox> <135F96AB-D20F-40E1-9012-09F47326F9EE@beaffinitive.com> <023201c7e4db$7807b410$6401a8c0@gamebox> Message-ID: <5FA35E12-11C9-48D2-AA2A-C474B630869D@beaffinitive.com> On Aug 22, 2007, at 12:42 PM, Ben Sgro ((ProjectSkyLine)) wrote: > Hello Rob, > I'm happy w/the relevance, but the order isn't right What do you mean by that? I thought you were sorting by relevance? > too many results are being returned (which is my own issue to fix). Can you just apply a limit to the query? > Without the BOOLEAN, the results were really off, minimal results > and not that accurate. Maybe this is because boolean searches don't use the 50% threshold: "" > There is also the problem where common words, aren't returning > anything, such as a search for > "water". It should however, since the water keyword is very > frequent throughout the site. Weird... that would be in line with the 50% threshold... but you're using boolean, so it shouldn't apply. Maybe try rebuilding the index? Also... boolean searches do have an operator (< or >) to increase or decrease a word's weight: http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html From ben at projectskyline.com Wed Aug 22 13:35:33 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 22 Aug 2007 13:35:33 -0400 Subject: [nycphp-talk] Tuning MySQL Full Text Search References: <01cb01c7e4cb$d855bca0$6401a8c0@gamebox><135F96AB-D20F-40E1-9012-09F47326F9EE@beaffinitive.com><023201c7e4db$7807b410$6401a8c0@gamebox> <5FA35E12-11C9-48D2-AA2A-C474B630869D@beaffinitive.com> Message-ID: <028b01c7e4e2$d88e8870$6401a8c0@gamebox> Hello Rob, What I meant is that, something that has the search criteria in the title, doesn't have more weight than something that does not, and therefor is possibly showing up lower then another item, when I believe its more relevant and should be displayed higher. I'll try to rebuild the index. In order to do so, do I just run the command that I did to build the original index, or is there a special syntax/command to do so? > Also... boolean searches do have an operator (< or >) to increase or > decrease a word's weight: > http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html Cool. I'll look into that. Thank, - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Rob Marscher" To: "NYPHP Talk" Sent: Wednesday, August 22, 2007 1:12 PM Subject: Re: [nycphp-talk] Tuning MySQL Full Text Search > > On Aug 22, 2007, at 12:42 PM, Ben Sgro ((ProjectSkyLine)) wrote: >> Hello Rob, >> I'm happy w/the relevance, but the order isn't right > What do you mean by that? I thought you were sorting by relevance? > >> too many results are being returned (which is my own issue to fix). > Can you just apply a limit to the query? > >> Without the BOOLEAN, the results were really off, minimal results and >> not that accurate. > Maybe this is because boolean searches don't use the 50% threshold: "" > >> There is also the problem where common words, aren't returning anything, >> such as a search for >> "water". It should however, since the water keyword is very frequent >> throughout the site. > Weird... that would be in line with the 50% threshold... but you're using > boolean, so it shouldn't apply. Maybe try rebuilding the index? > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From paulcheung at tiscali.co.uk Wed Aug 22 13:36:48 2007 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Wed, 22 Aug 2007 18:36:48 +0100 Subject: [nycphp-talk] Using Pagination Message-ID: <000601c7e4e3$04542140$0200a8c0@X9183> I am really sorry to have to ask your help once again, but no matter how hard I try I can't seem to understand how pagination works I created a MySQL database called "test_db" and then set up the demo table "products". the products.php is just a dummy. nate.php is the coding. I am trying to paginate through the records one by one.(view each record, in this case). Thanks Paul -------------- next part -------------- A non-text attachment was scrubbed... Name: products.php Type: application/octet-stream Size: 34 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: nate.php Type: application/octet-stream Size: 1625 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: make products table. txt.dat Type: application/octet-stream Size: 1037 bytes Desc: not available URL: From david at davidmintz.org Wed Aug 22 14:13:08 2007 From: david at davidmintz.org (David Mintz) Date: Wed, 22 Aug 2007 14:13:08 -0400 Subject: [nycphp-talk] [0T] Comcast as ISP -- opinions? In-Reply-To: <20070822100444.g0g8dowcgw40scg8@mail.fluidhosting.com> References: <721f1cc50708151554y206742ecs4402e2bf6feeb438@mail.gmail.com> <695E7BE2-AFB7-4916-936B-D27E54B8041F@beaffinitive.com> <721f1cc50708211213g12453c56hdda5a5fea291b2a3@mail.gmail.com> <003d01c7e42e$687009b0$39501d10$@com> <46CB5BF1.2050507@gmx.net> <000001c7e4bf$61ab9630$2502c290$@com> <20070822100444.g0g8dowcgw40scg8@mail.fluidhosting.com> Message-ID: <721f1cc50708221113j44a267fdpd42adb4ecee5ebc8@mail.gmail.com> It's clear that the TOS for residential accounts say "no servers, period" but I think it's ridiculous to tell us we can't even run sshd to move files to and from our home machines when we're away from home. That's what's nice about Speakeasy. It's your Internet connection and you can use it as you please. On 8/22/07, paul at gubavision.com wrote: > > I had a home server for quite a while with comcast. They never > blocked any ports on me since you get a dynamic ip address I would > think that would be hard to do. I did find myself booted off the > network about once a month and I would have to reset my router to get > back on. With hosting so affordable it didn't make sense to invest > the time to do it after a while. To many work arounds to do it and > then keeping up with security issues. My server was probed constantly > for attacks. It was a good learning experience though. > > Paul Guba > > > -- 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 jonbaer at jonbaer.com Wed Aug 22 14:47:43 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 22 Aug 2007 14:47:43 -0400 Subject: [nycphp-talk] Tuning MySQL Full Text Search In-Reply-To: <022c01c7e4db$0fa34ec0$6401a8c0@gamebox> References: <01cb01c7e4cb$d855bca0$6401a8c0@gamebox> <4EDA3EE6-55AD-48D7-B53F-6290A7DCC318@jonbaer.com> <022c01c7e4db$0fa34ec0$6401a8c0@gamebox> Message-ID: In other words you should stuff all that FULLTEXT inside of an index engine and let it deal w/ it since it is 10x better @ it ... http://en.wikipedia.org/wiki/Lucene On Aug 22, 2007, at 12:39 PM, Ben Sgro ((ProjectSkyLine)) wrote: > Hello Jon, > > A lot of what you said went over my head. I no zero experiance with > Zend, and I dont know what "Lucene" is. > I'll look into Zend_Search, and the link provided. > > Thanks! > > Ben Sgro, Chief Engineer > ProjectSkyLine - Defining New Horizons > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use > of the individual to whom it is addressed. > ----- Original Message ----- > From: Jon Baer > To: NYPHP Talk > Sent: Wednesday, August 22, 2007 12:18 PM > Subject: Re: [nycphp-talk] Tuning MySQL Full Text Search > > I would say build an index if its items which will rarely change. > There is real power in using a Lucene-based index for full text > search that a DB does not really focus on and would meet your > requirements better. Ive recently put a 200k record set thorough > Zend_Search and the clients were pretty happy w/ how results could > be tuned and refined. > > Also remember the fulltext parser is pluggable, example ... > > http://www.mnogosearch.org/doc/msearch-udmstemmer.html > > Has anyone written one for Zend_Search? Id love to figure out how > to cross the 2 w/o the need to configure my updates ... > > - Jon > > On Aug 22, 2007, at 10:50 AM, Ben Sgro ((ProjectSkyLine)) wrote: > >> Hello All, >> >> I've got search for very small database working fine. However, I'd >> like to tune this to have >> different weights for words, because I'm not happy with the search >> results. >> >> Are there any good books or whitepapers on tuning mysql for >> fulltext search? >> >> Here's the query: >> >> $dbObject->DatabaseQuery('SELECT id, title, body, links_to,' >> . ' MATCH(title, body)' >> . ' AGAINST (' . $dbObject->Safe >> ($searchStr) >> . ' IN BOOLEAN MODE)' >> . ' AS score FROM ' . >> DATABASE_TABLE_CONTENT >> . ' WHERE MATCH (title, body)' >> . ' AGAINST (' . $dbObject->Safe >> ($searchStr) >> . ' IN BOOLEAN MODE)' >> . ' ORDER BY score DESC', >> constReturnArray, LOG_LEVEL_DEBUG); >> >> And here's the index code: >> $dbObject->DatabaseQuery('CREATE FULLTEXT INDEX >> skillings_index ON ' . >> DATABASE_TABLE_CONTENT . ' (title, body);', >> constReturnNone, LOG_LEVEL_DEBUG); >> >> - Ben >> >> >> Ben Sgro, Chief Engineer >> ProjectSkyLine - Defining New Horizons >> Our company: www.projectskyline.com >> Our products: www.project-contact.com >> >> This e-mail is confidential information intended only for the use >> of the individual to whom it is addressed. >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Aug 22 15:08:46 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 22 Aug 2007 15:08:46 -0400 (EDT) Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: <024701c7e4dc$f2981660$6401a8c0@gamebox> Message-ID: On Wed, 22 Aug 2007, Ben Sgro \(ProjectSkyLine\) wrote: > I know there has been a ton of discussion about frameworks. > > So far, I've looked into: > 1) Cake > 2) Zend > 3) Joomla > 4) Symfony > 5) Drupal > > I've looked at tutorials, books and online how-tos'. Let me explain my development environment. > > I use smarty templates for all my HTML. My php is 5w/OOP. I have many libraries from everything > from database access, sitemap creation, html (textboxes, drop downs), simple ajax, error logging, > session handling, (all created by myself) and I use PEAR SOMETIMES as to not reinvent the wheel > for a single project. When I design sites & applications, I have an index.php and pass "actions=WHATEVER" > on the URL to change the action of the program. I dont use seperate files for different things EXCEPT for all the libs > and auxiliary functions. I use SVN for revision control. > > I guess I don't see the compelling reason to switch to a framework. Will it really speed up my development > time, even if I have all these libs (and still expanding) already created? Im working on a major site and we're using symfony. I can tell you that symfony gives you pretty much everything you need so your own classes will not be of much use (and even if you see something it doesn't do, you will most likely find a plugin already written that does). It uses PHP5 so its a total OOP environment with an MVC architecture and its own testing library. The command-line tool can generate code and stub files (and can even be used for deployment). One nice thing is that a lot of features can be switched on and off through config files which reduces coding. (And most of the config files are YAML files that get compiled and cached). I would describe symfony as simply elegant. The documentation, (The Apress book is available online), wiki, forums, mailing list, and snippets sites mean there is plenty of docs and sample code to look at (this more than anything else made coding with symfony a really nice experience). Ive gained enough experience and confidence with symfony that Im also converting an existing Joomla site to symfony (Joomla really was overkill for that site anyway and symfony is really easy to work with). There is a small learning curve but its not the hardest curve Ive ever had to climb and the Apress book is a nice read. > Applications I build are powered by PHP/MYSQL, HTML/CSS. There are forms to fillout, emailing, login, > account creation, etc. Some are more complicated than others. Forms validation is super easy - you setup validation "rules" in a YAML file. Add some code to your actions class and you're done. (symfony already comes with a bunch of built-in validators but you can also roll your own - something we only needed to do in two places IIRC). I should also mention that symfony has scaffolding and also generators for building a complete admin tool for your database models (so implementing a backend interface is easy). > Maybe I could use one framework for making simple websites, and another for applications? Sure, its possible to do that. For example, Joomla is great for an e-commerce site (Ive implemented e-commerce in Mambo, Joomla and symfony), since Joomla has a nicely pre-built backend for the customers to use. I never liked the documentation available for Joomla (though Joomla just published a nice book a month ago which might help). > Also, I LOVE books, so any that have good paperback book or white paper/tutorials is a BIG plus. Me too. You're in luck then - here's some references (incl. the official book): Official published book: http://apress.com/book/bookDisplay.html?bID=10222 Book online: http://www.symfony-project.com/book/trunk Wiki: http://trac.symfony-project.com/trac/wiki Forums: http://www.symfony-project.com/forum/ Community/Blog: http://www.symfony-project.com/content/support.html Mailing List / Group: http://groups.google.com/group/symfony-users Askeet Tutorial: http://www.symfony-project.com/askeet Ive been buying a LOT more technical books as ebooks this year thanks to Apress, Pragmatic Programmer and Friends of Ed (wish O'Reilly offered PDFs instead of Safari, oh well can't have everything). -- Aj. From rmarscher at beaffinitive.com Wed Aug 22 15:57:29 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 22 Aug 2007 15:57:29 -0400 Subject: [nycphp-talk] Tuning MySQL Full Text Search In-Reply-To: <028b01c7e4e2$d88e8870$6401a8c0@gamebox> References: <01cb01c7e4cb$d855bca0$6401a8c0@gamebox><135F96AB-D20F-40E1-9012-09F47326F9EE@beaffinitive.com><023201c7e4db$7807b410$6401a8c0@gamebox> <5FA35E12-11C9-48D2-AA2A-C474B630869D@beaffinitive.com> <028b01c7e4e2$d88e8870$6401a8c0@gamebox> Message-ID: On Aug 22, 2007, at 1:35 PM, Ben Sgro ((ProjectSkyLine)) wrote: > I'll try to rebuild the index. In order to do so, do I just run the > command that I did to build the > original index, or is there a special syntax/command to do so? Actually... I think this is the command: REPAIR TABLE tbl_name QUICK; Like Jon, I've been leaning towards ditching using mysql for fulltext searches lately. I haven't gotten a chance to test out Zend_Search_Lucene yet... but probably will soon. See you at mysql camp. -Rob From dlmerryweather at gmail.com Wed Aug 22 17:07:26 2007 From: dlmerryweather at gmail.com (David Merryweather) Date: Wed, 22 Aug 2007 16:07:26 -0500 Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: <024701c7e4dc$f2981660$6401a8c0@gamebox> References: <024701c7e4dc$f2981660$6401a8c0@gamebox> Message-ID: <793b2bec0708221407m7f0baf0eyee5749cc9f277519@mail.gmail.com> Ben, We went from hand rolled sites to CakePHP and have had very good success. Took us about 5 days to get up to speed. We do a lot of outsource work with firms in the US, India and Ukraine and they have all really enjoyed working with CakePHP. Most of our clients don't care as long as it works and its fast. The best part about the Cake framework (or any MVC Rails-Like framework) is it writes itself from your business logic. If you're a programmer first and not an architect this may seem foreign but if you build your data and process relationships first, develop your business domain as a system of data/process silos, then a MVC based framework really helps to keep thing in line. We document in UML and the MVC design pattern (and CakePHP) fit well. A side benefit of having this type of organized structure is the data defines the design. For data silos, the relationships of the data is what generates your SQL calls. Your need to hand write complex Many-to-Many SQL calls will drop dramatically (we still write a few, but not many). It takes some practice for many programmers because it isn't a natural transition, but if you can take off the programmer hat and look at your projects from the problem and solution domain instead, you will find that these frameworks begin to fit your new thinking. This is what I have found watching our programmers and outsource groups make the change over. On 8/22/07, Ben Sgro (ProjectSkyLine) wrote: > > Hello all, > > I know there has been a ton of discussion about frameworks. > > So far, I've looked into: > 1) Cake > 2) Zend > 3) Joomla > 4) Symfony > 5) Drupal > > I've looked at tutorials, books and online how-tos'. Let me explain my > development environment. > > I use smarty templates for all my HTML. My php is 5w/OOP. I have many > libraries from everything > from database access, sitemap creation, html (textboxes, drop downs), > simple ajax, error logging, > session handling, (all created by myself) and I use PEAR SOMETIMES as to > not reinvent the wheel > for a single project. When I design sites & applications, I have an > index.php and pass "actions=WHATEVER" > on the URL to change the action of the program. I dont use seperate files > for different things EXCEPT for all the libs > and auxiliary functions. I use SVN for revision control. > > I guess I don't see the compelling reason to switch to a framework. Will > it really speed up my development > time, even if I have all these libs (and still expanding) already created? > > The JSON stuff looks cool, but I dont use that much js and if I do, I just > write it myself. > > Applications I build are powered by PHP/MYSQL, HTML/CSS. There are forms > to fillout, emailing, login, > account creation, etc. Some are more complicated than others. > > Maybe I could use one framework for making simple websites, and another > for applications? > > I'm really looking for success stories or terros from switching from no > framework to using one, > which one, how long it took to be effecient with it, how easy it was to > expand/modify, the > userbase and user support, scalability, ease of use, organization of > codebase, etc. Also, > I LOVE books, so any that have good paperback book or white > paper/tutorials is a BIG plus. > > Any feedback is helpful, and please provide pros/cons. > > Thanks so much! > > - Ben > > > Ben Sgro, Chief Engineer > ProjectSkyLine - Defining New Horizons > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use of the > individual to whom it is addressed. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- David Merryweather Vice President of Information Technologies HighNote Technologies -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmjones88 at gmail.com Wed Aug 22 17:36:59 2007 From: pmjones88 at gmail.com (Paul M Jones) Date: Wed, 22 Aug 2007 16:36:59 -0500 Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: <024701c7e4dc$f2981660$6401a8c0@gamebox> References: <024701c7e4dc$f2981660$6401a8c0@gamebox> Message-ID: <8B58A80B-2DF3-471F-9F4F-4E12403BE269@gmail.com> On Aug 22, 2007, at 11:53 AM, Ben Sgro ((ProjectSkyLine)) wrote: > Hello all, > > I know there has been a ton of discussion about frameworks. ... > > I use smarty templates for all my HTML. My php is 5w/OOP. I have > many libraries from everything > from database access, sitemap creation, html (textboxes, drop > downs), simple ajax, error logging, > session handling, (all created by myself) and I use PEAR SOMETIMES > as to not reinvent the wheel > for a single project. ... > I guess I don't see the compelling reason to switch to a framework. (Full disclosure: I am the author of the Solar framework for PHP.) Not to be flippant, but it looks like you have built a framework of your own already. I am not surprised that you don't see a compelling reason to use something else. You have a familia way-of-working in tools and techniques, and you don't want to change those to suit someone else's way-of-working (which is perfectly fair). To be clear, you won't be switching from "no-framework" to another one, but from "your-framework" to another one. Changing to another framework (one written by someone else) will require you to change your approach and habits, and that sucks; just ask Laura Thomson. I know that doesn't help much. :-/ -- Paul M. Jones Solar: Simple Object Library and Application Repository for PHP5. Join the Solar community wiki! Savant: The simple, elegant, and powerful solution for templates in PHP. From ajai at bitblit.net Wed Aug 22 17:57:46 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 22 Aug 2007 17:57:46 -0400 (EDT) Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: <793b2bec0708221407m7f0baf0eyee5749cc9f277519@mail.gmail.com> Message-ID: On Wed, 22 Aug 2007, David Merryweather wrote: > It takes some practice for many programmers because it isn't a natural > transition, but if you can take off the programmer hat and look at your > projects from the problem and solution domain instead, you will find that > these frameworks begin to fit your new thinking. Absolutely - not having to deal with writing a whole database abstraction or ORM layer really frees you to concentrate more on the business logic and flow of the application. -- Aj. From shaijudavis at gmail.com Wed Aug 22 18:43:51 2007 From: shaijudavis at gmail.com (shaiju davis) Date: Thu, 23 Aug 2007 04:13:51 +0530 Subject: [nycphp-talk] problem with mdecrypt_generic Message-ID: <30ce306c0708221543x121a9dffq96824ccb29a2b6fe@mail.gmail.com> hi All, When I use mdecrypt_generic, I get an error "Warning: function.mdecrypt-generic: An empty string was passed in ". If any one has previous experience with this msg please help me. Thanks in Advance, Shaiju Davis. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Wed Aug 22 19:29:12 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Wed, 22 Aug 2007 19:29:12 -0400 Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: References: Message-ID: I find the fact that if something does go wrong in a framework(ed) environment you know *exactly* where to look (even if the project is not yours) so its normally the debugging aspect of the project I look @ first. Also I think the IDEs are going to (or should) accommodate more and more frameworks in the future which is where the quick agile development will really be. - Jon On Aug 22, 2007, at 5:57 PM, Ajai Khattri wrote: > On Wed, 22 Aug 2007, David Merryweather wrote: > >> It takes some practice for many programmers because it isn't a >> natural >> transition, but if you can take off the programmer hat and look at >> your >> projects from the problem and solution domain instead, you will >> find that >> these frameworks begin to fit your new thinking. > > Absolutely - not having to deal with writing a whole database > abstraction > or ORM layer really frees you to concentrate more on the business > logic > and flow of the application. > > > -- > Aj. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From brenttech at gmail.com Wed Aug 22 19:33:49 2007 From: brenttech at gmail.com (Brent Baisley) Date: Wed, 22 Aug 2007 19:33:49 -0400 Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: <024701c7e4dc$f2981660$6401a8c0@gamebox> References: <024701c7e4dc$f2981660$6401a8c0@gamebox> Message-ID: I'm in the same boat. Although I just switched jobs, so I don't have my framework anymore. Some of the frameworks require you to program to their standards and use the entire framework, like Drupal. I prefer to use only the pieces I need or the parts that are better than mine. The Zend framework is designed around that concept, so you can continue to use your framework and just incorporate pieces of theirs. I found a lot of the frameworks are designed around creating/managing a site. In my case, web sites are just the presentation of various pieces. The same "piece" can appear on any number of sites. The site isn't the central point, it's the "piece" that's important. The site is whatever the creative group comes up with, I just plugin the pieces. Many of the frameworks don't lend themselves to this type of setup. Most of my code lives in a centralized directory accessible by all web sites. Which is why I seem to be settling on Zend. On Aug 22, 2007, at 12:53 PM, Ben Sgro ((ProjectSkyLine)) wrote: > Hello all, > > I know there has been a ton of discussion about frameworks. > > So far, I've looked into: > 1) Cake > 2) Zend > 3) Joomla > 4) Symfony > 5) Drupal > > I've looked at tutorials, books and online how-tos'. Let me explain > my development environment. > > I use smarty templates for all my HTML. My php is 5w/OOP. I have > many libraries from everything > from database access, sitemap creation, html (textboxes, drop > downs), simple ajax, error logging, > session handling, (all created by myself) and I use PEAR SOMETIMES > as to not reinvent the wheel > for a single project. When I design sites & applications, I have an > index.php and pass "actions=WHATEVER" > on the URL to change the action of the program. I dont use seperate > files for different things EXCEPT for all the libs > and auxiliary functions. I use SVN for revision control. > > I guess I don't see the compelling reason to switch to a framework. > Will it really speed up my development > time, even if I have all these libs (and still expanding) already > created? > > The JSON stuff looks cool, but I dont use that much js and if I do, > I just write it myself. > > Applications I build are powered by PHP/MYSQL, HTML/CSS. There are > forms to fillout, emailing, login, > account creation, etc. Some are more complicated than others. > > Maybe I could use one framework for making simple websites, and > another for applications? > > I'm really looking for success stories or terros from switching > from no framework to using one, > which one, how long it took to be effecient with it, how easy it > was to expand/modify, the > userbase and user support, scalability, ease of use, organization > of codebase, etc. Also, > I LOVE books, so any that have good paperback book or white paper/ > tutorials is a BIG plus. > > Any feedback is helpful, and please provide pros/cons. > > Thanks so much! > > - Ben > > > Ben Sgro, Chief Engineer > ProjectSkyLine - Defining New Horizons > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use > of the individual to whom it is addressed. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Wed Aug 22 20:48:22 2007 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 22 Aug 2007 20:48:22 -0400 Subject: [nycphp-talk] PHP 5.3 Problem - Object Creation problem In-Reply-To: References: Message-ID: <20070823004821.GA12452@panix.com> Hey Jeff! On Tue, Aug 21, 2007 at 09:39:47AM -0400, jeff mailings wrote: > Anyone know the best way to handle this error? "PHP Catchable fatal error: > Object of class Database could not be converted to string" Beside the __toString() workaround mentioned, I'd get to the root of the matter: objects are not strings, so fix the code where you're using them as such. Are you, by chance, using an object as an array key? --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 jeffmailings99 at verizon.net Thu Aug 23 10:25:01 2007 From: jeffmailings99 at verizon.net (Jeff Siegel) Date: Thu, 23 Aug 2007 10:25:01 -0400 Subject: [nycphp-talk] PHP 5.3 Problem - Object Creation problem In-Reply-To: <20070823004821.GA12452@panix.com> Message-ID: Dan, While the Q&D (Quick and Dirty) method solved the problem...you are correct...makes sense to find out the real source of the problem. As best as I can tell...what made PHP annoyed was when I instantiated a class from within another class. That is, class "A" was instantiated by one of the methods in class "B." Jeff [snip] On Tue, Aug 21, 2007 at 09:39:47AM -0400, jeff mailings wrote: > Anyone know the best way to handle this error? "PHP Catchable fatal error: > Object of class Database could not be converted to string" Beside the __toString() workaround mentioned, I'd get to the root of the matter: objects are not strings, so fix the code where you're using them as such. Are you, by chance, using an object as an array key? --Dan [snip] From ajai at bitblit.net Thu Aug 23 11:10:35 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 23 Aug 2007 11:10:35 -0400 (EDT) Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: Message-ID: On Wed, 22 Aug 2007, Brent Baisley wrote: > I found a lot of the frameworks are designed around creating/managing > a site. Certainly that's true of Joomla, Drupal and Xaraya. Its not true of things like CakePHP or symfony. -- Aj. From mailinglists at caseysoftware.com Thu Aug 23 12:03:06 2007 From: mailinglists at caseysoftware.com (Keith Casey) Date: Thu, 23 Aug 2007 12:03:06 -0400 Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: <793b2bec0708221407m7f0baf0eyee5749cc9f277519@mail.gmail.com> References: <024701c7e4dc$f2981660$6401a8c0@gamebox> <793b2bec0708221407m7f0baf0eyee5749cc9f277519@mail.gmail.com> Message-ID: On 8/22/07, David Merryweather wrote: > It takes some practice for many programmers because it isn't a natural > transition, but if you can take off the programmer hat and look at your > projects from the problem and solution domain instead, you will find that > these frameworks begin to fit your new thinking. This is what I have found > watching our programmers and outsource groups make the change over. I would challenge this point... as I've seen the opposite happening more and more. There is a budding school of thought among new PHP'ers that says "you do it this way or it's wrong". Yes, the developers are to blame, not the framework, but it concerns me a bit that they're seeing everything in relation to how it doesn't match their framework of choice. That's originally why I picked up the Zend Framework. Instead of a fixed structure for my applications, it felt more like a tool box. I can reach in and pull out Logging, PDF creation, DB access, whatever and only use the pieces I need. It hasn't required a re-write/re-structuring of my applications, so it's been more evolutionary as opposed to scorched earth. In fact, while working on site for a major news network, I added logging using Zend_Log in about 45 minutes. Full Disclosure: Technically, I'm a contributor to the Zend Framework (signed the CLA), but I have yet to contribute anything... but I am speaking at ZendCon about the above experience. kc -- D. Keith Casey Jr. CEO, CaseySoftware, LLC http://CaseySoftware.com From danielc at analysisandsolutions.com Thu Aug 23 12:29:52 2007 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 23 Aug 2007 12:29:52 -0400 Subject: [nycphp-talk] PHP 5.3 Problem - Object Creation problem In-Reply-To: References: <20070823004821.GA12452@panix.com> Message-ID: <20070823162952.GA29715@panix.com> Hi Jeff: On Thu, Aug 23, 2007 at 10:25:01AM -0400, Jeff Siegel wrote: > > As best as I can tell...what made PHP annoyed was when I instantiated a > class from within another class. That is, class "A" was instantiated by one > of the methods in class "B." Hmm... That in itself isn't a problem. Perhaps you were using the object as a variable variable or something? --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 jeffmailings99 at verizon.net Thu Aug 23 13:01:12 2007 From: jeffmailings99 at verizon.net (Jeff Siegel) Date: Thu, 23 Aug 2007 13:01:12 -0400 Subject: [nycphp-talk] PHP 5.3 Problem - Object Creation problem In-Reply-To: <20070823162952.GA29715@panix.com> Message-ID: Dan, Honestly...the code is so old that variable variables were not part of my skill set at that time. Jeff =========================== -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Daniel Convissor Sent: Thursday, August 23, 2007 12:30 PM To: NYPHP Talk Subject: Re: [nycphp-talk] PHP 5.3 Problem - Object Creation problem Hi Jeff: On Thu, Aug 23, 2007 at 10:25:01AM -0400, Jeff Siegel wrote: > > As best as I can tell...what made PHP annoyed was when I instantiated a > class from within another class. That is, class "A" was instantiated by one > of the methods in class "B." Hmm... That in itself isn't a problem. Perhaps you were using the object as a variable variable or something? --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 Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From gisolfi at us.ibm.com Thu Aug 23 14:05:33 2007 From: gisolfi at us.ibm.com (Dan Gisolfi) Date: Thu, 23 Aug 2007 12:05:33 -0600 Subject: [nycphp-talk] Summer Shutdown Message-ID: I will be out of the office starting 08/23/2007 and will not return until 09/04/2007. While I may have access to email, please do not expect a response from me until my return. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mitch.pirtle at gmail.com Thu Aug 23 14:44:33 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Thu, 23 Aug 2007 14:44:33 -0400 Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: <024701c7e4dc$f2981660$6401a8c0@gamebox> References: <024701c7e4dc$f2981660$6401a8c0@gamebox> Message-ID: <330532b60708231144j63b63646oa30177c594577aef@mail.gmail.com> (Disclaimer: I'm a co-founder of Joomla) On 8/22/07, Ben Sgro (ProjectSkyLine) wrote: > Maybe I could use one framework for making simple websites, and another for > applications? Bingo. That is exactly how I approach things: 1. Simple websites, like corporate portals: Joomla CMS (Drupal as an alternative) 2. Big, complex custom sites: CakePHP (Symfony as an alternative) 3. Targeted, specific custom sites: Joomla 1.5 Framework (Zend Framework as an alternative) It may be to my familiarity with Joomla, but I cannot launch a garden-variety corporate site on anything else as quickly or efficiently. Stock Joomla and a template, and I'm done. Total time: 15 minutes, and the admin interface is still the easiest I've been able to find out there. For monster projects, I like the scaffolding-style frameworks to help with the load. Integrated testing and change management/deployment tools are essential in this regard. Then there are the simple, specific applications or websites that do a specific thing. Those can be pieced together using what I call 'includes style frameworks' like Joomla 1.5 Framework or Zend, as you just load what you need to get the job done, and can control bloat. Here you might end up just sticking with the stuff you've already created, as it does indeed sound like you have your own framework going on already. Just like a carpenter, our jobs as technologists should be to know how to use a multitude of tools (hammer, saw, etc) and our experience should be able to tell us when to use which. I've branched out to Rails (and of course Ruby) and can say I'm writing more elegant PHP code as a result. -- Mitch From michael.southwell at nyphp.com Thu Aug 23 15:56:34 2007 From: michael.southwell at nyphp.com (Michael Southwell) Date: Thu, 23 Aug 2007 15:56:34 -0400 Subject: [nycphp-talk] Using Pagination In-Reply-To: <000601c7e4e3$04542140$0200a8c0@X9183> References: <000601c7e4e3$04542140$0200a8c0@X9183> Message-ID: <6.2.3.4.2.20070823155316.028209b0@pop.nyphp.com> At 01:36 PM 8/22/2007, you wrote: >I am really sorry to have to ask your help once again, but no matter how >hard I try I can't seem to understand how pagination works Paul, here is how I would approach your problem (if I have understood it correctly. I'm sure the experts on the list will be able to improve this code, but it does work: INDEX.PHP session_start(); // get stuff from the db, unshown $pagePointer = 0; while( $row = mysql_fetch_row( $result ) { // store each row in the session $_SESSION['pages'][$pagePointer] = $row; $pagePointer ++; } // count how many rows we have $_SESSION['pageCount'] = count( $_SESSION['pages']; // redirect to the display header( Location:pages.php?start=0 ); PAGES.PHP $last ) $next = 0; // display this one somehow print_r( $_SESSION['pages'][$start] ); // provide links to move through each page ?>
previous
next >I created a MySQL database called "test_db" and then set up the demo table >"products". the products.php is just a dummy. > >nate.php is the coding. > >I am trying to paginate through the records one by one.(view each record, in >this case). > >Thanks >Paul > > > > > >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >NYPHPCon 2006 Presentations Online >http://www.nyphpcon.com > >Show Your Participation in New York PHP >http://www.nyphp.org/show_participation.php Michael Southwell, Vice President for Education New York PHP http://www.nyphp.com/training - In-depth PHP Training Courses From bz-gmort at beezifies.com Thu Aug 23 16:10:24 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Thu, 23 Aug 2007 16:10:24 -0400 Subject: [nycphp-talk] Using Pagination In-Reply-To: <000601c7e4e3$04542140$0200a8c0@X9183> References: <000601c7e4e3$04542140$0200a8c0@X9183> Message-ID: <46CDE9B0.10304@beezifies.com> PaulCheung wrote: > I am really sorry to have to ask your help once again, but no matter how > hard I try I can't seem to understand how pagination works > > I created a MySQL database called "test_db" and then set up the demo > table > "products". the products.php is just a dummy. > > nate.php is the coding. > > I am trying to paginate through the records one by one.(view each > record, in > this case). > There are 2 kinds of pagination. One assumes the data is dynamic and could change at any point in time. So, for every query you run, you save off a copy of the data to disk and use that report for forward and back. The other kind assumes the data is static(a list of products that is rarely updated, for example) and that you don't care about the occassional odd case of someone trying to go forward or back and not getting what they would expect. For the latter case, you just need to know what record you were looking at in the table and use the limit command on your SQL. IE, LIMIT 0,1 Start at the first record, give me 1 record So when they click forward or back, they send row=3 or row=1 assuming your on the second row Than you set $rownum to the row variable, and your query becomes LIMIT $rownum, 1 The problem with this case is say there are 100 records in the database, and the person is on #90 While they are there, you delete record 89 and then they use the previous button to load record 89..it loads what used to be record 90(the one they were looking at). Honestly, it's not elegant, but this is good enough for many situations. From drydell at optonline.net Thu Aug 23 17:46:41 2007 From: drydell at optonline.net (drydell at optonline.net) Date: Thu, 23 Aug 2007 21:46:41 +0000 (GMT) Subject: [nycphp-talk] Using Pagination In-Reply-To: <46CDE9B0.10304@beezifies.com> References: <000601c7e4e3$04542140$0200a8c0@X9183> <46CDE9B0.10304@beezifies.com> Message-ID: actually, the most effective technique is very simple... all you need is a query, the page number you want and the number of items on a page.First execute your query but don't fetch the resuts. Keep in mind is that executing a query takes a fraction of the time & resources it takes to fetch the result set and build an array - especially if it's a large result set. $qh = mysql_query($sql, [connection stuff]);All you want to fetch is the page of data you want to display, so you want to shift the result set's internal pointer to the right spot. The index you want will be (PageNumber -1) * numberOfItemsOnPage:mysql_data_seek($qh, $index); This is also very fast and will return false if the index is out of range.Now, you can do a fetch loop until you get a page's worth of rows or reach the end of the result set. No matter how big the result set is, you're always building a small array so it's pretty fast..If you'd like to display how many rows were returned, use?mysql_num_rows($qh);?This also uses the query handle and is also very fast.Since you can execute your query every time without a lot of overhead, it doesn't really matter how volatile the data is.While this example uses mysql, other engines have similar functions available too. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsia18 at yahoo.com Thu Aug 23 22:11:58 2007 From: jsia18 at yahoo.com (Jason Sia) Date: Thu, 23 Aug 2007 19:11:58 -0700 (PDT) Subject: [nycphp-talk] php gd problem Message-ID: <711072.5327.qm@web37901.mail.mud.yahoo.com> Hi, I created a drawing application flash using actionscript then I wanted to save the drawing in a jpg file. I succefulkly saved the file however upon looking at the output image, the output is not smooth, I used imagefillpolygon for lines thicker than 1px coz according to php.net imagesetthickness is only applicable to orthogonal lines. I also tried to use imgaesetthickness but the output was worse. I got convincing output when I convert the drawing to swf using PHP ming. Attached is the output image could someone help me with this? Thanks, Jason Send instant messages to your online friends http://uk.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 764.jpg Type: image/jpeg Size: 1262 bytes Desc: not available URL: From dcech at phpwerx.net Fri Aug 24 09:34:41 2007 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 24 Aug 2007 09:34:41 -0400 Subject: [nycphp-talk] php gd problem In-Reply-To: <711072.5327.qm@web37901.mail.mud.yahoo.com> References: <711072.5327.qm@web37901.mail.mud.yahoo.com> Message-ID: <46CEDE71.1060703@phpwerx.net> Jason Sia wrote: > Hi, I created a drawing application flash using actionscript then I wanted to save the drawing in a jpg file. I succefulkly saved the file however upon looking at the output image, the output is not smooth, I used imagefillpolygon for lines thicker than 1px coz according to php.net imagesetthickness is only applicable to orthogonal lines. I also tried to use imgaesetthickness but the output was worse. I got convincing output when I convert the drawing to swf using PHP ming. Attached is the output image could someone help me with this? Jason, It looks like you are probably generating a huge number of points for the line, so you've got a lot of polygons and possibly the jagged edges you are seeing are from misplaced corners. You will probably need to post some code so that we can see exactly what is happening. My guess would be that we don't need to see the flash stuff, but just the gd script and the data you're feeding it. Dan From ken at secdat.com Fri Aug 24 10:09:55 2007 From: ken at secdat.com (Kenneth Downs) Date: Fri, 24 Aug 2007 10:09:55 -0400 Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: References: <024701c7e4dc$f2981660$6401a8c0@gamebox> <793b2bec0708221407m7f0baf0eyee5749cc9f277519@mail.gmail.com> Message-ID: <46CEE6B3.4090401@secdat.com> Keith Casey wrote: > On 8/22/07, David Merryweather wrote: > >> It takes some practice for many programmers because it isn't a natural >> transition, but if you can take off the programmer hat and look at your >> projects from the problem and solution domain instead, you will find that >> these frameworks begin to fit your new thinking. This is what I have found >> watching our programmers and outsource groups make the change over. >> > > I would challenge this point... as I've seen the opposite happening > more and more. There is a budding school of thought among new PHP'ers > that says "you do it this way or it's wrong". Yes, the developers are > to blame, not the framework, but it concerns me a bit that they're > seeing everything in relation to how it doesn't match their framework > of choice. > Methinks this is not so much PHP as plain human nature, programmers are by nature rules-bound, thinking in terms of the problem domain is not necessarily our first reflex, but when we learn it it it is what makes computers really do the magic they do. PHP is still penetrating the enterprise space and has such the community has not "grown up" enough yet. Both behaviors mentioned above can be seen, it depends upon where you look. Frameworks are a result of a breakthrough in thinking -- there is not necessarily a perfect way to do anything, but if you pick a way and do it consistently, the consistency itself will bring real productivity gains. You leave behind the headaches of having to work out a solution to every problem, only to find out later what the weaknesses of your answer were. You join a group that are all doing things the same way and can teach each other and help each other out. You also leave behind that naive rules-based thinking that there is only one perfect way to do anything. But ironically it doesn't look this way. The framework becomes the new accepted way to do things for the sake of consistency, and sometimes people mistake that for new rules-bound inflexibility. > That's originally why I picked up the Zend Framework. Instead of a > fixed structure for my applications, it felt more like a tool box. I > can reach in and pull out Logging, PDF creation, DB access, whatever > and only use the pieces I need. It hasn't required a > re-write/re-structuring of my applications, so it's been more > evolutionary as opposed to scorched earth. In fact, while working on > site for a major news network, I added logging using Zend_Log in about > 45 minutes. > I would argue that that makes it what you called it - a toolbox, and not a framework. A toolbox gives you ways to do whatever you want, while a framework tends to give you more of an assembly line. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 -------------- next part -------------- An HTML attachment was scrubbed... URL: From urb at e-government.com Fri Aug 24 10:29:43 2007 From: urb at e-government.com (Urb LeJeune) Date: Fri, 24 Aug 2007 10:29:43 -0400 Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: <46CEE6B3.4090401@secdat.com> References: <024701c7e4dc$f2981660$6401a8c0@gamebox> <793b2bec0708221407m7f0baf0eyee5749cc9f277519@mail.gmail.com> <46CEE6B3.4090401@secdat.com> Message-ID: <7.0.1.0.2.20070824102510.0322db40@e-government.com> >>>It takes some practice for many programmers because it isn't a natural >>>transition, but if you can take off the programmer hat and look at your >>>projects from the problem and solution domain instead, you will find that >>>these frameworks begin to fit your new thinking. This is what I >>>have found watching our programmers and outsource groups make the change over. I used to teach Computer Science at the college and graduate level. When OOP first started the programmers with a lot of experience had real difficulty seeing the advantage and adapting to the new methodology. However, students who were just starting to program had no problem adjusting. I think it's simply human nature to keep wanting to do things that have worked well in the past. Urb Dr. Urban A. LeJeune, President E-Government.com 800-204-9545 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsia18 at yahoo.com Fri Aug 24 10:31:32 2007 From: jsia18 at yahoo.com (Jason Sia) Date: Fri, 24 Aug 2007 07:31:32 -0700 (PDT) Subject: [nycphp-talk] php gd problem Message-ID: <238314.77632.qm@web37902.mail.mud.yahoo.com> Here's the code the format of the line is: line_startX_startY_endX,endY_thickness; 0 && $difY<0){$startD=180;$endD=270;} if($difX>0 && $difY>0){$startD=90;$endD=180;} if($difX<0 && $difY>0){$startD=0;$endD=90;} if($imagetype=="jpg" || $imagetype=="png"){imagesetthickness($image,$shapeData[5]); imagearc($image,$shapeData[1],$shapeData[4],abs($difX)*2,abs($difY)*2,$startD,$endD,$shapecolor); } } // draw the circle shapes if($shapeData[0]=="circle"){ $w=abs($shapeData[1]-$shapeData[3]); if($w==0){$w=0.1;} $h=abs($shapeData[2]-$shapeData[4]); if($h==0){$h=0.1;} if($imagetype=="jpg" || $imagetype=="png"){imagesetthickness($image,$shapeData[5]); if($shapeData[7]=="true"){ imagefilledarc($image,$shapeData[1],$shapeData[2],$w*2,$h*2,0,359,$shapecolor,IMAGE_ARC_PIE); imagefilledarc($image,$shapeData[1],$shapeData[2],$w*2,$h*2,359,360,$shapecolor,IMAGE_ARC_PIE); }else{ imagearc($image,$shapeData[1],$shapeData[2],$w*2,$h*2,0,359,$shapecolor); imagearc($image,$shapeData[1],$shapeData[2],$w*2,$h*2,359,360,$shapecolor); }} $j=$w*0.70711; $n=$h*0.70711; $i=$j-($h-$n)*$w/$h; $M=$n-($w-$j)*$h/$w; if($imagetype=="swf"){ $l->movePenTo($shapeData[1]+$w,$shapeData[2]); $l->drawCurveTo($shapeData[1]+$w,$shapeData[2]-$M,$shapeData[1]+$j,$shapeData[2]-$n); $l->drawCurveTo($shapeData[1]+$i,$shapeData[2]-$h,$shapeData[1],$shapeData[2]-$h); $l->drawCurveTo($shapeData[1]-$i,$shapeData[2]-$h,$shapeData[1]-$j,$shapeData[2]-$n); $l->drawCurveTo($shapeData[1]-$w,$shapeData[2]-$M,$shapeData[1]-$w,$shapeData[2]); $l->drawCurveTo($shapeData[1]-$w,$shapeData[2]+$M,$shapeData[1]-$j,$shapeData[2]+$n); $l->drawCurveTo($shapeData[1]-$i,$shapeData[2]+$h,$shapeData[1],$shapeData[2]+$h); $l->drawCurveTo($shapeData[1]+$i,$shapeData[2]+$h,$shapeData[1]+$j,$shapeData[2]+$n); $l->drawCurveTo($shapeData[1]+$w,$shapeData[2]+$M,$shapeData[1]+$w,$shapeData[2]); }} } // end drawing data loop // copy the pallette drawing image to the truecolor jpeg image if($imagetype=="jpg" || $imagetype=="png"){ imageantialias($image,true); imageantialias($background,true); $background = imagecreatetruecolor(90, 55); imagecopyresampled($background,$image,0,0,0,0,90,55,500,300); } // save the jpeg to file $uniqueFile=rand(); if($imagetype=="jpg"){imagejpeg($background,"draw/$uniqueFile.jpg");} // save the png to file if($imagetype=="png"){imagepng($background,"draw/$uniqueFile.png");} // free up the image allocations if($imagetype=="jpg" || $imagetype=="png"){ imagedestroy($background); imagedestroy($image); } ?> ----- Original Message ---- From: Dan Cech To: NYPHP Talk Sent: Friday, August 24, 2007 9:34:41 PM Subject: Re: [nycphp-talk] php gd problem Jason Sia wrote: > Hi, I created a drawing application flash using actionscript then I wanted to save the drawing in a jpg file. I succefulkly saved the file however upon looking at the output image, the output is not smooth, I used imagefillpolygon for lines thicker than 1px coz according to php.net imagesetthickness is only applicable to orthogonal lines. I also tried to use imgaesetthickness but the output was worse. I got convincing output when I convert the drawing to swf using PHP ming. Attached is the output image could someone help me with this? Jason, It looks like you are probably generating a huge number of points for the line, so you've got a lot of polygons and possibly the jagged edges you are seeing are from misplaced corners. You will probably need to post some code so that we can see exactly what is happening. My guess would be that we don't need to see the flash stuff, but just the gd script and the data you're feeding it. Dan _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php Send instant messages to your online friends http://uk.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Fri Aug 24 16:10:53 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Fri, 24 Aug 2007 16:10:53 -0400 Subject: [nycphp-talk] Frameworks - Which best fits my development style? In-Reply-To: <7.0.1.0.2.20070824102510.0322db40@e-government.com> References: <024701c7e4dc$f2981660$6401a8c0@gamebox> <793b2bec0708221407m7f0baf0eyee5749cc9f277519@mail.gmail.com> <46CEE6B3.4090401@secdat.com> <7.0.1.0.2.20070824102510.0322db40@e-government.com> Message-ID: <46CF3B4D.7050306@beezifies.com> Urb LeJeune wrote: > I used to teach Computer Science at the college and graduate > level. When OOP first > started the programmers with a lot of experience had real difficulty > seeing the advantage and > adapting to the new methodology. However, students who were just > starting to program had > no problem adjusting. > > I think it's simply human nature to keep wanting to do things > that have worked well in > the past. > I dunno, I think that in a lot of cases there was this tendency for people to descibe every aspect of OOP as a new way of doing things. "We have classes" - yeah, I have those, their called function libraries. "You can create subclasses" - yeah, I can do that to, it's called making a copy of my library and changing it.(yes yes, it's not the same. OTOH, I've seen subclasses get so mangled beyond recognition that the relationship to the original class is meaningless). "We have references to objects" - I have pointers. Don't get me wrong, OOP has it's own strength. It takes all the good coding practices that people should have been doing anyway, and formalizes and enforces them. And than it creates a whole new way of writing bad code. But, here is the catch, every now and then it doesn't work. You can't do something in an object oriented fashion, and figuring out how to circumvent it can be a pain. So, if your a programmer that is already disciplined to using the good practices, and you can easily write code adhering to those practices but have the flexibility of breaking them when it is economically the best decision - you will really really really recent being forced not to. After the second or third time I had "refereneces" explained in this incredibly complex jargon, which boiled down to "it's a pointer" - and having steam come out of the ears of the explainer that I dared compare his OOP baby to regular old programming, I started to see the point of programmers that didn't like OOP. A lot of terminology was changed just for the sake of calling it something "new". I don't know the reasoning involved, my guess would be it was done to force programmers to think in a new way and not confuse it with old techniques and intermix. And that's fine, as long as you have the decency to admit that the 2 terms are pretty similiar. The programming examples for object oriented programming were just tedious in the extreme. Pet subclassed to Dog subclassed to German Shepherd. The problem was that each subclassing was such a trivial change,. that it seemed like a waste of time(oh, and don't get me started on programmers that would declare that Object Oriented programming would solve everything and so they would rewrite their applications in Java or whatever the latest craze was. The end result was that instead of having a big chunk of code that was written by a team, we now had a section of code that could only be maintained by one person, and another section that only another person could maintain. It only makes business sense to rewrite code when your going to train your whole team in it, not when one guy thinks it looks good on his resume). From cliff at pinestream.com Fri Aug 24 17:26:30 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 24 Aug 2007 17:26:30 -0400 Subject: [nycphp-talk] phpGACL access control Message-ID: <20070824212500.M50719@pinestream.com> Does anyone use phpGACL? Good, bad, ugly? Alternative? Other suggestions for access control? This looks like an easy drop in, although the UI is wicked confusing. Clif From mwithington at PLMresearch.com Fri Aug 24 17:29:36 2007 From: mwithington at PLMresearch.com (Mark Withington) Date: Fri, 24 Aug 2007 17:29:36 -0400 Subject: [nycphp-talk] phpGACL access control In-Reply-To: <20070824212500.M50719@pinestream.com> References: <20070824212500.M50719@pinestream.com> Message-ID: <491198290708241429o77b43379v5fbbe2512f1d9092@mail.gmail.com> It's used in Joomla! 1.x although I think this was something that was to be replaced in 1.5? Perhaps Mitch can chime in here. On 8/24/07, Cliff Hirsch wrote: > > Does anyone use phpGACL? Good, bad, ugly? Alternative? Other suggestions > for > access control? This looks like an easy drop in, although the UI is wicked > confusing. > > Clif > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Mark -------------------------- Mark L. Withington PLMresearch PO Box 1354 Plymouth, MA 02362 o: 800-310-3992 ext. 704 f: 508-746-4973 v: 508-746-2383 m: 508-801-0181 AIM/MSN/Skype: PLMresearch -------------- next part -------------- An HTML attachment was scrubbed... URL: From mitch.pirtle at gmail.com Fri Aug 24 18:10:50 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Fri, 24 Aug 2007 18:10:50 -0400 Subject: [nycphp-talk] phpGACL access control In-Reply-To: <491198290708241429o77b43379v5fbbe2512f1d9092@mail.gmail.com> References: <20070824212500.M50719@pinestream.com> <491198290708241429o77b43379v5fbbe2512f1d9092@mail.gmail.com> Message-ID: <330532b60708241510s76260cd1ye8b0e18c053f3987@mail.gmail.com> On 8/24/07, Mark Withington wrote: > It's used in Joomla! 1.x although I think this was something that was to be > replaced in 1.5? Perhaps Mitch can chime in here. It was intended for 1.0, then got pushed to 1.1 which became 1.5, and now is sitting in 1.6 waiting for the chance to be released to the world ;-) phpGACL was what was originally intended to be implemented, however there were some challenges behind making that possible. Andrew Eddie is behind the current ACL work, so he's most definitely the best resource to ask that question to. I know the base tables were there even in the Mambo days, but we never implemented the logic to support it as it broke backwards compatibility. Ditto for the next implementation, methinks. As for phpGACL, the feedback I got was that most ACLs out there are good at answering one question, from the following list: 1) "Can I access this object?" 2) "Who can access this object?" The trouble is finding an ACL that is equally adept at doing both. -- Mitch From mailinglists at caseysoftware.com Fri Aug 24 19:02:39 2007 From: mailinglists at caseysoftware.com (Keith Casey) Date: Fri, 24 Aug 2007 19:02:39 -0400 Subject: [nycphp-talk] phpGACL access control In-Reply-To: <330532b60708241510s76260cd1ye8b0e18c053f3987@mail.gmail.com> References: <20070824212500.M50719@pinestream.com> <491198290708241429o77b43379v5fbbe2512f1d9092@mail.gmail.com> <330532b60708241510s76260cd1ye8b0e18c053f3987@mail.gmail.com> Message-ID: On 8/24/07, Mitch Pirtle wrote: > phpGACL was what was originally intended to be implemented, however > there were some challenges behind making that possible. Andrew Eddie > is behind the current ACL work, so he's most definitely the best > resource to ask that question to. dotProject has been using phpGACL for about 2.5 years or so. When we implemented it, we found that some of it was nasty due to the level of granularity that we needed so we wrote a wrapper around it to hide most of it from the core of the code. Lately we've been adding helper methods to the various core classes to further abstract this and simplify the overall API. I think it's worked out pretty well and has hidden all the complexity while still allowing admins to define very specific permissions while respecting parent/child relationships. For example, knowing that someone has permissions to see a specific Project doesn't imply anything about the attached tasks. > As for phpGACL, the feedback I got was that most ACLs out there are > good at answering one question, from the following list: > > 1) "Can I access this object?" > 2) "Who can access this object?" For the most part, we ignore the 2nd question but also ask the opposite of the first - "Am I denied access to this object?" If you check out dotProject, the core of the implementation is in classes/permissions.php. kc -- D. Keith Casey Jr. CEO, CaseySoftware, LLC http://CaseySoftware.com From cliff at pinestream.com Fri Aug 24 19:24:19 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 24 Aug 2007 19:24:19 -0400 Subject: [nycphp-talk] phpGACL access control In-Reply-To: <330532b60708241510s76260cd1ye8b0e18c053f3987@mail.gmail.com> References: <20070824212500.M50719@pinestream.com> <491198290708241429o77b43379v5fbbe2512f1d9092@mail.gmail.com> <330532b60708241510s76260cd1ye8b0e18c053f3987@mail.gmail.com> Message-ID: <20070824231937.M58846@pinestream.com> > As for phpGACL, the feedback I got was that most ACLs out there are > good at answering one question, from the following list: > > 1) "Can I access this object?" > 2) "Who can access this object?" > > The trouble is finding an ACL that is equally adept at doing both. I understand #1. That's the main point -- access control. But why do I need #2? To see if I need to bar the door for someone as the # of rules, groups, users grows increasingly complex? I like having an instant front-end gui for setting up the ACLs. That's where phpGACL seems to make sense. But it doesn't solve the issue of implementing it in an application. I'm guessing thats where a really well designed and structured front-end controller could be handy. It would just need to check permission based on a page/action. Cliff From chsnyder at gmail.com Sat Aug 25 23:52:39 2007 From: chsnyder at gmail.com (csnyder) Date: Sat, 25 Aug 2007 23:52:39 -0400 Subject: [nycphp-talk] phpGACL access control In-Reply-To: <20070824231937.M58846@pinestream.com> References: <20070824212500.M50719@pinestream.com> <491198290708241429o77b43379v5fbbe2512f1d9092@mail.gmail.com> <330532b60708241510s76260cd1ye8b0e18c053f3987@mail.gmail.com> <20070824231937.M58846@pinestream.com> Message-ID: On 8/24/07, Cliff Hirsch wrote: > > As for phpGACL, the feedback I got was that most ACLs out there are > > good at answering one question, from the following list: > > > > 1) "Can I access this object?" > > 2) "Who can access this object?" > > > > The trouble is finding an ACL that is equally adept at doing both. > > I understand #1. That's the main point -- access control. But why do I need > #2? To see if I need to bar the door for someone as the # of rules, groups, > users grows increasingly complex? I think number 2 translates to things like "Who else can read posts to this forum?" or "What developers have commit access" or even reports like "List all editors by site". -- Chris Snyder http://chxo.com/ From cliff at pinestream.com Sun Aug 26 08:15:56 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Sun, 26 Aug 2007 08:15:56 -0400 Subject: [nycphp-talk] phpGACL access control In-Reply-To: References: <20070824212500.M50719@pinestream.com> <491198290708241429o77b43379v5fbbe2512f1d9092@mail.gmail.com> <330532b60708241510s76260cd1ye8b0e18c053f3987@mail.gmail.com> <20070824231937.M58846@pinestream.com> Message-ID: <20070826120930.M72087@pinestream.com> On Sat, 25 Aug 2007 23:52:39 -0400, csnyder wrote > On 8/24/07, Cliff Hirsch wrote: > > > As for phpGACL, the feedback I got was that most ACLs out there are > > > good at answering one question, from the following list: > > > > > > 1) "Can I access this object?" > > > 2) "Who can access this object?" > I think number 2 translates to things like "Who else can read posts > to this forum?" or "What developers have commit access" or even reports > like "List all editors by site". > > -- > Chris Snyder I was waiting for you to chime in here. Just re-read your RBAC chapter in Pro PHP Security (AWESOME BOOK, BTW). Nice Hamptons beach reading. Its that or Clive Cussler. As I think about this, the problem is all the "locations". A front-end controller can consolidate or automatically synthesize and manage locations. But there could be soooo many. And it seems to me the presentation layer needs a heck of a lot of if statements to hide sections, links, buttons, etc. if you want to hide unaccessible stuff instead of a simple "not authorized" msg. From chsnyder at gmail.com Sun Aug 26 13:27:43 2007 From: chsnyder at gmail.com (csnyder) Date: Sun, 26 Aug 2007 13:27:43 -0400 Subject: [nycphp-talk] phpGACL access control In-Reply-To: <20070826120930.M72087@pinestream.com> References: <20070824212500.M50719@pinestream.com> <491198290708241429o77b43379v5fbbe2512f1d9092@mail.gmail.com> <330532b60708241510s76260cd1ye8b0e18c053f3987@mail.gmail.com> <20070824231937.M58846@pinestream.com> <20070826120930.M72087@pinestream.com> Message-ID: On 8/26/07, Cliff Hirsch wrote: > > I was waiting for you to chime in here. Just re-read your RBAC chapter in Pro > PHP Security (AWESOME BOOK, BTW). Nice Hamptons beach reading. Its that or > Clive Cussler. > > As I think about this, the problem is all the "locations". A front-end > controller can consolidate or automatically synthesize and manage locations. > But there could be soooo many. And it seems to me the presentation layer needs > a heck of a lot of if statements to hide sections, links, buttons, etc. if you > want to hide unaccessible stuff instead of a simple "not authorized" msg. That depends on your information architecture (how interconnected is everything, really?) and how granular your access policies are. But it's true what you say--there's a _lot_ of checking to see if the user can do this or access that in any reasonably complex system. I just looked at a typical calendar view and counted around 360 separate access control checks. It's extremely important that these checks be as inexpensive as possible--you obviously don't want to hit the database or ldap directory that many times. But that doesn't mean you have to write a bunch of conditional statements. Access control is, ideally, itegrated into your framework. When you fetch a collection of objects to populate a navigation menu, the ones that the user doesn't have access to shouldn't be sent to the presentation layer in the first place. That "embeddedness" is the main reason why we didn't include an actual RBAC system in Pro PHP Security--the sample code would have had to implement an entire mini framework. -- Chris Snyder http://chxo.com/ From bz-gmort at beezifies.com Sun Aug 26 13:34:35 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Sun, 26 Aug 2007 13:34:35 -0400 Subject: [nycphp-talk] Linux editors Message-ID: <46D1B9AB.4000307@beezifies.com> Since there are a lot of people here who probably code in PHP(ha) and use Linux, I thought I'd ask here if anyone is familiar with GUI programmer editors in Linux. Yes, yes, I can and do use VI when on linux. But my work habits have formed over the years based on using the best tool for my mindset on the platform I had to use(Windows XP). So my editor of choice has been UltraEdit. The features of UltraEdit which I like(and they are probably laughably small): FTP built into the editor: I can open my files right off a remote server without any fiddle faddling around. SSH built into the editor: More importantly FTP over SSH so I can still open files right off a remove server. Automatic code collapse: Ultraedit has a tag library for PHP and HTML. When I'm editing a PHP file, it automatically find the start and stop of tags and I can collapse them. So I can open a huge PHP file, collapse all the functions into single lines, and than scan through and find the function I'm interested in. While coding, once I have finished a section, I can collapse it and see what came before it and goes after it. It is this last feature that I have had a hard time finding in other editors. Heck, I downloaded the latest Dreamweaver for a ProStores project(as it was the only way to get the who collection of program scripts out of prostores without downloading 1 by 1) and the best it had to offer was that I could create my own code foldings. At the past PHP meeting, it finally sunk in to me that for years I've been saying "I'd really love to develop in Linux, but I have to run Lotus Notes for work and you can't get the full environment to work reliably in Linux[ok, that's not quite TRUE. Those individuals who were not second class citizens at work were welcome to use the Linux test platform which had all such goodness built into it. However, such a platform was not for the likes of a second class contractor such as myself. The best I could get was a notes client, but no development or admin client without which I was dead in the water) Well, that time is past, and other than the periodic UG meeting I will likely never set foot in that company again, and even if I do I won't need to keep my personal system compatible with their work environment. So, it's time to bite the bullet. Time to learn to code in linux and break my bad Windows habits. All I need is the editor to do it with. So any suggestions? From bz-gmort at beezifies.com Sun Aug 26 13:37:24 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Sun, 26 Aug 2007 13:37:24 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <46D1B9AB.4000307@beezifies.com> References: <46D1B9AB.4000307@beezifies.com> Message-ID: <46D1BA54.9040507@beezifies.com> Oh, as a follow up, approximately 1 year ago I did try the Komodo editor, since it was available for Windows and Linux. I felt that if it did what I needed in windows, I could then migrate to Linux. At the time it did not have code folding built in. I'll review it again and see if that has changed. From chsnyder at gmail.com Sun Aug 26 13:54:38 2007 From: chsnyder at gmail.com (csnyder) Date: Sun, 26 Aug 2007 13:54:38 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <46D1B9AB.4000307@beezifies.com> References: <46D1B9AB.4000307@beezifies.com> Message-ID: On 8/26/07, bz-gmort at beezifies.com wrote: > Since there are a lot of people here who probably code in PHP(ha) and > use Linux, I thought I'd ask here if anyone is familiar with GUI > programmer editors in Linux. Zend-IDE rarely lets me down. When it does I blame Java. ;-) If you're looking for something free, the PHP IDE for Eclipse project is roughly equivalent, plus you get all of the other Eclipse goodness in the bargain. We had a presentation on it at the February NYPHP meeting, but the slides never made it online... -- Chris Snyder http://chxo.com/ From bz-gmort at beezifies.com Sun Aug 26 14:16:53 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Sun, 26 Aug 2007 14:16:53 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: References: <46D1B9AB.4000307@beezifies.com> Message-ID: <46D1C395.9050107@beezifies.com> csnyder wrote: > If you're looking for something free, the PHP IDE for Eclipse project > is roughly equivalent, plus you get all of the other Eclipse goodness > in the bargain. We had a presentation on it at the February NYPHP > meeting, but the slides never made it online... > Mainly I am looking for something I can test drive first. Ultraedit cost 50$ and Komodo would cost me $100 to upgrade to the latest version. So I guess I'd use that as my budget, I want a decent editor for PHP and HTML with code folding and FTP/SFTP access for under 100$(there ARE other features I like, but if it has those two it will have enough of the other features to make it worthwhile) My general feeling is that a good independent dev environment is worth between 200 and 300 to me. Of course, siuce I already have one that I like, now my feeling is that for me going over 100 would not be worth the jump. From ramons at gmx.net Sun Aug 26 15:16:04 2007 From: ramons at gmx.net (David Krings) Date: Sun, 26 Aug 2007 15:16:04 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <46D1C395.9050107@beezifies.com> References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> Message-ID: <46D1D174.9040504@gmx.net> bz-gmort at beezifies.com wrote: > csnyder wrote: >> If you're looking for something free, the PHP IDE for Eclipse project >> is roughly equivalent, plus you get all of the other Eclipse goodness >> in the bargain. We had a presentation on it at the February NYPHP >> meeting, but the slides never made it online... I can never figure out any of the Eclipse based IDEs and the ZEND stuff is designed as if the developers never saw a desktop app before. I use NuSphere's PHPEd, which is available for both Windope and Linux. They offer trial versions and the Standard edition was around 50 bucks when I bought it during one of their sales. I don't know if it does the FTP and SSH stuff as I never use that, but you can easily find out by looking at their website. The best thing about PHPEd is the debugger implementation. Reminds me that I need to finish the rundown of my tests that I promised months ago....ooops. David From preinheimer at gmail.com Sun Aug 26 15:10:43 2007 From: preinheimer at gmail.com (Paul Reinheimer) Date: Sun, 26 Aug 2007 15:10:43 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> Message-ID: <6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com> p.s. I am a registered owner of UltraEdit, Komodo, and Zend Studio, and have developed in all three of them full time for at least 8 months each. paul -- Paul Reinheimer Zend Certified Engineer -------------- next part -------------- An HTML attachment was scrubbed... URL: From preinheimer at gmail.com Sun Aug 26 15:05:56 2007 From: preinheimer at gmail.com (Paul Reinheimer) Date: Sun, 26 Aug 2007 15:05:56 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <46D1C395.9050107@beezifies.com> References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> Message-ID: <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> Call me biased (php|arch is a training partner for AS) but I'm a big fan of Komodo, recent versions do have code folding, built in SFTP/SCP/FTP support, along with the usual suspects like CVS & Subversion, and such. The editor itself is good, being able to match it up with XDebug on my server is great, the little tools like HTTP Inspector and the Rx Toolkit are the icing on the cake. And no JVM :) IIRC ActiveState is sponsoring the php|works conference in Atlanta in a few weeks, so if you're attending there may be some sort of attendee discount on the program (there was last year). There's a coupon code for the conference in our podcast (podcast.phparch.com) ? paul -- Paul Reinheimer Zend Certified Engineer -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Sun Aug 26 15:50:18 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Sun, 26 Aug 2007 15:50:18 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <46D1B9AB.4000307@beezifies.com> References: <46D1B9AB.4000307@beezifies.com> Message-ID: http://www.php-editors.com/review/ My own personal experience has gone from Modelworks SitePad on Windows -> Bluefish on Linux -> TextMate on OS X. I actually liked Bluefish, but have not kept up on what the latest 1.0 delivered. - Jon On Aug 26, 2007, at 1:34 PM, bz-gmort at beezifies.com wrote: > Since there are a lot of people here who probably code in PHP(ha) > and use Linux, I thought I'd ask here if anyone is familiar with > GUI programmer editors in Linux. > > > Yes, yes, I can and do use VI when on linux. But my work habits > have formed over the years based on using the best tool for my > mindset on the platform I had to use(Windows XP). > > So my editor of choice has been UltraEdit. > > The features of UltraEdit which I like(and they are probably > laughably small): > > FTP built into the editor: > I can open my files right off a remote server without any fiddle > faddling around. > > SSH built into the editor: > More importantly FTP over SSH so I can still open files right off a > remove server. > > Automatic code collapse: > Ultraedit has a tag library for PHP and HTML. > > When I'm editing a PHP file, it automatically find the start and > stop of tags and I can collapse them. So I can open a huge PHP > file, collapse all the functions into single lines, and than scan > through and find the function I'm interested in. > > While coding, once I have finished a section, I can collapse it and > see what came before it and goes after it. > > It is this last feature that I have had a hard time finding in > other editors. Heck, I downloaded the latest Dreamweaver for a > ProStores project(as it was the only way to get the who collection > of program scripts out of prostores without downloading 1 by 1) and > the best it had to offer was that I could create my own code foldings. > At the past PHP meeting, it finally sunk in to me that for years > I've been saying "I'd really love to develop in Linux, but I have > to run Lotus Notes for work and you can't get the full environment > to work reliably in Linux[ok, that's not quite TRUE. Those > individuals who were not second class citizens at work were welcome > to use the Linux test platform which had all such goodness built > into it. However, such a platform was not for the likes of a > second class contractor such as myself. The best I could get was a > notes client, but no development or admin client without which I > was dead in the water) > > Well, that time is past, and other than the periodic UG meeting I > will likely never set foot in that company again, and even if I do > I won't need to keep my personal system compatible with their work > environment. So, it's time to bite the bullet. Time to learn to > code in linux and break my bad Windows habits. > > All I need is the editor to do it with. > > So any suggestions? > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From preinheimer at gmail.com Sun Aug 26 15:05:56 2007 From: preinheimer at gmail.com (Paul Reinheimer) Date: Sun, 26 Aug 2007 15:05:56 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <46D1C395.9050107@beezifies.com> References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> Message-ID: <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> Call me biased (php|arch is a training partner for AS) but I'm a big fan of Komodo, recent versions do have code folding, built in SFTP/SCP/FTP support, along with the usual suspects like CVS & Subversion, and such. The editor itself is good, being able to match it up with XDebug on my server is great, the little tools like HTTP Inspector and the Rx Toolkit are the icing on the cake. And no JVM :) IIRC ActiveState is sponsoring the php|works conference in Atlanta in a few weeks, so if you're attending there may be some sort of attendee discount on the program (there was last year). There's a coupon code for the conference in our podcast (podcast.phparch.com) ? paul -- Paul Reinheimer Zend Certified Engineer -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Sun Aug 26 15:16:04 2007 From: ramons at gmx.net (David Krings) Date: Sun, 26 Aug 2007 15:16:04 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <46D1C395.9050107@beezifies.com> References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> Message-ID: <46D1D174.9040504@gmx.net> bz-gmort at beezifies.com wrote: > csnyder wrote: >> If you're looking for something free, the PHP IDE for Eclipse project >> is roughly equivalent, plus you get all of the other Eclipse goodness >> in the bargain. We had a presentation on it at the February NYPHP >> meeting, but the slides never made it online... I can never figure out any of the Eclipse based IDEs and the ZEND stuff is designed as if the developers never saw a desktop app before. I use NuSphere's PHPEd, which is available for both Windope and Linux. They offer trial versions and the Standard edition was around 50 bucks when I bought it during one of their sales. I don't know if it does the FTP and SSH stuff as I never use that, but you can easily find out by looking at their website. The best thing about PHPEd is the debugger implementation. Reminds me that I need to finish the rundown of my tests that I promised months ago....ooops. David From selyah1 at yahoo.com Sun Aug 26 18:15:06 2007 From: selyah1 at yahoo.com (selyah) Date: Sun, 26 Aug 2007 15:15:06 -0700 (PDT) Subject: [nycphp-talk] image display In-Reply-To: <46D1D174.9040504@gmx.net> Message-ID: <433325.14415.qm@web30813.mail.mud.yahoo.com> could someone please look at this code and please tell me what is wrong. it is suppose to display a 4 column table with an indiffenate number of rows. Instead it displays one image in row , then 3 images in row 2. Then one image in row 3 and e images in row 4, and so on. thanks. Here is the code: require_once('connect/mysql_connect.php'); $query="SELECT item_id, modelnum, name, upload, size, description, price, gender FROM clothing ORDER BY item_id ASC"; $result=@mysql_query($query); $num=@mysql_num_rows($result); $col = 0; echo '
'; if($num>0) { while($row=mysql_fetch_array($result)) { if($col == 0) echo ''; echo ''; if($col == 0) echo ''; $col++; $col = ($col == 4) ? 0 : $col; } } echo '
cAclOm'.$row['modelnum'].' '.$row['name'].'


'.$row['description'].''.$row['price'].'
'; -------------- next part -------------- An HTML attachment was scrubbed... URL: From urb at e-government.com Sun Aug 26 19:48:30 2007 From: urb at e-government.com (Urb LeJeune) Date: Sun, 26 Aug 2007 19:48:30 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com > References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> <6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com> Message-ID: <7.0.1.0.2.20070826194806.03178de0@e-government.com> >p.s. I am a registered owner of UltraEdit, Komodo, and Zend Studio, >and have developed in all three >of them full time for at least 8 months each. What was your order of preference? Urb Dr. Urban A. LeJeune, President E-Government.com 800-204-9545 From michael.southwell at nyphp.com Sun Aug 26 20:15:27 2007 From: michael.southwell at nyphp.com (Michael Southwell) Date: Sun, 26 Aug 2007 20:15:27 -0400 Subject: [nycphp-talk] image display In-Reply-To: <433325.14415.qm@web30813.mail.mud.yahoo.com> References: <46D1D174.9040504@gmx.net> <433325.14415.qm@web30813.mail.mud.yahoo.com> Message-ID: <6.2.3.4.2.20070826200837.02819018@pop.nyphp.com> At 06:15 PM 8/26/2007, you wrote: >could someone please look at this code and please tell me what is wrong. >it is suppose to display a 4 column table with an indiffenate number of rows. >Instead it displays one image in row , then 3 images in row 2. Then >one image in row 3 and e images in row 4, and so on. thanks. If I understand correctly what you are trying to do, the simple way to do this is to end a row and start a new row in your table every time you have finished displaying four rows from the database, like this, using your $num variable: // loop through result // display stuff if ( $num % 4 == 0 ) echo ''; }
>Here is the code: > >require_once('connect/mysql_connect.php'); > >$query="SELECT item_id, modelnum, name, upload, size, description, >price, gender FROM clothing ORDER BY item_id ASC"; > $result=@mysql_query($query); > $num=@mysql_num_rows($result); >$col = 0; >echo 'align="center">'; > >if($num>0) { >while($row=mysql_fetch_array($result)) { >if($col == 0) >echo ''; > > >echo ''; > >if($col == 0) > >echo ''; > >$col++; >$col = ($col == 4) ? 0 : $col; >} >} >echo '
color="teal">cAclOm'.$row['modelnum'].' >'.$row['name'].'

>height="140" />
>'.$row['description'].''.$row['price'].' >
'; >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >NYPHPCon 2006 Presentations Online >http://www.nyphpcon.com > >Show Your Participation in New York PHP >http://www.nyphp.org/show_participation.php Michael Southwell, Vice President for Education New York PHP http://www.nyphp.com/training - In-depth PHP Training Courses From michael.southwell at nyphp.com Sun Aug 26 20:19:29 2007 From: michael.southwell at nyphp.com (Michael Southwell) Date: Sun, 26 Aug 2007 20:19:29 -0400 Subject: Fwd: Re: [nycphp-talk] image display Message-ID: <6.2.3.4.2.20070826201647.028152c8@pop.nyphp.com> oops, forgot to set $num correctly: >If I understand correctly what you are trying to do, the simple way >to do this is to end a row and start a new row in your table every >time you have finished displaying four rows from the database, like >this, using your $num variable: > > $num = 0; >// loop through result >// display stuff $num ++; >if ( $num % 4 == 0 ) echo ''; >} > >
> >>Here is the code: >> >>require_once('connect/mysql_connect.php'); >> >>$query="SELECT item_id, modelnum, name, upload, size, description, >>price, gender FROM clothing ORDER BY item_id ASC"; >> $result=@mysql_query($query); >> $num=@mysql_num_rows($result); >>$col = 0; >>echo '>align="center">'; >> >>if($num>0) { >>while($row=mysql_fetch_array($result)) { >>if($col == 0) >>echo ''; >> >> >>echo ''; >> >>if($col == 0) >> >>echo ''; >> >>$col++; >>$col = ($col == 4) ? 0 : $col; >>} >>} >>echo '
>color="teal">cAclOm'.$row['modelnum'].' >>'.$row['name'].'

>>>height="140" />
>>'.$row['description'].''.$row['price'].' >>
'; >>_______________________________________________ >>New York PHP Community Talk Mailing List >>http://lists.nyphp.org/mailman/listinfo/talk >> >>NYPHPCon 2006 Presentations Online >>http://www.nyphpcon.com >> >>Show Your Participation in New York PHP >>http://www.nyphp.org/show_participation.php > >Michael Southwell, Vice President for Education >New York PHP >http://www.nyphp.com/training - In-depth PHP Training Courses > > >_______________________________________________ >New York PHP Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >NYPHPCon 2006 Presentations Online >http://www.nyphpcon.com > >Show Your Participation in New York PHP >http://www.nyphp.org/show_participation.php Michael Southwell, Vice President for Education New York PHP http://www.nyphp.com/training - In-depth PHP Training Courses From preinheimer at gmail.com Sun Aug 26 20:22:04 2007 From: preinheimer at gmail.com (Paul Reinheimer) Date: Sun, 26 Aug 2007 20:22:04 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <7.0.1.0.2.20070826194806.03178de0@e-government.com> References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> <6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com> <7.0.1.0.2.20070826194806.03178de0@e-government.com> Message-ID: <6ec19ec70708261722u6f0b2fbeuc969393932c81f4f@mail.gmail.com> > What was your order of preference? I actually see them as hitting slightly different markets in my mind. UltraEdit - A great editor, syntax highlighting, code folding, great SFTP support (I'll still put UltraEdit's SFTP support up against ZDE & Komodo any day). Worked great with a lot of files, always fast, responsive. A couple nice smaller features like the function list for easy navigation. Great Product for part time developers, students, hobbiests working with a variety of languages, or simply maintaining a few small projects. Even after I converted to ZDE, I still used UltraEdit for maintaining the websites I host for friends and family since the SFTP support was so much stronger, a task that has fallen onto Coda since my conversion to MacOS X. Zend Development Environment - Good development environment. You pay for the JVM, converting from a program as responsive as UltraEdit this is something you really feel. But once the app is up and your files are loaded you get very aggressive code completion, it's there all the time (still beats Komodo) with hints and tips trying to help you get your code out. Support for PHPDoc encourages developers to code well, since it not only provides code completion, but parses it for improved tool-tips when calling that function in the future. Some really slick features like code-completion on PHP5 Soap objects (this blew my mind the first time I saw it). CVS & SVN support is a bit weak, you're forced to choose one over the other on an application wide setting (rather than project). Great product for developers who just do PHP, built in debugger(/php install) is a bit limited but works out of the box without any tweaking. I still use ZDE when working with code my students present for things like Indent Code and the Code Analyzer which finds tonnes of bugs in their code (and often mine). Komodo - Good development environment. Not a Java app (no JVM!), but a... different approach. The application was written in XUL, ontop of the firefox codebase. Which likely has a bunch of limitations and problems for the development team, but what it means for you as a developer is that you can extend & tweak the entire IDE to make it suit your needs with JavaScript & python. Add custom actions to the toolbar, right click context menu, whatever you need. You have access to all of Komodo's features via do commands, or you can code your own from scratch. These can be added on an either application or project level. Komodo uses XDebug to handle debugging, which (since it's a free product) can be installed for free on any of your servers, the Komodo application uses a custom php.ini to add the apropriate extension to your local php install for a (hopefully) painless local run. Code completion and syntax highlighting isn't limited to PHP, Komodo supports most dynamic languages, it also understands that a .php document isn't just PHP, it's a multi language buffer and you get full support for HTML, JS & PHP in that document (as well as full DOM support). Great Product for programmers who are able to deal with code completion that's not quite as good as Zend Studio, but enjoy the ability to extend their environment, or the power tools like RxToolkit or the HTTP Inspector (not just another packet sniffer). So, apart from the fact that I use all three, and have all three installed (paralells & bootcamp) Komodo is my top choice, then ZDE, then UE (but UE doesn't really have a prayer, I'm in the wrong OS). paul -- Paul Reinheimer Zend Certified Engineer -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Sun Aug 26 20:33:37 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Sun, 26 Aug 2007 20:33:37 -0400 Subject: [nycphp-talk] image display In-Reply-To: <433325.14415.qm@web30813.mail.mud.yahoo.com> References: <433325.14415.qm@web30813.mail.mud.yahoo.com> Message-ID: <46D21BE1.3090405@beezifies.com> selyah wrote: > could someone please look at this code and please tell me what is wrong. > it is suppose to display a 4 column table with an indiffenate number > of rows. > Instead it displays one image in row , then 3 images in row 2. Then > one image in row 3 and e images in row 4, and so on. thanks. Your end table code is in the wrong place. Here is what your code is doing: $col is set to 0 Your loop begins Checks $col to see if it is 0, it is so it starts a row Image 1 Checks $col to see if it is 0, it is so it ends the row increments $col to 1 Checks $col to see if it is 4, it isn't so it does nothing. Image 2 Checks $col to see if it is 0, it is not increments $col to 2 Checks $col to see if it is 4, it isn't so it does nothing. Image 3 Checks $col to see if it is 0, it is not increments $col to 3 Checks $col to see if it is 4, it isn't so it does nothing. Image 4 Checks $col to see if it is 0, it is not increments $col to 4 Checks $col to see if it is 4, it is so it sets $col to 0 Checks $col to see if it is 0, it is so it starts a row Image 5 Checks $col to see if it is 0, it is so it ends the row .... Your output is probably really strange, as follows: Frankly, it's a matter of luck on how those non row cells get displayed. Move if($col == 0)... to the end of the loop, after $col = ($col == 4) ? 0 : $col; and you should be all good. From ioplex at gmail.com Sun Aug 26 20:45:27 2007 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 26 Aug 2007 20:45:27 -0400 Subject: [nycphp-talk] Accessing First Element of Array Message-ID: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> Hi, How do you access the first element of an array? I'm looking for something like array_shift but without modifying the array. Mike From ken at secdat.com Sun Aug 26 20:51:06 2007 From: ken at secdat.com (Ken Downs) Date: Sun, 26 Aug 2007 20:51:06 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> Message-ID: look at "each", it is a (mostly deprecate) form of array iteration.  The sample code in the PHP manual will show exactly what you are looking for."Michael B Allen" <ioplex at gmail.com> wrote: > Hi, > > How do you access the first element of an array? I'm looking for > something like array_shift but without modifying the array. > > Mike > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > _________________________________________________________ This mail sent using V-webmail - http://www.v-webmail.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Sun Aug 26 20:54:13 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Sun, 26 Aug 2007 20:54:13 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> Message-ID: <000AA0D6-8160-40F7-BDC2-E9D7DB6840E7@jonbaer.com> Is it anything that $array[0] would not be able to get access to? - Jon On Aug 26, 2007, at 8:45 PM, Michael B Allen wrote: > Hi, > > How do you access the first element of an array? I'm looking for > something like array_shift but without modifying the array. > > Mike > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ioplex at gmail.com Sun Aug 26 21:04:48 2007 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 26 Aug 2007 21:04:48 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> Message-ID: <78c6bd860708261804hc05221bi35c34d8631417ca5@mail.gmail.com> On 8/26/07, Ken Downs wrote: > look at "each", it is a (mostly deprecate) form of array iteration. The > sample code in the PHP manual will show exactly what you are looking for. But again that modifies the array (it advances the cursor). I guess I can write something myself: function array_first($array) { foreach ($array as $element) return element; } > > > "Michael B Allen" wrote: > > > Hi, > > > > How do you access the first element of an array? I'm looking for > > something like array_shift but without modifying the array. > > From pmjones88 at gmail.com Sun Aug 26 21:06:47 2007 From: pmjones88 at gmail.com (Paul M Jones) Date: Sun, 26 Aug 2007 20:06:47 -0500 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: <000AA0D6-8160-40F7-BDC2-E9D7DB6840E7@jonbaer.com> References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <000AA0D6-8160-40F7-BDC2-E9D7DB6840E7@jonbaer.com> Message-ID: On Aug 26, 2007, at 7:54 PM, Jon Baer wrote: > Is it anything that $array[0] would not be able to get access to? The function `current($array)` should do the trick. Make sure you do so before trying to loop through the array or anything. ;-) -- Paul M. Jones Solar: Simple Object Library and Application Repository for PHP5. Join the Solar community wiki! Savant: The simple, elegant, and powerful solution for templates in PHP. From ioplex at gmail.com Sun Aug 26 21:08:47 2007 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 26 Aug 2007 21:08:47 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: <000AA0D6-8160-40F7-BDC2-E9D7DB6840E7@jonbaer.com> References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <000AA0D6-8160-40F7-BDC2-E9D7DB6840E7@jonbaer.com> Message-ID: <78c6bd860708261808s7d4a95e9p6f4d90e7efed72ce@mail.gmail.com> On 8/26/07, Jon Baer wrote: > Is it anything that $array[0] would not be able to get access to? Hi Jon, Nope. The 0 element is not necessarily first. Consider the following example: $array = array(); $array['first'] = 'foo'; $array[] = 'bar'; $ ./t.php Array ( [first] => foo [0] => bar ) In this case the element 'foo' is first. Mike From dell at sala.ca Sun Aug 26 21:25:27 2007 From: dell at sala.ca (Dell Sala) Date: Sun, 26 Aug 2007 21:25:27 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: <78c6bd860708261808s7d4a95e9p6f4d90e7efed72ce@mail.gmail.com> References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <000AA0D6-8160-40F7-BDC2-E9D7DB6840E7@jonbaer.com> <78c6bd860708261808s7d4a95e9p6f4d90e7efed72ce@mail.gmail.com> Message-ID: On Aug 26, 2007, at 9:08 PM, Michael B Allen wrote: > On 8/26/07, Jon Baer wrote: >> Is it anything that $array[0] would not be able to get access to? > > Nope. The 0 element is not necessarily first. Consider the > following example: > > $array = array(); > $array['first'] = 'foo'; > $array[] = 'bar'; How about this: $values = array_values($array); $first = $values[0]; -- Dell From ioplex at gmail.com Sun Aug 26 21:42:18 2007 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 26 Aug 2007 21:42:18 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <000AA0D6-8160-40F7-BDC2-E9D7DB6840E7@jonbaer.com> <78c6bd860708261808s7d4a95e9p6f4d90e7efed72ce@mail.gmail.com> Message-ID: <78c6bd860708261842i96571eftcc58ccce71e939b1@mail.gmail.com> On 8/26/07, Dell Sala wrote: > On Aug 26, 2007, at 9:08 PM, Michael B Allen wrote: > > > On 8/26/07, Jon Baer wrote: > >> Is it anything that $array[0] would not be able to get access to? > > > > Nope. The 0 element is not necessarily first. Consider the > > following example: > > > > $array = array(); > > $array['first'] = 'foo'; > > $array[] = 'bar'; > > > How about this: > > $values = array_values($array); > $first = $values[0]; Yes, that would work. But building a new array is potentially very expensive. So far the following is the best I can think of: function _array_first($a, $want_key=FALSE) { foreach ($a as $key => $elem) return $want_key ? $key : $elem; return FALSE; } Mike From lists at enobrev.com Sun Aug 26 21:42:36 2007 From: lists at enobrev.com (Mark Armendariz) Date: Sun, 26 Aug 2007 21:42:36 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <000AA0D6-8160-40F7-BDC2-E9D7DB6840E7@jonbaer.com> Message-ID: <46D22C0C.3080002@enobrev.com> Paul M Jones wrote: > On Aug 26, 2007, at 7:54 PM, Jon Baer wrote: > >> Is it anything that $array[0] would not be able to get access to? > > The function `current($array)` should do the trick. Make sure you do > so before trying to loop through the array or anything. ;-) Or just reset before using it. |reset($array); echo current($array) |http://php.net/reset -------------- next part -------------- An HTML attachment was scrubbed... URL: From selyah1 at yahoo.com Sun Aug 26 21:44:03 2007 From: selyah1 at yahoo.com (selyah) Date: Sun, 26 Aug 2007 18:44:03 -0700 (PDT) Subject: [nycphp-talk] image display In-Reply-To: <46D21BE1.3090405@beezifies.com> Message-ID: <972736.84432.qm@web30805.mail.mud.yahoo.com> yjanks, but that did not work, it created a 1 column table Gary Mort wrote: selyah wrote: > could someone please look at this code and please tell me what is wrong. > it is suppose to display a 4 column table with an indiffenate number > of rows. > Instead it displays one image in row , then 3 images in row 2. Then > one image in row 3 and e images in row 4, and so on. thanks. Your end table code is in the wrong place. Here is what your code is doing: $col is set to 0 Your loop begins Checks $col to see if it is 0, it is so it starts a row Image 1 Checks $col to see if it is 0, it is so it ends the row increments $col to 1 Checks $col to see if it is 4, it isn't so it does nothing. Image 2 Checks $col to see if it is 0, it is not increments $col to 2 Checks $col to see if it is 4, it isn't so it does nothing. Image 3 Checks $col to see if it is 0, it is not increments $col to 3 Checks $col to see if it is 4, it isn't so it does nothing. Image 4 Checks $col to see if it is 0, it is not increments $col to 4 Checks $col to see if it is 4, it is so it sets $col to 0 Checks $col to see if it is 0, it is so it starts a row Image 5 Checks $col to see if it is 0, it is so it ends the row .... Your output is probably really strange, as follows: image1 image2image3image4 image5 image6image7image8 Frankly, it's a matter of luck on how those non row cells get displayed. Move if($col == 0)... to the end of the loop, after $col = ($col == 4) ? 0 : $col; and you should be all good. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken at secdat.com Sun Aug 26 21:45:03 2007 From: ken at secdat.com (Ken Downs) Date: Sun, 26 Aug 2007 21:45:03 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: <78c6bd860708261804hc05221bi35c34d8631417ca5@mail.gmail.com> References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <78c6bd860708261804hc05221bi35c34d8631417ca5@mail.gmail.com> Message-ID: "Michael B Allen" <ioplex at gmail.com> wrote: > On 8/26/07, Ken Downs <ken at secdat.com> wrote: > > look at "each", it is a (mostly deprecate) form of array iteration. The > > sample code in the PHP manual will show exactly what you are looking for. > > But again that modifies the array (it advances the cursor).Not really.  It does not modify the keys or the values.  The cursor is a variable used to determine which key and value is returned on the next call to each().If you absolutely must have the state exactly the same before and after, then add a call to reset() to your code, it is mentioned in that page in the manual. > > I guess I can write something myself: > > function array_first($array) { > foreach ($array as $element) > return element; > } > > > > > > > "Michael B Allen" <ioplex at gmail.com> wrote: > > > > > Hi, > > > > > > How do you access the first element of an array? I'm looking for > > > something like array_shift but without modifying the array. > > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > _________________________________________________________ This mail sent using V-webmail - http://www.v-webmail.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From speel3k at gmail.com Sun Aug 26 21:50:56 2007 From: speel3k at gmail.com (Anthony) Date: Sun, 26 Aug 2007 21:50:56 -0400 Subject: [nycphp-talk] how did you learn php? Message-ID: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> Hey, i'm kinda new around here and just tinkering around with php. My question to you guys is how did you learn? by reading or by taking apart scripts and adding your own style or what? I'm very curious. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.com Sun Aug 26 21:52:50 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Sun, 26 Aug 2007 21:52:50 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: <78c6bd860708261808s7d4a95e9p6f4d90e7efed72ce@mail.gmail.com> References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <000AA0D6-8160-40F7-BDC2-E9D7DB6840E7@jonbaer.com> <78c6bd860708261808s7d4a95e9p6f4d90e7efed72ce@mail.gmail.com> Message-ID: <28A4D0B7-4D59-4613-825E-FEF1681E5955@jonbaer.com> Hmmm I dunno, if that was more towards "what was the way to access the first element of a hash?" I would say ok, but Im still convinced most would see an "array" as an object numerically indexed. But current() it is :-) Time to rewrite all those PHP books ... On a side note to why the example does not work as expected - (I think it came up on the list way back): The docs do not specify this, but adding to the array using the brackets syntax: $my_array[] = $new_value; will not advance the internal pointer of the array. therefore, you cannot use current() to get the last value added or key() to get the key of the most recently added element. - Jon On Aug 26, 2007, at 9:08 PM, Michael B Allen wrote: > On 8/26/07, Jon Baer wrote: >> Is it anything that $array[0] would not be able to get access to? > > Hi Jon, > > Nope. The 0 element is not necessarily first. Consider the > following example: > > $array = array(); > $array['first'] = 'foo'; > $array[] = 'bar'; > > $ ./t.php > Array > ( > [first] => foo > [0] => bar > ) > > In this case the element 'foo' is first. > > Mike > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Sun Aug 26 22:12:08 2007 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 26 Aug 2007 22:12:08 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <78c6bd860708261804hc05221bi35c34d8631417ca5@mail.gmail.com> Message-ID: <78c6bd860708261912m3088955bgb8f7d47870f04e54@mail.gmail.com> On 8/26/07, Ken Downs wrote: > "Michael B Allen" wrote: > > > On 8/26/07, Ken Downs wrote: > > > look at "each", it is a (mostly deprecate) form of array iteration. The > > > sample code in the PHP manual will show exactly what you are looking > for. > > > > But again that modifies the array (it advances the cursor). > > Not really. It does not modify the keys or the values. The cursor is a > variable used to determine which key and value is returned on the next call > to each(). > > If you absolutely must have the state exactly the same before and after, > then add a call to reset() to your code, it is mentioned in that page in the > manual. Again, reset changes the array. The cursor is part of the array's state such that calling it at an arbtrary location within your code could change the logic of the application. Mike From ken at secdat.com Sun Aug 26 22:24:52 2007 From: ken at secdat.com (Ken Downs) Date: Sun, 26 Aug 2007 22:24:52 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: <78c6bd860708261912m3088955bgb8f7d47870f04e54@mail.gmail.com> References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <78c6bd860708261804hc05221bi35c34d8631417ca5@mail.gmail.com> <78c6bd860708261912m3088955bgb8f7d47870f04e54@mail.gmail.com> Message-ID: "Michael B Allen" <ioplex at gmail.com> wrote: > On 8/26/07, Ken Downs <ken at secdat.com> wrote: > > "Michael B Allen" <ioplex at gmail.com> wrote: > > > > > On 8/26/07, Ken Downs <ken at secdat.com> wrote: > > > > look at "each", it is a (mostly deprecate) form of array iteration. The > > > > sample code in the PHP manual will show exactly what you are looking > > for. > > > > > > But again that modifies the array (it advances the cursor). > > > > Not really. It does not modify the keys or the values. The cursor is a > > variable used to determine which key and value is returned on the next call > > to each(). > > > > If you absolutely must have the state exactly the same before and after, > > then add a call to reset() to your code, it is mentioned in that page in the > > manual. >  > Again, reset changes the array. The cursor is part of the array's > state such that calling it at an arbtrary location within your code > could change the logic of the application.Um, you could, uh, write a function called array_first() that does the reset() and then calls each()?  Then maybe even calls reset() again?  Then you could, like, maybe, only use this function and not make arbitrary use of each() and reset() in your code?And btw, when you write that function, pass the array by reference, not by value.Best of luck, tell us how it works out. > > Mike > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > _________________________________________________________ This mail sent using V-webmail - http://www.v-webmail.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Sun Aug 26 22:32:26 2007 From: ramons at gmx.net (David Krings) Date: Sun, 26 Aug 2007 22:32:26 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> Message-ID: <46D237BA.6020403@gmx.net> Anthony wrote: > Hey, i'm kinda new around here and just tinkering around with php. My > question to you guys is how did you learn? by reading or by taking apart > scripts and adding your own style or what? I'm very curious. I set out to accomplish a project and then try things out. It helps if you know the basics of HTML as that is what you need to display things (assuming you use a web browser, which is the easiest way). It also helps if you know some of the really basic programming terms, such as variable, string, if...then (else if even what I consider a bit more advanced), loops, etc. I look through the command list on php.net and often find something that fits. My first project was collecting form data and writing it to a text file. Then I set out to create a self-replicating script to create pages to view pictures dynamically. Then I started looking at using MySQL. Then I created an MP3 archiving and playing app, then I tried creating a CRM system (which turned out to be to tought for me at the time). Now I'm working on an even better picture and video archiving and viewing app. Pick something that you have a use and interest in. Then figure out what this gizmo is supposed to do. Then figure out how to implement each feature. Write many comments into your script, that helps me to understand what I did and plan what I need to do. Of course, you can get a book from the library and read that. You can go to http://w3schools.com/php/default.asp and get a first primer. And then just keep on digging and searching the web and driving PHP experts crazy on mailing lists with all your questions. Oh, and bring some time and patience, it won't happen overnight and also not by next week, but I am sure that by next week you can do things you never ever thought you could do. That is the magic of PHP. Good luck! David From ioplex at gmail.com Sun Aug 26 22:37:18 2007 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 26 Aug 2007 22:37:18 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <78c6bd860708261804hc05221bi35c34d8631417ca5@mail.gmail.com> <78c6bd860708261912m3088955bgb8f7d47870f04e54@mail.gmail.com> Message-ID: <78c6bd860708261937n586c5d5ci52bb6d745f45c29a@mail.gmail.com> On 8/26/07, Ken Downs wrote: > "Michael B Allen" wrote: > > > On 8/26/07, Ken Downs wrote: > > > "Michael B Allen" wrote: > > > > > > > On 8/26/07, Ken Downs wrote: > > > > > look at "each", it is a (mostly deprecate) form of array iteration. > The > > > > > sample code in the PHP manual will show exactly what you are > looking > > > for. > > > > > > > > But again that modifies the array (it advances the cursor). > > > > > > Not really. It does not modify the keys or the values. The cursor is a > > > variable used to determine which key and value is returned on the next > call > > > to each(). > > > > > > If you absolutely must have the state exactly the same before and > after, > > > then add a call to reset() to your code, it is mentioned in that page > in the > > > manual. > > > > Again, reset changes the array. The cursor is part of the array's > > state such that calling it at an arbtrary location within your code > > could change the logic of the application. > > > Um, you could, uh, write a function called array_first() that does the > reset() and then calls each()? Then maybe even calls reset() again? Then > you could, like, maybe, only use this function and not make arbitrary use of > each() and reset() in your code? I guess you missed my earlier post. This is what I'm using right now: function _array_first($a, $want_key=FALSE) { foreach ($a as $key => $elem) return $want_key ? $key : $elem; return FALSE; } > And btw, when you write that function, pass the array by reference, not by > value. With the above function I don't think it is necessary to pass by reference because the array state is not modified and the array is not returned from the function so it should not copy (I'm not positive about this - I would be curious to know if someone had the definitive answer on this scenario). Mike From ken at secdat.com Mon Aug 27 07:45:50 2007 From: ken at secdat.com (Ken Downs) Date: Mon, 27 Aug 2007 07:45:50 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: <78c6bd860708261937n586c5d5ci52bb6d745f45c29a@mail.gmail.com> References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <78c6bd860708261804hc05221bi35c34d8631417ca5@mail.gmail.com> <78c6bd860708261912m3088955bgb8f7d47870f04e54@mail.gmail.com> <78c6bd860708261937n586c5d5ci52bb6d745f45c29a@mail.gmail.com> Message-ID: "Michael B Allen" <ioplex at gmail.com> wrote: > > > > > > Um, you could, uh, write a function called array_first() that does the > > reset() and then calls each()? Then maybe even calls reset() again? Then > > you could, like, maybe, only use this function and not make arbitrary use of > > each() and reset() in your code? > > I guess you missed my earlier post. This is what I'm using right now: > > function _array_first($a, $want_key=FALSE) { > foreach ($a as $key => $elem) > return $want_key ? $key : $elem; > return FALSE; > } > > > And btw, when you write that function, pass the array by reference, not by > > value.No, I caught your post, it's just that an experienced PHP programmer would never write the function you wrote to do what you're doing.  They'd use each().Hint: read the manual to find find out why I told you to pass by reference, read the manual to find out what foreach does internally.Have a nice day.--Ken DownsSecure Data Softwarewww.secdat.com631-689-7200631-379-0010 _________________________________________________________ This mail sent using V-webmail - http://www.v-webmail.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Mon Aug 27 09:58:57 2007 From: dcech at phpwerx.net (Dan Cech) Date: Mon, 27 Aug 2007 09:58:57 -0400 Subject: [nycphp-talk] phpGACL access control In-Reply-To: <20070824212500.M50719@pinestream.com> References: <20070824212500.M50719@pinestream.com> Message-ID: <46D2D8A1.5030800@phpwerx.net> Cliff Hirsch wrote: > Does anyone use phpGACL? Good, bad, ugly? Alternative? Other suggestions for > access control? This looks like an easy drop in, although the UI is wicked > confusing. Back in the day I actually rewrote most of the phpGACL database structure and reskinned the 'wicked confusing' interface. Unfortunately the project I was planning to use it for never eventuated. It has some definite strengths, not the least of which is that it is seriously fast at answering questions like 'can user X perform action Y on object Z?' due to the MPTT database structure, and the use of caching. I dug up my tests from 2005, and on my P4 2.8 laptop with 1GB ram and a 5400rpm hdd, the average query time was 0.05s. That is with no caching, on a random database with 1,000 ACLs, 1,000 ACOs, 100,000 AROs, 1,000 ARO groups, 100,000 AXOs and 1,000 AXO groups. If you want to do your own performance testing the system ships with an included benchmarking suite. It isn't as quick at answering questions like 'who can perform action Y on object Z?', 'which actions can user X perform on object Z?', or 'which objects can user X perform action Y on?'. However, I don't know of any quicker solution which supports the level of granularity it does. I do believe that cakephp at least borrows some of the concepts, though I'm not sure of that. Nate? At the time I stopped active contribution to the project, the 2 main things I wanted to add were: 1. The ability to support multiple 'root' ARO/AXO elements. Currently the system requires a single 'root' node in each of these trees. Usually this is just a placeholder without any real use, but it would be possible to add the ability to support multiple root nodes which would be a neat way to partition the system and should yield a speed increase. 2. Consolidation of the ARO and AXO system into a single tree. Currently if you want to have permissions like 'user X can edit user Y', you must have all your users and groups in both ARO and AXO trees. It would be much simpler to just have objects, groups and permissions. If anyone were interested in implementing these features, I would be more than happy to answer any questions. Who knows, maybe the bug will bite again and I'll implement them myself! Dan From anoland at indigente.net Mon Aug 27 10:32:59 2007 From: anoland at indigente.net (Adrian Noland) Date: Mon, 27 Aug 2007 10:32:59 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> Message-ID: <1d8a0e930708270732o71c58a26k47f3574d504a5df0@mail.gmail.com> On 8/26/07, Anthony wrote: > > Hey, i'm kinda new around here and just tinkering around with php. My > question to you guys is how did you learn? by reading or by taking apart > scripts and adding your own style or what? I'm very curious. The first place to start is the PHP manual. Definitely read the first 5 chapters all the way through. Here are a couple more sites that I have used extensively in the past. http://phpbuilder.com/columns/ http://melonfire.com/community/columns/trog/archives.php?category=PHP Remember, there are a lot of articles and code that were written for PHP4 that will look and act different for PHP5. Also running v.4 on a v.5 server could open you up to security vulnerabilities. Make sure you concentrate on recognizing the differences. http://www.php.net/manual/en/faq.migration5.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From mitch.pirtle at gmail.com Mon Aug 27 10:52:19 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 27 Aug 2007 10:52:19 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <6ec19ec70708261722u6f0b2fbeuc969393932c81f4f@mail.gmail.com> References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> <6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com> <7.0.1.0.2.20070826194806.03178de0@e-government.com> <6ec19ec70708261722u6f0b2fbeuc969393932c81f4f@mail.gmail.com> Message-ID: <330532b60708270752p318e3232h89f9891953472e78@mail.gmail.com> I followed pretty much the same path as John, but I also used Kate and the Kate-powered editors in the KDE environment. I really enjoyed working with bluefish. On the mac, I caved in to peer pressure and tried TextMate - however I'm finding that Smultron is free and feels a LOT like the quick-and-dirty editor I've always wanted; and if I need a lot of features (class browser, integrated remote svn, etc) then I grab a clean install of eclipse and then add the Aptana plugin. -- Mitch From mitch.pirtle at gmail.com Mon Aug 27 11:01:09 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 27 Aug 2007 11:01:09 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> Message-ID: <330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com> On 8/26/07, Anthony wrote: > Hey, i'm kinda new around here and just tinkering around with php. My > question to you guys is how did you learn? by reading or by taking apart > scripts and adding your own style or what? I'm very curious. I had a project that was failing bigtime, and had to fire the developer that I'd hired to do the work. He'd chosen to do the work in PHP, and since I have this masochistic tendency to spend all my time cleaning up other's messes, I taught myself. By the time I was done with that one project I was already pining for new features and such, as this was the early years (I think around 1997, 1998). Back then I was mostly writing apache modules in c, and a lot of PL/SQL... Your approach depends on your existing experience, and your personality and learning style. I learn by doing, and have been doing this longer than most of my coworkers have been out of diapers. Others may work differently, and want an example, or a book, or even a class. Just like all other languages, there are nuances of performance, security and such that can only be learned by doing. So rolling up your sleeves and diving in might be the fastest way to get you on the road, so to speak. -- Mitch From krook at us.ibm.com Mon Aug 27 11:01:23 2007 From: krook at us.ibm.com (Daniel Krook) Date: Mon, 27 Aug 2007 11:01:23 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> Message-ID: Hi Anthony, > Hey, i'm kinda new around here and just tinkering around > with php. My question to you guys is how did you learn? by > reading or by taking apart scripts and adding your own > style or what? I'm very curious. Welcome :) There's no substitute for hands on learning. Find a project that scratches an itch - a todo list application or CD inventory system for example - and try to build it yourself. When you run into issues hit Google, read the manual or source code of an existing, similar program. Personally, my watershed for 'getting' PHP was to take a 2 or 3 day class with one of the folks on this list about 5 years ago. This got me set up with a development environment (Zend Studio), a basic set of tools (phpMyAdmin, local copy of the PHP manual), and a list of resources to consult for questions or existing solutions (phpclasses.org). If you're specifically looking for things to read first, check out the list Carlos Hoyos and I put together last year. It's showing its age, but most of the concepts and resources are still relevant: Recommended PHP reading list http://www.ibm.com/developerworks/opensource/library/os-php-read/ Daniel Krook Content Tools Developer - SCSA, SCJP, SCWCD, ZCE, ICDAssoc. Global Solutions, ibm.com From matteo.rinaudo at gmail.com Mon Aug 27 11:07:23 2007 From: matteo.rinaudo at gmail.com (Matteo Rinaudo) Date: Mon, 27 Aug 2007 11:07:23 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <330532b60708270752p318e3232h89f9891953472e78@mail.gmail.com> References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> <6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com> <7.0.1.0.2.20070826194806.03178de0@e-government.com> <6ec19ec70708261722u6f0b2fbeuc969393932c81f4f@mail.gmail.com> <330532b60708270752p318e3232h89f9891953472e78@mail.gmail.com> Message-ID: Hi, I use emacs with PHP mode: http://sourceforge.net/projects/php-mode/ Matteo From cliff at pinestream.com Mon Aug 27 11:12:58 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 27 Aug 2007 11:12:58 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> <330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com> Message-ID: <20070827150731.M74063@pinestream.com> On Mon, 27 Aug 2007 11:01:09 -0400, Mitch Pirtle wrote > On 8/26/07, Anthony wrote: > > Hey, i'm kinda new around here and just tinkering around with php. My > > question to you guys is how did you learn? by reading or by taking apart > > scripts and adding your own style or what? I'm very curious. > > ... > So rolling up > your sleeves and diving in might be the fastest way to get you on the > road, so to speak. But...what are you trying to accomplish? Tinkering? Developing an application? When I started, regretfully, there really weren't any frameworks. Now I'm in way over my head and constantly debate the merits of switching to a framework versus hobbling along with my own "framework". For tinkering, sure, learn and play with php. This is a wicked cool tool: http://www.hping.org/phpinteractive/ Install it, play with it, experiment with code snippets in it. Instant feedback. But if you want to develop a full-bore application, please don't roll your own -- learn a framework while you are learning php. Clif From ben at projectskyline.com Mon Aug 27 11:23:14 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Mon, 27 Aug 2007 11:23:14 -0400 Subject: [nycphp-talk] how did you learn php? References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com><330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com> <20070827150731.M74063@pinestream.com> Message-ID: <010301c7e8be$30036e70$6401a8c0@gamebox> Hello All, > Now I'm in > way over my head and constantly debate the merits of switching to a > framework > versus hobbling along with my own "framework". Mself included. After all the discussion about frameworks, I've decided to stick to what I'm doing and continue to refine my toolbox/framework. It works well, and I still don't see how switching will save me development time. Anyways, I learned when my first coding job demanded I write code in PHP. Until then, I only had experiance in C & VB, both of which I learned by reading and doing. So, I would say, "lots of book reading and code writing got me started". I also did a few vaporware GPL apps to get started. People don't really care how much you have to learn still, when your coding for free, so long as you deliver working code on time. = ] - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons ----- Original Message ----- From: "Cliff Hirsch" To: "NYPHP Talk" Sent: Monday, August 27, 2007 11:12 AM Subject: Re: [nycphp-talk] how did you learn php? > On Mon, 27 Aug 2007 11:01:09 -0400, Mitch Pirtle wrote >> On 8/26/07, Anthony wrote: >> > Hey, i'm kinda new around here and just tinkering around with php. My >> > question to you guys is how did you learn? by reading or by taking >> > apart >> > scripts and adding your own style or what? I'm very curious. >> >> ... >> So rolling up >> your sleeves and diving in might be the fastest way to get you on the >> road, so to speak. > > But...what are you trying to accomplish? Tinkering? Developing an > application? > When I started, regretfully, there really weren't any frameworks. Now I'm > in > way over my head and constantly debate the merits of switching to a > framework > versus hobbling along with my own "framework". > > For tinkering, sure, learn and play with php. This is a wicked cool tool: > http://www.hping.org/phpinteractive/ > Install it, play with it, experiment with code snippets in it. Instant > feedback. > > But if you want to develop a full-bore application, please don't roll your > own > -- learn a framework while you are learning php. > > Clif > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ben at projectskyline.com Mon Aug 27 11:27:08 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Mon, 27 Aug 2007 11:27:08 -0400 Subject: [nycphp-talk] Linux editors References: <46D1B9AB.4000307@beezifies.com><46D1C395.9050107@beezifies.com><6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com><6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com><7.0.1.0.2.20070826194806.03178de0@e-government.com><6ec19ec70708261722u6f0b2fbeuc969393932c81f4f@mail.gmail.com><330532b60708270752p318e3232h89f9891953472e78@mail.gmail.com> Message-ID: <011301c7e8be$c15d5ca0$6401a8c0@gamebox> Hello, I used to use emacs w/php mode, but as I got to be working with more and more files, I needed an IDE and I moved to Komodo. I love it, never looked back! - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons ----- Original Message ----- From: "Matteo Rinaudo" To: "NYPHP Talk" Sent: Monday, August 27, 2007 11:07 AM Subject: Re: [nycphp-talk] Linux editors > Hi, > I use emacs with PHP mode: > > http://sourceforge.net/projects/php-mode/ > > > Matteo > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From smanes at magpie.com Mon Aug 27 11:34:26 2007 From: smanes at magpie.com (Steve Manes) Date: Mon, 27 Aug 2007 11:34:26 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> <330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com> Message-ID: <46D2EF02.3050702@magpie.com> Mitch Pirtle wrote: > Just like all other languages, there are nuances of performance, > security and such that can only be learned by doing. So rolling up > your sleeves and diving in might be the fastest way to get you on the > road, so to speak. That's the best way to learn: by throwing yourself into the deep end of the pool, hopefully on a project for yourself, not a client. I started programming with 6502 assembler. My initial deep-end project was reprogramming the fader ballistics for my recording studio's console, which was automated by an Apple II. I've learned six languages, not including SQL, programming the same tree-structured BBS in my spare time: 8088/86 assembler, AT&T "portable C", Tandem BASIC, C++, Perl and eventually PHP. One of these days I'll finish it. From bz-gmort at beezifies.com Mon Aug 27 11:49:27 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Mon, 27 Aug 2007 11:49:27 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> Message-ID: <46D2F287.2070701@beezifies.com> Anthony wrote: > Hey, i'm kinda new around here and just tinkering around with php. My > question to you guys is how did you learn? by reading or by taking > apart scripts and adding your own style or what? I'm very curious. I started by inheriting a project that need some major rewrites done to it, it was written in this funny little language called Net.Data. Net.Data was a web CGI language geared to allow you to connect to a DB2 database, process data, and format it for the web. And it allowed you to intermix your HTML and Net.Data code in the same file. After completing that, I was wondering how one would write the same thing in a non-IBM environment, so I got myself a Web Provider that supported everything at the time and looked into different ways of doing things. PHP was a natural transition from Net.Data and for the most part painless. The only real difference was PHP had a lot more power since it wasn't limited to being designed to interoperate with DB2 and than grudgingly extended to meet the needs of specific clients. A couple years after that, IBM end of lifed Net.Data. I mentioned that rewriting the app would be trivial in PHP, we went partially down that road and then gave up due to politics(the application was going to be replaced that year with the new application)......6 years later and their still running that application, on hardware that is failling, and with a backup that is completely useless(you can't get Net.Data to install on a new system anymore). From jonbaer at jonbaer.com Mon Aug 27 11:58:49 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Mon, 27 Aug 2007 11:58:49 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <010301c7e8be$30036e70$6401a8c0@gamebox> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com><330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com> <20070827150731.M74063@pinestream.com> <010301c7e8be$30036e70$6401a8c0@gamebox> Message-ID: <3D3114C7-ECE2-46CB-B2F6-1A3CC936F54A@jonbaer.com> Don't forget ... probably the one best thing to take advantage of is the vast enormous amount of video screencasts + other free elearning material. There was literally none of it (or it was ridiculously expensive) when I started and it has helped alot of people I know (and I think Rails benefited hugely from developer committed videos) ... http://www.bestechvideos.com/tag/php/page/2 - Jon On Aug 27, 2007, at 11:23 AM, Ben Sgro ((ProjectSkyLine)) wrote: > Hello All, > >> Now I'm in >> way over my head and constantly debate the merits of switching to >> a framework >> versus hobbling along with my own "framework". -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Mon Aug 27 12:39:41 2007 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 27 Aug 2007 12:39:41 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> Message-ID: <20070827163941.GB19591@panix.com> Hi Anthony: I learn by doing. When I run into issues, I consult the PHP manual, online tutorials, existing scripts that do similar things, deja news (now groups.google.com) archives of the php.general mailing list, the php.general mailing list -- generally in that order. --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 ioplex at gmail.com Mon Aug 27 12:54:47 2007 From: ioplex at gmail.com (Michael B Allen) Date: Mon, 27 Aug 2007 12:54:47 -0400 Subject: [nycphp-talk] Accessing First Element of Array In-Reply-To: References: <78c6bd860708261745q6e6ca48bp6af4e496957a45f8@mail.gmail.com> <78c6bd860708261804hc05221bi35c34d8631417ca5@mail.gmail.com> <78c6bd860708261912m3088955bgb8f7d47870f04e54@mail.gmail.com> <78c6bd860708261937n586c5d5ci52bb6d745f45c29a@mail.gmail.com> Message-ID: <78c6bd860708270954u7758a989s63fbacd7919a61e9@mail.gmail.com> On 8/27/07, Ken Downs wrote: > "Michael B Allen" wrote: > > > > > > > > > > Um, you could, uh, write a function called array_first() that does the > > > reset() and then calls each()? Then maybe even calls reset() again? > Then > > > you could, like, maybe, only use this function and not make arbitrary > use of > > > each() and reset() in your code? > > > > I guess you missed my earlier post. This is what I'm using right now: > > > > function _array_first($a, $want_key=FALSE) { > > foreach ($a as $key => $elem) > > return $want_key ? $key : $elem; > > return FALSE; > > } > > > > > And btw, when you write that function, pass the array by reference, not > by > > > value. > > No, I caught your post, it's just that an experienced PHP programmer would > never write the function you wrote to do what you're doing. They'd use > each(). > > Hint: read the manual to find find out why I told you to pass by reference, > read the manual to find out what foreach does internally. Hi Ken, I appreciate your help but I don't have a lot of time for games. After reading the manual for each() I see nothing to indicate that using each() w/ reset() would be superior to the foreach() method I've been using. The each() function already accepts references and AFAIK runtime pass-by-reference is being deprecated anyway. Also, even if there is something that would preserve the state of the array cursor, that would suggest that a copy of the array would be made which could be potentially very slow. I'd very willing to accept direction as I spend a lot more time writing C than I do PHP but I have to admit sometimes I have trouble reading between the lines. If you still care to help please spell it out for me why each() w/ reset() is superior to the foreach() method I've been using. Thanks, Mike From bz-gmort at beezifies.com Mon Aug 27 14:13:37 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Mon, 27 Aug 2007 14:13:37 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <011301c7e8be$c15d5ca0$6401a8c0@gamebox> References: <46D1B9AB.4000307@beezifies.com><46D1C395.9050107@beezifies.com><6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com><6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com><7.0.1.0.2.20070826194806.03178de0@e-government.com><6ec19ec70708261722u6f0b2fbeuc969393932c81f4f@mail.gmail.com><330532b60708270752p318e3232h89f9891953472e78@mail.gmail.com> <011301c7e8be$c15d5ca0$6401a8c0@gamebox> Message-ID: <46D31451.6020102@beezifies.com> Hmm... I looked into pricing. To upgrade from my previous copy of Komodo Personal to Komodo 4.1 costs 195. A full license is 295. So it's in the range of what I would expect for a decent IDE environment. I'll give their trial a try and see if it meets my needs or not. If it can get me off of windows it will be well worth it(as than my requirements for a dev machine drop substantially) Ben Sgro (ProjectSkyLine) wrote: > Hello, > > I used to use emacs w/php mode, but as I got to be working with more > and more files, > I needed an IDE and I moved to Komodo. > > I love it, never looked back! > From cliff at pinestream.com Mon Aug 27 14:49:13 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 27 Aug 2007 14:49:13 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <46D2EF02.3050702@magpie.com> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> <330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com> <46D2EF02.3050702@magpie.com> Message-ID: <20070827184405.M5872@pinestream.com> On Mon, 27 Aug 2007 11:34:26 -0400, Steve Manes wrote > I started programming with 6502 assembler Wow, the 6502 -- you just revealed your age! That was a great processor. If we're going to tell stories... My first computer manual was the original binder for the Altair 8800 -- still have it and the first few issues of Byte :) Bought the manual, but could never afford the parts. When I was a kid, I would ride my bike to Schweber Electronics in Jericho. I would go up to the will call window and say, I'd like an AMD 2900 data book please." Since then, I've had therapy. Cliff From jmcgraw1 at gmail.com Mon Aug 27 15:12:36 2007 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Mon, 27 Aug 2007 15:12:36 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <20070827184405.M5872@pinestream.com> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> <330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com> <46D2EF02.3050702@magpie.com> <20070827184405.M5872@pinestream.com> Message-ID: My first experience programming in PHP was writing my own online guest book. Gets to you used to interfacing with a database (or flat file) and working with user input. After getting a taste of the syntax, take a gander at Object Oriented Programming in PHP and the many security issues that crop up when handling user input. Keep the php.net function list handy and you should be on your way. - jake On 8/27/07, Cliff Hirsch wrote: > > On Mon, 27 Aug 2007 11:34:26 -0400, Steve Manes wrote > > I started programming with 6502 assembler > > Wow, the 6502 -- you just revealed your age! That was a great processor. > If > we're going to tell stories... > > My first computer manual was the original binder for the Altair 8800 -- > still > have it and the first few issues of Byte :) Bought the manual, but could > never > afford the parts. When I was a kid, I would ride my bike to Schweber > Electronics in Jericho. I would go up to the will call window and say, I'd > like an AMD 2900 data book please." Since then, I've had therapy. > > Cliff > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulcheung at tiscali.co.uk Mon Aug 27 16:17:51 2007 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Mon, 27 Aug 2007 21:17:51 +0100 Subject: [nycphp-talk] how did you learn php? References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com><330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com><46D2EF02.3050702@magpie.com> <20070827184405.M5872@pinestream.com> Message-ID: <001901c7e8e7$5b1c76f0$0200a8c0@X9183> Hi Jake, There is a book called "PHP and MySQL Web Development", which contains a DVD, It is good in so much as it teaches using a specific project devised by the authors. Paul ----- Original Message ----- From: Jake McGraw To: NYPHP Talk Sent: Monday, August 27, 2007 8:12 PM Subject: Re: [nycphp-talk] how did you learn php? My first experience programming in PHP was writing my own online guest book. Gets to you used to interfacing with a database (or flat file) and working with user input. After getting a taste of the syntax, take a gander at Object Oriented Programming in PHP and the many security issues that crop up when handling user input. Keep the php.net function list handy and you should be on your way. - jake On 8/27/07, Cliff Hirsch < cliff at pinestream.com> wrote: On Mon, 27 Aug 2007 11:34:26 -0400, Steve Manes wrote > I started programming with 6502 assembler Wow, the 6502 -- you just revealed your age! That was a great processor. If we're going to tell stories... My first computer manual was the original binder for the Altair 8800 -- still have it and the first few issues of Byte :) Bought the manual, but could never afford the parts. When I was a kid, I would ride my bike to Schweber Electronics in Jericho. I would go up to the will call window and say, I'd like an AMD 2900 data book please." Since then, I've had therapy. Cliff _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From mitch.pirtle at gmail.com Mon Aug 27 16:30:18 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 27 Aug 2007 16:30:18 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <001901c7e8e7$5b1c76f0$0200a8c0@X9183> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com> <330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com> <46D2EF02.3050702@magpie.com> <20070827184405.M5872@pinestream.com> <001901c7e8e7$5b1c76f0$0200a8c0@X9183> Message-ID: <330532b60708271330w6e9ee8d1wcc478226f099a47a@mail.gmail.com> On 8/27/07, PaulCheung wrote: > There is a book called "PHP and MySQL Web Development", which contains a > DVD, It is good in so much as it teaches using a specific project devised by > the authors. You're absolutely right. Holy moly, there's books - books and books and books, so many good ones that there are probably too many to read. Here's a trick that I learned early on. Go into a bookstore, and check out the existing PHP books that they have. Look at the reading style, read a couple pages from each, just to see if one writing style is easier for you to understand and so on. Then compare whether the books you like more happen to come from a common publisher. There's a chance that they do. For example, I know people that love O'Reilly books, others that love WROX, and I personally enjoy the Apress books. You might find a particular publisher, author or writing style that you prefer as well. Books are good :-) -- Mitch From bz-gmort at beezifies.com Mon Aug 27 16:55:55 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Mon, 27 Aug 2007 16:55:55 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <001901c7e8e7$5b1c76f0$0200a8c0@X9183> References: <98a958580708261850v3094dca8sbf5af23165d1bec7@mail.gmail.com><330532b60708270801u815d10eodb5427f86f802b22@mail.gmail.com><46D2EF02.3050702@magpie.com> <20070827184405.M5872@pinestream.com> <001901c7e8e7$5b1c76f0$0200a8c0@X9183> Message-ID: <46D33A5B.1050305@beezifies.com> PaulCheung wrote: > Hi Jake, > > There is a book called "PHP and MySQL Web Development", which contains > a DVD, It is good in so much as it teaches using a specific project > devised by the authors. > > Speaking of books, if you like OReilly books and can deal with online copies, you can purchase a months sub to read all their books online for the cost of 1 hardcopy book. I find it more cost effective as I use a book and than am done with it for quite a while. From susan_shemin at yahoo.com Mon Aug 27 17:10:55 2007 From: susan_shemin at yahoo.com (Susan Shemin) Date: Mon, 27 Aug 2007 14:10:55 -0700 (PDT) Subject: [nycphp-talk] how did you learn php? Message-ID: <403176.66373.qm@web50201.mail.re2.yahoo.com> Even better than that, you can go to Safari on the Premier Club at www.devx.com and for $15.00/month have access to thousands of books. You can have 10 books available at any one time. I keep some PHP books and some MySQL ones, and an Ajax book and one on Javascript, and of course a Photoshop book, on my Bookshelf and wander over to Devx when I need to look up some syntax or look for a better way to do something. What's wonderful is that there's beginning books AND complex books, so you can start out with how-to books and advance to more complex programming. For me, I love the books that take you through setting up some code with explanations for each segment of code, and have you work through the example and write the code as you go, rather than the books that "discuss" how to do something, and there's plenty of these types of books there. Susan -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Mon Aug 27 17:36:31 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Mon, 27 Aug 2007 17:36:31 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <403176.66373.qm@web50201.mail.re2.yahoo.com> References: <403176.66373.qm@web50201.mail.re2.yahoo.com> Message-ID: <46D343DF.80201@beezifies.com> Susan Shemin wrote: > Even better than that, you can go to Safari on the Premier Club at > www.devx.com and for $15.00/month have access to > thousands of books. You can have 10 books available at any one time. I found, for me, the 10 book bookshelf was just a little too limiting. You have to keep a book on the bookshelf for a month before you can rotate it off. I prefer their unlimited plan with no rotation. That way when I need one chapter from one book, I get it and am done with it. From speel3k at gmail.com Mon Aug 27 20:07:48 2007 From: speel3k at gmail.com (Anthony) Date: Mon, 27 Aug 2007 20:07:48 -0400 Subject: [nycphp-talk] how did you learn php? In-Reply-To: <46D343DF.80201@beezifies.com> References: <403176.66373.qm@web50201.mail.re2.yahoo.com> <46D343DF.80201@beezifies.com> Message-ID: <98a958580708271707x7a34a391gc3b233bb2f0cf649@mail.gmail.com> I found a new love for this list..amazing replies in such a short time. Well me personally I just want to tinker around, possibly make some pretty general apps for now then move on to bigger things. All your replies are very juicy in information and i want to say thanks :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.rundlett at gmail.com Mon Aug 27 20:47:26 2007 From: greg.rundlett at gmail.com (Greg Rundlett) Date: Mon, 27 Aug 2007 20:47:26 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <46D31451.6020102@beezifies.com> References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> <6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com> <7.0.1.0.2.20070826194806.03178de0@e-government.com> <6ec19ec70708261722u6f0b2fbeuc969393932c81f4f@mail.gmail.com> <330532b60708270752p318e3232h89f9891953472e78@mail.gmail.com> <011301c7e8be$c15d5ca0$6401a8c0@gamebox> <46D31451.6020102@beezifies.com> Message-ID: <5e2aaca40708271747m7b51188ax7b6be6781d43877@mail.gmail.com> Nobody mentioned Quanta Plus, the best free (GPL) IDE on Linux. http://quanta.kdewebdev.org/ Disclaimer: I'm a minor contributor to the Quanta community and a happy user. Quanta does code folding, FTP and SSH (using KIO slaves), supports multiple programming languages, has project mangement / team features, works with a debugger like XDebug and is completely customizable from scripts, to toolbars, and full-blown wizards. For example, I configured it so that it can 'natively' speak the XML dialect for 'TaskJuggler' which is a Linux Project Management tool. It has code completion (plus local documentation for PHP, MySQL, JavaScript, CSS), structure browser, a terrific CSS editor built-in. http://quanta.kdewebdev.org/resources.php It does XSLT, DocBook and XML. Local plugins (provided) such as Tidy, Linkchecker, and Konsole are just examples of using the extensibility of the system. It integrates CVS too through Cervisia (but not yet Subversion -- just because Cervisia doesn't do Subversion). You can certainly build in a subversion toolbar yourself due to the flexibility and extensibility of the system. Quanta (the editor part) is based on Kate. Current development is progressing on merging/aligning the project with KDevelop http://www.kdevelop.org/ for KDE 4 I've been looking at Eclipse, not for any lack in Quanta, but rather because I manage a cross-platform development team. Eclipse would be available on any desktop while Quanta is only available for Linux. From mitch.pirtle at gmail.com Mon Aug 27 20:54:02 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 27 Aug 2007 20:54:02 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <5e2aaca40708271747m7b51188ax7b6be6781d43877@mail.gmail.com> References: <46D1B9AB.4000307@beezifies.com> <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> <6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com> <7.0.1.0.2.20070826194806.03178de0@e-government.com> <6ec19ec70708261722u6f0b2fbeuc969393932c81f4f@mail.gmail.com> <330532b60708270752p318e3232h89f9891953472e78@mail.gmail.com> <011301c7e8be$c15d5ca0$6401a8c0@gamebox> <46D31451.6020102@beezifies.com> <5e2aaca40708271747m7b51188ax7b6be6781d43877@mail.gmail.com> Message-ID: <330532b60708271754r244b5f84y9e32959556e79971@mail.gmail.com> On 8/27/07, Greg Rundlett wrote: > Nobody mentioned Quanta Plus, the best free (GPL) IDE on Linux. > http://quanta.kdewebdev.org/ +1 I can't believe I forgot that, been on the macbook for too long I suppose. Quanta+ is the shiznit folks. -- Mitch From ben at projectskyline.com Mon Aug 27 21:46:41 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Mon, 27 Aug 2007 21:46:41 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce Message-ID: <005c01c7e915$4860ffd0$6401a8c0@gamebox> Hello All, So, I've been asked by a client to implement a shopping cart into a php/mysql site that we built. They want to start with about 12 items and have the shop interface w/miva, cart32 or shopsite. I know nothing about those merchant accounts, if that's even what they are. Any insight on those would be great. Now, I LOVE reinventing the wheel on the first go, to better understand stuff. It also enables me to build up my code library. And as far as time frame and budget, I could build a cart from scratch. I have the Apress book "PHP5 & E-commerce", plus all the obvious online resources. Is it a wise idea to build the cart from scratch? If so, what are some obvious pitfalls I should be aware of? I'm not even 100% sure what parties are involved in an ecommerce transaction. I will also need to construct some sort of admin side of this application to manage inventory, etc. If I don't build the cart from scratch, what are some alternatives? I need it to be totaly skinable if its a 3rd party solution. I'm sure joomla or drupal have ecommerce modules. Let me hear from success stories! Thanks! - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons -------------- next part -------------- An HTML attachment was scrubbed... URL: From cliff at pinestream.com Mon Aug 27 22:13:23 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Mon, 27 Aug 2007 22:13:23 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <005c01c7e915$4860ffd0$6401a8c0@gamebox> Message-ID: > They want to start with about 12 items and have the shop interface w/miva, cart32 or shopsite. These are carts, not merchant accounts or gateways, so I?m confused. >And as far as time frame and budget, I could build a cart from scratch. I have the Apress book "PHP5 & E-commerce", plus all the obvious online resources. No, no, no!!! A cart can be deceivingly complex. I used the same book as a sort of ?Framework? for a tangential project that is cart-like. The three layer architecture is great, but upside down. The presentation layer selects the business logic ? go figure. Plus, it covers maybe 20% of what?s really required. > Is it a wise idea to build the cart from scratch? NO. See above. >If I don't build the cart from scratch, what are some alternatives? I need it to be totaly skinable... There are a gazillion carts ? both open source and commercial .Even the commercial are dirt cheap. Another alternative is a hosted solution. You?ve got to have a really, really good reason to develop a cart from scratch. The big open source cart is oscommerce, which has a reasonably good fork called Zencart. X-cart is a good commercial alternative. The code is a nightmare, and will make any oop purist barf, but very easy to hack and skin. There?s numerous others. First, figure out the budget and requirements. That will wittle down the list. Cliff -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at projectskyline.com Mon Aug 27 22:24:57 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Mon, 27 Aug 2007 22:24:57 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce References: Message-ID: <00a201c7e91a$a13a1bf0$6401a8c0@gamebox> Re: [nycphp-talk] Two part question: Shopping carts & E-commerceHello Cliff, hah, ok, that's convincing enough. The budget and timeframe are both in my favour, so I can choose the best tools for the job. Since I've yet to work w/joomla, would it be a good idea to try to set that up for e-commerce. I remember a few days back, an answer to my Framework question, some responding saying they had great success with joomla & e-commerce. miva, cart32 or shopsite are carts? I didn't know that. I guess that's what THEY (the client) want to use. Any experiance with those? Im googling right now and it says miva is a merchange account as well. http://smallbusiness.miva.com/products/merchant/ and shopping cart software http://smallbusiness.miva.com/ Hmm..cart32 is windows based, so that's out! Shopsite: looking at their website. I guess I need to read up on the e-commerce and shopping cart basics. Do some carts only work with certain merchants? - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: Cliff Hirsch To: NYPHP Talk Sent: Monday, August 27, 2007 10:13 PM Subject: Re: [nycphp-talk] Two part question: Shopping carts & E-commerce > They want to start with about 12 items and have the shop interface w/miva, cart32 or shopsite. These are carts, not merchant accounts or gateways, so I'm confused. >And as far as time frame and budget, I could build a cart from scratch. I have the Apress book "PHP5 & E-commerce", plus all the obvious online resources. No, no, no!!! A cart can be deceivingly complex. I used the same book as a sort of "Framework" for a tangential project that is cart-like. The three layer architecture is great, but upside down. The presentation layer selects the business logic - go figure. Plus, it covers maybe 20% of what's really required. > Is it a wise idea to build the cart from scratch? NO. See above. >If I don't build the cart from scratch, what are some alternatives? I need it to be totaly skinable... There are a gazillion carts - both open source and commercial .Even the commercial are dirt cheap. Another alternative is a hosted solution. You've got to have a really, really good reason to develop a cart from scratch. The big open source cart is oscommerce, which has a reasonably good fork called Zencart. X-cart is a good commercial alternative. The code is a nightmare, and will make any oop purist barf, but very easy to hack and skin. There's numerous others. First, figure out the budget and requirements. That will wittle down the list. Cliff ------------------------------------------------------------------------------ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Mon Aug 27 22:25:53 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 27 Aug 2007 22:25:53 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <005c01c7e915$4860ffd0$6401a8c0@gamebox> References: <005c01c7e915$4860ffd0$6401a8c0@gamebox> Message-ID: <8f0676b40708271925g69b62100hec1c1e99b6f67ab0@mail.gmail.com> > So, I've been asked by a client to implement a shopping cart into a > php/mysql site that we built. > They want to start with about 12 items and have the shop interface w/miva, > cart32 or shopsite. Okay... > Now, I LOVE reinventing the wheel on the first go, to better understand > stuff. It also > enables me to build up my code library. And as far as time frame and budget, > I > could build a cart from scratch. Now I am confused... Do you want to write your own, or do you want to use cart32/shopsite? Please provide an example site with a cart system you like, and I can tell you what needs to be done. Right now it appears you are really confused about the process. Please DO NOT write your own. Below is one example of how complicated things get: Cart has two items. One is available for shipment today, one is backordered. What credit card transactions are you supposed to process and when? If you don't know the answer to that, you have no business rolling you own. -John Campbell From jcampbell1 at gmail.com Mon Aug 27 22:55:35 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 27 Aug 2007 22:55:35 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <00a201c7e91a$a13a1bf0$6401a8c0@gamebox> References: <00a201c7e91a$a13a1bf0$6401a8c0@gamebox> Message-ID: <8f0676b40708271955i14123b1ej87c13f0048c35907@mail.gmail.com> > Since I've yet to work w/joomla, would it be a good idea to try to set that > up for e-commerce. > I remember a few days back, an answer to my Framework question, some > responding saying > they had great success with joomla & e-commerce. Joomla is a CMS, it really has nothing to do with e-commerce however it is common to integrate cart software with a CMS. > miva, cart32 or shopsite are carts? I didn't know that. I guess that's what > THEY (the client) want to use. > Any experiance with those? They will not work with a PHP site. Most Cart software is pretty much the same. > Im googling right now and it says miva is a merchange account as well. > http://smallbusiness.miva.com/products/merchant/ > and shopping cart software > http://smallbusiness.miva.com/ I know it is a bit confusing because terms like "Merchant Account" and "Gateway" mean two different things depending on what you are doing... There are two options: 1) Have a 3rd party charge the cards and they give you the funds (PayPal/Google Checkout/Miva Merchant) 2) Charge the cards on your own site -- You need a merchant bank account with Chase, and a payment gateway. Before you go any further, which route does you client want to go? There is a big difference. From ben at projectskyline.com Mon Aug 27 23:11:53 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Mon, 27 Aug 2007 23:11:53 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce References: <00a201c7e91a$a13a1bf0$6401a8c0@gamebox> <8f0676b40708271955i14123b1ej87c13f0048c35907@mail.gmail.com> Message-ID: <000901c7e921$2fa36b20$6401a8c0@gamebox> Hello, Great points. Both the client and myself don't know too much about this. I guess I'll have to do more research before I can say. Thanks, I'll look into this. - Ben Ben Sgro, Chief Engineer ----- Original Message ----- From: "John Campbell" To: "NYPHP Talk" Sent: Monday, August 27, 2007 10:55 PM Subject: Re: [nycphp-talk] Two part question: Shopping carts & E-commerce >> Since I've yet to work w/joomla, would it be a good idea to try to set >> that >> up for e-commerce. >> I remember a few days back, an answer to my Framework question, some >> responding saying >> they had great success with joomla & e-commerce. > > Joomla is a CMS, it really has nothing to do with e-commerce however > it is common to integrate cart software with a CMS. > >> miva, cart32 or shopsite are carts? I didn't know that. I guess that's >> what >> THEY (the client) want to use. >> Any experiance with those? > > They will not work with a PHP site. Most Cart software is pretty much the > same. > >> Im googling right now and it says miva is a merchange account as well. >> http://smallbusiness.miva.com/products/merchant/ >> and shopping cart software >> http://smallbusiness.miva.com/ > > I know it is a bit confusing because terms like "Merchant Account" and > "Gateway" mean two different things depending on what you are doing... > > There are two options: > 1) Have a 3rd party charge the cards and they give you the funds > (PayPal/Google Checkout/Miva Merchant) > 2) Charge the cards on your own site -- You need a merchant bank > account with Chase, and a payment gateway. > > Before you go any further, which route does you client want to go? > There is a big difference. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From nyphp at dynamicink.com Mon Aug 27 23:26:31 2007 From: nyphp at dynamicink.com (Dynamic Ink) Date: Mon, 27 Aug 2007 23:26:31 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce References: <00a201c7e91a$a13a1bf0$6401a8c0@gamebox> Message-ID: <005f01c7e923$506f0a10$0401a8c0@e6300> Re: [nycphp-talk] Two part question: Shopping carts & E-commerceBen, if you are interested in rolling your own cart and are willing to spend $9 on ordering PHP Architect back issues, there is a detailed explanation of building your own feature-rich cart in an article that I wrote for PHP Architect, The Ultimate PHP 5 Shopping Cart, spanning Aug. and Sept. 2004. The article includes a detailed explanation of merchant account fundamentals, credit card gateways, verification algorithms as well as step-by-step instructions to building your own cart. By the way, what did you think of MySQL camp? Everyone there was great, but the presentations by Jay and Jeremy were definitely the highlight in my opinion... -------------- next part -------------- An HTML attachment was scrubbed... URL: From mancinic at gmail.com Tue Aug 28 02:24:25 2007 From: mancinic at gmail.com (Christopher M Mancini) Date: Tue, 28 Aug 2007 02:24:25 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <005f01c7e923$506f0a10$0401a8c0@e6300> References: <00a201c7e91a$a13a1bf0$6401a8c0@gamebox> <005f01c7e923$506f0a10$0401a8c0@e6300> Message-ID: <84caf2b90708272324i6a11f7dckb0604dfcf0f5864@mail.gmail.com> Ben, A lot can go wrong altogether if you have little experience with ecommerce. Even if you use an off the shelf shopping cart. If this client is expecting high volumes in the future, you may want to do your research wisely regarding security. In fact, you may want to consider subcontracting that portion of the project out, and try to learn as much about the process from the subcontractor so that you can accomplish it by yourself on the next run. Chris On 8/27/07, Dynamic Ink wrote: > > Ben, if you are interested in rolling your own cart and are willing to > spend $9 on ordering PHP Architect back issues, there is a detailed > explanation of building your own feature-rich cart in an article that I > wrote for PHP Architect, *The Ultimate PHP 5 Shopping Cart*, spanning Aug. > and Sept. 2004. The article includes a detailed explanation of merchant > account fundamentals, credit card gateways, verification algorithms as well > as step-by-step instructions to building your own cart. > > By the way, what did you think of MySQL camp? Everyone there was great, > but the presentations by Jay and Jeremy were definitely the highlight in my > opinion... > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- <------------------------- Sincerely, Christopher M Mancini mancinic at gmail.com http://www.linkedin.com/in/buffaloit http://blog.itrealm.net --------------------------> -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at enobrev.com Tue Aug 28 06:36:57 2007 From: lists at enobrev.com (Mark Armendariz) Date: Tue, 28 Aug 2007 06:36:57 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <5e2aaca40708271747m7b51188ax7b6be6781d43877@mail.gmail.com> References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> <6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com> <7.0.1.0.2.20070826194806.03178de0@e-government.com> <6ec19ec70708261722u6f0b2fbeuc969393932c81f4f@mail.gmail.com> <330532b60708270752p318e3232h89f9891953472e78@mail.gmail.com> <011301c7e8be$c15d5ca0$6401a8c0@gamebox> <46D31451.6020102@beezifies.com> <5e2aaca40708271747m7b51188ax7b6be6781d43877@mail.gmail.com> Message-ID: <46D3FAC9.1030104@enobrev.com> Greg Rundlett wrote: > Nobody mentioned Quanta Plus, the best free (GPL) IDE on Linux. > http://quanta.kdewebdev.org/ > > Disclaimer: I'm a minor contributor to the Quanta community and a happy user. > > I tried Quanta, and it was ok. I've tried many of the others mentioned as well. My favorite still stands as Eclipse PDT. Yes, the eclipse 'way' - workspaces - takes a bit of getting used to, especially as I used to work directly on a remote dev server instead of using local directories, but working locally is just so much faster. It has incredible Subversion / CVS integration Trac / Bugzilla Integration is very good using an interesting plugin called mylyn - which integrates your tickets with your revision control to auto-write your checkins (also shows tickets in actual ide). Also does tons for managing current tasks. HIGHLY recommend it. Solid ANT integration for automated deployment Built-in PHP debugging works great. XDebug debugging works great as well (though a bit annoying to install since it's unpackaged) Weak Bazaar integration, but the Bazaar devs are working on it PHPDoc Support PHP Explorer shows your object / function tree (shows includes and interface / parent classes in the tree as well) Proper Code Coloring and even completion for everything - even in the same file - php, html, css, js And, of course, vim when working over ssh. Mark From bz-gmort at beezifies.com Tue Aug 28 06:39:45 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Tue, 28 Aug 2007 06:39:45 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <005c01c7e915$4860ffd0$6401a8c0@gamebox> References: <005c01c7e915$4860ffd0$6401a8c0@gamebox> Message-ID: <46D3FB71.7080805@beezifies.com> Ben Sgro (ProjectSkyLine) wrote: > Hello All, > > So, I've been asked by a client to implement a shopping cart into a > php/mysql site that we built. > They want to start with about 12 items and have the shop interface > w/miva, cart32 or shopsite. The O'Reilly book PHP Hacks has a couple articles on Shopping Carts and payment gateways in it. It is primarily the checkout process where Carts get tricky, especially if you use the Paypal process and especially if you are selling digital content(when do flag an item as sold? Paypal can take up to a day to actually process the charge. How do you deal with chargebacks and cancellations? How do you reconcile the amount charged vs the amount that should have been charged? Paypal is an ugly hack because your actually having the client system send the charge to paypal, so a smart individual can intercept the redirect and change the amount charged from $100 to 1 penny. Though to be honest, the bulk of non paypal charge systems also do the same - have the client send the total to the server which then processes what the client sent. It really depends on how much time and effort you want to put into having the program do a lot of checking compared to having a human check the order and verify the prices and quantities. Joomla has Virtuemart which works well if you have a content heavy site where you want to do a few sales. OSCommerce works well for a heavy sales site with low content. Of course, never underestimate just using something off the shelf. A lot of web providers have a cart script they provide for free and deals with merchant accounts for charging. Also if I recall correctly, Amazon let's you sell products through them, so you can build your cart and everything on your site, but send the cart for checkout to Amazon and let them deal with payment gateways and chargebacks and such. From cliff at pinestream.com Tue Aug 28 06:48:22 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 28 Aug 2007 06:48:22 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <00a201c7e91a$a13a1bf0$6401a8c0@gamebox> Message-ID: On 8/27/07 10:24 PM, "Ben Sgro (ProjectSkyLine)" wrote: > > I guess I need to read up on the e-commerce and shopping cart basics. Do some > carts only > work with certain merchants? > > - Ben > Look at this thread: http://www.scriptygoddess.com/archives/2006/12/28/cube-cart-vs-zen-cart/ The ZenCart site also has some good comp data. This: http://www.cs-cart.com/ is like a next-gen x-cart. Most carts support many gateways and payment methods. The gateway is what matters, not the merchant account, other than some specialized ones like google, paypal, etc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Tue Aug 28 07:14:41 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Tue, 28 Aug 2007 07:14:41 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: References: Message-ID: <46D403A1.9060504@beezifies.com> Cliff Hirsch wrote: > On 8/27/07 10:24 PM, "Ben Sgro (ProjectSkyLine)" > wrote: > > > I guess I need to read up on the e-commerce and shopping cart > basics. Do some carts only > work with certain merchants? > > - Ben > > Not so much a merchant, but a payment gateway(and I consider Google and Paypal gateways). Also there is the issue of the way payment is supposed to work, and how most people do it. Supposedly: A)Client puts 100$ worth of products in their cart B)Client goes to checkout C)Charging information collected from client D) Charging information submitted to gateway for APPROVAL E) Charge result processed E1) Denied? Go to step C E2) Success? Tell client so F) You ship the products G) You mark the item as shipped in the system H) The system contacts the payment gateway and has the funds released It's a two step process, Authorize the charge, than Release the funds after shipping In the real world, most companies seem to do it in 1 step, Authorize and Release - which you can do but is a legal liability(what happens if a tornado comes through and destroys the warehouse before it shipped? You HAVE to provide the product since you took the money, a refund is not good enough). Payment Gateways work in one of two ways: 1) You collect all the payment information on your server and submit it through an SSL session to the gateway for approval. 2) You send the client to the payment gateway with some hidden fields for the products and pricing and they pay there, than the gateway returns the client to your site, as well as hitting it's own secret callback url to notify you a payment has been approved A long long time ago, Paypal was strictly a remote gateway, you would redirect the client to paypal, they would process the payment. Nowadays Paypal has an extremely inexpensive option for doing payment approvals yourself without a client redirect - the catch is that you must also accept paypal and must provide a process for this, so you need to implement 2 payment methods for Paypal(that said, a number of companies use the Paypal payflow method and don't advertise/allow direct paypal payments in violation of their agreement). It also gets really complicated when your dealing with stores located in other countries. Paypal won't provide gateway services for many countries, and in those countries gateways that will provide such service charge an arm and a leg(and considering that developers from those countries tend to be very cagey about saying what country they are in, my own feeling is those fees are justified. I know of at least 2 companies completely run out of India with Florida LLC's in order to use Paypal) I generally work backwards with a cart system, first I determine what payment gateways(Paypal, Authrorize.net, Worldpay, linkpoint, etc) are preferred, than find a cart that supports that gateway. If they don't know what they want, than I recommend paypal until they decide what they want(a lot of merchant accounts charge hefty monthly fees, setup fees, and percentages - so make sure to setup the gateway first - working 6 weeks on the project only to have the client refuse to implement because those "thieves" want 100$ application fee, 30$ a month, and 4% of sales is frustrating. Paypal is cheap, it works, and it looks 'chintzy'. It is amazing how many objections to Paypal disappear when they find out the costs of different system). From bz-gmort at beezifies.com Tue Aug 28 07:41:00 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Tue, 28 Aug 2007 07:41:00 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <46D3FAC9.1030104@enobrev.com> References: <46D1B9AB.4000307@beezifies.com> <46D1C395.9050107@beezifies.com> <6ec19ec70708261205o42254b67t66f92737fa6b1541@mail.gmail.com> <6ec19ec70708261210p2f9b81dct2c0b4e514472ed6@mail.gmail.com> <7.0.1.0.2.20070826194806.03178de0@e-government.com> <6ec19ec70708261722u6f0b2fbeuc969393932c81f4f@mail.gmail.com> <330532b60708270752p318e3232h89f9891953472e78@mail.gmail.com> <011301c7e8be$c15d5ca0$6401a8c0@gamebox> <46D31451.6020102@beezifies.com> <5e2aaca40708271747m7b51188ax7b6be6781d43877@mail.gmail.com> <46D3FAC9.1030104@enobrev.com> Message-ID: <46D409CC.5080903@beezifies.com> Speaking of Linux editors, are there any editors which can recognize and import a Dreamweaver taglist? I was recently doing some work on ProStores and they had a dreamweaver taglist for their ugly little scripting language. I would have loved to be able to edit their pages in an editor I am more comfortable with(well, I DID edit their pages in an editor I was more comfortable with, I just did not have the time to build my own tag library for it) From elharo at metalab.unc.edu Tue Aug 28 07:57:01 2007 From: elharo at metalab.unc.edu (Elliotte Harold) Date: Tue, 28 Aug 2007 07:57:01 -0400 Subject: [nycphp-talk] State of XML databases presentation? In-Reply-To: <004001c7df87$24b59f10$651ba8c0@MobileZ> References: <46C375F5.3070401@metalab.unc.edu> <004001c7df87$24b59f10$651ba8c0@MobileZ> Message-ID: <46D40D8D.5050109@metalab.unc.edu> Hans Zaunere wrote: > That's ok - if you're up to it, send us the typical blurb/bio/etc and what > month works (always the 4th Tuesday). > How's Tuesday, October 23rd then? Bio: Elliotte is originally from New Orleans to which he returns periodically in search of a decent bowl of gumbo. However, he currently resides in the Prospect Heights neighborhood of Brooklyn with his wife Beth, dog Shayna, and cats Charm (named after the quark) and Marjorie (named after his mother-in-law). He's an adjunct professor of computer science at Polytechnic University where he teaches Java, XML, and object oriented programming. His books include Java I/O, Java Network Programming, the XML Bible, and XML in a Nutshell. His next book will be Refactoring HTML from Addison-Wesley. He's currently working on the XOM Library for processing XML with Java, and the jaxen XPath engine. -- Elliotte Rusty Harold elharo at metalab.unc.edu Java I/O 2nd Edition Just Published! http://www.cafeaulait.org/books/javaio2/ http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/ From cliff at pinestream.com Tue Aug 28 08:50:41 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 28 Aug 2007 08:50:41 -0400 Subject: [nycphp-talk] Framework poll Message-ID: Does Nyphp have any polling capability? It would be interesting to see how many of us are actually using Frameworks, and if so, what Frameworks we are using. (Might want to throw in JavaScript libraries like jQuery, Prototype, etc too). If we can?t do a poll, perhaps just a wiki or passing this email around with a list of frameworks and initials for each responder. Cliff P.S. If Mark Withington is listening, the Bostonphp web site has polling capability ? perhaps he can set something up for everyone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Tue Aug 28 10:47:16 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Aug 2007 10:47:16 -0400 (EDT) Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <46D3FB71.7080805@beezifies.com> Message-ID: On Tue, 28 Aug 2007, Gary Mort wrote: > Joomla has Virtuemart which works well if you have a content heavy site > where you want to do a few sales. Ive built about 5 sites with Joomla + Virtuemart, its a nice solution if you're willing to learn Joomla. > OSCommerce works well for a heavy > sales site with low content. Hated it... > I recall correctly, Amazon let's you sell products through them, so you > can build your cart and everything on your site, but send the cart for > checkout to Amazon and let them deal with payment gateways and > chargebacks and such. Or even Google Checkout. -- Aj. From bz-gmort at beezifies.com Tue Aug 28 11:11:04 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Tue, 28 Aug 2007 11:11:04 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: References: Message-ID: <46D43B08.60009@beezifies.com> Ajai Khattri wrote: > Or even Google Checkout. > > I'm not thrilled with Google checkout since it requires you to have your customer setup a Google account(I think Amazon requires an amazon account, but the process just appears more streamlined and felt like setting up a shipping/billing subcomponent of the account rather than 2 accounts). Ya know, one thing that wasn't mentioned, just what ARE these 10 products they plan on selling? Let me explain a bit. If your selling photo's or photo related items(a poster, postcards, etc) - a saner solution could be to use Menalto Gallery and use their built in hooks to the various photo printing services. You define your products, the markups, etc in the printer service, and than just setup the online digital photos. You can even have 2 versions of the file on your site, one that is publicly viewable and one high quality one the photo service will use. If your selling stuff with emblazoned logo's, tote bags and junk, a lot of people use CafePress for that, and you can build your own interface into it to the degree you need it(from redirecting to a skinned cafepress store, to embedding the iutems inside your site but using their checkout, to having your own checkout and than you submit the order to cafepress and have it drop shipped to the customer). If your selling digital content, there is a whole slew of issues to think through regarding downloads and such. From jonbaer at jonbaer.com Tue Aug 28 11:15:06 2007 From: jonbaer at jonbaer.com (Jon Baer) Date: Tue, 28 Aug 2007 11:15:06 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <46D43B08.60009@beezifies.com> References: <46D43B08.60009@beezifies.com> Message-ID: <70745236-EB98-4AC3-B754-4DC2A315323E@jonbaer.com> Or why even reinvent the wheel altogether ... http://www.shopify.com Worth a look I think ... - Jon On Aug 28, 2007, at 11:11 AM, Gary Mort wrote: > Ajai Khattri wrote: >> Or even Google Checkout. >> >> > > I'm not thrilled with Google checkout since it requires you to have > your customer setup a Google account(I think Amazon requires an > amazon account, but the process just appears more streamlined and > felt like setting up a shipping/billing subcomponent of the account > rather than 2 accounts). > > Ya know, one thing that wasn't mentioned, just what ARE these 10 > products they plan on selling? > > Let me explain a bit. > > If your selling photo's or photo related items(a poster, postcards, > etc) - a saner solution could be to use Menalto Gallery and use > their built in hooks to the various photo printing services. You > define your products, the markups, etc in the printer service, and > than just setup the online digital photos. You can even have 2 > versions of the file on your site, one that is publicly viewable > and one high quality one the photo service will use. > > If your selling stuff with emblazoned logo's, tote bags and junk, a > lot of people use CafePress for that, and you can build your own > interface into it to the degree you need it(from redirecting to a > skinned cafepress store, to embedding the iutems inside your site > but using their checkout, to having your own checkout and than you > submit the order to cafepress and have it drop shipped to the > customer). > > If your selling digital content, there is a whole slew of issues to > think through regarding downloads and such. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From pyurt at yahoo.com Tue Aug 28 12:53:21 2007 From: pyurt at yahoo.com (pyurt) Date: Tue, 28 Aug 2007 09:53:21 -0700 Subject: [nycphp-talk] Linux editors In-Reply-To: <46D3FAC9.1030104@enobrev.com> Message-ID: <0de601c7e993$f111ac00$6700a8c0@Pres2103> Using Eclipse do you map your local directories to a web server? Do you save your local files in a browser accessible folder? Paul Yurt The most accurate credible, & timely website directory on the web: mastermoz.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mark Armendariz Sent: Tuesday, August 28, 2007 3:37 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Linux editors Greg Rundlett wrote: > Nobody mentioned Quanta Plus, the best free (GPL) IDE on Linux. > http://quanta.kdewebdev.org/ > > Disclaimer: I'm a minor contributor to the Quanta community and a happy user. > > I tried Quanta, and it was ok. I've tried many of the others mentioned as well. My favorite still stands as Eclipse PDT. Yes, the eclipse 'way' - workspaces - takes a bit of getting used to, especially as I used to work directly on a remote dev server instead of using local directories, but working locally is just so much faster. It has incredible Subversion / CVS integration Trac / Bugzilla Integration is very good using an interesting plugin called mylyn - which integrates your tickets with your revision control to auto-write your checkins (also shows tickets in actual ide). Also does tons for managing current tasks. HIGHLY recommend it. Solid ANT integration for automated deployment Built-in PHP debugging works great. XDebug debugging works great as well (though a bit annoying to install since it's unpackaged) Weak Bazaar integration, but the Bazaar devs are working on it PHPDoc Support PHP Explorer shows your object / function tree (shows includes and interface / parent classes in the tree as well) Proper Code Coloring and even completion for everything - even in the same file - php, html, css, js And, of course, vim when working over ssh. Mark _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From lists at enobrev.com Tue Aug 28 13:17:27 2007 From: lists at enobrev.com (Mark Armendariz) Date: Tue, 28 Aug 2007 13:17:27 -0400 Subject: [nycphp-talk] Linux editors In-Reply-To: <0de601c7e993$f111ac00$6700a8c0@Pres2103> References: <0de601c7e993$f111ac00$6700a8c0@Pres2103> Message-ID: <46D458A7.6050801@enobrev.com> pyurt wrote: > Using Eclipse do you map your local directories to a web server? > Do you save your local files in a browser accessible folder? > Short... Yes, but a local server. Yes. Long... Locally I'm running apache2 and set up each project as a virtualhost subdomain, like project1.example.com project2.example.com project3.example.com project4.example.com and so on and then update my hosts file to point those subdomains to localhost. My directory stucture looks something like this /home/example/www/com/project1 /home/example/www/com/project3 /home/example/www/net/project2 /home/example/www/org/project4 Also, I have a similar setup on my win32 box. D:\W\com\project1 D:\W\com\project3 etc... Each folder is an eclipse project, and I have bazaar (or subversion) ignore the eclipse files (.project, .settings, .cache, etc). I don't use Eclipse's workspace directory for anything project-related. As for how they map to the live sites, they don't in any specific way. Each project has a different directory structure due to differing servers/needs. I handle those differences in configuration files. From bz-gmort at beezifies.com Tue Aug 28 15:03:14 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Tue, 28 Aug 2007 15:03:14 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <70745236-EB98-4AC3-B754-4DC2A315323E@jonbaer.com> References: <46D43B08.60009@beezifies.com> <70745236-EB98-4AC3-B754-4DC2A315323E@jonbaer.com> Message-ID: <46D47172.1000909@beezifies.com> Jon Baer wrote: > Or why even reinvent the wheel altogether ... > > http://www.shopify.com > > Worth a look I think ... > Be very very cautious with those providers. I'm just wrapping up a project with ProStores(please let me be wrapping this up and nothing new thrown in) and my experience there has been painful, to say the least. Part of it is the odd configuration of the server that is not up to ProStores but the reseller. And part of it is the odd little language they have to use with their services. (Now granted, they do have an XML API that can let you do quite a lot outside of their structure). It didn't help that I came into it cold after the previous group fell down on a number of things they felt they could do. I like things under my control.....(yeah, I suggested Amazon and CafePRess, but they have some good API's you can integrate to) From mitch.pirtle at gmail.com Tue Aug 28 15:04:17 2007 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 28 Aug 2007 15:04:17 -0400 Subject: [nycphp-talk] Framework poll In-Reply-To: References: Message-ID: <330532b60708281204g7aafc2f1nd43baf9c8fdc7b88@mail.gmail.com> On 8/28/07, Cliff Hirsch wrote: > > Does Nyphp have any polling capability? > > It would be interesting to see how many of us are actually using > Frameworks, and if so, what Frameworks we are using. (Might want to throw in > JavaScript libraries like jQuery, Prototype, etc too). If we can't do a > poll, perhaps just a wiki or passing this email around with a list of > frameworks and initials for each responder. Why not just put up a poll ourselves? There are tons of frameworks available that would make such an effort an easy one. We would just need to pick one and get going... -- Mitch, ducking under desk with an evil grin From cliff at pinestream.com Tue Aug 28 15:10:29 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Tue, 28 Aug 2007 15:10:29 -0400 Subject: [nycphp-talk] Framework poll In-Reply-To: <330532b60708281204g7aafc2f1nd43baf9c8fdc7b88@mail.gmail.com> Message-ID: > Why not just put up a poll ourselves? There are tons of frameworks > available that would make such an effort an easy one. We would just > need to pick one and get going... > > -- Mitch, ducking under desk with an evil grin There's always one wise guy.... Maybe we should write the ap in Ruby on Rails... From lists at zaunere.com Tue Aug 28 15:16:25 2007 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 28 Aug 2007 15:16:25 -0400 Subject: [nycphp-talk] Framework poll In-Reply-To: References: Message-ID: <03fa01c7e9a7$ed94f140$651ba8c0@MobileZ> Cliff Hirsch wrote on Tuesday, August 28, 2007 8:51 AM: > Does Nyphp have any polling capability? Not currently, but it's something we should do. There's actually some discussion today on the NYPHP-Org list about the next nyphp.org site. While sure, we could throw something up using a framework, we like pain (ie, we like to develop). We're going to start up a community based nyphp.org revision (which is how the current nyphp.org was developed) which is fun for people to get involved in, etc. After all, half the fun is getting there, right? H > > It would be interesting to see how many of us are actually using > Frameworks, and if so, what Frameworks we are using. (Might want to > throw in JavaScript libraries like jQuery, Prototype, etc too). If we > can't do a poll, perhaps just a wiki or passing this email around > with a list of frameworks and initials for each responder. > > Cliff > > P.S. If Mark Withington is listening, the Bostonphp web site has > polling capability - perhaps he can set something up for everyone. From chsnyder at gmail.com Tue Aug 28 15:53:02 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 28 Aug 2007 15:53:02 -0400 Subject: [nycphp-talk] Framework poll In-Reply-To: <03fa01c7e9a7$ed94f140$651ba8c0@MobileZ> References: <03fa01c7e9a7$ed94f140$651ba8c0@MobileZ> Message-ID: On 8/28/07, Hans Zaunere wrote: > > > Cliff Hirsch wrote on Tuesday, August 28, 2007 8:51 AM: > > Does Nyphp have any polling capability? > > Not currently, but it's something we should do. There's actually some > discussion today on the NYPHP-Org list about the next nyphp.org site. While > sure, we could throw something up using a framework, we like pain (ie, we > like to develop). We're going to start up a community based nyphp.org > revision (which is how the current nyphp.org was developed) which is fun for > people to get involved in, etc. After all, half the fun is getting there, > right? > I think we should have nyphp.org implemented using as many different frameworks as possible, and that each request should by handled by a different, random framework. But maybe that's just me. -- Chris Snyder http://chxo.com/ From pyurt at yahoo.com Tue Aug 28 15:58:23 2007 From: pyurt at yahoo.com (pyurt) Date: Tue, 28 Aug 2007 12:58:23 -0700 Subject: [nycphp-talk] Framework poll In-Reply-To: Message-ID: <0e0a01c7e9ad$ca9b2e10$6700a8c0@Pres2103> Yes sure I'll hack at it in Ruby... Paul The most accurate credible, & timely website directory on the web: mastermoz.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Cliff Hirsch Sent: Tuesday, August 28, 2007 12:10 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Framework poll > Why not just put up a poll ourselves? There are tons of frameworks > available that would make such an effort an easy one. We would just > need to pick one and get going... > > -- Mitch, ducking under desk with an evil grin There's always one wise guy.... Maybe we should write the ap in Ruby on Rails... _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php From lists at enobrev.com Tue Aug 28 16:11:52 2007 From: lists at enobrev.com (Mark Armendariz) Date: Tue, 28 Aug 2007 16:11:52 -0400 Subject: [nycphp-talk] Framework poll In-Reply-To: References: <03fa01c7e9a7$ed94f140$651ba8c0@MobileZ> Message-ID: <46D48188.6000007@enobrev.com> csnyder wrote: > > I think we should have nyphp.org implemented using as many different > frameworks as possible, and that each request should by handled by a > different, random framework. > Brilliant!! And each will have separate implementations for each database (mysql, postgres, oracle, xml, couchdb, etc) and then each of those for each OS (linux, windows, palm, hacked wii, etc) and we'll name each framework/database/os implementation according to our favorite beers, which we'll pick according to our ruby-poll. Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From codebowl at gmail.com Tue Aug 28 16:14:43 2007 From: codebowl at gmail.com (Joseph Crawford) Date: Tue, 28 Aug 2007 16:14:43 -0400 Subject: [nycphp-talk] Framework poll In-Reply-To: <46D48188.6000007@enobrev.com> References: <03fa01c7e9a7$ed94f140$651ba8c0@MobileZ> <46D48188.6000007@enobrev.com> Message-ID: <8d9a42800708281314m1c35ab30u48cc87019703a315@mail.gmail.com> that last one threw me off, the only word i could think of was WOW -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. http://www.codebowl.com/ Blog: http://www.josephcrawford.com/ 1-802-671-2021 codebowl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Tue Aug 28 18:25:43 2007 From: chsnyder at gmail.com (csnyder) Date: Tue, 28 Aug 2007 18:25:43 -0400 Subject: [nycphp-talk] Framework poll In-Reply-To: <46D48188.6000007@enobrev.com> References: <03fa01c7e9a7$ed94f140$651ba8c0@MobileZ> <46D48188.6000007@enobrev.com> Message-ID: On 8/28/07, Mark Armendariz wrote: > > Brilliant!! And each will have separate implementations for each database > (mysql, postgres, oracle, xml, couchdb, etc) and then each of those for each > OS (linux, windows, palm, hacked wii, etc) and we'll name each > framework/database/os implementation according to our favorite beers, which > we'll pick according to our ruby-poll. > Mark, I think you must have worked at my company before I started... this sounds suspiciously like how our accounting system is set up. chris. From lists at zaunere.com Wed Aug 29 01:24:51 2007 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 29 Aug 2007 01:24:51 -0400 Subject: [nycphp-talk] NYPHP List/Server Upgrade Message-ID: <00ad01c7e9fc$eced8d10$640aa8c0@MobileZ> Hello all, We've recently upgraded our server and while everything appears to have been migrated correctly, if anyone notices any issues with any lists or parts of the web site, we'd appreciate hearing about it. You can contact me directly off list, or using our contact form (which I've tested and I know works): http://www.nyphp.org/contact.php Best, --- Hans Zaunere / President / New York PHP www.nyphp.org / www.nyphp.com From arpancs at arpancs.ro Wed Aug 29 03:36:26 2007 From: arpancs at arpancs.ro (Vass Arpad) Date: Wed, 29 Aug 2007 10:36:26 +0300 Subject: [nycphp-talk] Framework poll In-Reply-To: References: Message-ID: <46D521FA.5050304@arpancs.ro> An HTML attachment was scrubbed... URL: From ken at secdat.com Wed Aug 29 07:51:23 2007 From: ken at secdat.com (Kenneth Downs) Date: Wed, 29 Aug 2007 07:51:23 -0400 Subject: XML vs. Table DBs [was: Re: [nycphp-talk] Many pages: one script] In-Reply-To: <46BE770D.9030704@metalab.unc.edu> References: <46B60C11.2090904@metalab.unc.edu> <46B86E12.2060101@gmx.net> <46B8E0F7.1030203@metalab.unc.edu> <46B9ADD2.1010600@secdat.com> <46B9B027.9030900@gmx.net> <46B9CECC.5010207@metalab.unc.edu> <46B9D231.9070706@gmx.net> <46B9DF2A.3050800@metalab.unc.edu> <46BA2A9C.2010400@secdat.com> <46BA6211.3010404@metalab.unc.edu> <46BB3041.2040909@secdat.com> <46BE770D.9030704@metalab.unc.edu> Message-ID: <46D55DBB.7050700@secdat.com> Elliotte Harold wrote: > Kenneth Downs wrote: > >> Select title >> ,SUBSTRING(text ...insert regexp here...) >> from chapters >> where book_name = 'XML in a Nutshell' >> > > Regexps can't do that though. Regular expression are an insufficiently > powerful tool for processing XML. Trying to do that is just a world of > pain. ???? The example shows a query of a table, not XML. The purpose is to demonstrate with a quick snippet that all examples of a supposed indispensable need for the "XML Database" stem from an ignorance of the abilities of other tools. Say that you prefer XML, say that you like it, say that you are used to using it, but don't say that it is a fundamental requirement of the data itself because it just ain't so. > >> Rusty, you appear to be arguing from ignorance, very unusual coming >> from you. > > Funny how you confuse different experiences with ignorance. Have you > ever worked in publishing? Or in library science? Or on anything that > operates at web scale like Yahoo or Google? There are many use cases > where a couple of months of hard labor will rapidly disabuse anyone of > the belief that relational databases are the one true solution to all > problems. Your career just happens not to have taken you down those > paths yet. My observation on your arguments stems from your repeatedly ignoring obvious examples of where tables do just fine to store data, and the claim that 80% of the world's apps need an XML database. If you have gotten used to using XML for text, then say so. If you like it, then say so. Don't say it is the only tool available because it is not. It has many very serious drawbacks, verbosity being the very first, not to mention the confounding of structure and implementation, encouraging the illusion of "structureless" data, and so on. > >> The true difference between us in this argument is that I understand >> that I have a prejudice for relational over hierarchical, based on my >> knowledge and use of both, and based on judgment calls as to how to >> get through the day. I daresay however that you are promoting a >> religious favoring of XML w/o a working knowledge of the alternatives. > > Ken, you know me. Do you really think I don't know the relational > model or what it's good for? I use relational databases all the time, > and I'm using them now. However unlike you I've hit their limits. > While I'm sure many people can profitably spend their life doing > nothing but relational databases, I happen to be working on > applications where neither the relational model nor the actual SQL > databases out there can come close to managing my data. I've never > said that all applications should use XML databases or other > non-relational systems, You keep trying to put those words into my > mouth. I do say that some applications, especially in publishing and > web publishing, do not fit the relational model well and can better > served by XML databases. I do know you, and that is why I was struck by your pro-XML stance for "80% of applications", in which you must either be ignorant of what most applications really need, or what modern RDBMS's can do, or both. Forget about EF Codd and the relational model for a moment, lets just look at the real products that have come along, the table-based servers we call RDBMS's. These have all solved the very basic issues of data storage. Most of their power comes from so-called "ACID" compliance, the ability to allow multiple simultaneous users to access a data store with assurances of predictable behavior. Your XML databases must solve these same issues. What about security? The modern RDBMS defines security on all objects. Your XML databases will have to provide the ability to define security on the complete tree. (By the way, I'm sure they'll get there, just keep reading). But there is one aspect of the relational model where XML, as a format, takes a huge leap backward. Codd realized the incredible productivity gains that could be had if a programmer could access data by name and not worry about its internal storage structure. He separated the implementation from the interface. XML, as a format (file, data, whatever), confounds these two. It is a verbose format for hierarchical data. There are better formats for nearly all uses. Here's the clincher. Let's say the XML database grows up and has all of these things. On this day the only thing it will have in common with XML is a hierarchical model, the XML format itself will be the first to go. The ability to accept XQuery statements will be a historical footnote, and people will end up hating XQuery as much as they hate SQL (everybody's least favorite part of the RDBMS world). These databases will end up supporting output formats as YAML, JSON, and others, and probably inputs as well. There is just not a lot in the XML format that really makes up data storage. We can thank XML for making us conscious of the ubiquitous need for hierarchical data. I use it all of the time. Personally I store my database definitions in YAML, a hierarchical data format that is human readable/writable (unlike XML) as well as machine readable-writable. My programs return hierarchical data from AJAX requests as JSON, because that's what the browser works best with, and all of my PHP programs handle all data universally as associative arrays, which are just hierarchical data in yet another disguise. I love hierarchies, but have not use for a format that is not human readable/writable, which is incredibly verbose, and which So when I say you are arguing from ignorance, I am saying that you are generalizing your own experience with heavy-duty text management, and since you have never mentioned any of the topics above, you may not have the entire picture. Now, to your point about my own limited experience, I picked a path some years ago that has made me an expert in some areas and ignorant in others. But I don't go claiming that "80% of the worlds applications cannot use RDBMS". In fact, the examples you raise are all examples of text management. This is a new area that the RDBMS was never intended to solve. Many people have found it easily possible to extend the RDBMS in a few areas, but others (such as you) are saying we need to start over. But it is amusing that the look-again crowd has started over with hierarchical data. In the end it won't be the format that is used, but the basic abilities to manage and store text. I submit that the clear solution has yet to emerge from that pursuit. > >> You simply cannot defend a file format as a foundation for frameworks >> and databases. The best you can do is defend the model, such as the >> hierarchical model. > > XML is not a file format. We've been down this road before. A native > XML database is no more based ona file format than MySQL is based on > tab delimited text. But you are not saying what it is based upon. My statements above about ACID compliance, security, and separation of implementation from interface provide a basis for a database. The structure of the data is given by tables. This makes a complete system. If you cannot provide the basis for the entire picture of data management, we are left with what the XML books tell me: how to format the file. > >> Going further, you cannot defend a file format as a foundation for >> anything based on how it handles large text (or binary) fields. >> There are three issues here: >> >> -> Data model, hierarchical vs. relational. -> File format, XML vs >> YAML or JSON or any other format you like >> -> Handling of large text (and binary) columns. >> >> Finally, if we can all admit that XML is just a file format, then the >> entire framework crumbles as soon as somebody comes up with a better >> one, because let's admit it, XML is just about the worst you're going >> to find. > > Troll. Troll. Troll. ???? Geez Rusty, come on. My conclusion is worded harshly yes, but do you really label as a troll a description of the larger issues of formats, data models, and everything else that makes up the larger picture? > > >> In conclusion, the examples you provide appear to give advantage to >> XML because tools exist to handle data that has been buried in opaque >> formats and poorly defined structures. If the data had been >> structured properly in the first place and put into formats that were >> not so opaque, using (pardon me for saying) a *real* database, >> designed on solid principles, the examples you give become child's play. > > LOL. Seriously, try storing a book or an encyclopedia in a relational > database with anything approximating 1NF, not even 2NF. Then try and > make it perform adequately. > > Not all data fits neatly into tables. > Actually most data does not, not at first glance. But since a table is simply a mapping of properties to entities, it turns out that most data does when you look at it closely. It takes about the same effort as deciding upon a set of tags, since it is of course exactly the same process. The crucial question is, does your book have structure? Can you make up tags as you go or are you limited to a pre-defined set, such as Docbook? Once you commit to a specific set of tags, you have committed to a structure, and you may as well use tables as anything else. Methinks however that at this point it comes down to what you are comfortable with. If you want to use XML, go for it, if you want to use tables, go for it, just don't confuse the structure of the data with a fundamental need for either system. -- Kenneth Downs Secure Data Software, Inc. www.secdat.com www.andromeda-project.org 631-689-7200 Fax: 631-689-0527 cell: 631-379-0010 From david at davidmintz.org Wed Aug 29 12:53:05 2007 From: david at davidmintz.org (David Mintz) Date: Wed, 29 Aug 2007 12:53:05 -0400 Subject: [nycphp-talk] Framework poll In-Reply-To: <46D521FA.5050304@arpancs.ro> References: <46D521FA.5050304@arpancs.ro> Message-ID: <721f1cc50708290953r43121dbfyf2a5d8e3b8da952@mail.gmail.com> Yeah, tried playing with it once, declared it too complicated, moved on. On 8/29/07, Vass Arpad wrote: > > Hi everybody! > > Did you try the Qcodo Framework? > > www.qcodo.com > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- 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 ben at projectskyline.com Wed Aug 29 13:16:29 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 29 Aug 2007 13:16:29 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce References: <46D43B08.60009@beezifies.com> <70745236-EB98-4AC3-B754-4DC2A315323E@jonbaer.com> Message-ID: <010f01c7ea60$570cb8c0$6401a8c0@gamebox> Hello again, I looked at shopify, seems cool but only supports google and paypal. I dont *think* my client wants to use them. But I will double check. I've worked with the paypal IPN system for subscriptions only. Never with a cart or multiple items. John Campbell asked which of the two options my client wanted to use: I believe they want to use miva merchant to process the cards. Now, I've read through all the emails and I still don't have a firm grasp on how that works. I looked on wikipedia for a nice explanation of an e-commerce transaction, but didn't find it. Anyone know of a graphical flow chart style explanation with details on each parties responsiblity and where they fit. Anyways, the items they are selling are misc hardware items, for wells, filters, bolts, etc. All tangible goods they will be shipping. So, if I am to use miva merchant, where does the shopping cart come into play? I'm assume I have to find a shoping cart that works with Miva merchant. - Ben ----- Original Message ----- From: "Jon Baer" To: "NYPHP Talk" Sent: Tuesday, August 28, 2007 11:15 AM Subject: Re: [nycphp-talk] Two part question: Shopping carts & E-commerce > Or why even reinvent the wheel altogether ... > > http://www.shopify.com > > Worth a look I think ... > > - Jon > > On Aug 28, 2007, at 11:11 AM, Gary Mort wrote: > >> Ajai Khattri wrote: >>> Or even Google Checkout. >>> >>> >> >> I'm not thrilled with Google checkout since it requires you to have your >> customer setup a Google account(I think Amazon requires an amazon >> account, but the process just appears more streamlined and felt like >> setting up a shipping/billing subcomponent of the account rather than 2 >> accounts). >> >> Ya know, one thing that wasn't mentioned, just what ARE these 10 >> products they plan on selling? >> >> Let me explain a bit. >> >> If your selling photo's or photo related items(a poster, postcards, >> etc) - a saner solution could be to use Menalto Gallery and use their >> built in hooks to the various photo printing services. You define your >> products, the markups, etc in the printer service, and than just setup >> the online digital photos. You can even have 2 versions of the file on >> your site, one that is publicly viewable and one high quality one the >> photo service will use. >> >> If your selling stuff with emblazoned logo's, tote bags and junk, a lot >> of people use CafePress for that, and you can build your own interface >> into it to the degree you need it(from redirecting to a skinned >> cafepress store, to embedding the iutems inside your site but using >> their checkout, to having your own checkout and than you submit the >> order to cafepress and have it drop shipped to the customer). >> >> If your selling digital content, there is a whole slew of issues to >> think through regarding downloads and such. >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jakob.buchgraber at googlemail.com Wed Aug 29 16:31:49 2007 From: jakob.buchgraber at googlemail.com (Jakob Buchgraber) Date: Wed, 29 Aug 2007 22:31:49 +0200 Subject: [nycphp-talk] How to make a model/database accessible to different parts/classes of the application Message-ID: <46D5D7B5.1090505@gmail.com> Hey! I have an MVC based application and I need to have access to my Model object in different parts of the application (controller, templates(read operations), view helpers, plugins ...). So I first thought of passing it to each class that needs it, however it's not very elegant to pass it to 6 classes until it arrives at a class that actually needs it. So my second attempt was to create a singleton, but the problem is that my model needs configuration data in order to be instantiated correctly. So whenever I would call the getInstance(...) method I need to have the model's configuration data available as I can't always be sure that the getInstance method has been called before and an instance of the model class already exists. It also doesn't make sense to have a configurable singleton object as there is always one instance, no mater whether you pass different configuration data to it. Last but not least I wanted to create a Registry class, add my model to it and access it from whatever method I want. This however makes unit testing harder and has all the site effects which global variables have. So how do you handle your model/database object? What's the best way? Thanks! Jakob From arlo at icall.com Wed Aug 29 17:20:50 2007 From: arlo at icall.com (Arlo Gilbert) Date: Wed, 29 Aug 2007 17:20:50 -0400 Subject: [nycphp-talk] Full time PHP/MySQL/*nix guru needed. Message-ID: I hope this is appropriate to post. I am looking for one full time expert at PHP/MySQL/*nix... this is a great paying job, allows you to work from home, hours are flexible. Duties include maintaining code, debugging, administering systems, monitoring databases, creating new scripts to interact with our various merchant banks for an online media company. This position is great for self motivated individuals. Experience creating desktop applications (vc++, delphi) is a plus but not required. Please submit resume's to me via e-mail. Thank you, Arlo From lists at zaunere.com Wed Aug 29 17:35:49 2007 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 29 Aug 2007 17:35:49 -0400 Subject: [nycphp-talk] Full time PHP/MySQL/*nix guru needed. In-Reply-To: References: Message-ID: <003601c7ea84$9140bc70$651ba8c0@MobileZ> Hi Arlo, You may post jobs/etc to our Jobs list as well. http://lists.nyphp.org/mailman/listinfo/jobs H Arlo Gilbert wrote on Wednesday, August 29, 2007 5:21 PM: > I hope this is appropriate to post. > > I am looking for one full time expert at PHP/MySQL/*nix... this is a > great paying job, allows you to work from home, hours are flexible. > > Duties include maintaining code, debugging, administering systems, > monitoring databases, creating new scripts to interact with our > various merchant banks for an online media company. > > This position is great for self motivated individuals. > > Experience creating desktop applications (vc++, delphi) is a plus but > not required. > > Please submit resume's to me via e-mail. > > Thank you, > Arlo > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ben at projectskyline.com Wed Aug 29 18:44:03 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 29 Aug 2007 18:44:03 -0400 Subject: [nycphp-talk] PEAR CAPTCHA Problems Message-ID: <036601c7ea8e$1aab2d70$6401a8c0@gamebox> Hello, I've just written a class around the PEAR captcha code. Except, I can't get it to work. The code is included: class Captcha { private $path; public $error; function __construct($PATH) { $this->phrase = ''; $this->image = ''; $this->width = ''; $this->height = ''; $this->path = $PATH; $this->error = ''; } function GenerateCaptcha($width, $height, $options=false) { if ( !$options ) $this->GenerateCaptchaOptions($options); $captcha = TEXT_CAPTCHA::factory('Image'); $result = $captcha->init($width, $height, null, $options); if ( PEAR::isError($captcha) ) { return ($this->error = CAPTCHA_CREATE_ERROR); } $this->phrase = $captcha->getPhrase( ); $this->image = $captcha->getCAPTCHAAsJPEG( ); if ( PEAR::isError($this->image) ) { return ($this->error = CAPTCHA_IMAGE_ERROR); } $this->width = $width; $this->height = $height; $this->WriteCaptcha( ); return $this; } function WriteCaptcha( ) { $file = $this->path . md5($this->phrase) . '.jpg'; file_put_contents($file, $this->image); } function GetCaptchaFilename( ) { return md5($this->phrase) . '.jpg'; } function GenerateCaptchaOptions(&$options) { $options = array( 'font_size' => 32, 'font_path' => './', 'font_file' => 'arial.ttf' ); } } As far as I can tell, its unable to write/create the file/image. [29-Aug-2007 18:34:09] There was an error creating the captcha image Is what I am getting in my PHP logs. Now the captcha directory is chmod 777, just to see if that fixed it. It didn't. I also did a chown apache:blah captcha and that didn't work either. The code I'm using to call the CAPTCHA is: $captchaObject = new Captcha(CAPTCHA_PATH); $captchaObject->GenerateCaptcha(400, 180); if ( $captchaObject->error != '' ) { error_log($captchaObject->error); } $smartyObject->assign('captcha', $htmlObject->CreateImage( $captchaObject->GetCaptchaFilename( ), 300, 180, 'CAPTCHA')); Now, if I print_r($captchaObject) I get: [error] => There was an error creating the captcha image [phrase] => chiaprae [image] => PEAR_Error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => [message] => Error initializing Image_Text (font missing?!)I just copied this from the PEAR Apress book. Does anyone know where to get the font file,if that is indeed the error?- Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Wed Aug 29 18:58:34 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 29 Aug 2007 18:58:34 -0400 Subject: [nycphp-talk] PEAR CAPTCHA Problems In-Reply-To: <036601c7ea8e$1aab2d70$6401a8c0@gamebox> References: <036601c7ea8e$1aab2d70$6401a8c0@gamebox> Message-ID: <8f0676b40708291558u6b31caesfdb43a84c31b6cd8@mail.gmail.com> Are you on a linux server? Is freetype and the arial font installed? From ben at projectskyline.com Wed Aug 29 19:14:31 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 29 Aug 2007 19:14:31 -0400 Subject: [nycphp-talk] PEAR CAPTCHA Problems References: <036601c7ea8e$1aab2d70$6401a8c0@gamebox> <8f0676b40708291558u6b31caesfdb43a84c31b6cd8@mail.gmail.com> Message-ID: <03dc01c7ea92$5b6e5270$6401a8c0@gamebox> Hello Jon, Yes I'm on centOS, I have no idea about fonts. Where do I look. I did a "locate arial.ttf" and it found nothing. - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "John Campbell" To: "NYPHP Talk" Sent: Wednesday, August 29, 2007 6:58 PM Subject: Re: [nycphp-talk] PEAR CAPTCHA Problems > Are you on a linux server? Is freetype and the arial font installed? > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From jcampbell1 at gmail.com Wed Aug 29 19:27:04 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 29 Aug 2007 19:27:04 -0400 Subject: [nycphp-talk] PEAR CAPTCHA Problems In-Reply-To: <03dc01c7ea92$5b6e5270$6401a8c0@gamebox> References: <036601c7ea8e$1aab2d70$6401a8c0@gamebox> <8f0676b40708291558u6b31caesfdb43a84c31b6cd8@mail.gmail.com> <03dc01c7ea92$5b6e5270$6401a8c0@gamebox> Message-ID: <8f0676b40708291627v49a3a2d4nbb89778ed6900ff7@mail.gmail.com> > I did a "locate arial.ttf" > and it found nothing. Fonts should be in /usr/X11R6/lib/X11/fonts/ You probably need to install mscorefonts and freetype. From bz-gmort at beezifies.com Wed Aug 29 19:43:55 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Wed, 29 Aug 2007 19:43:55 -0400 Subject: [nycphp-talk] PEAR CAPTCHA Problems In-Reply-To: <036601c7ea8e$1aab2d70$6401a8c0@gamebox> References: <036601c7ea8e$1aab2d70$6401a8c0@gamebox> Message-ID: <46D604BB.1050007@beezifies.com> Find a ttf file, any ttf file(if your using windows, take a look in your control panel->fonts folder Upload it to the server and put it somewhere readable by your web program. Set the options appropriately, ie: |// Set CAPTCHA options (font must exist!) $options = array( 'font_size' => 24, 'font_path' => './', 'font_file' => 'COUR.TTF' ); Where font_path is the full path to your font file and font_file is your font file(make sure case matches!) Make sure to pass your options to the functions that require them. A little prayer couldn't hurt. :-) (Captcha images are a royal PITA due to the font issues, ability to write to the correct directory, and whether or not you have GD or freetype or ImageMagick or whatever they want installed) | From dell at sala.ca Wed Aug 29 20:40:24 2007 From: dell at sala.ca (Dell Sala) Date: Wed, 29 Aug 2007 20:40:24 -0400 Subject: [nycphp-talk] How to make a model/database accessible to different parts/classes of the application In-Reply-To: <46D5D7B5.1090505@gmail.com> References: <46D5D7B5.1090505@gmail.com> Message-ID: <5A31C021-DF8B-4716-B4F3-00EBE0CD7E7E@sala.ca> > [...] my second attempt was to create a singleton, but the problem > is that my model needs configuration data in order to be > instantiated correctly. So whenever I would call the getInstance > (...) method I need to have the model's configuration data > available as I can't always be sure that the getInstance method has > been called before and an instance of the model class already exists. > [...] I wanted to create a Registry class, add my model to it and > access it from whatever method I want. This however makes unit > testing harder and has all the site effects which global variables > have. Sounds like you might find some answers in reading about Dependency Injection. I've come across this recently, and it's helped my thinking around some of these issues. http://www.martinfowler.com/ articles/injection.html I think the key here is the concept of the "container". It's like a class configuration registry. There was also a good article about Dependency Injection in a recent php|architect issue: http://www.phparch.com/issue.php?mid=82 The idea of implementing a generic container seemed a little overkill for most of what I was doing. I've found myself using static methods to configure a class (rather than a singleton), and I place my configuration code in a bootstrap file. For example, the bootstrap file might look something like: require_once 'Proj/SomeModel.php'; Proj_SomeModel::configure(array( 'option1' => 'some value', 'option2' => 'another value', )); The boostrap could either be a global one, or one that could be required only when I knew I was going to work with the model. The model object would then access these static config values within the constructor when instantiating itself. Using a model becomes a simple as: require_once 'model-bootstrap.php'; $model = new Proj_SomeModel(); Don't know if this is helpful, or just rehashing things you've already tried. Care to share more details about what you've tried so far? -- Dell From ben at projectskyline.com Wed Aug 29 21:39:20 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 29 Aug 2007 21:39:20 -0400 Subject: [nycphp-talk] PEAR CAPTCHA Problems References: <036601c7ea8e$1aab2d70$6401a8c0@gamebox> <46D604BB.1050007@beezifies.com> Message-ID: <003d01c7eaa6$97e9c860$6401a8c0@gamebox> Hello, I did just as you stated. No luck. I grabbed the file from windows and mac (.ttf) checked the path, tried a few variations, and made sure the $options array had the values set before passing to the function. I want to say its a path issue, but I've tried both relative and absolute paths. Any ideas? - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Gary Mort" To: "NYPHP Talk" Sent: Wednesday, August 29, 2007 7:43 PM Subject: Re: [nycphp-talk] PEAR CAPTCHA Problems > Find a ttf file, any ttf file(if your using windows, take a look in your > control panel->fonts folder > > Upload it to the server and put it somewhere readable by your web program. > > Set the options appropriately, ie: > > |// Set CAPTCHA options (font must exist!) > $options = array( > 'font_size' => 24, > 'font_path' => './', > 'font_file' => 'COUR.TTF' > ); > > Where font_path is the full path to your font file > and font_file is your font file(make sure case matches!) > > Make sure to pass your options to the functions that require them. > > > A little prayer couldn't hurt. :-) > > (Captcha images are a royal PITA due to the font issues, ability to write > to the correct directory, and whether or not you have GD or freetype or > ImageMagick or whatever they want installed) > > > > | > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From mikesz at qualityadvantages.com Wed Aug 29 22:13:01 2007 From: mikesz at qualityadvantages.com (mikesz at qualityadvantages.com) Date: Thu, 30 Aug 2007 10:13:01 +0800 Subject: [nycphp-talk] PEAR CAPTCHA Problems In-Reply-To: <003d01c7eaa6$97e9c860$6401a8c0@gamebox> References: <036601c7ea8e$1aab2d70$6401a8c0@gamebox> <46D604BB.1050007@beezifies.com> <003d01c7eaa6$97e9c860$6401a8c0@gamebox> Message-ID: <1797489476.20070830101301@qualityadvantages.com> Hello Ben, Thursday, August 30, 2007, 9:39:20 AM, you wrote: > Hello, > I did just as you stated. No luck. > I grabbed the file from windows and mac (.ttf) checked the path, tried a few > variations, and made sure the $options array had the values set before > passing to the function. > I want to say its a path issue, but I've tried both relative and absolute > paths. > Any ideas? > - Ben > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) > Our company: www.projectskyline.com > Our products: www.project-contact.com > This e-mail is confidential information intended only for the use of the > individual to whom it is addressed. > ----- Original Message ----- > From: "Gary Mort" > To: "NYPHP Talk" > Sent: Wednesday, August 29, 2007 7:43 PM > Subject: Re: [nycphp-talk] PEAR CAPTCHA Problems >> Find a ttf file, any ttf file(if your using windows, take a look in your >> control panel->fonts folder >> >> Upload it to the server and put it somewhere readable by your web program. >> >> Set the options appropriately, ie: >> >> |// Set CAPTCHA options (font must exist!) >> $options = array( >> 'font_size' => 24, >> 'font_path' => './', >> 'font_file' => 'COUR.TTF' >> ); >> >> Where font_path is the full path to your font file >> and font_file is your font file(make sure case matches!) >> >> Make sure to pass your options to the functions that require them. >> >> >> A little prayer couldn't hurt. :-) >> >> (Captcha images are a royal PITA due to the font issues, ability to write >> to the correct directory, and whether or not you have GD or freetype or >> ImageMagick or whatever they want installed) >> >> >> >> | >> >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > __________ NOD32 2491 (20070830) Information __________ > This message was checked by NOD32 antivirus system. > http://www.eset.com Hello Ben, All the captcha scripts that I have worked with either use an explicit path to the specific font or the font has been in the same folder as the script that calls it. In your example, the font would need to be in the same folder as the script that sets up the options array, I think. HTH, -- Best regards, mikesz mailto:mikesz at qualityadvantages.com From ben at projectskyline.com Wed Aug 29 23:07:31 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Wed, 29 Aug 2007 23:07:31 -0400 Subject: [nycphp-talk] PEAR CAPTCHA Problems References: <036601c7ea8e$1aab2d70$6401a8c0@gamebox><46D604BB.1050007@beezifies.com><003d01c7eaa6$97e9c860$6401a8c0@gamebox> <1797489476.20070830101301@qualityadvantages.com> Message-ID: <005e01c7eab2$e864b1e0$6401a8c0@gamebox> Hello Mike, I did a print_r() on the object to see, and the path is correct. I also did a chmod 777 on the arial.ttf file, plus tried to chown it as well to apache. Nothing seems to work. Here is the PEAR code where its failing: $this->_imt = new Image_Text( $this->_phrase, $options ); if (PEAR::isError($this->_imt->init())) { $this->_error = PEAR::raiseError('Error initializing Image_Text (fo\ nt missing?!)'); return $this->_error; So, I hacked up the PEAR code to if (!PEAR::isError($this->_imt->init())) { continue in case of an error, and it is generating the colored textbox image w/lines and circles drawn on it, just no text. Hmmm... - Ben Hello Ben, All the captcha scripts that I have worked with either use an explicit path to the specific font or the font has been in the same folder as the script that calls it. In your example, the font would need to be in the same folder as the script that sets up the options array, I think. HTH, Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: To: "NYPHP Talk" Sent: Wednesday, August 29, 2007 10:13 PM Subject: Re[2]: [nycphp-talk] PEAR CAPTCHA Problems > Hello Ben, > > Thursday, August 30, 2007, 9:39:20 AM, you wrote: > >> Hello, > >> I did just as you stated. No luck. > >> I grabbed the file from windows and mac (.ttf) checked the path, tried a >> few >> variations, and made sure the $options array had the values set before >> passing to the function. > >> I want to say its a path issue, but I've tried both relative and absolute >> paths. > >> Any ideas? > >> - Ben > >> Ben Sgro, President >> ProjectSkyLine - Defining New Horizons >> +1 718.487.9368 (N.Y. Office) > >> Our company: www.projectskyline.com >> Our products: www.project-contact.com > >> This e-mail is confidential information intended only for the use of the >> individual to whom it is addressed. >> ----- Original Message ----- >> From: "Gary Mort" >> To: "NYPHP Talk" >> Sent: Wednesday, August 29, 2007 7:43 PM >> Subject: Re: [nycphp-talk] PEAR CAPTCHA Problems > > >>> Find a ttf file, any ttf file(if your using windows, take a look in your >>> control panel->fonts folder >>> >>> Upload it to the server and put it somewhere readable by your web >>> program. >>> >>> Set the options appropriately, ie: >>> >>> |// Set CAPTCHA options (font must exist!) >>> $options = array( >>> 'font_size' => 24, >>> 'font_path' => './', >>> 'font_file' => 'COUR.TTF' >>> ); >>> >>> Where font_path is the full path to your font file >>> and font_file is your font file(make sure case matches!) >>> >>> Make sure to pass your options to the functions that require them. >>> >>> >>> A little prayer couldn't hurt. :-) >>> >>> (Captcha images are a royal PITA due to the font issues, ability to >>> write >>> to the correct directory, and whether or not you have GD or freetype or >>> ImageMagick or whatever they want installed) >>> >>> >>> >>> | >>> >>> >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php > >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk > >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com > >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > >> __________ NOD32 2491 (20070830) Information __________ > >> This message was checked by NOD32 antivirus system. >> http://www.eset.com > > > Hello Ben, > > All the captcha scripts that I have worked with either use an explicit > path to the specific font or the font has been in the same folder as > the script that calls it. In your example, the font would need to be > in the same folder as the script that sets up the options array, I > think. > > HTH, > > -- > Best regards, > mikesz mailto:mikesz at qualityadvantages.com > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From bz-gmort at beezifies.com Thu Aug 30 08:22:35 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Thu, 30 Aug 2007 08:22:35 -0400 Subject: [nycphp-talk] Why can't I create a second directory? Message-ID: <46D6B68B.8090203@beezifies.com> I have a complex little install script that creates directories and subdirectories and copies files. It keeps failing on one providers server. I boiled down the install script problems to the fact that it cannot create a subdirectory after creating a directory. I made a simple test script, all it does is create one subdirectory, than create another inside the first. I set the mode to 777 just to make sure the directory would be created completely unsecured(I will also note that does not happen, instead the directory is created as 755 which should STILL be acceptable since the script itself is the one creating both directories and thus should be the owner). Any ideas on why the first case works and the second case does not? $path = "/var/www/vhosts/mydomain.com/httpdocs/j/components/com_test/"; $mode = 0777; if (!@mkdir(substr($path,0,-1),$mode)) { die ("Cannot create ".substr($path,0,-1)); } $path = "/var/www/vhosts/mydomain.com/httpdocs/j/components/com_test/test/"; $mode = 0777; if (!@mkdir(substr($path,0,-1),$mode)) { die ("Cannot create ".substr($path,0,-1)); } From kenneth at ylayali.net Thu Aug 30 10:45:49 2007 From: kenneth at ylayali.net (Kenneth Dombrowski) Date: Thu, 30 Aug 2007 10:45:49 -0400 Subject: [nycphp-talk] Why can't I create a second directory? In-Reply-To: <46D6B68B.8090203@beezifies.com> References: <46D6B68B.8090203@beezifies.com> Message-ID: <20070830144549.GH30169@ylayali.net> On 07-08-30 08:22 -0400, Gary Mort wrote: > > $path = "/var/www/vhosts/mydomain.com/httpdocs/j/components/com_test/test/"; > $mode = 0777; > if (!@mkdir(substr($path,0,-1),$mode)) { > die ("Cannot create ".substr($path,0,-1)); > } > Hi Gary, what does it complain about when you remove the error supression @s ? also, i'm curious, why are the calls to substr() necessary? does shelling out to mkdir work? `mkdir -p /var/www/vhosts/mydomain.com/httpdocs/j/components/com_test/test` is this a cli script, or one you trigger via apache? what user is running it & what exactly are the permissions? From bz-gmort at beezifies.com Thu Aug 30 11:33:31 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Thu, 30 Aug 2007 11:33:31 -0400 Subject: [nycphp-talk] Why can't I create a second directory? In-Reply-To: <20070830144549.GH30169@ylayali.net> References: <46D6B68B.8090203@beezifies.com> <20070830144549.GH30169@ylayali.net> Message-ID: <46D6E34B.7000308@beezifies.com> Kenneth Dombrowski wrote: > Hi Gary, > > what does it complain about when you remove the error supression @s ? > It doesn't. I am finding more and more web providers setup Apache to not give any error messages when something goes wrong. This naturally makes it more difficult to troubleshoot the problem(and when they do not allow you command line access to run it manually in their environment...) > also, i'm curious, why are the calls to substr() necessary? > It removes the trailing slash on the directory, which for some servers is necessary. Since it is done for both directories, that should not be the problem. > does shelling out to mkdir work? > > `mkdir -p /var/www/vhosts/mydomain.com/httpdocs/j/components/com_test/test` > > is this a cli script, or one you trigger via apache? what user is > running it & what exactly are the permissions? > It's triggered by Apache. Actually, it's triggered by Joomla running under Apache to create a directory. I simply tracked down where it was creating those directories and removed the extraneous bits and consolidated it down to the problematic function call(mkdir). Interestingly, I expanded my script somewhat to determine: A) The uid running the script B) The uid which owns the first directory(they are the same, so both own the same directory) C) I added an explicit call to chmod to set the first directory to 777 (this BTW is frustrating me to no end. I can't count the number of providers who do not place the web server in the same group as the user invoked for PHP scripts. Mind you, I'm not asking that the PHP scripts be in the same group as Apache, ie access to all files apache can access, I want Apache to be in the group of each PHP user therefore giving it access to any files PHP creates) This is in the interest of security - and I understand the security concerns, but the result is people using these servers end up needing to set the security of their own files to 777 to get around the server problems. Which means that they end up running less secure in the name of security) From czech at npgroup.net Thu Aug 30 11:59:27 2007 From: czech at npgroup.net (Pete Czech - New Possibilities Group, LLC) Date: Thu, 30 Aug 2007 11:59:27 -0400 Subject: [nycphp-talk] GD w/ Lots of Files Message-ID: <46D6E95F.4010902@npgroup.net> Hey all: I'm trying to process 100-150 jpgs that are 2-4 mb into smaller files. What advice/best practices can you guys share in regards to memory management? I can make my job go through about 5 before it blows up, and yes, i've upped the memory limit. I need some method to clear out memory after each loop iteration... Any ideas? Thanks, PJC -- Pete Czech Lead Guru New Possibilities Group, LLC http://npgroup.net 973.931.8283 AIM: PJCzech From dcech at phpwerx.net Thu Aug 30 12:15:04 2007 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 30 Aug 2007 12:15:04 -0400 Subject: [nycphp-talk] GD w/ Lots of Files In-Reply-To: <46D6E95F.4010902@npgroup.net> References: <46D6E95F.4010902@npgroup.net> Message-ID: <46D6ED08.1070208@phpwerx.net> Pete Czech - New Possibilities Group, LLC wrote: > I'm trying to process 100-150 jpgs that are 2-4 mb into smaller files. > What advice/best practices can you guys share in regards to memory > management? I can make my job go through about 5 before it blows up, > and yes, i've upped the memory limit. I need some method to clear out > memory after each loop iteration... Any ideas? Are you using http://php.net/imagedestroy to clear out the memory after each iteration? Dan From jcampbell1 at gmail.com Thu Aug 30 12:18:30 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 30 Aug 2007 12:18:30 -0400 Subject: [nycphp-talk] GD w/ Lots of Files In-Reply-To: <46D6E95F.4010902@npgroup.net> References: <46D6E95F.4010902@npgroup.net> Message-ID: <8f0676b40708300918jc5ea2a3y17acc06dcb90310b@mail.gmail.com> > I'm trying to process 100-150 jpgs that are 2-4 mb into smaller files. > What advice/best practices can you guys share in regards to memory > management? I can make my job go through about 5 before it blows up, > and yes, i've upped the memory limit. I need some method to clear out > memory after each loop iteration... Any ideas? If you want a quick fix, just write the output file after processing each file, and set the variable that stores the image to null. This should automatically happen if you reuse the same variables to store the image. I am curious to see how you coded this so the memory grows with each additional image. If it is a one time job, you should run the script from the command line (no time limit, or memory limit). This is not a realistic task for a web request, if you want to implement background processing then a scheduler/queue is the way to go. -John Campbell From ajai at bitblit.net Thu Aug 30 12:19:30 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 30 Aug 2007 12:19:30 -0400 (EDT) Subject: [nycphp-talk] Why can't I create a second directory? In-Reply-To: <46D6B68B.8090203@beezifies.com> Message-ID: On Thu, 30 Aug 2007, Gary Mort wrote: > I set the mode to 777 just to make sure the directory would be created > completely unsecured(I will also note that does not happen, instead the > directory is created as 755 which should STILL be acceptable since the > script itself is the one creating both directories and thus should be > the owner). That's probably were you're wrong: more often than not, the script will be running as the same user as the Apache process (after all, the Apache process hands off to the PHP module). So the script is running as "nobody" or "www" rather than the owner of the files. -- Aj. (wearing sys admin hat). From bz-gmort at beezifies.com Thu Aug 30 12:23:09 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Thu, 30 Aug 2007 12:23:09 -0400 Subject: [nycphp-talk] GD w/ Lots of Files In-Reply-To: <46D6E95F.4010902@npgroup.net> References: <46D6E95F.4010902@npgroup.net> Message-ID: <46D6EEED.5070907@beezifies.com> Pete Czech - New Possibilities Group, LLC wrote: > Hey all: > > I'm trying to process 100-150 jpgs that are 2-4 mb into smaller files. If you have shell access and either image magick or magickimage, use shalbum. Shalbum is FAST, has a lot of greate features, and zips through image files. Technically, what it does is take a directory full of images, and a bunch of parms, and creates 2 new versions of each image(a thumbnail and a fullsize), places them all in a new set of directories, and creates a simple set of HTML pages to navigate between them as a photo gallery. But I find it easy to use for practically anytime I need to create a couple hundred thumbnails and I don't want to have to deal with a PHP script timing out(if run over the web) or any other issues. From ajai at bitblit.net Thu Aug 30 12:27:00 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 30 Aug 2007 12:27:00 -0400 (EDT) Subject: [nycphp-talk] Why can't I create a second directory? In-Reply-To: <46D6E34B.7000308@beezifies.com> Message-ID: On Thu, 30 Aug 2007, bz-gmort at beezifies.com wrote: > It doesn't. I am finding more and more web providers setup Apache to > not give any error messages when something goes wrong. > > This naturally makes it more difficult to troubleshoot the problem(and > when they do not allow you command line access to run it manually in > their environment...) Do you have access to the error logs? > C) I added an explicit call to chmod to set the first directory to 777 But if your script is running as "apache" or "nobody" or "www" then that chmod is gonna fail... > providers who do not place the web server in the same group as the user > invoked for PHP scripts. Mind you, I'm not asking that the PHP scripts > be in the same group as Apache, ie access to all files apache can > access, I want Apache to be in the group of each PHP user therefore > giving it access to any files PHP creates) This is in the interest of > security - and I understand the security concerns, but the result is > people using these servers end up needing to set the security of their > own files to 777 to get around the server problems. Which means that > they end up running less secure in the name of security) Though the latest Joomla upload process uses FTP now right? Maybe your script can do the same? -- Aj. From bz-gmort at beezifies.com Thu Aug 30 12:33:13 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Thu, 30 Aug 2007 12:33:13 -0400 Subject: [nycphp-talk] Why can't I create a second directory? In-Reply-To: References: Message-ID: <46D6F149.2010602@beezifies.com> Ajai Khattri wrote: > On Thu, 30 Aug 2007, Gary Mort wrote: > > >> I set the mode to 777 just to make sure the directory would be created >> completely unsecured(I will also note that does not happen, instead the >> directory is created as 755 which should STILL be acceptable since the >> script itself is the one creating both directories and thus should be >> the owner). >> > > That's probably were you're wrong: more often than not, the script will be > running as the same user as the Apache process (after all, the Apache > process hands off to the PHP module). So the script is running as "nobody" > or "www" rather than the owner of the files. > > Not an issue in this case, since the script is creating both directories. No matter what user it is running as, it will be the owner of the directories since it is the one creating the directories. (though just to be on the safe side, I did rewrite my script to print out the uid the script was running under, and the uid of the directory and they matched. I also realized the reason I was getting 755 was due to the umask, so I just changed the initial permissions to minimal and added a call to chmod - that worked - as far as setting permissions. The dang second directory still won't create. Heck, I even put a 2 second delay between creations just in case the OS was being flaky ) More and more, I find I am spoiled with my current web provider. I never have these problems with them. Given that not being an option, give me a system I can have root on and can setup things myself. From rolan at omnistep.com Thu Aug 30 13:07:16 2007 From: rolan at omnistep.com (Rolan Yang) Date: Thu, 30 Aug 2007 13:07:16 -0400 Subject: [nycphp-talk] Why can't I create a second directory? In-Reply-To: <46D6B68B.8090203@beezifies.com> References: <46D6B68B.8090203@beezifies.com> Message-ID: <46D6F944.6070703@omnistep.com> Gary Mort wrote: > I have a complex little install script that creates directories and > subdirectories and copies files. > > It keeps failing on one providers server. > > I boiled down the install script problems to the fact that it cannot > create a subdirectory after creating a directory. > > I lost some hair over the same issue when trying to hack FsckEditor with image upload into a clients website hosted at hosting4less.com The details are kind of vague, but I remember it having something to do a php SAFE MODE restriction on mkdir and the fact that the web server was running as a different user than that owned by the user. I could create a directory, but not set the attributes for that directory. That prevented creating any futher subdirectories. I tried all sorts of hacks to circumvent this, but with no satisfactory results. The ISP does not provide shell access but I was able to get around the one-deep restriction by having the php script "ftp" into the server and do mkdir's. However, the directories were then owned by the user and not writable by the web server. Their ftp server restricted chowning or chmoding those to be world writable, so in the end, there was no way I could write files into the directories I created. Good luck with a solution. I couldn't find one. ~Rolan From czech at npgroup.net Thu Aug 30 13:14:07 2007 From: czech at npgroup.net (Pete Czech - New Possibilities Group, LLC) Date: Thu, 30 Aug 2007 13:14:07 -0400 Subject: [nycphp-talk] GD w/ Lots of Files In-Reply-To: <46D6EEED.5070907@beezifies.com> References: <46D6E95F.4010902@npgroup.net> <46D6EEED.5070907@beezifies.com> Message-ID: <46D6FADF.3090902@npgroup.net> Thanks for all the suggestions. I'm debugging it now and making sure i destroy everything. I'd send you the code but it's huge. Basically, I'm taking each photo and downsizing 4 ways per. Yes, 4. I'll check out shalbum as well - sounds great. But for this, there are associated DB calls and tons of other things I have to do. Thanks again! Gary Mort wrote: > Pete Czech - New Possibilities Group, LLC wrote: >> Hey all: >> >> I'm trying to process 100-150 jpgs that are 2-4 mb into smaller files. > If you have shell access and either image magick or magickimage, use > shalbum. > > Shalbum is FAST, has a lot of greate features, and zips through image > files. > > Technically, what it does is take a directory full of images, and a > bunch of parms, and creates 2 new versions of each image(a thumbnail > and a fullsize), places them all in a new set of directories, and > creates a simple set of HTML pages to navigate between them as a photo > gallery. > > But I find it easy to use for practically anytime I need to create a > couple hundred thumbnails and I don't want to have to deal with a PHP > script timing out(if run over the web) or any other issues. > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > -- Pete Czech Lead Guru New Possibilities Group, LLC http://npgroup.net 973.931.8283 AIM: PJCzech From bz-gmort at beezifies.com Thu Aug 30 14:41:09 2007 From: bz-gmort at beezifies.com (bz-gmort at beezifies.com) Date: Thu, 30 Aug 2007 14:41:09 -0400 Subject: [nycphp-talk] Why can't I create a second directory? In-Reply-To: <46D6F944.6070703@omnistep.com> References: <46D6B68B.8090203@beezifies.com> <46D6F944.6070703@omnistep.com> Message-ID: <46D70F45.6030708@beezifies.com> Rolan Yang wrote: > I lost some hair over the same issue when trying to hack FsckEditor > with image upload into a clients website hosted at hosting4less.com > The details are kind of vague, but I remember it having something to > do a php SAFE MODE restriction on mkdir and the fact that the web > server was running as a different user than that owned by the user. > I could create a directory, but not set the attributes for that > directory. That prevented creating any futher subdirectories. Yes, this was the error. They turned off safe mode and now it is working. Note: there was a specific note about safe mode causing problems with mkdir, but they specified it would also cause the chmod function not to work, and that it only occured if the directory owner differs from the directory creator. Since I checked all those first, and chmod would work, I assumed it was somewhere else. Thanks! From smanes at magpie.com Thu Aug 30 14:53:59 2007 From: smanes at magpie.com (Steve Manes) Date: Thu, 30 Aug 2007 14:53:59 -0400 Subject: [nycphp-talk] Why can't I create a second directory? In-Reply-To: <46D6F944.6070703@omnistep.com> References: <46D6B68B.8090203@beezifies.com> <46D6F944.6070703@omnistep.com> Message-ID: <46D71247.8010005@magpie.com> Gary Mort wrote: > I have a complex little install script that creates directories and > subdirectories and copies files. > > It keeps failing on one providers server. > > I boiled down the install script problems to the fact that it cannot > create a subdirectory after creating a directory. If you're not squeamish about shell calls and the OS supports it, try the -p option for /bin/mkdir. From ramons at gmx.net Thu Aug 30 19:12:35 2007 From: ramons at gmx.net (David Krings) Date: Thu, 30 Aug 2007 19:12:35 -0400 Subject: [nycphp-talk] Why can't I create a second directory? In-Reply-To: <46D6E34B.7000308@beezifies.com> References: <46D6B68B.8090203@beezifies.com> <20070830144549.GH30169@ylayali.net> <46D6E34B.7000308@beezifies.com> Message-ID: <46D74EE3.3080909@gmx.net> bz-gmort at beezifies.com wrote: > Kenneth Dombrowski wrote: >> Hi Gary, >> what does it complain about when you remove the error supression @s ? > > It doesn't. I am finding more and more web providers setup Apache to > not give any error messages when something goes wrong. > Just out of curiosity, why not install Apache on your own box and see what the error message is? Is there anything special about that server that cannot be replicated locally? David From bz-gmort at beezifies.com Thu Aug 30 19:43:20 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Thu, 30 Aug 2007 19:43:20 -0400 Subject: [nycphp-talk] Why can't I create a second directory? In-Reply-To: <46D74EE3.3080909@gmx.net> References: <46D6B68B.8090203@beezifies.com> <20070830144549.GH30169@ylayali.net> <46D6E34B.7000308@beezifies.com> <46D74EE3.3080909@gmx.net> Message-ID: <46D75618.8090906@beezifies.com> David Krings wrote: > bz-gmort at beezifies.com wrote: >> Kenneth Dombrowski wrote: >>> Hi Gary, >>> what does it complain about when you remove the error supression @s ? >> >> It doesn't. I am finding more and more web providers setup Apache to >> not give any error messages when something goes wrong. >> > > Just out of curiosity, why not install Apache on your own box and see > what the error message is? Is there anything special about that server > that cannot be replicated locally? > Yes, it is not a matter of a non funcitoning program. It was a program that would not function on that providers server. I test programs on my own web provider where I can enable and disable the level of error messages and whether to send them to the screen or the logfile at will - and I have access to the error log. Than I have fun trying to figure out what the provider does differently. From danielc at analysisandsolutions.com Thu Aug 30 22:48:03 2007 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 30 Aug 2007 22:48:03 -0400 Subject: [nycphp-talk] Why can't I create a second directory? In-Reply-To: <46D6E34B.7000308@beezifies.com> References: <46D6B68B.8090203@beezifies.com> <20070830144549.GH30169@ylayali.net> <46D6E34B.7000308@beezifies.com> Message-ID: <20070831024803.GA2984@panix.com> On Thu, Aug 30, 2007 at 11:33:31AM -0400, bz-gmort at beezifies.com wrote: > It doesn't. I am finding more and more web providers setup Apache to > not give any error messages when something goes wrong. You know you can most likely use ini_set('display_errors', 1) combined with ini_set('error_reporting', E_ALL) to get the errors to show up? --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 birgunjp0071 at yahoo.com Fri Aug 31 07:08:19 2007 From: birgunjp0071 at yahoo.com (birgunj birgunj) Date: Fri, 31 Aug 2007 04:08:19 -0700 (PDT) Subject: [nycphp-talk] how to prevent documents from download In-Reply-To: <22AD9319-71B7-44DC-8574-C6A0C87DBF85@jonbaer.com> Message-ID: <455483.3875.qm@web59306.mail.re1.yahoo.com> Dear All, can any body tell me how to prevent documents from download using php. thanks to all humayoo Jon Baer wrote: There is already a download progress bar in every known browser last time I checked ;-) Why replicate? On Aug 6, 2007, at 3:24 PM, csnyder wrote: > On 8/6/07, birgunj birgunj wrote: >> Dear All, >> >> i want to write script to download file.how do i display download >> bar in php >> like when download file from any site, it download bar appear, it >> show >> size of file,time etc. >> >> can any body help me how to do this. >> >> thanks humayoo > > Download is the responsibility of the client. This isn't in PHP's > domain. > > -- > Chris Snyder > http://chxo.com/ > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php --------------------------------- Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bz-gmort at beezifies.com Fri Aug 31 09:23:12 2007 From: bz-gmort at beezifies.com (Gary Mort) Date: Fri, 31 Aug 2007 09:23:12 -0400 Subject: [nycphp-talk] how to prevent documents from download In-Reply-To: <455483.3875.qm@web59306.mail.re1.yahoo.com> References: <455483.3875.qm@web59306.mail.re1.yahoo.com> Message-ID: <46D81640.3020403@beezifies.com> birgunj birgunj wrote: > Dear All, > > can any body tell me how to prevent documents from download using php. > > thanks to all > You don't. If a document is available on the web server it can be downloaded. If you provide a bit more background, there are tricks you can do with PHP to restrict access to files, but those files must NOT be publicly accessible, you basically make your php script the intermediary between the browser and the file. From ben at projectskyline.com Fri Aug 31 10:29:21 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Fri, 31 Aug 2007 10:29:21 -0400 Subject: [nycphp-talk] PEAR CAPTCHA Problems References: <036601c7ea8e$1aab2d70$6401a8c0@gamebox><46D604BB.1050007@beezifies.com><003d01c7eaa6$97e9c860$6401a8c0@gamebox><1797489476.20070830101301@qualityadvantages.com> <005e01c7eab2$e864b1e0$6401a8c0@gamebox> Message-ID: <00c201c7ebdb$531cf3c0$6401a8c0@gamebox> Hello, I'm still having CAPTCHA issues. Does anyone have experiance w/PEAR's CAPTCHA code and has it working? I'd like to see some source code. Otherwise, I might have to switch to a system that works. - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Ben Sgro (ProjectSkyLine)" To: "NYPHP Talk" Sent: Wednesday, August 29, 2007 11:07 PM Subject: Re: Re[2]: [nycphp-talk] PEAR CAPTCHA Problems > Hello Mike, > > I did a print_r() on the object to see, and the path is correct. > I also did a chmod 777 on the arial.ttf file, plus tried to chown it as > well > to apache. Nothing seems to work. > > Here is the PEAR code where its failing: > > $this->_imt = new Image_Text( > $this->_phrase, > $options > ); > > if (PEAR::isError($this->_imt->init())) { > $this->_error = PEAR::raiseError('Error initializing Image_Text > (fo\ > nt missing?!)'); > return $this->_error; > > So, I hacked up the PEAR code to > if (!PEAR::isError($this->_imt->init())) { > > continue in case of an error, and it is generating the colored textbox > image w/lines and circles > drawn on it, just no text. > > Hmmm... > > - Ben > > Hello Ben, > > All the captcha scripts that I have worked with either use an explicit > path to the specific font or the font has been in the same folder as > the script that calls it. In your example, the font would need to be > in the same folder as the script that sets up the options array, I > think. > > HTH, > > > Ben Sgro, President > ProjectSkyLine - Defining New Horizons > +1 718.487.9368 (N.Y. Office) > > Our company: www.projectskyline.com > Our products: www.project-contact.com > > This e-mail is confidential information intended only for the use of the > individual to whom it is addressed. > ----- Original Message ----- > From: > To: "NYPHP Talk" > Sent: Wednesday, August 29, 2007 10:13 PM > Subject: Re[2]: [nycphp-talk] PEAR CAPTCHA Problems > > >> Hello Ben, >> >> Thursday, August 30, 2007, 9:39:20 AM, you wrote: >> >>> Hello, >> >>> I did just as you stated. No luck. >> >>> I grabbed the file from windows and mac (.ttf) checked the path, tried a >>> few >>> variations, and made sure the $options array had the values set before >>> passing to the function. >> >>> I want to say its a path issue, but I've tried both relative and >>> absolute >>> paths. >> >>> Any ideas? >> >>> - Ben >> >>> Ben Sgro, President >>> ProjectSkyLine - Defining New Horizons >>> +1 718.487.9368 (N.Y. Office) >> >>> Our company: www.projectskyline.com >>> Our products: www.project-contact.com >> >>> This e-mail is confidential information intended only for the use of the >>> individual to whom it is addressed. >>> ----- Original Message ----- >>> From: "Gary Mort" >>> To: "NYPHP Talk" >>> Sent: Wednesday, August 29, 2007 7:43 PM >>> Subject: Re: [nycphp-talk] PEAR CAPTCHA Problems >> >> >>>> Find a ttf file, any ttf file(if your using windows, take a look in >>>> your >>>> control panel->fonts folder >>>> >>>> Upload it to the server and put it somewhere readable by your web >>>> program. >>>> >>>> Set the options appropriately, ie: >>>> >>>> |// Set CAPTCHA options (font must exist!) >>>> $options = array( >>>> 'font_size' => 24, >>>> 'font_path' => './', >>>> 'font_file' => 'COUR.TTF' >>>> ); >>>> >>>> Where font_path is the full path to your font file >>>> and font_file is your font file(make sure case matches!) >>>> >>>> Make sure to pass your options to the functions that require them. >>>> >>>> >>>> A little prayer couldn't hurt. :-) >>>> >>>> (Captcha images are a royal PITA due to the font issues, ability to >>>> write >>>> to the correct directory, and whether or not you have GD or freetype or >>>> ImageMagick or whatever they want installed) >>>> >>>> >>>> >>>> | >>>> >>>> >>>> _______________________________________________ >>>> New York PHP Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> NYPHPCon 2006 Presentations Online >>>> http://www.nyphpcon.com >>>> >>>> Show Your Participation in New York PHP >>>> http://www.nyphp.org/show_participation.php >> >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >> >>> __________ NOD32 2491 (20070830) Information __________ >> >>> This message was checked by NOD32 antivirus system. >>> http://www.eset.com >> >> >> Hello Ben, >> >> All the captcha scripts that I have worked with either use an explicit >> path to the specific font or the font has been in the same folder as >> the script that calls it. In your example, the font would need to be >> in the same folder as the script that sets up the options array, I >> think. >> >> HTH, >> >> -- >> Best regards, >> mikesz mailto:mikesz at qualityadvantages.com >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ben at projectskyline.com Fri Aug 31 10:43:42 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Fri, 31 Aug 2007 10:43:42 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce References: <46D43B08.60009@beezifies.com><70745236-EB98-4AC3-B754-4DC2A315323E@jonbaer.com> <010f01c7ea60$570cb8c0$6401a8c0@gamebox> Message-ID: <010701c7ebdd$541d13c0$6401a8c0@gamebox> Hello all, After speaking with the client about their needs, this is what I gathered: They are using the Royal Bank of Scotland, and the bank recommened they use MIVA. They want to the transactions to go through their bank as to keep their records all in one place. So, what is the next step I need to do? What additional information should I gather from the client? - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Ben Sgro (ProjectSkyLine)" To: "NYPHP Talk" Sent: Wednesday, August 29, 2007 1:16 PM Subject: Re: [nycphp-talk] Two part question: Shopping carts & E-commerce > Hello again, > > I looked at shopify, seems cool but only supports google and paypal. > I dont *think* my client wants to use them. But I will double check. > I've worked with the paypal IPN system for subscriptions only. > Never with a cart or multiple items. > > John Campbell asked which of the two options my client wanted to use: > I believe they want to use miva merchant to process the cards. > > Now, I've read through all the emails and I still don't have a firm grasp > on how that works. I looked on wikipedia for a nice explanation of an > e-commerce transaction, but didn't find it. Anyone know of a graphical > flow chart style explanation with details on each parties responsiblity > and where they fit. > > Anyways, the items they are selling are misc hardware items, for wells, > filters, bolts, etc. All tangible goods they will be shipping. > > So, if I am to use miva merchant, where does the shopping cart come into > play? I'm assume I have to find a shoping cart that works with Miva > merchant. > > - Ben > > ----- Original Message ----- > From: "Jon Baer" > To: "NYPHP Talk" > Sent: Tuesday, August 28, 2007 11:15 AM > Subject: Re: [nycphp-talk] Two part question: Shopping carts & E-commerce > > >> Or why even reinvent the wheel altogether ... >> >> http://www.shopify.com >> >> Worth a look I think ... >> >> - Jon >> >> On Aug 28, 2007, at 11:11 AM, Gary Mort wrote: >> >>> Ajai Khattri wrote: >>>> Or even Google Checkout. >>>> >>>> >>> >>> I'm not thrilled with Google checkout since it requires you to have >>> your customer setup a Google account(I think Amazon requires an amazon >>> account, but the process just appears more streamlined and felt like >>> setting up a shipping/billing subcomponent of the account rather than 2 >>> accounts). >>> >>> Ya know, one thing that wasn't mentioned, just what ARE these 10 >>> products they plan on selling? >>> >>> Let me explain a bit. >>> >>> If your selling photo's or photo related items(a poster, postcards, >>> etc) - a saner solution could be to use Menalto Gallery and use their >>> built in hooks to the various photo printing services. You define your >>> products, the markups, etc in the printer service, and than just setup >>> the online digital photos. You can even have 2 versions of the file on >>> your site, one that is publicly viewable and one high quality one the >>> photo service will use. >>> >>> If your selling stuff with emblazoned logo's, tote bags and junk, a lot >>> of people use CafePress for that, and you can build your own interface >>> into it to the degree you need it(from redirecting to a skinned >>> cafepress store, to embedding the iutems inside your site but using >>> their checkout, to having your own checkout and than you submit the >>> order to cafepress and have it drop shipped to the customer). >>> >>> If your selling digital content, there is a whole slew of issues to >>> think through regarding downloads and such. >>> _______________________________________________ >>> New York PHP Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> NYPHPCon 2006 Presentations Online >>> http://www.nyphpcon.com >>> >>> Show Your Participation in New York PHP >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From rmarscher at beaffinitive.com Fri Aug 31 11:33:04 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 31 Aug 2007 11:33:04 -0400 Subject: [nycphp-talk] how to prevent documents from download In-Reply-To: <46D81640.3020403@beezifies.com> References: <455483.3875.qm@web59306.mail.re1.yahoo.com> <46D81640.3020403@beezifies.com> Message-ID: > rgunj birgunj wrote: >> can any body tell me how to prevent documents from download using >> php. On Aug 31, 2007, at 9:23 AM, Gary Mort wrote: > You don't. You can put them out of the docroot for your webserver... but then they won't be accessible at all through your site. You can wrap the files in a php script that checks for credentials to make sure a user has access to the file, but, and I have to explain this to clients all the time, when someone views a file on the web, the file is *downloaded* to their computer for it to be viewed. There's no way to get around this. The user might have to figure out how to get it from their cache, but there's no way to let someone view a file without it being transfered to their computer and therefore it's not possible to keep a person from saving the file somewhere if they're smart enough. From ajai at bitblit.net Fri Aug 31 11:37:28 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 31 Aug 2007 11:37:28 -0400 (EDT) Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <010701c7ebdd$541d13c0$6401a8c0@gamebox> Message-ID: On Fri, 31 Aug 2007, Ben Sgro \(ProjectSkyLine\) wrote: > After speaking with the client about their needs, this is what I gathered: > They are using the Royal Bank of Scotland, and the bank recommened > they use MIVA. They want to the transactions to go through their bank > as to keep their records all in one place. > > So, what is the next step I need to do? What additional information > should I gather from the client? What is the product that's being sold? Does it ship worldwide? How complicated is there shipping methods and rates? What about sales tax / VAT? Does it need to support special promotions and/or coupons? Do they expect to manage products through a back-end application? What sort of features should that have? Any content management needed? Categories? News pages? Yeah, e-commcerce is not so simple... -- Aj. From ben at projectskyline.com Fri Aug 31 11:41:02 2007 From: ben at projectskyline.com (Ben Sgro (ProjectSkyLine)) Date: Fri, 31 Aug 2007 11:41:02 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce References: Message-ID: <014401c7ebe5$5680fac0$6401a8c0@gamebox> Hello again, Products being sold are filters, nuts & bolts, etc. Shipping is local, new england area @ most. Sales tax is not applicable in NH, where they are located. I'm not sure how they plan to manage inventory. I know they will need the ability to manage it however. - Ben Ben Sgro, President ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project-contact.com This e-mail is confidential information intended only for the use of the individual to whom it is addressed. ----- Original Message ----- From: "Ajai Khattri" To: "NYPHP Talk" Sent: Friday, August 31, 2007 11:37 AM Subject: Re: [nycphp-talk] Two part question: Shopping carts & E-commerce > On Fri, 31 Aug 2007, Ben Sgro \(ProjectSkyLine\) wrote: > >> After speaking with the client about their needs, this is what I >> gathered: >> They are using the Royal Bank of Scotland, and the bank recommened >> they use MIVA. They want to the transactions to go through their bank >> as to keep their records all in one place. >> >> So, what is the next step I need to do? What additional information >> should I gather from the client? > > What is the product that's being sold? > > Does it ship worldwide? How complicated is there shipping methods and > rates? What about sales tax / VAT? Does it need to support special > promotions and/or coupons? > > Do they expect to manage products through a back-end application? What > sort of features should that have? Any content management needed? > Categories? News pages? > > Yeah, e-commcerce is not so simple... > > -- > Aj. > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ajai at bitblit.net Fri Aug 31 12:17:20 2007 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 31 Aug 2007 12:17:20 -0400 (EDT) Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <014401c7ebe5$5680fac0$6401a8c0@gamebox> Message-ID: On Fri, 31 Aug 2007, Ben Sgro \(ProjectSkyLine\) wrote: > Products being sold are filters, nuts & bolts, etc. > > Shipping is local, new england area @ most. > > Sales tax is not applicable in NH, where they are located. > > I'm not sure how they plan to manage inventory. > I know they will need the ability to manage it however. Joomla + VirtueMart can do all this quite easily. www.joomla.org www.virtuemart.net -- Aj. From jcampbell1 at gmail.com Fri Aug 31 13:25:37 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Fri, 31 Aug 2007 13:25:37 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <010701c7ebdd$541d13c0$6401a8c0@gamebox> References: <46D43B08.60009@beezifies.com> <70745236-EB98-4AC3-B754-4DC2A315323E@jonbaer.com> <010f01c7ea60$570cb8c0$6401a8c0@gamebox> <010701c7ebdd$541d13c0$6401a8c0@gamebox> Message-ID: <8f0676b40708311025u2938c21fuc67d49e6a5a3f590@mail.gmail.com> > So, what is the next step I need to do? What additional information > should I gather from the client? Your client needs a gateway & merchant account. If you want authorize.net (as the gateway), then go to authorize.net and research the resellers. Make some recommendations to your client. Have your client call the reseller and set up an account. Once that is done, you will be good to go. All you need is the authorize.net account information. Authorize.net is supported by pretty much every cart software on the market. Keep in mind that the credit card fees are all lies. No matter what rate they advertise, it will end up being more. If it says 2.5%, that means 2.5% for a blue colored visa with no rewards program issued in Guam. Expect to pay %3.5 + .40 processing + $20-40/month for the gateway + $25 for each charge back regardless of the outcome. -John Campbell From cliff at pinestream.com Fri Aug 31 13:48:20 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 31 Aug 2007 13:48:20 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <8f0676b40708311025u2938c21fuc67d49e6a5a3f590@mail.gmail.com> Message-ID: On 8/31/07 1:25 PM, "John Campbell" wrote: > Keep in mind that the credit card fees are all lies. No matter what > rate they advertise, it will end up being more. If it says 2.5%, that > means 2.5% for a blue colored visa with no rewards program issued in > Guam. Expect to pay %3.5 + .40 processing + $20-40/month for the > gateway + $25 for each charge back regardless of the outcome. If you really want to get into the nitty-gritty, make sure you get a cost-plus account. Meaning full-transparency where you get the actually interchange rates plus the payment processor markup. From jcampbell1 at gmail.com Fri Aug 31 14:22:09 2007 From: jcampbell1 at gmail.com (John Campbell) Date: Fri, 31 Aug 2007 14:22:09 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: References: <8f0676b40708311025u2938c21fuc67d49e6a5a3f590@mail.gmail.com> Message-ID: <8f0676b40708311122r4991b32pec2febe9bcbccd20@mail.gmail.com> > If you really want to get into the nitty-gritty, make sure you get a > cost-plus account. Meaning full-transparency where you get the actually > interchange rates plus the payment processor markup. Can you get this service on turnover ~$300k? A couple of years ago I looked and couldn't find anything. Ben, The wikipedia articles on "payment gateway" and "merchant bank" are worth readying if you have not already. From cliff at pinestream.com Fri Aug 31 16:44:16 2007 From: cliff at pinestream.com (Cliff Hirsch) Date: Fri, 31 Aug 2007 16:44:16 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <8f0676b40708311122r4991b32pec2febe9bcbccd20@mail.gmail.com> Message-ID: On 8/31/07 2:22 PM, "John Campbell" wrote: >> If you really want to get into the nitty-gritty, make sure you get a >> cost-plus account. Meaning full-transparency where you get the actually >> interchange rates plus the payment processor markup. > > Can you get this service on turnover ~$300k? A couple of years ago I > looked and couldn't find anything. Not sure. You can always say you're a startup and project millions :) A little chutzpah goes a long way. From rmarscher at beaffinitive.com Fri Aug 31 22:38:02 2007 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 31 Aug 2007 22:38:02 -0400 Subject: [nycphp-talk] Two part question: Shopping carts & E-commerce In-Reply-To: <010701c7ebdd$541d13c0$6401a8c0@gamebox> References: <46D43B08.60009@beezifies.com><70745236-EB98-4AC3-B754-4DC2A315323E@jonbaer.com> <010f01c7ea60$570cb8c0$6401a8c0@gamebox> <010701c7ebdd$541d13c0$6401a8c0@gamebox> Message-ID: <7A884316-F2A6-4B6C-B10D-434175D7DA61@beaffinitive.com> On Aug 31, 2007, at 10:43 AM, Ben Sgro ((ProjectSkyLine)) wrote: > After speaking with the client about their needs, this is what I > gathered: > They are using the Royal Bank of Scotland, and the bank recommened > they use MIVA. They want to the transactions to go through their bank > as to keep their records all in one place. MIVA is an e-commerce application. They'd have to buy it if they want to use it and then you'd have to figure out how to set it up on the web server and configure it. They are books available on MIVA (I had a site a long time ago that an install of it setup by our hosting company for like $10 a month). In order to enable online transactions, MIVA needs to be configured to connect to a "merchant account" with a bank. It looks like from your statement that their merchant account is with Royal Bank of Scotland. MIVA manages inventory and provides a pretty detailed admin interface to configure how all the pages are displayed and do some nice features like spotlight certain products, have special sales, etc. You'll probably just have to created a wrapper html template that it sits inside to integrate it with the rest of the site. Assuming they have the money, I would recommend just buying whatever the bank recommends because it will probably end up being the least headache and would have the fastest turnaround time.
image1
image2image3image4
image5
image6image7image8