From mmwaldman at optonline.net Tue Sep 2 07:57:09 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Tue, 02 Sep 2008 07:57:09 -0400 Subject: [nycphp-talk] Php Debugger Message-ID: <0K6K00LSJHANP170@mta3.srv.hcvlny.cv.net> Does anyone know of a good php debuggers for the windows platform (xp)? Are there any all-in-ones for Php, javascript, etc? Michele Sovereign Sites L.L.C. Website Development Rule your domain ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From edwardpotter at gmail.com Tue Sep 2 08:04:07 2008 From: edwardpotter at gmail.com (Edward Potter) Date: Tue, 2 Sep 2008 08:04:07 -0400 Subject: [nycphp-talk] Php Debugger In-Reply-To: <0K6K00LSJHANP170@mta3.srv.hcvlny.cv.net> References: <0K6K00LSJHANP170@mta3.srv.hcvlny.cv.net> Message-ID: print "foo"; :-) On Tue, Sep 2, 2008 at 7:57 AM, (Margaret) Michele Waldman wrote: > Does anyone know of a good php debuggers for the windows platform (xp)? > > > > Are there any all-in-ones for Php, javascript, etc? > > > > Michele > > > > Sovereign Sites L.L.C. > > Website Development > > Rule your domain ... > > > > _______________________________________________ > 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 > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Blog: http://www.preceptress.com/blog Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com Projects: http://flickr.com/photos/86842405 at N00/ Store: http://astore.amazon.com/httpwwwutopic-20 From mmwaldman at optonline.net Tue Sep 2 08:07:54 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Tue, 02 Sep 2008 08:07:54 -0400 Subject: [nycphp-talk] Php Debugger In-Reply-To: Message-ID: <0K6K00L8THSLP180@mta3.srv.hcvlny.cv.net> I already use print statements. I've been programming php for about 1 1/2-2 years without a debugger. I can do it. I'm just hoping to speed up my development. I can't think of any other ways to cut corners. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Edward Potter Sent: Tuesday, September 02, 2008 8:04 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Php Debugger print "foo"; :-) On Tue, Sep 2, 2008 at 7:57 AM, (Margaret) Michele Waldman wrote: > Does anyone know of a good php debuggers for the windows platform (xp)? > > > > Are there any all-in-ones for Php, javascript, etc? > > > > Michele > > > > Sovereign Sites L.L.C. > > Website Development > > Rule your domain ... > > > > _______________________________________________ > 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 > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Blog: http://www.preceptress.com/blog Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com Projects: http://flickr.com/photos/86842405 at N00/ Store: http://astore.amazon.com/httpwwwutopic-20 _______________________________________________ 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 Sep 2 08:29:46 2008 From: ken at secdat.com (Kenneth Downs) Date: Tue, 02 Sep 2008 08:29:46 -0400 Subject: [nycphp-talk] Php Debugger In-Reply-To: <0K6K00L8THSLP180@mta3.srv.hcvlny.cv.net> References: <0K6K00L8THSLP180@mta3.srv.hcvlny.cv.net> Message-ID: <48BD31BA.8040202@secdat.com> Start out with the xdebug extension to PHP. This adds debugging abilities to PHP itself. Then from there you have to get an editor that can talk to xdebug. I have never gone ahead and done this, so I can't give specifics, but the idea is to have something that can talk back and forth to the server on a back-channel while the page is processing. Start out here: http://www.xdebug.org/docs/remote (Margaret) Michele Waldman wrote: > I already use print statements. > > I've been programming php for about 1 1/2-2 years without a debugger. > > I can do it. I'm just hoping to speed up my development. > > I can't think of any other ways to cut corners. > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On > Behalf Of Edward Potter > Sent: Tuesday, September 02, 2008 8:04 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Php Debugger > > print "foo"; :-) > > On Tue, Sep 2, 2008 at 7:57 AM, (Margaret) Michele Waldman > wrote: > >> Does anyone know of a good php debuggers for the windows platform (xp)? >> >> >> >> Are there any all-in-ones for Php, javascript, etc? >> >> >> >> Michele >> >> >> >> Sovereign Sites L.L.C. >> >> Website Development >> >> Rule your domain ... >> >> >> >> _______________________________________________ >> 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 anoland at indigente.net Tue Sep 2 08:29:59 2008 From: anoland at indigente.net (Adrian Noland) Date: Tue, 2 Sep 2008 08:29:59 -0400 Subject: [nycphp-talk] Php Debugger In-Reply-To: <0K6K00L8THSLP180@mta3.srv.hcvlny.cv.net> References: <0K6K00L8THSLP180@mta3.srv.hcvlny.cv.net> Message-ID: <1d8a0e930809020529k3fb90759k6367cc4838f561d6@mail.gmail.com> Xdebug is my personal favorite. xdebug.org. -- installs as a php module, works about the same on Linux and Windows. The venerable dbg started it all. http://dd.cron.ru/dbg/ -- can be a pain to use. Have to purchase to get latest fixes, but works for most cases. In order to see the debugging info you need an IDE. I've used both PDT and Eclipse with phpEclipse. All the Java Dev stuff makes it pretty bloated, but most of that can be removed or disabled. Recommend at least 2GB RAM. Komodo is also a good one. Not Free (or free) http://activestate.com/Products/komodo_ide/index.mhtml I tried the trial of Zend Studio once. Didn't like it because the server component requires lots more than just debugging modules. There's more: http://en.wikipedia.org/wiki/PHP_IDE On Tue, Sep 2, 2008 at 8:07 AM, (Margaret) Michele Waldman < mmwaldman at optonline.net> wrote: > I already use print statements. > > I've been programming php for about 1 1/2-2 years without a debugger. > > I can do it. I'm just hoping to speed up my development. > > I can't think of any other ways to cut corners. > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On > Behalf Of Edward Potter > Sent: Tuesday, September 02, 2008 8:04 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Php Debugger > > print "foo"; :-) > > On Tue, Sep 2, 2008 at 7:57 AM, (Margaret) Michele Waldman > wrote: > > Does anyone know of a good php debuggers for the windows platform (xp)? > > > > > > > > Are there any all-in-ones for Php, javascript, etc? > > > > > > > > Michele > > > > > > > > Sovereign Sites L.L.C. > > > > Website Development > > > > Rule your domain ... > > > > > > > > _______________________________________________ > > 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 > > > > > > -- > IM/iChat: ejpusa > Links: http://del.icio.us/ejpusa > Blog: http://www.preceptress.com/blog > Follow me: http://www.twitter.com/ejpusa > Karma: http://www.coderswithconscience.com > Projects: http://flickr.com/photos/86842405 at N00/ > Store: http://astore.amazon.com/httpwwwutopic-20 > _______________________________________________ > 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 anoland at indigente.net Tue Sep 2 08:32:49 2008 From: anoland at indigente.net (Adrian Noland) Date: Tue, 2 Sep 2008 08:32:49 -0400 Subject: [nycphp-talk] Php Debugger In-Reply-To: <1d8a0e930809020529k3fb90759k6367cc4838f561d6@mail.gmail.com> References: <0K6K00L8THSLP180@mta3.srv.hcvlny.cv.net> <1d8a0e930809020529k3fb90759k6367cc4838f561d6@mail.gmail.com> Message-ID: <1d8a0e930809020532l66ff6356uadcb85eedab8b122@mail.gmail.com> Forgot to include: http://tech.blog.box.net/2007/06/20/how-to-debug-php-with-vim-and-xdebug-on-linux/ On Tue, Sep 2, 2008 at 8:29 AM, Adrian Noland wrote: > Xdebug is my personal favorite. xdebug.org. > -- installs as a php module, works about the same on Linux and Windows. > The venerable dbg started it all. http://dd.cron.ru/dbg/ > -- can be a pain to use. Have to purchase to get latest fixes, but works > for most cases. > > In order to see the debugging info you need an IDE. > I've used both PDT and Eclipse with phpEclipse. All the Java Dev stuff > makes it pretty bloated, but most of that can be removed or disabled. > Recommend at least 2GB RAM. > Komodo is also a good one. Not Free (or free) > http://activestate.com/Products/komodo_ide/index.mhtml > > I tried the trial of Zend Studio once. Didn't like it because the server > component requires lots more than just debugging modules. > > There's more: http://en.wikipedia.org/wiki/PHP_IDE > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willie at pdfsystems.com Tue Sep 2 09:07:36 2008 From: willie at pdfsystems.com (William Klein) Date: Tue, 2 Sep 2008 09:07:36 -0400 Subject: [nycphp-talk] FDF support In-Reply-To: References: <48B94B3C.4020701@secdat.com> Message-ID: <047f01c90cfc$e5407b30$afc17190$@com> I've been using fpdf also for years. The problem I have with it is when I want to fill in a form. I know I can do that by XY coordinates but I need to set up a site where people around the country can fill in a state tax resale certificate. So there are many different forms with the same information. I did this a few years ago with JAVA and iText but I need a PHP solution, and I'd rather not figure out the XY coordinates for every states tax form. Fpdf is made for this and if the bloody thing would compile I'd be in fat city since I already have made all the state tax fpdf blank forms. > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On > Behalf Of tedd > Sent: Saturday, August 30, 2008 10:46 AM > To: NYPHP Talk > Subject: [php] Re: [nycphp-talk] FDF support > > At 9:29 AM -0400 8/30/08, Kenneth Downs wrote: > >> > >Willie, for what it's worth I've been using FPDF, > >http://www.fpdf.org since I began with PHP and > >have never had any complaints. Its function list does not appear to > >be quite as extensive as fdf, but it is rock-solid and reliable and > >well-documented, so in productivity terms I love it. > > I second that recommendation -- it works great for me -- here's an example: > > http://webbytedd.com/bb/pdf/ > > 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 ramons at gmx.net Tue Sep 2 09:08:45 2008 From: ramons at gmx.net (David Krings) Date: Tue, 02 Sep 2008 09:08:45 -0400 Subject: [nycphp-talk] Php Debugger In-Reply-To: <0K6K00L8THSLP180@mta3.srv.hcvlny.cv.net> References: <0K6K00L8THSLP180@mta3.srv.hcvlny.cv.net> Message-ID: <48BD3ADD.3060203@gmx.net> (Margaret) Michele Waldman wrote: > I already use print statements. > > I've been programming php for about 1 1/2-2 years without a debugger. > > I can do it. I'm just hoping to speed up my development. > > I can't think of any other ways to cut corners. Yes, there are debuggers for Windows. One of the popular ones is dbg, but there is also xdebug. They are usually included in an IDE, but as far as I know they can also be run on the command line, but I have no idea how that works. I use NuSphere PHPEd which comes with the commercial version of dbg. Other IDEs that use the free versions of dbg are Luckasoft's EngInSite Editor for PHP (www.enginsite.com) and PHPEdit from Waterproof (www.waterproof.fr). Waterproof gives out free licenses when you ask them for one and explain to them that you only want to use it for private projects. You can get Luckasoft's IDE for free as well if you translate the GUI strings and help file for them to a language currently not listed, otherwise you need to buy a license for a fair price. Luckasoft often bundles other apps in such as their MySQL client, which is the best MySQL client I have seen. And then there is Zend, Eclipse (you need to puzzle it together yourself, your mileage may vary, I had no mileage at all), Maguma, plugins for Microsoft VisualStudio, and others. Some even have both dbg and xdebug available, but most implement it in a way that is obstrusive to efficient development as they force a stop at start of each script file. So if you develop as I do and segment the entire project into individual script files that each include a logical module then stopping at every corner gets old really fast. NuSphere costs money, but not as much as Zend and unless you are hooked on all the Zend stuff I am convinced that NuSphere's IDE does the trick. I did some development in VB some years ago and got acustomed to the excellent IDEs from Microsoft (probably the only area where Microsoft is actually good at). NuSphere is not a VisualStudio clone, but provides the same level of luxury and all the features. And it has the debugger implemented in such a way that it does not need to stop at the start of each file, but can run through a dozen files and then stop at a break point in the 13th file. NuSphere's IDE also comes with its own web server so you don't need to fork around in the Apache config file to get the debugger dll loaded and working (although, that is quite easy with Apache). NuSphere has also internal browsers and you can switch between IE and Mozilla engines, but you can also use an external browser and still have the full debugging capabilities. And that will allow for example to add additional debuggers to Firefox so that you can debug client side scripts (which is why I doubt that there is an all inclusive debugger as PHP is server side and ECMAScript is client side). If you are interested in NuSphere's IDE, I have version 5.0 that I would pass on for a small compensation. It allows getting the upgrade to the current 5.5 for 39$. I think that is dirt cheap, even the other pricing isn't as ridiculous as that from Zend, but Zend gives you everything and two kitchen sinks. It depends on what you need. I used a trial of Zend Studio for a few days and then gave up. I just couldn't figure anything out. IMHO Zend Studio is the opposite of "intuitive". What is interesting is that several tests have shown that the performance of the XAMPP stack on Windows is better than on Linux, so developing PHP on Windows isn't that off the mark as some may claim. I use the XAMPP from apachefriends.org as 'production' server, there are other providers of XAMPP stacks, but I found the one from apachefriends to be the best. HTH, David From lists at zaunere.com Tue Sep 2 10:32:54 2008 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 2 Sep 2008 10:32:54 -0400 Subject: [nycphp-talk] Dynamic/Scripting Languages Message-ID: <00a101c90d08$c9855df0$5c9019d0$@com> Hello all, hope the weekend was good. Some food for thought for the Fall: http://www.cio.com/article/446829/PHP_JavaScript_Ruby_Perl_Python_and_Tcl_To day_The_State_of_the_Scripting_Universe or: http://tinyurl.com/55tpka Aside from the two pop-ups, an interesting read. --- Hans Zaunere / Managing Member / New York PHP www.nyphp.org / ?www.nyphp.com From ioplex at gmail.com Tue Sep 2 11:43:08 2008 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 2 Sep 2008 11:43:08 -0400 Subject: [nycphp-talk] FDF support In-Reply-To: <047f01c90cfc$e5407b30$afc17190$@com> References: <48B94B3C.4020701@secdat.com> <047f01c90cfc$e5407b30$afc17190$@com> Message-ID: <78c6bd860809020843o2e6d08f4rfce5f032ff0b8d34@mail.gmail.com> On Tue, Sep 2, 2008 at 9:07 AM, William Klein wrote: > states tax form. Fpdf is made for this and if the bloody thing would > compile I'd be in fat city since I already have made all the state tax fpdf > blank forms. The ./configure script keeps a config.log in current directory of all of the tests it's tried. Usually the tests involve dynamically creating a small test program and then trying to compile it. If that compilation failed, you should see the compiler error. It could be just a missing dependency that the vendor didn't anticipate or it could be that PHP uses a specific API that isn't present in the library you want to use. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From willie at pdfsystems.com Tue Sep 2 14:11:32 2008 From: willie at pdfsystems.com (William Klein) Date: Tue, 2 Sep 2008 14:11:32 -0400 Subject: [nycphp-talk] FDF support In-Reply-To: <78c6bd860809020843o2e6d08f4rfce5f032ff0b8d34@mail.gmail.com> References: <48B94B3C.4020701@secdat.com> <047f01c90cfc$e5407b30$afc17190$@com> <78c6bd860809020843o2e6d08f4rfce5f032ff0b8d34@mail.gmail.com> Message-ID: <04cb01c90d27$5b205120$1160f360$@com> > The ./configure script keeps a config.log in current directory of all > of the tests it's tried. Usually the tests involve dynamically > creating a small test program and then trying to compile it. If that > compilation failed, you should see the compiler error. It could be > just a missing dependency that the vendor didn't anticipate or it > could be that PHP uses a specific API that isn't present in the > library you want to use. Excellent advice, thank you, that told me quite a bit. The relevant log entrys are: configure:32582: checking for FDF support configure:32800: checking for FDFOpen in -lFdfTk configure:32819: gcc -o conftest -g -O2 -Wl,-rpath,/usr//lib -L/usr//lib -lm conftest.c -lFdfTk -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm 1>&5 /usr/bin/ld: skipping incompatible /usr//lib/libm.so when searching for -lm /usr/bin/ld: skipping incompatible /usr//lib/libm.a when searching for -lm /usr/bin/ld: skipping incompatible /usr//lib/libFdfTk.so when searching for -lFdfTk /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../libFdfTk.so when searching for -lFdfTk /usr/bin/ld: skipping incompatible /usr/local/lib/libFdfTk.so when searching for -lFdfTk /usr/bin/ld: skipping incompatible /usr/lib/libFdfTk.so when searching for -lFdfTk /usr/bin/ld: cannot find -lFdfTk collect2: ld returned 1 exit status configure: failed program was: #line 32808 "configure" So a bit of googling and I find this usually means there are 32 bit libraries that are for some reason incompatible with 64 bit libraries. The things I've read say link the incompatible libraries to their 64 bit versions. Since the Adobe toolkit is distributed in binary form, I'm guessing it's 32 bit, I'm not sure how to get around it. I don't particularly want to reformat the server with a 32 bit OS. I'm thinking the difference between a 64 and 32 bit version is minimal. Is there a way of forcing php to compile in 32 bit mode? From ameseguer at gmail.com Tue Sep 2 16:16:30 2008 From: ameseguer at gmail.com (=?ISO-8859-1?Q?@ndr=E9s?=) Date: Tue, 2 Sep 2008 14:16:30 -0600 Subject: [nycphp-talk] Php Debugger In-Reply-To: <48BD3ADD.3060203@gmx.net> References: <0K6K00L8THSLP180@mta3.srv.hcvlny.cv.net> <48BD3ADD.3060203@gmx.net> Message-ID: <2d0b1cd70809021316j503a96e0r776a182973a9ae4a@mail.gmail.com> www.*firephp*.org/ It's like coding print sentences but without being intrusive to the layout/presentation layer On Tue, Sep 2, 2008 at 7:08 AM, David Krings wrote: > (Margaret) Michele Waldman wrote: > >> I already use print statements. >> >> I've been programming php for about 1 1/2-2 years without a debugger. >> >> I can do it. I'm just hoping to speed up my development. >> >> I can't think of any other ways to cut corners. >> > > Yes, there are debuggers for Windows. One of the popular ones is dbg, but > there is also xdebug. They are usually included in an IDE, but as far as I > know they can also be run on the command line, but I have no idea how that > works. > > I use NuSphere PHPEd which comes with the commercial version of dbg. Other > IDEs that use the free versions of dbg are Luckasoft's EngInSite Editor for > PHP (www.enginsite.com) and PHPEdit from Waterproof (www.waterproof.fr). > Waterproof gives out free licenses when you ask them for one and explain to > them that you only want to use it for private projects. You can get > Luckasoft's IDE for free as well if you translate the GUI strings and help > file for them to a language currently not listed, otherwise you need to buy > a license for a fair price. Luckasoft often bundles other apps in such as > their MySQL client, which is the best MySQL client I have seen. And then > there is Zend, Eclipse (you need to puzzle it together yourself, your > mileage may vary, I had no mileage at all), Maguma, plugins for Microsoft > VisualStudio, and others. Some even have both dbg and xdebug available, but > most implement it in a way that is obstrusive to efficient development as > they force a stop at start of each script file. So if you develop as I do > and segment the entire project into individual script files that each > include a logical module then stopping at every corner gets old really fast. > NuSphere costs money, but not as much as Zend and unless you are hooked on > all the Zend stuff I am convinced that NuSphere's IDE does the trick. I did > some development in VB some years ago and got acustomed to the excellent > IDEs from Microsoft (probably the only area where Microsoft is actually good > at). NuSphere is not a VisualStudio clone, but provides the same level of > luxury and all the features. And it has the debugger implemented in such a > way that it does not need to stop at the start of each file, but can run > through a dozen files and then stop at a break point in the 13th file. > NuSphere's IDE also comes with its own web server so you don't need to fork > around in the Apache config file to get the debugger dll loaded and working > (although, that is quite easy with Apache). NuSphere has also internal > browsers and you can switch between IE and Mozilla engines, but you can also > use an external browser and still have the full debugging capabilities. And > that will allow for example to add additional debuggers to Firefox so that > you can debug client side scripts (which is why I doubt that there is an all > inclusive debugger as PHP is server side and ECMAScript is client side). > If you are interested in NuSphere's IDE, I have version 5.0 that I would > pass on for a small compensation. It allows getting the upgrade to the > current 5.5 for 39$. I think that is dirt cheap, even the other pricing > isn't as ridiculous as that from Zend, but Zend gives you everything and two > kitchen sinks. It depends on what you need. I used a trial of Zend Studio > for a few days and then gave up. I just couldn't figure anything out. IMHO > Zend Studio is the opposite of "intuitive". > What is interesting is that several tests have shown that the performance > of the XAMPP stack on Windows is better than on Linux, so developing PHP on > Windows isn't that off the mark as some may claim. I use the XAMPP from > apachefriends.org as 'production' server, there are other providers of > XAMPP stacks, but I found the one from apachefriends to be the best. > > HTH, > > 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 > -- Andr?s Meseguer Rojas http://www.ic-itcr.ac.cr/about/ameseguer -------------- next part -------------- An HTML attachment was scrubbed... URL: From ps at sun-code.com Tue Sep 2 20:16:54 2008 From: ps at sun-code.com (Peter Sawczynec) Date: Tue, 2 Sep 2008 20:16:54 -0400 Subject: [nycphp-talk] PHP to Online Payment Processing Message-ID: <000001c90d5a$5f7a7b50$1e6f71f0$@com> I know that with PHP (and, of course, without PHP) it is a snap to create something like an online Contribute button on a web site that hooks to PayPal for credit card contribution/payment processing. But, client doesn't want to use PayPal. So is anyone aware of any other similar or alternate service provider(s) that can very similarly allow users to contribute online to something like a medical center construction fund. So that the client can likely set up an account with the provider and then users can uncomplicatedly contribute online to the fund via a major credit card(s). Warmest regards, ? Peter Sawczynec Technology Dir. Sun-code Interactive Sun-code.com 941.893.0396 ps at sun-code.com From ka at kacomputerconsulting.com Tue Sep 2 20:24:00 2008 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Tue, 2 Sep 2008 17:24:00 -0700 Subject: [nycphp-talk] PHP to Online Payment Processing Message-ID: <1220401440.6583@coral.he.net> Peter -- for people who do a lot of international sales and need fraud protection, WorldPay is a decent option that some are using. It's not as easy to set up as Paypal but not too onerous. Documentation was good a few years back at least. -- Kristina > I know that with PHP (and, of course, without PHP) it is a snap to > create something like an online Contribute button on a web site that > hooks to PayPal for credit card contribution/payment processing. > > But, client doesn't want to use PayPal. > > So is anyone aware of any other similar or alternate service provider (s) > that can very similarly allow users to contribute online to something > like a medical center construction fund. So that the client can likely > set up an account with the provider and then users can uncomplicatedly > contribute online to the fund via a major credit card(s). > > Warmest regards, > ? > Peter Sawczynec > Technology Dir. > Sun-code Interactive > Sun-code.com > 941.893.0396 > ps at sun-code.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 Tue Sep 2 20:29:07 2008 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 2 Sep 2008 20:29:07 -0400 Subject: [nycphp-talk] Foo_Shape_Circle class naming convention from where? Message-ID: <78c6bd860809021729k2ed9944ehe4342d205f4f7e09@mail.gmail.com> I'm just curious but does anyone know what the origin of the class underscore per-directory naming convention used by some frameworks is? Meaning, a class with a name like: Zend_Auth_Adapter_Ldap would have a script file path that ends with: /Zend/Auth/Adapter/Ldap.php Also, do people sense a trend in the PHP community to follow this convention? If you were to encounter a library that used this convention, would it be considered a positive quality? Mike From ioplex at gmail.com Tue Sep 2 20:34:16 2008 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 2 Sep 2008 20:34:16 -0400 Subject: [nycphp-talk] Constants interfaces Message-ID: <78c6bd860809021734k5b786d14yfa11c8323c3ee5b6@mail.gmail.com> How do people feel about the use of Java-ist "Constants" interfaces like: interface Sql_Constants { const SELECT = 1; const FROM = 2; const WHERE = 3; const NOT = 4; .... } where the objective is to permit any class that needs these constants to access them using "self" like: require_once 'Sql/Constants.php'; class Sql_Parser implements Sql_Constants { public function parse($sql) { ... if ($tokenCode === self::WHERE) { ... Mike From ioplex at gmail.com Tue Sep 2 20:46:25 2008 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 2 Sep 2008 20:46:25 -0400 Subject: [nycphp-talk] PHP to Online Payment Processing In-Reply-To: <000001c90d5a$5f7a7b50$1e6f71f0$@com> References: <000001c90d5a$5f7a7b50$1e6f71f0$@com> Message-ID: <78c6bd860809021746l5cd3c997rfc2be1d2ec9015f0@mail.gmail.com> On Tue, Sep 2, 2008 at 8:16 PM, Peter Sawczynec wrote: > I know that with PHP (and, of course, without PHP) it is a snap to > create something like an online Contribute button on a web site that > hooks to PayPal for credit card contribution/payment processing. > > But, client doesn't want to use PayPal. > > So is anyone aware of any other similar or alternate service provider(s) > that can very similarly allow users to contribute online to something > like a medical center construction fund. So that the client can likely > set up an account with the provider and then users can uncomplicatedly > contribute online to the fund via a major credit card(s). Authorize.Net is popular. You can find PHP classes that interface with their payment gateways (although I never used them myself). But regardless of what payment gateway provider you use, you'll first need a merchant account that supports that provider. The merchant account is acting as a bank in this case. The payment gateway just handles the transaction details, auditing numbers, refunds, etc. Note that by default MasterCard and VISA is all you get by default. For AMEX, Discover and others you'll need to take additional steps and pay additional fees. Also, note that CC processing is actually a little expensive. It's about $40 a month if you have no sales whatsoever and then an additional 2-4% of each purchase depending on the customer's bank location. Finally, just a thought, but if you're taking donations you might have additional tax responsibilities. Not sure, but if I donated $1000 to building a medical center I would probably want something to prove my deduction to The Man if necessary. Mike From ben at projectskyline.com Tue Sep 2 20:48:13 2008 From: ben at projectskyline.com (Ben Sgro) Date: Tue, 02 Sep 2008 20:48:13 -0400 Subject: [nycphp-talk] Foo_Shape_Circle class naming convention from where? In-Reply-To: <78c6bd860809021729k2ed9944ehe4342d205f4f7e09@mail.gmail.com> References: <78c6bd860809021729k2ed9944ehe4342d205f4f7e09@mail.gmail.com> Message-ID: <48BDDECD.5070808@projectskyline.com> Hello, Yes, I follow this name space / naming convention. Learned from Zend and kept using. Since PHP doesn't support namespaces (like java) I guess the next best thing is the "Zend_Auth_.." style. - Ben Michael B Allen wrote: > I'm just curious but does anyone know what the origin of the class > underscore per-directory naming convention used by some frameworks is? > > Meaning, a class with a name like: > > Zend_Auth_Adapter_Ldap > > would have a script file path that ends with: > > /Zend/Auth/Adapter/Ldap.php > > Also, do people sense a trend in the PHP community to follow this convention? > > If you were to encounter a library that used this convention, would it > be considered a positive quality? > > 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 pmjones88 at gmail.com Tue Sep 2 21:06:05 2008 From: pmjones88 at gmail.com (Paul M Jones) Date: Tue, 2 Sep 2008 20:06:05 -0500 Subject: [nycphp-talk] Foo_Shape_Circle class naming convention from where? In-Reply-To: <78c6bd860809021729k2ed9944ehe4342d205f4f7e09@mail.gmail.com> References: <78c6bd860809021729k2ed9944ehe4342d205f4f7e09@mail.gmail.com> Message-ID: On Sep 2, 2008, at 19:29 , Michael B Allen wrote: > I'm just curious but does anyone know what the origin of the class > underscore per-directory naming convention used by some frameworks is? > > Meaning, a class with a name like: > > Zend_Auth_Adapter_Ldap > > would have a script file path that ends with: > > /Zend/Auth/Adapter/Ldap.php To the best of my knowledge, it originated in the PEAR project ... http://pear.php.net ... and it was adopted by lots of other projects thereafter, not just frameworks. > Also, do people sense a trend in the PHP community to follow this > convention? I do; but then, I am biased in favor of it.. ;-) > If you were to encounter a library that used this convention, would it > be considered a positive quality? I would. -- Paul M. Jones http://paul-m-jones.com/ From dan.horning at planetnoc.com Tue Sep 2 21:42:12 2008 From: dan.horning at planetnoc.com (Dan Horning) Date: Tue, 02 Sep 2008 21:42:12 -0400 Subject: [nycphp-talk] PHP to Online Payment Processing In-Reply-To: <000001c90d5a$5f7a7b50$1e6f71f0$@com> References: <000001c90d5a$5f7a7b50$1e6f71f0$@com> Message-ID: <1220406132.10840.7.camel@dan-linux-home.nycap.rr.com> I can help you get that setup - i use it for a few clients... a couple of options exist as well paypal pro is nice 2checkout.com ... but make sure they can use it - i think as long as they are a 501/3c thing e-onlinedata options authorize.net - https://www.e-onlinedata.com/amerids Plug'n'pay - https://www.e-onlinedata.com/amerids chargeeasy - https://www.e-onlinedata.com/ameridsce (in person) Retail - https://www.e-onlinedata.com/ameridsre (also in person) i can help with the software for these if you need it php i assume -dan On Tue, 2008-09-02 at 20:16 -0400, Peter Sawczynec wrote: > I know that with PHP (and, of course, without PHP) it is a snap to > create something like an online Contribute button on a web site that > hooks to PayPal for credit card contribution/payment processing. > > But, client doesn't want to use PayPal. > > So is anyone aware of any other similar or alternate service provider(s) > that can very similarly allow users to contribute online to something > like a medical center construction fund. So that the client can likely > set up an account with the provider and then users can uncomplicatedly > contribute online to the fund via a major credit card(s). > > Warmest regards, > > Peter Sawczynec > Technology Dir. > Sun-code Interactive > Sun-code.com > 941.893.0396 > ps at sun-code.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 -- Dan Horning American Digital Services - Where you are only limited by imagination. direct 1-866-493-4218 . main 1-800-863-3854 . fax 1-888-474-6133 dan.horning at planetnoc.com http://www.americandigitalservices.com From mikesz at qualityadvantages.com Tue Sep 2 22:07:20 2008 From: mikesz at qualityadvantages.com (mikesz at qualityadvantages.com) Date: Wed, 3 Sep 2008 10:07:20 +0800 Subject: [nycphp-talk] PHP to Online Payment Processing In-Reply-To: <1220401440.6583@coral.he.net> References: <1220401440.6583@coral.he.net> Message-ID: <1569232565.20080903100720@qualityadvantages.com> Hello Kristina, Wednesday, September 3, 2008, 8:24:00 AM, you wrote: > Peter -- for people who do a lot of international sales and need fraud > protection, WorldPay is a decent option that some are using. > It's not as easy to set up as Paypal but not too onerous. > Documentation was good a few years back at least. > -- Kristina >> I know that with PHP (and, of course, without PHP) it is a snap to >> create something like an online Contribute button on a web site that >> hooks to PayPal for credit card contribution/payment processing. >> >> But, client doesn't want to use PayPal. >> >> So is anyone aware of any other similar or alternate service provider > (s) >> that can very similarly allow users to contribute online to something >> like a medical center construction fund. So that the client can likely >> set up an account with the provider and then users can uncomplicatedly >> contribute online to the fund via a major credit card(s). >> >> Warmest regards, >> ? >> Peter Sawczynec >> Technology Dir. >> Sun-code Interactive >> Sun-code.com >> 941.893.0396 >> ps at sun-code.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 > __________ Information from ESET Smart Security, version of virus > signature database 3409 (20080902) __________ > The message was checked by ESET Smart Security. > http://www.eset.com If memory serves me, WorldPay has horrendous setup fees for a small site operation. Correct me if I am wrong but... http://www.worldpay.com/business/content.php?page=pricing2&c=UK -- Best regards, mikesz mailto:mikesz at qualityadvantages.com From danielc at analysisandsolutions.com Tue Sep 2 23:12:00 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 2 Sep 2008 23:12:00 -0400 Subject: [nycphp-talk] Module Organization ideas... In-Reply-To: <322675432.20080826114505@qualityadvantages.com> References: <322675432.20080826114505@qualityadvantages.com> Message-ID: <20080903031200.GA14297@panix.com> Hi Mike: I'm a bit late, but hey... > I am thinking that maybe I need to break up the second function into a > more specific set of functions The structure your code takes doesn't matter at all. You have a set of steps you have to take. It doesn't matter if you write them all in line or in five hundred separate functions. What you need is good debugging/logging code. At each critical step (like a call to PHP's mail() function, for example), log the parameters you passed and the response that came back. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From ajai at bitblit.net Wed Sep 3 00:06:52 2008 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 3 Sep 2008 00:06:52 -0400 (EDT) Subject: [nycphp-talk] Foo_Shape_Circle class naming convention from where? In-Reply-To: Message-ID: On Tue, 2 Sep 2008, Paul M Jones wrote: > To the best of my knowledge, it originated in the PEAR project ... > > http://pear.php.net > > ... and it was adopted by lots of other projects thereafter, not just > frameworks. Im probably showing my age here, but its pretty common on COBOL and Lisp :-) -- Aj. From arzala at gmail.com Wed Sep 3 00:34:27 2008 From: arzala at gmail.com (Anirudh Zala) Date: Wed, 3 Sep 2008 10:04:27 +0530 Subject: [nycphp-talk] Constants interfaces In-Reply-To: <78c6bd860809021734k5b786d14yfa11c8323c3ee5b6@mail.gmail.com> References: <78c6bd860809021734k5b786d14yfa11c8323c3ee5b6@mail.gmail.com> Message-ID: <200809031004.27235.arzala@gmail.com> On Wednesday 03 September 2008 06:04:16 Michael B Allen wrote: > How do people feel about the use of Java-ist "Constants" interfaces like: > > interface Sql_Constants > { > > const SELECT = 1; > const FROM = 2; > const WHERE = 3; > const NOT = 4; > .... > > } > > where the objective is to permit any class that needs these constants > to access them using "self" like: > > require_once 'Sql/Constants.php'; > > class Sql_Parser implements Sql_Constants > { > > public function parse($sql) > { > ... > if ($tokenCode === self::WHERE) { Hello Mike Defining interface constants, according to me, is not good design pattern even if it is enabled later in PHP. Reason behind this is that Interfaces are primarily designed to define types and not to hold data. As well as when any class implements any Interface it means it will be implementing all the Methods defined in Interface. This is not required in case of Constants that means primary purpose of Interface (what is defined in the Interface must be implemented) is not met. There are certain disadvantages also as mentioned in below thread. http://www.trap17.com/forums/constant-interface-constant-class-t59974.html Thanks Anirudh Zala > ... > > 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 Sep 3 02:07:29 2008 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 3 Sep 2008 02:07:29 -0400 Subject: [nycphp-talk] Constants interfaces In-Reply-To: <200809031004.27235.arzala@gmail.com> References: <78c6bd860809021734k5b786d14yfa11c8323c3ee5b6@mail.gmail.com> <200809031004.27235.arzala@gmail.com> Message-ID: <78c6bd860809022307j48caafd7lf8dda6a719afb2bf@mail.gmail.com> On Wed, Sep 3, 2008 at 12:34 AM, Anirudh Zala wrote: > On Wednesday 03 September 2008 06:04:16 Michael B Allen wrote: >> How do people feel about the use of Java-ist "Constants" interfaces like: >> >> interface Sql_Constants >> { >> >> const SELECT = 1; >> const FROM = 2; >> const WHERE = 3; >> const NOT = 4; >> .... >> >> } >> >> where the objective is to permit any class that needs these constants >> to access them using "self" like: >> >> require_once 'Sql/Constants.php'; >> >> class Sql_Parser implements Sql_Constants >> { >> >> public function parse($sql) >> { >> ... >> if ($tokenCode === self::WHERE) { > > Hello Mike > > Defining interface constants, according to me, is not good design pattern even > if it is enabled later in PHP. > > Reason behind this is that Interfaces are primarily designed to define types > and not to hold data. That would not be true if the constants represented an enum or more generally values that never change. An enum defines a type that can be a specific subset of values. I think that qualifies as part of an interface definition. A constant could be thought of as a method that accepts no parameters and always returns the same value. Consider the following: interface Math_Constants { const PI = 3.14159265; I think PI would qualify as part of an interface definition. The value of PI will never change. However, if for example the interface were used to "define" database connection parameters then that would be a gross violation of an interface definition (and a poor use of const in general). Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From ps at sun-code.com Wed Sep 3 07:04:15 2008 From: ps at sun-code.com (Peter Sawczynec) Date: Wed, 3 Sep 2008 07:04:15 -0400 Subject: [nycphp-talk] Dynamic/Scripting Languages In-Reply-To: <00a101c90d08$c9855df0$5c9019d0$@com> References: <00a101c90d08$c9855df0$5c9019d0$@com> Message-ID: <000001c90db4$ceb9d790$6c2d86b0$@com> Very nice read thank you. Ahhh, so then where and/or what's next. Now that AJAX and AJAX-like technique in the new browser/desktop environment is rapidly becoming a defacto standard and google has rolled out their new Chrome browser (the thin edge of the wedge in the google adhoc, distributed, net browser/OS initiative up against hemmed-in MSFT) which behaves very AJAX like. (I downloaded Chrome. It does have a nice business-like, stay out of your way feel. Positions your bookmarks collection on the right. Which for a rightie, does seem to feel like a natural place to have them. For me the right hand bookmarks feel so natural, it almost doesn't feel natural.) So going mobile. Mobile platform -- that is what it next (actually now). And like AJAX, mobile didn't announce itself. It just happened everywhere, at the same time. Mobile phone = Calendar/planner, contacts, GPS w/ text to speech turn-by-turn instructions, wi-fi connection, browser interface to web, 911 emergency tool, weather, news, camera, webcam, game console, music player, video player, TV, walkie talkie, pdf reader, Flash player, JAVA platform, email send/receive, texting, call log and lastly phone calls. All timed, merchandised in flexible contract and non-contract configs, and parentally-controlled (if desired), while packaged in an infinite array of sizes, materials, user customizable interfaces and audio stylings. Excellent pictorial roundup of best in class businessy Smartphones (non- iPhone) overview here: http://www.informationweek.com/news/personal_tech/smartphones/showArticl e.jhtml?articleID=209101183 Warmest mobile regards, ? Peter Sawczynec Technology Dir. Sun-code Interactive Sun-code.com 941.893.0396 ps at sun-code.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Hans Zaunere Sent: Tuesday, September 02, 2008 10:33 AM To: 'NYPHP Talk' Subject: [nycphp-talk] Dynamic/Scripting Languages Hello all, hope the weekend was good. Some food for thought for the Fall: http://www.cio.com/article/446829/PHP_JavaScript_Ruby_Perl_Python_and_Tc l_To day_The_State_of_the_Scripting_Universe or: http://tinyurl.com/55tpka Aside from the two pop-ups, an interesting read. --- Hans Zaunere / Managing Member / New York PHP www.nyphp.org / ?www.nyphp.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 bzcoder at bzcode.com Wed Sep 3 09:04:57 2008 From: bzcoder at bzcode.com (bzcoder) Date: Wed, 03 Sep 2008 09:04:57 -0400 Subject: [nycphp-talk] PHP to Online Payment Processing In-Reply-To: <000001c90d5a$5f7a7b50$1e6f71f0$@com> References: <000001c90d5a$5f7a7b50$1e6f71f0$@com> Message-ID: <48BE8B79.7070403@bzcode.com> Peter Sawczynec wrote: > I know that with PHP (and, of course, without PHP) it is a snap to > create something like an online Contribute button on a web site that > hooks to PayPal for credit card contribution/payment processing. > > But, client doesn't want to use PayPal. > Amazon Honor System is one alternative for donations. From kenneth at ylayali.net Wed Sep 3 09:41:12 2008 From: kenneth at ylayali.net (Kenneth Dombrowski) Date: Wed, 3 Sep 2008 09:41:12 -0400 Subject: [nycphp-talk] Constants interfaces In-Reply-To: <78c6bd860809022307j48caafd7lf8dda6a719afb2bf@mail.gmail.com> References: <78c6bd860809021734k5b786d14yfa11c8323c3ee5b6@mail.gmail.com> <200809031004.27235.arzala@gmail.com> <78c6bd860809022307j48caafd7lf8dda6a719afb2bf@mail.gmail.com> Message-ID: <20080903134112.GA23393@ylayali.net> Hi Michael, I have to disagree. On 08-09-03 02:07 -0400, Michael B Allen wrote: > > Consider the following: > > interface Math_Constants { > > const PI = 3.14159265; No, that's not at all what an interface is for. An interface is nothing more than a contract which specifies what methods its implementors must define, it is not a sneaky way to implement multiple inheritance > I think PI would qualify as part of an interface definition. The value > of PI will never change. If it will never change, there is no value in including it as part of an interface definition Some libs with a lot of constants define a dedicated class for them, others implement them in a parent class, both are valid strategies which make sense in different situations Kenneth From ioplex at gmail.com Wed Sep 3 13:04:00 2008 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 3 Sep 2008 13:04:00 -0400 Subject: [nycphp-talk] Constants interfaces In-Reply-To: <20080903134112.GA23393@ylayali.net> References: <78c6bd860809021734k5b786d14yfa11c8323c3ee5b6@mail.gmail.com> <200809031004.27235.arzala@gmail.com> <78c6bd860809022307j48caafd7lf8dda6a719afb2bf@mail.gmail.com> <20080903134112.GA23393@ylayali.net> Message-ID: <78c6bd860809031004g9e8d520j6d68e737e5da1328@mail.gmail.com> On Wed, Sep 3, 2008 at 9:41 AM, Kenneth Dombrowski wrote: > Hi Michael, > > I have to disagree. > > On 08-09-03 02:07 -0400, Michael B Allen wrote: >> >> Consider the following: >> >> interface Math_Constants { >> >> const PI = 3.14159265; > > No, that's not at all what an interface is for. An interface is nothing > more than a contract which specifies what methods its implementors must > define, it is not a sneaky way to implement multiple inheritance Well I don't want to get into a big argument about it but I don't agree. In the abstract sense of the word, an interface defines how to interact with a separable component of a library. In C this would be a simple header file containing DEFINEs and prototypes. I the case of an object oriented library, this would be a class or more generally an interface definition. Also, I think interfaces can be used to implement multiple inheritance (provided that multiple inheritance is warranted or course). There's nothing wrong with multiple inheritance provided that the concepts being implemented are orthogonal. In fact, for practical programming reasons, you have to use multiple interfaces to implement multiple inheritance (as opposed to extending one class an using interfaces for the other concepts). >> I think PI would qualify as part of an interface definition. The value >> of PI will never change. > > If it will never change, there is no value in including it as part of an > interface definition I disagree. For example, a library that provides an interface for a concept like a circle might very well need a constant like Shape_Circle::PI for the library to be able to compute things with adequate precision. And again, an enum defines a type that is restricted to a specific subset of values. IMO that is unquestionably something that could be part of an interface definition and in PHP that amounts to a sequence of const declarations as PHP does not support enums. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From kenneth at ylayali.net Wed Sep 3 14:20:28 2008 From: kenneth at ylayali.net (Kenneth Dombrowski) Date: Wed, 3 Sep 2008 14:20:28 -0400 Subject: [nycphp-talk] Constants interfaces In-Reply-To: <78c6bd860809031004g9e8d520j6d68e737e5da1328@mail.gmail.com> References: <78c6bd860809021734k5b786d14yfa11c8323c3ee5b6@mail.gmail.com> <200809031004.27235.arzala@gmail.com> <78c6bd860809022307j48caafd7lf8dda6a719afb2bf@mail.gmail.com> <20080903134112.GA23393@ylayali.net> <78c6bd860809031004g9e8d520j6d68e737e5da1328@mail.gmail.com> Message-ID: <20080903182028.GB23393@ylayali.net> Hi Michael, Well, if it works for you, go for it. I think it's a bit weird and extremely unintuitive to inherit from an interface, and I wouldn't have expected it was even permitted, but it turns out it's even documented (apparantly it only works for constants): http://www.php.net/manual/en/language.oop5.interfaces.php I don't have a problem with multiple inheritence, it just seems very kludgey to me to implement it with interfaces; I guesss PHP gives you little choice though.. Kenneth From ioplex at gmail.com Wed Sep 3 15:12:59 2008 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 3 Sep 2008 15:12:59 -0400 Subject: [nycphp-talk] Constants interfaces In-Reply-To: <20080903182028.GB23393@ylayali.net> References: <78c6bd860809021734k5b786d14yfa11c8323c3ee5b6@mail.gmail.com> <200809031004.27235.arzala@gmail.com> <78c6bd860809022307j48caafd7lf8dda6a719afb2bf@mail.gmail.com> <20080903134112.GA23393@ylayali.net> <78c6bd860809031004g9e8d520j6d68e737e5da1328@mail.gmail.com> <20080903182028.GB23393@ylayali.net> Message-ID: <78c6bd860809031212p59c34017ke4ea222e52c87069@mail.gmail.com> On Wed, Sep 3, 2008 at 2:20 PM, Kenneth Dombrowski wrote: > I don't have a problem with multiple inheritence, it just seems very > kludgey to me to implement it with interfaces; I guesss PHP gives you > little choice though.. Quite the opposite. The only non-kludgey way to implement multiple inheritance is to use interfaces because if you use a class you cannot implement *it* without extending it and you cannot (or should not) extend multiple classes as overriding inherited methods can easily lead to non-deterministic behavior. For example, let's say you have financial instrument interfaces "Stock", "Bond", "MutualFund" and "MoneyMarket" where a mutual fund can be traded like a stock or a bond but a money market instrument has characteristics of a mutual fund (I'm not a financial wiz - this is just an example). So which one do you make the base class? The answer is very simple: none. You make an interface for all of them and then create concrete classes that implement each of the interfaces required. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From kenneth at ylayali.net Wed Sep 3 16:23:22 2008 From: kenneth at ylayali.net (Kenneth Dombrowski) Date: Wed, 3 Sep 2008 16:23:22 -0400 Subject: [nycphp-talk] Constants interfaces In-Reply-To: <78c6bd860809031212p59c34017ke4ea222e52c87069@mail.gmail.com> References: <78c6bd860809021734k5b786d14yfa11c8323c3ee5b6@mail.gmail.com> <200809031004.27235.arzala@gmail.com> <78c6bd860809022307j48caafd7lf8dda6a719afb2bf@mail.gmail.com> <20080903134112.GA23393@ylayali.net> <78c6bd860809031004g9e8d520j6d68e737e5da1328@mail.gmail.com> <20080903182028.GB23393@ylayali.net> <78c6bd860809031212p59c34017ke4ea222e52c87069@mail.gmail.com> Message-ID: <20080903202322.GC23393@ylayali.net> On 08-09-03 15:12 -0400, Michael B Allen wrote: > On Wed, Sep 3, 2008 at 2:20 PM, Kenneth Dombrowski wrote: > > I don't have a problem with multiple inheritence, it just seems very > > kludgey to me to implement it with interfaces; I guesss PHP gives you > > little choice though.. > > Quite the opposite. The only non-kludgey way to implement multiple > inheritance is to use interfaces because if you use a class you cannot > implement *it* without extending it As far as I can tell, it is the only kludgey or non-kludgey way to implement multiple inheritance in PHP, and all you can inherit from an Interface is consts. > and you cannot (or should not) > extend multiple classes as overriding inherited methods can easily > lead to non-deterministic behavior. It's quite idiomatic in other languages to extend multiple base classes. > For example, let's say you have financial instrument interfaces > "Stock", "Bond", "MutualFund" and "MoneyMarket" where a mutual fund > can be traded like a stock or a bond but a money market instrument has > characteristics of a mutual fund (I'm not a financial wiz - this is > just an example). So which one do you make the base class? The answer > is very simple: none. You make an interface for all of them and then > create concrete classes that implement each of the interfaces > required. That's what an Abstract class is for. An interface is for exposing a contractual set of methods, like Observer, Observeable, etc.. From rotsen at gmail.com Thu Sep 4 12:50:17 2008 From: rotsen at gmail.com (=?ISO-8859-1?Q?N=E9stor?=) Date: Thu, 4 Sep 2008 09:50:17 -0700 Subject: [nycphp-talk] Polling software Message-ID: Hi, I was wondering what free polling software you have use and recommend to use. Thanks, Nestor :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From bmartin at mac.com Thu Sep 4 13:01:02 2008 From: bmartin at mac.com (Bruce Martin) Date: Thu, 04 Sep 2008 13:01:02 -0400 Subject: [nycphp-talk] Polling software In-Reply-To: References: Message-ID: <0D2B44E6-E46E-44D6-A67C-18C1F287542A@mac.com> http://www.flektor.com/ They have basic polls you can create. Bruce Martin The Martin Solution bruce at martinsolution.com http://www.martinsolution.com http://externals.martinsolution.com On Sep 4, 2008, at 12:50 PM, N?stor wrote: > Hi, > > I was wondering what free polling software you have use and > recommend to use. > > Thanks, > > Nestor :-) > _______________________________________________ > 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 bzcoder at bzcode.com Thu Sep 4 13:08:16 2008 From: bzcoder at bzcode.com (bzcoder) Date: Thu, 04 Sep 2008 13:08:16 -0400 Subject: [nycphp-talk] Polling software In-Reply-To: References: Message-ID: <48C01600.9080008@bzcode.com> Limesurvey is an open source PHP survey/polling application. From justin at justinhileman.info Thu Sep 4 13:28:12 2008 From: justin at justinhileman.info (justin) Date: Thu, 4 Sep 2008 13:28:12 -0400 Subject: [nycphp-talk] Polling software In-Reply-To: References: Message-ID: <1dc0e7e00809041028n594cebe9ib6f39195cb1ef7e0@mail.gmail.com> On Thu, Sep 4, 2008 at 12:50 PM, N?stor wrote: > Hi, > > I was wondering what free polling software you have use and recommend to > use. > It depends entirely on your need. If you just want a "quick show of hands" style poll, check out http://checkyesorno.info or http://friendfeedback.com For Twitter based polling, it's hard to beat StrawPoll - http://strawpollnow.com/ If you already have a Drupal, Plone, Joomla, WordPress or phpBB site, there are poll modules that integrate with each of those, and are pretty slick. If you're looking for a complete survey, rather than just a quick poll, LimeSurvey (http://limesurvey.org) and Drupal or Plone's webform modules are powerful, flexible and open source. If you want a hosted solution, Dmoz has a huge list of hosted poll providers: http://tinyurl.com/hosted-polls Of that list, I've used PollDaddy and SurveyMonkey, and I think I like SurveyMonkey better. Be aware that most hosted poll providers use a tiered service approach, with limited free accounts. justin -- http://justinhileman.com From chsnyder at gmail.com Thu Sep 4 13:49:55 2008 From: chsnyder at gmail.com (csnyder) Date: Thu, 4 Sep 2008 13:49:55 -0400 Subject: [nycphp-talk] Polling software In-Reply-To: <1dc0e7e00809041028n594cebe9ib6f39195cb1ef7e0@mail.gmail.com> References: <1dc0e7e00809041028n594cebe9ib6f39195cb1ef7e0@mail.gmail.com> Message-ID: On Thu, Sep 4, 2008 at 1:28 PM, justin wrote: > For Twitter based polling, it's hard to beat StrawPoll - > http://strawpollnow.com/ Nice, I had no idea that StrawPoll had gone "platform". > Of that list, I've used PollDaddy and SurveyMonkey, and I think I like > SurveyMonkey better. Be aware that most hosted poll providers use a > tiered service approach, with limited free accounts. > We use SurveyMonkey at work. I hate the way the polls look--why aren't standard html form controls good enough?--but it gets the job done and you get a nice export of the results. Respondents are likely to have seen it before, which can help your response rate. As mentioned before, it's not really free if you use it for anything interesting, but it's not exactly expensive, either. "Free" and "survey engine" sounds like a privacy nightmare in the making to me. Chris Snyder http://chxor.chxo.com/ From snirgal at optonline.net Thu Sep 4 14:25:41 2008 From: snirgal at optonline.net (snir gal) Date: Thu, 04 Sep 2008 14:25:41 -0400 Subject: [nycphp-talk] escrow script Message-ID: Hi all, I need to add escrow service to application Something similar to all freelance sites. (guru.com) Will appreciate any input. This script is all over http://www.hotscripts.com/Detailed/29273.html didn't like it. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From codebowl at gmail.com Thu Sep 4 14:41:09 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Thu, 4 Sep 2008 14:41:09 -0400 Subject: [nycphp-talk] escrow script In-Reply-To: References: Message-ID: <620F25B9-DD6B-47AA-AEDB-47965E75DA5F@gmail.com> If you are looking to hire someone you might be better off sending it to the NYPHP Jobs list. On Sep 4, 2008, at 2:25 PM, snir gal wrote: > Hi all, > > I need to add escrow service to application > Something similar to all freelance sites. (guru.com) > Will appreciate any input. > This script is all over > http://www.hotscripts.com/Detailed/29273.html didn?t like it. > > > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From snirgal at optonline.net Thu Sep 4 16:03:05 2008 From: snirgal at optonline.net (snir gal) Date: Thu, 04 Sep 2008 16:03:05 -0400 Subject: [nycphp-talk] escrow script In-Reply-To: <620F25B9-DD6B-47AA-AEDB-47965E75DA5F@gmail.com> References: <620F25B9-DD6B-47AA-AEDB-47965E75DA5F@gmail.com> Message-ID: <9296117F2DD34B6FAEC1CF0BA2875B73@pcxps> i'm well aware of NYPHP jobs list is there anywhere on my post the word HIRE? i just want some feedback does anyone on this list ever dealt with coding escrow script? or even manage website that offer escrow service. I?m sure there are some issues that can be avoided while integrating this service on a site on a design level as well as maintenance. and dude, you should do some reading on Open source. http://en.wikipedia.org/wiki/Open_source ----- Original Message ----- From: Joseph Crawford To: NYPHP Talk Sent: Thursday, September 04, 2008 2:41 PM Subject: Re: [nycphp-talk] escrow script If you are looking to hire someone you might be better off sending it to the NYPHP Jobs list. On Sep 4, 2008, at 2:25 PM, snir gal wrote: Hi all, I need to add escrow service to application Something similar to all freelance sites. (guru.com) Will appreciate any input. This script is all over http://www.hotscripts.com/Detailed/29273.html didn?t like it. 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 ------------------------------------------------------------------------------ _______________________________________________ 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 bzcoder at bzcode.com Thu Sep 4 16:05:39 2008 From: bzcoder at bzcode.com (bzcoder) Date: Thu, 04 Sep 2008 16:05:39 -0400 Subject: [nycphp-talk] escrow script In-Reply-To: References: Message-ID: <48C03F93.8030009@bzcode.com> snir gal wrote: > > Hi all, > > > > I need to add escrow service to application > > Something similar to all freelance sites. (guru.com) > > Will appreciate any input. > My understanding is escrow is a legal term and you have to follow some pretty strict regulations when offering to escrow money. The function is simple, you take the payment, you stick it in an account, when the payment is authorized you release the funds to either the original payer or the intended recipient. If there is a dispute, you have to provide a method of resolving the dispute. If you release the money back to the initial party, you can't charge them CC fees, so you have to eat them. But please, I have no idea how much of this is correct, so consult someone in a financial or legal industry to give you the ins and outs. From snirgal at optonline.net Thu Sep 4 16:31:33 2008 From: snirgal at optonline.net (snir gal) Date: Thu, 04 Sep 2008 16:31:33 -0400 Subject: [nycphp-talk] escrow script In-Reply-To: <48C03F93.8030009@bzcode.com> References: <48C03F93.8030009@bzcode.com> Message-ID: ----- Original Message ----- From: "bzcoder" To: "NYPHP Talk" Sent: Thursday, September 04, 2008 4:05 PM Subject: Re: [nycphp-talk] escrow script > snir gal wrote: >> >> Hi all, >> >> >> I need to add escrow service to application >> >> Something similar to all freelance sites. (guru.com) >> >> Will appreciate any input. >> > > My understanding is escrow is a legal term and you have to follow some > pretty strict regulations when offering to escrow money. > yes, i know that 99% of online escrow services are not real escrow service they just use the term escrow the only real online escrow service is escrow.com "All escrow services offered on this Website are provided independently and exclusively by Internet Escrow Services(SM) (IES), one of the operating subsidiaries of Escrow.com. IES is fully licensed and accredited as an escrow company and is subject to compliance with all applicable escrow regulations, including the California Financial and Business Code. " > The function is simple, you take the payment, you stick it in an account, > when the payment is authorized you release the funds to either the > original payer or the intended recipient. > > If there is a dispute, you have to provide a method of resolving the > dispute. > > If you release the money back to the initial party, you can't charge them > CC fees, so you have to eat them. i wish to know how other site deal with that. > > But please, I have no idea how much of this is correct, so consult someone > in a financial or legal industry to give you the ins and outs. thanks, i did consult a lawer about liability. you know enough, most people i talk with dont know all this info. > _______________________________________________ > 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 rotsen at gmail.com Thu Sep 4 18:33:47 2008 From: rotsen at gmail.com (=?ISO-8859-1?Q?N=E9stor?=) Date: Thu, 4 Sep 2008 15:33:47 -0700 Subject: [nycphp-talk] Polling software In-Reply-To: References: <1dc0e7e00809041028n594cebe9ib6f39195cb1ef7e0@mail.gmail.com> Message-ID: I play with some of this polls and they are not use full to me. I wanted to be able to add the poll into a web page. I did find other polls software and looked at the code for hyperpoll and they use cookies and a flat file to keep track of the votes. I will write something similar. Thanks for your replies, Nestor :-) On Thu, Sep 4, 2008 at 10:49 AM, csnyder wrote: > On Thu, Sep 4, 2008 at 1:28 PM, justin wrote: > > > For Twitter based polling, it's hard to beat StrawPoll - > > http://strawpollnow.com/ > > Nice, I had no idea that StrawPoll had gone "platform". > > > Of that list, I've used PollDaddy and SurveyMonkey, and I think I like > > SurveyMonkey better. Be aware that most hosted poll providers use a > > tiered service approach, with limited free accounts. > > > > We use SurveyMonkey at work. I hate the way the polls look--why aren't > standard html form controls good enough?--but it gets the job done and > you get a nice export of the results. Respondents are likely to have > seen it before, which can help your response rate. > > As mentioned before, it's not really free if you use it for anything > interesting, but it's not exactly expensive, either. "Free" and > "survey engine" sounds like a privacy nightmare in the making to me. > > Chris Snyder > http://chxor.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 ioplex at gmail.com Sun Sep 7 12:17:15 2008 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 7 Sep 2008 12:17:15 -0400 Subject: [nycphp-talk] Table Indexes Message-ID: <78c6bd860809070917s2cffc729h86c80850e081cdd4@mail.gmail.com> I need a table that will be used basically as a map between records in another table and I'm not sure how to create the indexes. At first I thought I would just do something like: CREATE TABLE map ( id int(5) unsigned NOT NULL AUTO_INCREMENT, a int(5) unsigned NOT NULL, b int(5) unsigned NOT NULL, PRIMARY KEY (id), UNIQUE (a,b) ); But I think I could work around dumping the id if that would help which would give me: CREATE TABLE map ( a int(5) unsigned NOT NULL, b int(5) unsigned NOT NULL, PRIMARY KEY (a,b) ); However ultimately I want to do queries with WHERE clauses like: FROM map m3, map m2, map m1 WHERE (m3.a = m2.a AND m2.b = m1.a AND m1.b = 72) OR (m3.a = m2.a AND m2.b = m1.b AND m1.a = 72) OR (m3.a = m2.b AND m2.a = m1.a AND m1.b = 72) OR (m3.a = m2.b AND m2.a = m1.b AND m1.a = 72) OR (m3.b = m2.a AND m2.b = m1.a AND m1.b = 72) OR (m3.b = m2.a AND m2.b = m1.b AND m1.a = 72) OR (m3.b = m2.b AND m2.a = m1.a AND m1.b = 72) OR (m3.b = m2.b AND m2.a = m1.b AND m1.a = 72) so I'm wondering if I want to optimize lookups by a OR b so perhaps I should do something like the following (not sure if this is even valid): CREATE TABLE map ( a int(5) unsigned NOT NULL, b int(5) unsigned NOT NULL, INDEX (a), INDEX (b) ); Or maybe I should have no indexes at all? CREATE TABLE map ( a int(5) unsigned NOT NULL, b int(5) unsigned NOT NULL ); Can anyone recommend which method I should try first? Mike From jcampbell1 at gmail.com Sun Sep 7 14:31:48 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Sun, 7 Sep 2008 14:31:48 -0400 Subject: [nycphp-talk] Table Indexes In-Reply-To: <78c6bd860809070917s2cffc729h86c80850e081cdd4@mail.gmail.com> References: <78c6bd860809070917s2cffc729h86c80850e081cdd4@mail.gmail.com> Message-ID: <8f0676b40809071131r7e6f15c7uc15c7223a0896b90@mail.gmail.com> > Can anyone recommend which method I should try first? Don't create the auto increment pk, as it is unnecessary. With MySQL the fastest is often: Primary(a,b) index(b) And in sometimes you even want: Primary(a,b) index(a) index(b) I think mysql treats primary key pairs as a simple concatenation. If you don't index b, then the searches are really slow. Regards, John Campbell From brian at realm3.com Mon Sep 8 11:11:21 2008 From: brian at realm3.com (Brian D.) Date: Mon, 8 Sep 2008 11:11:21 -0400 Subject: [nycphp-talk] Dynamic/Scripting Languages In-Reply-To: <000001c90db4$ceb9d790$6c2d86b0$@com> References: <00a101c90d08$c9855df0$5c9019d0$@com> <000001c90db4$ceb9d790$6c2d86b0$@com> Message-ID: Good read, and I appreciate the post. However, I had one semantic issue that bugs me here: "Much of the Web has traditionally been created using dynamic languages, from Ajax on the client to server code written in PHP, Perl, Python and Ruby." AJAX is not a "language"! Grrr. Of course this is Lam, who works at Microsoft, so you have to forgive him I suppose. I've definitely seen Javascript rise in prominence of what I do on a daily basis. It's starting to take up more and more of my time as clients go from wanting back-end functionality to matching front-end wizardry. -Brian D. On Wed, Sep 3, 2008 at 7:04 AM, Peter Sawczynec wrote: > Very nice read thank you. Ahhh, so then where and/or what's next. > > Now that AJAX and AJAX-like technique in the new browser/desktop > environment is rapidly becoming a defacto standard and google has rolled > out their new Chrome browser (the thin edge of the wedge in the google > adhoc, distributed, net browser/OS initiative up against hemmed-in MSFT) > which behaves very AJAX like. (I downloaded Chrome. It does have a nice > business-like, stay out of your way feel. Positions your bookmarks > collection on the right. Which for a rightie, does seem to feel like a > natural place to have them. For me the right hand bookmarks feel so > natural, it almost doesn't feel natural.) > > So going mobile. Mobile platform -- that is what it next (actually now). > And like AJAX, mobile didn't announce itself. It just happened > everywhere, at the same time. > > Mobile phone = Calendar/planner, contacts, GPS w/ text to speech > turn-by-turn instructions, wi-fi connection, browser interface to web, > 911 emergency tool, weather, news, camera, webcam, game console, music > player, video player, TV, walkie talkie, pdf reader, Flash player, JAVA > platform, email send/receive, texting, call log and lastly phone calls. > All timed, merchandised in flexible contract and non-contract configs, > and parentally-controlled (if desired), while packaged in an infinite > array of sizes, materials, user customizable interfaces and audio > stylings. > > Excellent pictorial roundup of best in class businessy Smartphones (non- > iPhone) overview here: > http://www.informationweek.com/news/personal_tech/smartphones/showArticl > e.jhtml?articleID=209101183 > > > Warmest mobile regards, > > > Peter Sawczynec > Technology Dir. > Sun-code Interactive > Sun-code.com > 941.893.0396 > ps at sun-code.com > > > > > > > > > > > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Hans Zaunere > Sent: Tuesday, September 02, 2008 10:33 AM > To: 'NYPHP Talk' > Subject: [nycphp-talk] Dynamic/Scripting Languages > > Hello all, hope the weekend was good. Some food for thought for the > Fall: > > http://www.cio.com/article/446829/PHP_JavaScript_Ruby_Perl_Python_and_Tc > l_To > day_The_State_of_the_Scripting_Universe > > or: > > http://tinyurl.com/55tpka > > Aside from the two pop-ups, an interesting read. > > --- > Hans Zaunere / Managing Member / New York PHP > www.nyphp.org / www.nyphp.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 > -- realm3 web applications [realm3.com] Information architecture, application development. phone: (917) 512-3594 fax: (440) 744-3559 From ioplex at gmail.com Tue Sep 9 22:31:07 2008 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 9 Sep 2008 22:31:07 -0400 Subject: [nycphp-talk] Weird Switch Behavior Message-ID: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> Can someone explain why the below switch matches the 0 element? $ cat switch.php 1, 'bar' => 2, 'zap', ); foreach ($tmp as $key => $val) { switch ($key) { case 'foo': case 'bar': echo "[$key][$val]\n"; break; } } $ php -f switch.php [foo][1] [bar][2] [0][zap] -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From ioplex at gmail.com Tue Sep 9 22:44:34 2008 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 9 Sep 2008 22:44:34 -0400 Subject: [nycphp-talk] Re: Weird Switch Behavior In-Reply-To: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> References: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> Message-ID: <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> On Tue, Sep 9, 2008 at 10:31 PM, Michael B Allen wrote: > Can someone explain why the below switch matches the 0 element? > > $ cat switch.php > > $tmp = array( > 'foo' => 1, > 'bar' => 2, > 'zap', > ); > > foreach ($tmp as $key => $val) { Nevermind - $key is an int so 'foo' is being cast to an int which evaluates to 0. I think I would prefer that switch be a little more explicit. > switch ($key) { > case 'foo': > case 'bar': > echo "[$key][$val]\n"; > break; > } > } > > $ php -f switch.php > [foo][1] > [bar][2] > [0][zap] -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From dsteplight at gmail.com Tue Sep 9 22:56:05 2008 From: dsteplight at gmail.com (Darryle Steplight) Date: Tue, 9 Sep 2008 22:56:05 -0400 Subject: [nycphp-talk] Re: Weird Switch Behavior In-Reply-To: <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> References: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> Message-ID: <47f4c4570809091956p618ffaf1nfdac81a74414ba45@mail.gmail.com> Hi Michael, Switch isn't the problem. Arrays are going to behave like Arrays no matter how you choose to loop through them. $tmp = array('foo','bar','zap'); is the same as typing $tmp = array(0=>'foo', 1='bar', 2='zap'); If you don't specify the index, PHP will start using numbers starting at zero as array keys. So in your example, you basically ended up doing this $tmp = array( ' foo ' =>1, ' bar ' =>2, ' 0 '=>'zap'); I hope this helps clarify things. On Tue, Sep 9, 2008 at 10:44 PM, Michael B Allen wrote: > On Tue, Sep 9, 2008 at 10:31 PM, Michael B Allen wrote: >> Can someone explain why the below switch matches the 0 element? >> >> $ cat switch.php >> > >> $tmp = array( >> 'foo' => 1, >> 'bar' => 2, >> 'zap', >> ); >> >> foreach ($tmp as $key => $val) { > > Nevermind - $key is an int so 'foo' is being cast to an int which > evaluates to 0. > > I think I would prefer that switch be a little more explicit. > >> switch ($key) { >> case 'foo': >> case 'bar': >> echo "[$key][$val]\n"; >> break; >> } >> } >> >> $ php -f switch.php >> [foo][1] >> [bar][2] >> [0][zap] > > -- > Michael B Allen > PHP Active Directory SPNEGO SSO > http://www.ioplex.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 lists at zaunere.com Tue Sep 9 22:56:24 2008 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 9 Sep 2008 22:56:24 -0400 Subject: [nycphp-talk] Re: Weird Switch Behavior In-Reply-To: <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> References: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> Message-ID: <003101c912f0$d0cd0d40$726727c0$@com> > > Can someone explain why the below switch matches the 0 element? > > > > $ cat switch.php > > > > > $tmp = array( > > 'foo' => 1, > > 'bar' => 2, > > 'zap', > > ); > > > > foreach ($tmp as $key => $val) { > > Nevermind - $key is an int so 'foo' is being cast to an int which > evaluates to 0. > > I think I would prefer that switch be a little more explicit. > > > switch ($key) { > > case 'foo': > > case 'bar': > > echo "[$key][$val]\n"; > > break; > > } > > } > > > > $ php -f switch.php > > [foo][1] > > [bar][2] > > [0][zap] Should switch be more explicit, or should the programmer? :) Don't depend on auto type casting... H From michael.southwell at nyphp.com Tue Sep 9 23:00:20 2008 From: michael.southwell at nyphp.com (Michael Southwell) Date: Tue, 09 Sep 2008 23:00:20 -0400 Subject: [nycphp-talk] Re: Weird Switch Behavior In-Reply-To: <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> References: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> Message-ID: <48C73844.8090406@nyphp.com> Michael B Allen wrote: > On Tue, Sep 9, 2008 at 10:31 PM, Michael B Allen wrote: >> Can someone explain why the below switch matches the 0 element? >> >> $ cat switch.php >> > >> $tmp = array( >> 'foo' => 1, >> 'bar' => 2, >> 'zap', >> ); >> >> foreach ($tmp as $key => $val) { > > Nevermind - $key is an int so 'foo' is being cast to an int which > evaluates to 0. That's not it. Your $tmp array has three elements; the first two elements are 1 and 2, and those elements have associative (that is, string) keys, foo and bar respectively. Your third element is zap, and it has no key specified. When PHP is given an array element with no key specified, it uses the next available integer. In this case, that is 0. So PHP is understanding this: 0 => 'zap' which is exactly what your output shows: >> [foo][1] >> [bar][2] >> [0][zap] > -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From ioplex at gmail.com Tue Sep 9 23:45:39 2008 From: ioplex at gmail.com (Michael B Allen) Date: Tue, 9 Sep 2008 23:45:39 -0400 Subject: [nycphp-talk] Re: Weird Switch Behavior In-Reply-To: <003101c912f0$d0cd0d40$726727c0$@com> References: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> <003101c912f0$d0cd0d40$726727c0$@com> Message-ID: <78c6bd860809092045g431d048cx61aaabd5d63e6556@mail.gmail.com> On Tue, Sep 9, 2008 at 10:56 PM, Hans Zaunere wrote: >> Nevermind - $key is an int so 'foo' is being cast to an int which >> evaluates to 0. >> >> I think I would prefer that switch be a little more explicit. >> >> > switch ($key) { >> > case 'foo': >> > case 'bar': >> > echo "[$key][$val]\n"; >> > break; >> > } >> > } >> > >> > $ php -f switch.php >> > [foo][1] >> > [bar][2] >> > [0][zap] > > Should switch be more explicit, or should the programmer? :) Don't depend > on auto type casting... That's what I'm saying. In this case PHP looks at $key and sees (int)0. So now it auto type casts 'foo' to an int which for any string yields (int)0 and thus the case matches the 0 => 'zap' element unexpectedly. If switch used a typed comparison it would not auto type cast and it would compare (int)0 to (string)'foo' and because the types do not match I would get the expected results. But of course if switch used a typed comparison you would have to code something like: $str = '5'; switch ($str) { case 5: // no match ?! break; case 'foo': ... as: $str = '5'; switch ($str) { case 5: case '5': // ahhh, now it matches break; case 'foo': ... with double cases which people would no doubt be hee'n and haw'n over to no end. M -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From kenrbnsn at rbnsn.com Tue Sep 9 23:57:15 2008 From: kenrbnsn at rbnsn.com (Ken Robinson) Date: Tue, 09 Sep 2008 23:57:15 -0400 Subject: [nycphp-talk] Re: Weird Switch Behavior In-Reply-To: <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com > References: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> Message-ID: At 10:44 PM 9/9/2008, Michael B Allen wrote: >On Tue, Sep 9, 2008 at 10:31 PM, Michael B Allen wrote: > > Can someone explain why the below switch matches the 0 element? > > > > $ cat switch.php > > > > > $tmp = array( > > 'foo' => 1, > > 'bar' => 2, > > 'zap', > > ); > > > > foreach ($tmp as $key => $val) { > >Nevermind - $key is an int so 'foo' is being cast to an int which >evaluates to 0. > >I think I would prefer that switch be a little more explicit. > > > switch ($key) { > > case 'foo': > > case 'bar': > > echo "[$key][$val]\n"; > > break; > > } > > } > > > > $ php -f switch.php > > [foo][1] > > [bar][2] > > [0][zap] Here's one way to make switch behave the way you want: 1, 'bar' => 2, 'zap', ); foreach ($tmp as $key => $val) { switch (true) { case $key === 'foo': case $key === 'bar': echo "[$key][$val]\n"; break; } } ?> Ken From dsteplight at gmail.com Tue Sep 9 23:59:32 2008 From: dsteplight at gmail.com (Darryle Steplight) Date: Tue, 9 Sep 2008 23:59:32 -0400 Subject: [nycphp-talk] Re: Weird Switch Behavior In-Reply-To: <78c6bd860809092045g431d048cx61aaabd5d63e6556@mail.gmail.com> References: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> <003101c912f0$d0cd0d40$726727c0$@com> <78c6bd860809092045g431d048cx61aaabd5d63e6556@mail.gmail.com> Message-ID: <47f4c4570809092059pf8a49b5teebf8dd2abb17324@mail.gmail.com> Hi Mike, It kind of sounds like you are talking about two different things or at least the confusion involves two different topics. Basically, if you are going to use a Switch statement it's a good practice to keep the case expression within quotation, if you want to get desired results. Also, be very careful when doing , SWITCH($foo) { case ' 5 ' : case ' 6 ' : do execute some code... break; default: break; } also 5 is an interger, but ' 5 ' is a string. So that will make a difference when comparing it to $foo. Take a look at http://us.php.net/intval for more details. The above statement says if $foo equals 5 or 6 then execute some code. On Tue, Sep 9, 2008 at 11:45 PM, Michael B Allen wrote: > On Tue, Sep 9, 2008 at 10:56 PM, Hans Zaunere wrote: >>> Nevermind - $key is an int so 'foo' is being cast to an int which >>> evaluates to 0. >>> >>> I think I would prefer that switch be a little more explicit. >>> >>> > switch ($key) { >>> > case 'foo': >>> > case 'bar': >>> > echo "[$key][$val]\n"; >>> > break; >>> > } >>> > } >>> > >>> > $ php -f switch.php >>> > [foo][1] >>> > [bar][2] >>> > [0][zap] >> >> Should switch be more explicit, or should the programmer? :) Don't depend >> on auto type casting... > > That's what I'm saying. > > In this case PHP looks at $key and sees (int)0. So now it auto type > casts 'foo' to an int which for any string yields (int)0 and thus the > case matches the 0 => 'zap' element unexpectedly. If switch used a > typed comparison it would not auto type cast and it would compare > (int)0 to (string)'foo' and because the types do not match I would get > the expected results. > > But of course if switch used a typed comparison you would have to code > something like: > > $str = '5'; > switch ($str) { > case 5: > // no match ?! > break; > case 'foo': > ... > > as: > > $str = '5'; > switch ($str) { > case 5: > case '5': > // ahhh, now it matches > break; > case 'foo': > ... > > with double cases which people would no doubt be hee'n and haw'n over to no end. > > M > > -- > Michael B Allen > PHP Active Directory SPNEGO SSO > http://www.ioplex.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 jcampbell1 at gmail.com Wed Sep 10 00:03:41 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 10 Sep 2008 00:03:41 -0400 Subject: [nycphp-talk] Re: Weird Switch Behavior In-Reply-To: <47f4c4570809092059pf8a49b5teebf8dd2abb17324@mail.gmail.com> References: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> <003101c912f0$d0cd0d40$726727c0$@com> <78c6bd860809092045g431d048cx61aaabd5d63e6556@mail.gmail.com> <47f4c4570809092059pf8a49b5teebf8dd2abb17324@mail.gmail.com> Message-ID: <8f0676b40809092103k1ee547bcv9085c59c86739932@mail.gmail.com> Hi Mike, Maybe a simple way around this is just to use: switch("$key") It makes it pretty clear that you are only dealing with strings, and you won't have to deal with casting issues. Regards, John Campbell From ioplex at gmail.com Wed Sep 10 03:53:21 2008 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 10 Sep 2008 03:53:21 -0400 Subject: [nycphp-talk] Re: Weird Switch Behavior In-Reply-To: <8f0676b40809092103k1ee547bcv9085c59c86739932@mail.gmail.com> References: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> <78c6bd860809091944sd82eb9fn41e32d052ab4ca34@mail.gmail.com> <003101c912f0$d0cd0d40$726727c0$@com> <78c6bd860809092045g431d048cx61aaabd5d63e6556@mail.gmail.com> <47f4c4570809092059pf8a49b5teebf8dd2abb17324@mail.gmail.com> <8f0676b40809092103k1ee547bcv9085c59c86739932@mail.gmail.com> Message-ID: <78c6bd860809100053g34dfb302u9c950183f5cf49e8@mail.gmail.com> On Wed, Sep 10, 2008 at 12:03 AM, John Campbell wrote: > Hi Mike, > > Maybe a simple way around this is just to use: > > switch("$key") > > It makes it pretty clear that you are only dealing with strings, and > you won't have to deal with casting issues. Clever solution. -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From randalrust at gmail.com Fri Sep 12 08:24:37 2008 From: randalrust at gmail.com (Randal Rust) Date: Fri, 12 Sep 2008 08:24:37 -0400 Subject: [nycphp-talk] Cloud Hosting Recommendations for Linux/Apache/PHP Message-ID: Does anyone have any recommendations or advice regarding a cloud hosting solution? -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From jmcgraw1 at gmail.com Fri Sep 12 09:38:16 2008 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Fri, 12 Sep 2008 09:38:16 -0400 Subject: [nycphp-talk] Cloud Hosting Recommendations for Linux/Apache/PHP In-Reply-To: References: Message-ID: On Fri, Sep 12, 2008 at 8:24 AM, Randal Rust wrote: > Does anyone have any recommendations or advice regarding a cloud > hosting solution? > Check out this article about Heavy.com switching to Amazon EC2: http://www.mikebrittain.com/blog/2008/07/19/web-hosting-on-ec2/ - jake > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > _______________________________________________ > 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 Sep 12 11:31:06 2008 From: chsnyder at gmail.com (csnyder) Date: Fri, 12 Sep 2008 11:31:06 -0400 Subject: [nycphp-talk] Cloud Hosting Recommendations for Linux/Apache/PHP In-Reply-To: References: Message-ID: On Fri, Sep 12, 2008 at 9:38 AM, Jake McGraw wrote: > On Fri, Sep 12, 2008 at 8:24 AM, Randal Rust wrote: >> Does anyone have any recommendations or advice regarding a cloud >> hosting solution? >> > > Check out this article about Heavy.com switching to Amazon EC2: > > http://www.mikebrittain.com/blog/2008/07/19/web-hosting-on-ec2/ > > - jake > I second the EC2 recommendation, especially now that they have added persistent storage. Be prepared for a short learning curve as you get to know the ins-and-outs of building your own images. You will definitely want to experiment a bit to get a feel for the service and then plan out a local administration and monitoring infrastructure before going full steam ahead. From lists at zaunere.com Fri Sep 12 13:54:51 2008 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 12 Sep 2008 13:54:51 -0400 Subject: [nycphp-talk] Got a Boring Weekend? Message-ID: <001201c91500$a7bbdd20$f7339760$@com> FYI - free event this Saturday, see below. Also this: http://groups.drupal.org/node/13857 H > Silverlight 2 Fire Starter This Saturday in NYC > > Microsoft Silverlight is a cross-browser, cross- > platform, and cross-device plug-in for delivering the next generation of .NET > based media experiences and rich interactive applications for the Web. By > using Expression Studio and Visual Studio, designers and developers can > collaborate more effectively using the skills they have today to light up the > Web of tomorrow. > > Silverlight 2 just had its big coming out party as NBC used it to power their > online coverage of the 2008 Beijing Olympics . > The final release is due soon. Are you ready for it? > > Come on out for a full day of learning about Silverlight at our Silverlight > 2.0 Firestarter in NYC. We'll start out with an overview of the technology > and dig deeper as the day goes on. By the time you leave, you'll be ready to > crack open the tools on your own machine and fire up your own web applications > with Silverlight! We have a great line up of speakers on tap, including Shawn > Wildermuth , Todd Snyder > , and Jason Beres > . > > > Register Here! > > > > We have a great line up of content ready for you this Saturday. Here is the > agenda for Saturday at the Silverlight 2 Fire Starter: > > > > Title > > Description > > Speaker > > Session 1 > > Keynote > > Intro and overview of the Silverlight 2 platform. > > Shawn Wildermuth & Peter Laudati > > Session 2 > > XAML Basics > > What is this funny mark-up language? > > Jason Beres & Peter Laudati > > Session 3 > > The Tools > > Get the skinny on what you need to start your work. A look at designer & > developer tools that work together. Coverage of Expression Blend 2.5 & > Silverlight Tools for Visual Studio 2008 > > Jason Beres > > Session 4 > > Controls, Data Binding > > Silverlight 1 was just a tease. Now see what you can do with real controls, > styles, and rich data binding. > > Shawn Wildermuth > > Session 5 > > Server Communication > > Silverlight 2 is a rich Internet application platform. So how do you talk back > to the cloud? Coverage of all the communication options. > WCF/Astoria/REST/POX/AJAX/etc. > > Todd Snyder > > > > For event details and registration, please visit the registration site: > > http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032386412&cultur e=en-US From compustretch at gmail.com Fri Sep 12 14:20:33 2008 From: compustretch at gmail.com (forest mars) Date: Fri, 12 Sep 2008 14:20:33 -0400 Subject: [nycphp-talk] Got a Boring Weekend? In-Reply-To: <001201c91500$a7bbdd20$f7339760$@com> References: <001201c91500$a7bbdd20$f7339760$@com> Message-ID: As far as I know, there is still a waiting list to RSVP. So if you wanted to attend, you would have to RSVP to get on the waiting list, and then see if you can get in. This is the 5th DrupalCamp and they have tended to fill up well in advance, even with Brooklyn Polytechnic having a decent capacity. Just for the record, DrupalCamp is not married to PolyTech, and in the planning stages is always looking for a place to hold it, so if anyone has any ideas for future places with greater capacity, let us know! ?orest -- "In theory, theory and practice are exactly the same. In practice, they're completely different." ------------------------------------------------------------------ -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 (C) 1997-1999 Network Associates, Inc. and its affiliated companies. (Diffie-Helman/DSS-only version) iQA/AwUBRkjTLDbz7LySoccvEQJDcQCguZZj4M4kOVOlOX4CtbgR0rppsdovAjra 3RRXIlkdzuYI0YJz4WyvKlTn =MLhk -----END PGP SIGNATURE----- This email is: [ ] private: do not forward [ ] o.k. to forward [ ] o.k. to blog [ x ] ask first On Fri, Sep 12, 2008 at 1:54 PM, Hans Zaunere wrote: > FYI - free event this Saturday, see below. > > Also this: > > http://groups.drupal.org/node/13857 > > H > > > Silverlight 2 Fire Starter This Saturday in NYC > > > > Microsoft Silverlight is a cross-browser, > cross- > > platform, and cross-device plug-in for delivering the next generation of > .NET > > based media experiences and rich interactive applications for the Web. By > > using Expression Studio and Visual Studio, designers and developers can > > collaborate more effectively using the skills they have today to light up > the > > Web of tomorrow. > > > > Silverlight 2 just had its big coming out party as NBC used it to power > their > > online coverage of the 2008 Beijing Olympics > > . > > The final release is due soon. Are you ready for it? > > > > Come on out for a full day of learning about Silverlight at our > Silverlight > > 2.0 Firestarter in NYC. We'll start out with an overview of the > technology > > and dig deeper as the day goes on. By the time you leave, you'll be > ready > to > > crack open the tools on your own machine and fire up your own web > applications > > with Silverlight! We have a great line up of speakers on tap, including > Shawn > > Wildermuth , Todd Snyder > > , and Jason Beres > > . > > > > > > Register Here! > > > < > http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032386412&cultu > re=en-US > > > > > > > > We have a great line up of content ready for you this Saturday. Here is > the > > agenda for Saturday at the Silverlight 2 Fire Starter: > > > > > > > > Title > > > > Description > > > > Speaker > > > > Session 1 > > > > Keynote > > > > Intro and overview of the Silverlight 2 platform. > > > > Shawn Wildermuth & Peter Laudati > > > > Session 2 > > > > XAML Basics > > > > What is this funny mark-up language? > > > > Jason Beres & Peter Laudati > > > > Session 3 > > > > The Tools > > > > Get the skinny on what you need to start your work. A look at designer & > > developer tools that work together. Coverage of Expression Blend 2.5 & > > Silverlight Tools for Visual Studio 2008 > > > > Jason Beres > > > > Session 4 > > > > Controls, Data Binding > > > > Silverlight 1 was just a tease. Now see what you can do with real > controls, > > styles, and rich data binding. > > > > Shawn Wildermuth > > > > Session 5 > > > > Server Communication > > > > Silverlight 2 is a rich Internet application platform. So how do you talk > back > > to the cloud? Coverage of all the communication options. > > WCF/Astoria/REST/POX/AJAX/etc. > > > > Todd Snyder > > > > > > > > For event details and registration, please visit the registration site: > > > > > > http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032386412&cultur > e=en-US > > > > _______________________________________________ > 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 Fri Sep 12 14:45:09 2008 From: ben at projectskyline.com (Ben Sgro) Date: Fri, 12 Sep 2008 14:45:09 -0400 Subject: [nycphp-talk] Windows, Apache, SSL & Zend (Https Error) Message-ID: <48CAB8B5.50902@projectskyline.com> Hello, Someone else at my work is digging into this problem in more detail, but I know this list is a great resource and I had to post: We are running PHP5/Zend on Windows/Apache and getting this error when a HTTPS URI is passed into Zend_Http_Client(). /Unable to Connect to ssl://[redacted]. Error #192541028: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?/ Does anyone have experiance solving this problem, or can point me to a site that has a comprehensive solution. I'm guessing fsock* and family is dying . We could get around this by using curl_* family, but I'd rather use the Zend_Http_Client() {socket} class. Thanks, - Ben From tgales at tgaconnect.com Fri Sep 12 15:30:51 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 12 Sep 2008 15:30:51 -0400 Subject: [nycphp-talk] Windows, Apache, SSL & Zend (Https Error) In-Reply-To: <48CAB8B5.50902@projectskyline.com> References: <48CAB8B5.50902@projectskyline.com> Message-ID: <48CAC36B.3090803@tgaconnect.com> Ben Sgro wrote: > > We are running PHP5/Zend on Windows/Apache and getting this error when > a HTTPS URI is passed into Zend_Http_Client(). > > /Unable to Connect to ssl://[redacted]. Error #192541028: Unable to > find the socket transport "ssl" - did you forget to enable it when you > configured PHP?/ I would check the services and make sure it was running (maybe you already did this) -- Tjm G. > > From ben at projectskyline.com Fri Sep 12 15:57:21 2008 From: ben at projectskyline.com (Ben Sgro) Date: Fri, 12 Sep 2008 15:57:21 -0400 Subject: [nycphp-talk] Windows, Apache, SSL & Zend (Https Error) In-Reply-To: <48CAC36B.3090803@tgaconnect.com> References: <48CAB8B5.50902@projectskyline.com> <48CAC36B.3090803@tgaconnect.com> Message-ID: <48CAC9A1.1000103@projectskyline.com> Hello, I'm pretty sure this is a .dll defined in php.ini and loaded by apache. Do you mean a windows service? Care to elaborate? - Ben Tim Gales wrote: > Ben Sgro wrote: >> >> We are running PHP5/Zend on Windows/Apache and getting this error >> when a HTTPS URI is passed into Zend_Http_Client(). >> >> /Unable to Connect to ssl://[redacted]. Error #192541028: Unable to >> find the socket transport "ssl" - did you forget to enable it when >> you configured PHP?/ > I would check the services and make sure it was running > (maybe you already did this) > > -- Tjm G. > > >> >> > > > _______________________________________________ > 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 tgales at tgaconnect.com Fri Sep 12 16:27:18 2008 From: tgales at tgaconnect.com (Tim Gales) Date: Fri, 12 Sep 2008 16:27:18 -0400 Subject: [nycphp-talk] Windows, Apache, SSL & Zend (Https Error) In-Reply-To: <48CAC9A1.1000103@projectskyline.com> References: <48CAB8B5.50902@projectskyline.com> <48CAC36B.3090803@tgaconnect.com> <48CAC9A1.1000103@projectskyline.com> Message-ID: <48CAD0A6.1060000@tgaconnect.com> Ben Sgro wrote: > Hello, > > I'm pretty sure this is a .dll defined in php.ini and loaded by > apache. Do you mean a windows service? Yes -- Secure Socket Tunneling Protocol Service Provides support for the Secure Socket Tunneling Protocol (SSTP) to connect to remote computers -- Tim G. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From ps at sun-code.com Fri Sep 12 20:24:34 2008 From: ps at sun-code.com (Peter Sawczynec) Date: Fri, 12 Sep 2008 20:24:34 -0400 Subject: [nycphp-talk] [OT] AdSense, AdWords Books, Guides, etc. Message-ID: <000001c91537$199ca290$4cd5e7b0$@com> Of the many books on Google's advertising tools, such as AdSense and AdWords, has anyone had a chance to read or review one or two of them? Have you found one book/manual/online tutorials to be pithy, to the point and noteworthy? Would you recommend one to me/us? Warmest regards, Peter Sawczynec Technology Dir. Sun-code Interactive Sun-code.com 941.893.0396 ps at sun-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From glenn310b at mac.com Sat Sep 13 09:32:49 2008 From: glenn310b at mac.com (Glenn) Date: Sat, 13 Sep 2008 09:32:49 -0400 Subject: [nycphp-talk] Weird Switch Behavior In-Reply-To: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> References: <78c6bd860809091931q512f950ftc03c76a07e87ff0a@mail.gmail.com> Message-ID: <887f436d1607629b9dcd5ad7f0f5ed80@mac.com> Interesting and subtle code. IMHO, the best solution is to make sure every hash item has a key/value pair when the hash is created. Someone may have to work with the code in the future and if the hash creation is done in some required/included file like a class, it might be more time consuming to determine what was happening. Glenn On Sep 9, 2008, at 10:31 PM, Michael B Allen wrote: > Can someone explain why the below switch matches the 0 element? > > $ cat switch.php > > $tmp = array( > 'foo' => 1, > 'bar' => 2, > 'zap', > ); > > foreach ($tmp as $key => $val) { > switch ($key) { > case 'foo': > case 'bar': > echo "[$key][$val]\n"; > break; > } > } > > $ php -f switch.php > [foo][1] > [bar][2] > [0][zap] > > -- > Michael B Allen > PHP Active Directory SPNEGO SSO > http://www.ioplex.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 nynj.tech at hotmail.com Sat Sep 13 10:42:47 2008 From: nynj.tech at hotmail.com (chad qian) Date: Sat, 13 Sep 2008 10:42:47 -0400 Subject: [nycphp-talk] how to pass array from php to javascript Message-ID: How to pass array from php to javascrip?thanks! Here is my sample code: _________________________________________________________________ See how Windows Mobile brings your life together?at home, work, or on the go. http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From cbaltatescu at greenvision.ro Sat Sep 13 12:10:48 2008 From: cbaltatescu at greenvision.ro (Cristian Baltatescu) Date: Sat, 13 Sep 2008 19:10:48 +0300 Subject: [nycphp-talk] how to pass array from php to javascript In-Reply-To: References: Message-ID: <422973430809130910q7407cb8qfdb4ee9ae506afd9@mail.gmail.com> On Sat, Sep 13, 2008 at 5:42 PM, chad qian wrote: > How to pass array from php to javascrip?thanks! > > Here is my sample code: > require "include/connection.php"; > //$menu_name=$_GET['menus']; > //$menulist= array("Peter", "Joe", "Glenn", "Cleveland"); > //reset($menulist); > $menulist=array(); > $q="select name from menus"; > $result=mysql_query($q); > while($row=mysql_fetch_array($result)){ > $name=$row['name']; > array_push($menulist,'$name'); > } > ?> > > > Hello, you could use json_encode() to encode your array in php to the json format and then print it out from php inside the html, then decode the array using js's json functions. But as long as you do that you could print it straightforward, just write from php the "html" code that defines the array in js. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Sat Sep 13 23:41:00 2008 From: ioplex at gmail.com (Michael B Allen) Date: Sat, 13 Sep 2008 23:41:00 -0400 Subject: [nycphp-talk] Overwriting Cache Headers Message-ID: <78c6bd860809132041r4726ce1co63ca5fbc291b4003@mail.gmail.com> I want to send css and js files from a PHP script so I want to allow caching. But PHP always sends the following headers: Array ( [0] => X-Powered-By: PHP/5.2.6 [1] => Expires: Thu, 19 Nov 1981 08:52:00 GMT [2] => Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 [3] => Pragma: no-cache ) AFAIK it's not possible to remove or suppress headers but I can of course overwrite them. The question is: with what? For the Expires header I suppose it could just be the RFC822 time for now + 1 hour. For the Cache-Control header it's less clear. Here's the spec but I'm still trying to decipher the meaning of each directive: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 For the Pragma header I'm largely clueless. Does anyone know what values for these headers would be equivalent to not specifying them at all? Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From justin at justinhileman.info Sun Sep 14 00:21:19 2008 From: justin at justinhileman.info (justin) Date: Sun, 14 Sep 2008 00:21:19 -0400 Subject: [nycphp-talk] Overwriting Cache Headers In-Reply-To: <78c6bd860809132041r4726ce1co63ca5fbc291b4003@mail.gmail.com> References: <78c6bd860809132041r4726ce1co63ca5fbc291b4003@mail.gmail.com> Message-ID: <1dc0e7e00809132121t450a73p26b3703ffe8eab91@mail.gmail.com> On Sat, Sep 13, 2008 at 11:41 PM, Michael B Allen wrote: > I want to send css and js files from a PHP script so I want to allow caching. > > But PHP always sends the following headers: > > Array > ( > [0] => X-Powered-By: PHP/5.2.6 > [1] => Expires: Thu, 19 Nov 1981 08:52:00 GMT > [2] => Cache-Control: no-store, no-cache, must-revalidate, > post-check=0, pre-check=0 > [3] => Pragma: no-cache > ) > > AFAIK it's not possible to remove or suppress headers but I can of > course overwrite them. > > The question is: with what? > > For the Expires header I suppose it could just be the RFC822 time for > now + 1 hour. > > For the Cache-Control header it's less clear. Here's the spec but I'm > still trying to decipher the meaning of each directive: > > http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 > > For the Pragma header I'm largely clueless. > > Does anyone know what values for these headers would be equivalent to > not specifying them at all? > Is there any particular reason you need PHP to send the files? You do have a couple more options. I usually use PHP to write a static file, then let Apache serve it up as an actual css/js file. You can even use sweet mod_rewrite rules to hit the php file if the requested css/js file isn't present. If you're just reading a file from disk and spitting it out with PHP, you might want to have PHP send your favorite flavor of redirect header instead. As far as which headers to send, I poked around a bit. You'd be surprised how many of the big guys just dump the css on every single page... But a few that served actual files had headers like the following. Note that all these css files are coming from a CDN. For what that's worth. Headers for an Amazon.com css file: Cache-Control: max-age=630720000 Date: Sun, 14 Sep 2008 04:03:45 GMT Content-Type: text/css Last-Modified: Thu, 28 Aug 2008 00:32:03 GMT Server: Server X-Cache-Lookup: MISS from cdn-images.amazon.com:8080 X-Cache: MISS from cdn-images.amazon.com Content-Encoding: deflate Expires: Wed, 23 Aug 2028 00:39:01 GMT Content-Length: 2018 X-WR-MODIFICATION: Content-Length And one from Yahoo.com: Date: Thu, 11 Sep 2008 21:50:36 GMT Cache-Control: max-age=315360000 Expires: Sun, 09 Sep 2018 21:50:36 GMT Last-Modified: Mon, 17 Mar 2008 17:19:43 GMT Accept-Ranges: bytes Vary: Accept-Encoding Content-Type: text/css Content-Encoding: gzip Age: 195294 Content-Length: 1921 Server: YTS/1.17.8 Twitter seems to use a more reasonable cache length, you might try something like this: Date: Sun, 14 Sep 2008 04:07:46 GMT Server: Apache Last-Modified: Fri, 12 Sep 2008 00:23:22 GMT Accept-Ranges: bytes Cache-Control: max-age=86400 Expires: Mon, 15 Sep 2008 04:07:46 GMT Vary: Accept-Encoding Content-Encoding: gzip Content-Length: 6509 Content-Type: text/css I wasn't able to find a css file that returned a Pragma header. Perhaps you could try "Pragma: " ? justin -- http://justinhileman.com From tom at supertom.com Sun Sep 14 11:15:48 2008 From: tom at supertom.com (Tom Melendez) Date: Sun, 14 Sep 2008 11:15:48 -0400 Subject: [nycphp-talk] Overwriting Cache Headers In-Reply-To: <1dc0e7e00809132121t450a73p26b3703ffe8eab91@mail.gmail.com> References: <78c6bd860809132041r4726ce1co63ca5fbc291b4003@mail.gmail.com> <1dc0e7e00809132121t450a73p26b3703ffe8eab91@mail.gmail.com> Message-ID: <117286890809140815m2cf875faxf314bd7651fb64fa@mail.gmail.com> Have you tried overwriting the header with the header() function, either by making it blank ("Pragma:") or with the desired value? Tom http://www.liphp.org On Sun, Sep 14, 2008 at 12:21 AM, justin wrote: > On Sat, Sep 13, 2008 at 11:41 PM, Michael B Allen wrote: >> I want to send css and js files from a PHP script so I want to allow caching. >> >> But PHP always sends the following headers: >> >> Array >> ( >> [0] => X-Powered-By: PHP/5.2.6 >> [1] => Expires: Thu, 19 Nov 1981 08:52:00 GMT >> [2] => Cache-Control: no-store, no-cache, must-revalidate, >> post-check=0, pre-check=0 >> [3] => Pragma: no-cache >> ) >> >> AFAIK it's not possible to remove or suppress headers but I can of >> course overwrite them. >> >> The question is: with what? >> >> For the Expires header I suppose it could just be the RFC822 time for >> now + 1 hour. >> >> For the Cache-Control header it's less clear. Here's the spec but I'm >> still trying to decipher the meaning of each directive: >> >> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 >> >> For the Pragma header I'm largely clueless. >> >> Does anyone know what values for these headers would be equivalent to >> not specifying them at all? >> > > Is there any particular reason you need PHP to send the files? You do > have a couple more options. I usually use PHP to write a static file, > then let Apache serve it up as an actual css/js file. You can even use > sweet mod_rewrite rules to hit the php file if the requested css/js > file isn't present. If you're just reading a file from disk and > spitting it out with PHP, you might want to have PHP send your > favorite flavor of redirect header instead. > > As far as which headers to send, I poked around a bit. You'd be > surprised how many of the big guys just dump the css on every single > page... But a few that served actual files had headers like the > following. Note that all these css files are coming from a CDN. For > what that's worth. > > > Headers for an Amazon.com css file: > > Cache-Control: max-age=630720000 > Date: Sun, 14 Sep 2008 04:03:45 GMT > Content-Type: text/css > Last-Modified: Thu, 28 Aug 2008 00:32:03 GMT > Server: Server > X-Cache-Lookup: MISS from cdn-images.amazon.com:8080 > X-Cache: MISS from cdn-images.amazon.com > Content-Encoding: deflate > Expires: Wed, 23 Aug 2028 00:39:01 GMT > Content-Length: 2018 > X-WR-MODIFICATION: Content-Length > > > And one from Yahoo.com: > > Date: Thu, 11 Sep 2008 21:50:36 GMT > Cache-Control: max-age=315360000 > Expires: Sun, 09 Sep 2018 21:50:36 GMT > Last-Modified: Mon, 17 Mar 2008 17:19:43 GMT > Accept-Ranges: bytes > Vary: Accept-Encoding > Content-Type: text/css > Content-Encoding: gzip > Age: 195294 > Content-Length: 1921 > Server: YTS/1.17.8 > > > Twitter seems to use a more reasonable cache length, you might try > something like this: > > Date: Sun, 14 Sep 2008 04:07:46 GMT > Server: Apache > Last-Modified: Fri, 12 Sep 2008 00:23:22 GMT > Accept-Ranges: bytes > Cache-Control: max-age=86400 > Expires: Mon, 15 Sep 2008 04:07:46 GMT > Vary: Accept-Encoding > Content-Encoding: gzip > Content-Length: 6509 > Content-Type: text/css > > > I wasn't able to find a css file that returned a Pragma header. > Perhaps you could try "Pragma: " ? > > justin > -- > http://justinhileman.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 Sun Sep 14 12:25:18 2008 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 14 Sep 2008 12:25:18 -0400 Subject: [nycphp-talk] Overwriting Cache Headers In-Reply-To: <117286890809140815m2cf875faxf314bd7651fb64fa@mail.gmail.com> References: <78c6bd860809132041r4726ce1co63ca5fbc291b4003@mail.gmail.com> <1dc0e7e00809132121t450a73p26b3703ffe8eab91@mail.gmail.com> <117286890809140815m2cf875faxf314bd7651fb64fa@mail.gmail.com> Message-ID: <78c6bd860809140925n313cffedh459a24a4e00f2f46@mail.gmail.com> On Sun, Sep 14, 2008 at 11:15 AM, Tom Melendez wrote: > Have you tried overwriting the header with the header() function, > either by making it blank ("Pragma:") or with the desired value? Hi Tom, That sort of works. What it does is actually send blank headers to the client like: Cache-Control: \r\n Pragma: \r\n But Firefox at least seems to handle this correctly. [Note: Firebug does not show you what was received on the network. It shows you what FF knows from the communication. This is actually good IMO but if you want to know what was really sent out on the network you'll want to double check with WireShark.] Also, in the process of Googling this issue I read some forum posts that claimed a blank header generated an error. But with at least PHP 5.2.6, calling header('Pragma:') doesn't seem to generate any errors that I can see so far. Or perhaps the posts were just wrong (e.g. actually a headers-already-sent problem). Anyway, from playing around with this, I have finally settled on the following to enable caching of PHP output on the client: header('Expires: ' . gmdate('D, d M Y H:i:s ', time() + (60 * 60)) . 'GMT'); header('Cache-Control:'); header('Pragma:'); At least with Firefox it seems caching is largely controlled by the Expires header. Note that I set the expiration for one hour. And I've only tried this will application/x-javascript and text/css output with Content-Disposition: filename=. Mike > On Sun, Sep 14, 2008 at 12:21 AM, justin wrote: >> On Sat, Sep 13, 2008 at 11:41 PM, Michael B Allen wrote: >>> I want to send css and js files from a PHP script so I want to allow caching. >>> >>> But PHP always sends the following headers: >>> >>> Array >>> ( >>> [0] => X-Powered-By: PHP/5.2.6 >>> [1] => Expires: Thu, 19 Nov 1981 08:52:00 GMT >>> [2] => Cache-Control: no-store, no-cache, must-revalidate, >>> post-check=0, pre-check=0 >>> [3] => Pragma: no-cache >>> ) >>> >>> AFAIK it's not possible to remove or suppress headers but I can of >>> course overwrite them. >>> >>> The question is: with what? >>> >>> For the Expires header I suppose it could just be the RFC822 time for >>> now + 1 hour. >>> >>> For the Cache-Control header it's less clear. Here's the spec but I'm >>> still trying to decipher the meaning of each directive: >>> >>> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 >>> >>> For the Pragma header I'm largely clueless. >>> >>> Does anyone know what values for these headers would be equivalent to >>> not specifying them at all? >>> >> >> Is there any particular reason you need PHP to send the files? You do >> have a couple more options. I usually use PHP to write a static file, >> then let Apache serve it up as an actual css/js file. You can even use >> sweet mod_rewrite rules to hit the php file if the requested css/js >> file isn't present. If you're just reading a file from disk and >> spitting it out with PHP, you might want to have PHP send your >> favorite flavor of redirect header instead. >> >> As far as which headers to send, I poked around a bit. You'd be >> surprised how many of the big guys just dump the css on every single >> page... But a few that served actual files had headers like the >> following. Note that all these css files are coming from a CDN. For >> what that's worth. >> >> >> Headers for an Amazon.com css file: >> >> Cache-Control: max-age=630720000 >> Date: Sun, 14 Sep 2008 04:03:45 GMT >> Content-Type: text/css >> Last-Modified: Thu, 28 Aug 2008 00:32:03 GMT >> Server: Server >> X-Cache-Lookup: MISS from cdn-images.amazon.com:8080 >> X-Cache: MISS from cdn-images.amazon.com >> Content-Encoding: deflate >> Expires: Wed, 23 Aug 2028 00:39:01 GMT >> Content-Length: 2018 >> X-WR-MODIFICATION: Content-Length >> >> >> And one from Yahoo.com: >> >> Date: Thu, 11 Sep 2008 21:50:36 GMT >> Cache-Control: max-age=315360000 >> Expires: Sun, 09 Sep 2018 21:50:36 GMT >> Last-Modified: Mon, 17 Mar 2008 17:19:43 GMT >> Accept-Ranges: bytes >> Vary: Accept-Encoding >> Content-Type: text/css >> Content-Encoding: gzip >> Age: 195294 >> Content-Length: 1921 >> Server: YTS/1.17.8 >> >> >> Twitter seems to use a more reasonable cache length, you might try >> something like this: >> >> Date: Sun, 14 Sep 2008 04:07:46 GMT >> Server: Apache >> Last-Modified: Fri, 12 Sep 2008 00:23:22 GMT >> Accept-Ranges: bytes >> Cache-Control: max-age=86400 >> Expires: Mon, 15 Sep 2008 04:07:46 GMT >> Vary: Accept-Encoding >> Content-Encoding: gzip >> Content-Length: 6509 >> Content-Type: text/css >> >> >> I wasn't able to find a css file that returned a Pragma header. >> Perhaps you could try "Pragma: " ? >> >> justin >> -- >> http://justinhileman.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 > -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From dsteplight at gmail.com Sun Sep 14 20:02:31 2008 From: dsteplight at gmail.com (Darryle Steplight) Date: Sun, 14 Sep 2008 20:02:31 -0400 Subject: [nycphp-talk] Overwriting Cache Headers In-Reply-To: <78c6bd860809140925n313cffedh459a24a4e00f2f46@mail.gmail.com> References: <78c6bd860809132041r4726ce1co63ca5fbc291b4003@mail.gmail.com> <1dc0e7e00809132121t450a73p26b3703ffe8eab91@mail.gmail.com> <117286890809140815m2cf875faxf314bd7651fb64fa@mail.gmail.com> <78c6bd860809140925n313cffedh459a24a4e00f2f46@mail.gmail.com> Message-ID: <47f4c4570809141702k18b4ad26h2ce0ce1ed51c4fcc@mail.gmail.com> Michael, Firebug doesn't show you header information but the Web Developer Toolkit for FireFox does. Once installed, just go to Information > View Response Headers. Also, if you want to see what files are being used during your ajax scripts or any header redirects,etc then download FF's Live HTTP Headers plugin. Chrome's Inspect Element does a pretty good job at this too, IMHO. On Sun, Sep 14, 2008 at 12:25 PM, Michael B Allen wrote: > On Sun, Sep 14, 2008 at 11:15 AM, Tom Melendez wrote: >> Have you tried overwriting the header with the header() function, >> either by making it blank ("Pragma:") or with the desired value? > > Hi Tom, > > That sort of works. What it does is actually send blank headers to the > client like: > > Cache-Control: \r\n > Pragma: \r\n > > But Firefox at least seems to handle this correctly. > > [Note: Firebug does not show you what was received on the network. It > shows you what FF knows from the communication. This is actually good > IMO but if you want to know what was really sent out on the network > you'll want to double check with WireShark.] > > Also, in the process of Googling this issue I read some forum posts > that claimed a blank header generated an error. But with at least PHP > 5.2.6, calling header('Pragma:') doesn't seem to generate any errors > that I can see so far. Or perhaps the posts were just wrong (e.g. > actually a headers-already-sent problem). > > Anyway, from playing around with this, I have finally settled on the > following to enable caching of PHP output on the client: > > header('Expires: ' . gmdate('D, d M Y H:i:s ', time() + (60 * 60)) . 'GMT'); > header('Cache-Control:'); > header('Pragma:'); > > At least with Firefox it seems caching is largely controlled by the > Expires header. Note that I set the expiration for one hour. And I've > only tried this will application/x-javascript and text/css output with > Content-Disposition: filename=. > > Mike > >> On Sun, Sep 14, 2008 at 12:21 AM, justin wrote: >>> On Sat, Sep 13, 2008 at 11:41 PM, Michael B Allen wrote: >>>> I want to send css and js files from a PHP script so I want to allow caching. >>>> >>>> But PHP always sends the following headers: >>>> >>>> Array >>>> ( >>>> [0] => X-Powered-By: PHP/5.2.6 >>>> [1] => Expires: Thu, 19 Nov 1981 08:52:00 GMT >>>> [2] => Cache-Control: no-store, no-cache, must-revalidate, >>>> post-check=0, pre-check=0 >>>> [3] => Pragma: no-cache >>>> ) >>>> >>>> AFAIK it's not possible to remove or suppress headers but I can of >>>> course overwrite them. >>>> >>>> The question is: with what? >>>> >>>> For the Expires header I suppose it could just be the RFC822 time for >>>> now + 1 hour. >>>> >>>> For the Cache-Control header it's less clear. Here's the spec but I'm >>>> still trying to decipher the meaning of each directive: >>>> >>>> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 >>>> >>>> For the Pragma header I'm largely clueless. >>>> >>>> Does anyone know what values for these headers would be equivalent to >>>> not specifying them at all? >>>> >>> >>> Is there any particular reason you need PHP to send the files? You do >>> have a couple more options. I usually use PHP to write a static file, >>> then let Apache serve it up as an actual css/js file. You can even use >>> sweet mod_rewrite rules to hit the php file if the requested css/js >>> file isn't present. If you're just reading a file from disk and >>> spitting it out with PHP, you might want to have PHP send your >>> favorite flavor of redirect header instead. >>> >>> As far as which headers to send, I poked around a bit. You'd be >>> surprised how many of the big guys just dump the css on every single >>> page... But a few that served actual files had headers like the >>> following. Note that all these css files are coming from a CDN. For >>> what that's worth. >>> >>> >>> Headers for an Amazon.com css file: >>> >>> Cache-Control: max-age=630720000 >>> Date: Sun, 14 Sep 2008 04:03:45 GMT >>> Content-Type: text/css >>> Last-Modified: Thu, 28 Aug 2008 00:32:03 GMT >>> Server: Server >>> X-Cache-Lookup: MISS from cdn-images.amazon.com:8080 >>> X-Cache: MISS from cdn-images.amazon.com >>> Content-Encoding: deflate >>> Expires: Wed, 23 Aug 2028 00:39:01 GMT >>> Content-Length: 2018 >>> X-WR-MODIFICATION: Content-Length >>> >>> >>> And one from Yahoo.com: >>> >>> Date: Thu, 11 Sep 2008 21:50:36 GMT >>> Cache-Control: max-age=315360000 >>> Expires: Sun, 09 Sep 2018 21:50:36 GMT >>> Last-Modified: Mon, 17 Mar 2008 17:19:43 GMT >>> Accept-Ranges: bytes >>> Vary: Accept-Encoding >>> Content-Type: text/css >>> Content-Encoding: gzip >>> Age: 195294 >>> Content-Length: 1921 >>> Server: YTS/1.17.8 >>> >>> >>> Twitter seems to use a more reasonable cache length, you might try >>> something like this: >>> >>> Date: Sun, 14 Sep 2008 04:07:46 GMT >>> Server: Apache >>> Last-Modified: Fri, 12 Sep 2008 00:23:22 GMT >>> Accept-Ranges: bytes >>> Cache-Control: max-age=86400 >>> Expires: Mon, 15 Sep 2008 04:07:46 GMT >>> Vary: Accept-Encoding >>> Content-Encoding: gzip >>> Content-Length: 6509 >>> Content-Type: text/css >>> >>> >>> I wasn't able to find a css file that returned a Pragma header. >>> Perhaps you could try "Pragma: " ? >>> >>> justin >>> -- >>> http://justinhileman.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 >> > > > > -- > Michael B Allen > PHP Active Directory SPNEGO SSO > http://www.ioplex.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 jcampbell1 at gmail.com Mon Sep 15 00:13:25 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 15 Sep 2008 00:13:25 -0400 Subject: [nycphp-talk] how to pass array from php to javascript In-Reply-To: <422973430809130910q7407cb8qfdb4ee9ae506afd9@mail.gmail.com> References: <422973430809130910q7407cb8qfdb4ee9ae506afd9@mail.gmail.com> Message-ID: <8f0676b40809142113p20163031mb3db3c5632606e2f@mail.gmail.com> On Sat, Sep 13, 2008 at 12:10 PM, Cristian Baltatescu wrote: > > > On Sat, Sep 13, 2008 at 5:42 PM, chad qian wrote: >> >> How to pass array from php to javascrip?thanks! >> >> Here is my sample code: >> > require "include/connection.php"; >> //$menu_name=$_GET['menus']; >> //$menulist= array("Peter", "Joe", "Glenn", "Cleveland"); >> //reset($menulist); >> $menulist=array(); >> $q="select name from menus"; >> $result=mysql_query($q); >> while($row=mysql_fetch_array($result)){ >> $name=$row['name']; >> array_push($menulist,'$name'); >> } >> ?> >> >> > > Hello, > you could use json_encode() to encode your array in php to the json format > and then print it out from php inside the html, then decode the array using > js's json functions. > But as long as you do that you could print it straightforward, just write > from php the "html" code that defines the array in js. +1 for json... below is what you need to do: -John C. From jcampbell1 at gmail.com Mon Sep 15 01:16:32 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Mon, 15 Sep 2008 01:16:32 -0400 Subject: [nycphp-talk] how to pass array from php to javascript In-Reply-To: <8f0676b40809142113p20163031mb3db3c5632606e2f@mail.gmail.com> References: <422973430809130910q7407cb8qfdb4ee9ae506afd9@mail.gmail.com> <8f0676b40809142113p20163031mb3db3c5632606e2f@mail.gmail.com> Message-ID: <8f0676b40809142216t720641c4w61f23ab295710054@mail.gmail.com> On Mon, Sep 15, 2008 at 12:13 AM, John Campbell wrote: > On Sat, Sep 13, 2008 at 12:10 PM, Cristian Baltatescu > wrote: >> >> >> On Sat, Sep 13, 2008 at 5:42 PM, chad qian wrote: >>> >>> How to pass array from php to javascrip?thanks! >>> >>> Here is my sample code: >>> >> require "include/connection.php"; >>> //$menu_name=$_GET['menus']; >>> //$menulist= array("Peter", "Joe", "Glenn", "Cleveland"); >>> //reset($menulist); >>> $menulist=array(); >>> $q="select name from menus"; >>> $result=mysql_query($q); >>> while($row=mysql_fetch_array($result)){ >>> $name=$row['name']; >>> array_push($menulist,'$name'); >>> } >>> ?> >>> >>> >> >> Hello, >> you could use json_encode() to encode your array in php to the json format >> and then print it out from php inside the html, then decode the array using >> js's json functions. >> But as long as you do that you could print it straightforward, just write >> from php the "html" code that defines the array in js. > > +1 for json... below is what you need to do: > > Whoops.... it's a bit late. You don't even need to bother with the eval stuff. using eval becomes important when you are using the xmlHTTPRequest. just: Regards, John Campbell From bzcoder at bzcode.com Mon Sep 15 17:17:10 2008 From: bzcoder at bzcode.com (bzcoder) Date: Mon, 15 Sep 2008 17:17:10 -0400 Subject: [nycphp-talk] Overwriting Cache Headers In-Reply-To: <78c6bd860809132041r4726ce1co63ca5fbc291b4003@mail.gmail.com> References: <78c6bd860809132041r4726ce1co63ca5fbc291b4003@mail.gmail.com> Message-ID: <48CED0D6.8070801@bzcode.com> While I'm not familiar with this much at all, I dug through minify and they have a number of headers set there, so you might want to see how they do it. After all, their up to version 2, so they must have gone through the pain of headers already. http://code.google.com/p/minify/ (Minify is a library you can use to combine/compress css or javascript files on a page to save loadtime) From ben at projectskyline.com Wed Sep 17 15:05:57 2008 From: ben at projectskyline.com (Ben Sgro) Date: Wed, 17 Sep 2008 15:05:57 -0400 Subject: [nycphp-talk] Building PECL Sources Message-ID: <48D15515.9030107@projectskyline.com> Hello, I want to fix a bug (from '06) in the PECL PDO database adapter (http://cvs.php.net/viewvc.cgi/pecl/pdo_dblib/). There is zero documentation for this project however - I've just contacted the lead dev and I'm awaiting a response. I'm interested if anyone on the list has experience working w/the PECL C Sources - most importantly, what are you using to compile them and what do you have to link them with at build time? Windows, OSX or Linux? GCC or VS? Any feedback would be helpful. Thanks, - Ben From chsnyder at gmail.com Wed Sep 17 15:18:46 2008 From: chsnyder at gmail.com (csnyder) Date: Wed, 17 Sep 2008 15:18:46 -0400 Subject: [nycphp-talk] Building PECL Sources In-Reply-To: <48D15515.9030107@projectskyline.com> References: <48D15515.9030107@projectskyline.com> Message-ID: On Wed, Sep 17, 2008 at 3:05 PM, Ben Sgro wrote: > I'm interested if anyone on the list has experience working w/the PECL C > Sources - most importantly, what are you using to compile them > and what do you have to link them with at build time? Windows, OSX or Linux? > GCC or VS? I'm on Linux, so gcc. Generally pecl install just works. I've run into errors at the configure stage a few times, but it was relatively easy to figure out what was missing (or misplaced) and fix it. Windows is obviously a whole different ball of wax. Do people use Cygwin for that or what? Chris Snyder http://chxor.chxo.com/ From steve.francia at gmail.com Wed Sep 17 15:36:09 2008 From: steve.francia at gmail.com (Steve Francia) Date: Wed, 17 Sep 2008 15:36:09 -0400 Subject: [nycphp-talk] Which PHP Unit Testing Framework do you prefer (and why?) Message-ID: <3E3190B4-63E7-469C-A97F-9232F2E8C021@gmail.com> Which PHP Unit Testing Framework do you prefer (and why?) http://friendfeedback.com/questions/answer/tiks Respond at the poll at the url above. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Sep 17 15:38:29 2008 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 17 Sep 2008 15:38:29 -0400 (EDT) Subject: [nycphp-talk] SWF -> JPEG/GIF? Message-ID: Is there any way to generate a thumbnail image of a Flash movie (SWF) in PHP? -- A From compustretch at gmail.com Wed Sep 17 15:46:11 2008 From: compustretch at gmail.com (forest mars) Date: Wed, 17 Sep 2008 15:46:11 -0400 Subject: [nycphp-talk] SWF -> JPEG/GIF? In-Reply-To: References: Message-ID: On Wed, Sep 17, 2008 at 3:38 PM, Ajai Khattri wrote: > > Is there any way to generate a thumbnail image of a Flash movie (SWF) in > PHP? > > You could always use the class: http://www.phpclasses.org/browse/package/4312.html YMMV, of course, -?orest mars http://identi.ca/forest -- "In theory, theory and practice are exactly the same. In practice, they're completely different." ------------------------------------------------------------------ -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 (C) 1997-1999 Network Associates, Inc. and its affiliated companies. (Diffie-Helman/DSS-only version) iQA/AwUBRkjTLDbz7LySoccvEQJDcQCguZZj4M4kOVOlOX4CtbgR0rppsdovAjra 3RRXIlkdzuYI0YJz4WyvKlTn =MLhk -----END PGP SIGNATURE----- This email is: [ ] private: do not forward [ ] o.k. to forward [ ] o.k. to blog [ x ] ask first -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.kronen at kerstel-solutions.de Wed Sep 17 19:19:44 2008 From: r.kronen at kerstel-solutions.de (Ralf Kronen) Date: Thu, 18 Sep 2008 01:19:44 +0200 Subject: [nycphp-talk] Help with gdlib [ID:EYH7Qx4] Message-ID: <108920-22008931723194478@kerstel-solutions.de> Hello, i want to create an Button with your example in the GDLib Presentation. My Button looks like this: http://www.kerstel-solutions.de/button.jpg, the color (green) comes from the database. How must i make the 3 images (btn_body.png, btn_highlight.png, btn_shadow.png) that it shows like my button? Best Regards Ralf From tedd at sperling.com Thu Sep 18 12:39:40 2008 From: tedd at sperling.com (tedd) Date: Thu, 18 Sep 2008 12:39:40 -0400 Subject: [nycphp-talk] SWF -> JPEG/GIF? In-Reply-To: References: Message-ID: At 3:38 PM -0400 9/17/08, Ajai Khattri wrote: >Is there any way to generate a thumbnail image of a Flash movie (SWF) in >PHP? > >-- >A Yep, there is a way -- I've seen it done. But, I didn't do I myself and I don't have a reference for you. But, it IS possible. Sorry, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From chsnyder at gmail.com Thu Sep 18 13:00:09 2008 From: chsnyder at gmail.com (csnyder) Date: Thu, 18 Sep 2008 13:00:09 -0400 Subject: [nycphp-talk] SWF -> JPEG/GIF? In-Reply-To: References: Message-ID: On Thu, Sep 18, 2008 at 12:39 PM, tedd wrote: > At 3:38 PM -0400 9/17/08, Ajai Khattri wrote: >> >> Is there any way to generate a thumbnail image of a Flash movie (SWF) in >> PHP? >> >> -- >> A > > > Yep, there is a way -- I've seen it done. But, I didn't do I myself and I > don't have a reference for you. But, it IS possible. > If nothing else, you could go the Rube Goldberg route: script to open movie in browser window, take screenshot of browser window, then resize the resulting image and return the thumbnail. For your sake, I hope there's a library (or maybe a 3rd party service with an api) that just does it directly. From artur at marnik.net Thu Sep 18 14:15:49 2008 From: artur at marnik.net (Artur Marnik) Date: Thu, 18 Sep 2008 14:15:49 -0400 Subject: [nycphp-talk] SWF -> JPEG/GIF? In-Reply-To: References: Message-ID: <48D29AD5.9060506@marnik.net> csnyder wrote: > On Thu, Sep 18, 2008 at 12:39 PM, tedd wrote: >> At 3:38 PM -0400 9/17/08, Ajai Khattri wrote: >>> Is there any way to generate a thumbnail image of a Flash movie (SWF) in >>> PHP? >>> >>> -- >>> A >> >> Yep, there is a way -- I've seen it done. But, I didn't do I myself and I >> don't have a reference for you. But, it IS possible. >> > > If nothing else, you could go the Rube Goldberg route: script to open > movie in browser window, take screenshot of browser window, then > resize the resulting image and return the thumbnail. > > For your sake, I hope there's a library (or maybe a 3rd party service > with an api) that just does it directly. > _______________________________________________ You can use http://ffmpeg.mplayerhq.hu/ great tool I used it but you need a ssh access to your box to compile the binary (I am using 1and1 and I compiled it without root privileges) I used to use this script: \n"; exec($command); } echo "done\n\n"; ?> it will give you 10 frames (every 1 second) starting form the beginning of the movie it worked great but I don't remember why I used .gif instead of .jpg :) maybe on 1and1 some jpeg library was missing Artur From artur at marnik.net Thu Sep 18 14:19:46 2008 From: artur at marnik.net (Artur Marnik) Date: Thu, 18 Sep 2008 14:19:46 -0400 Subject: [nycphp-talk] SWF -> JPEG/GIF? In-Reply-To: <48D29AD5.9060506@marnik.net> References: <48D29AD5.9060506@marnik.net> Message-ID: <48D29BC2.1050000@marnik.net> Artur Marnik wrote: > csnyder wrote: >> On Thu, Sep 18, 2008 at 12:39 PM, tedd wrote: >>> At 3:38 PM -0400 9/17/08, Ajai Khattri wrote: >>>> Is there any way to generate a thumbnail image of a Flash movie >>>> (SWF) in >>>> PHP? >>>> >>>> -- >>>> A >>> >>> Yep, there is a way -- I've seen it done. But, I didn't do I myself >>> and I >>> don't have a reference for you. But, it IS possible. >>> >> >> If nothing else, you could go the Rube Goldberg route: script to open >> movie in browser window, take screenshot of browser window, then >> resize the resulting image and return the thumbnail. >> >> For your sake, I hope there's a library (or maybe a 3rd party service >> with an api) that just does it directly. >> _______________________________________________ > > > You can use http://ffmpeg.mplayerhq.hu/ > great tool I used it but you need a ssh access to your box to compile > the binary (I am using 1and1 and I compiled it without root privileges) > > I used to use this script: > > $script_path = "/kunden/homepages/16/xxx/htdocs/ffmpeg"; > $flv_path = "/kunden/homepages/16/xxx/htdocs/"; > $jpg_path = "/kunden/homepages/16/xxx/htdocs/jpg/"; > $filename = "test.flv"; > $seconds = 10; > $image_name = "frame"; > > for ($i = 0; $i <= $seconds $i++) { > $command = $script_path."/ffmpeg -i ".$flv_path."/".$filename. > " -ss ".$i." -vframes 1 -f gif -pix_fmt rgb24". > $jpg_path."/".$image_name."_".$i.".gif"; > echo $command."
\n"; > exec($command); > } > > echo "done\n\n"; > ?> > > it will give you 10 frames (every 1 second) starting form the beginning > of the movie > it worked great but I don't remember why I used .gif instead of .jpg :) > maybe on 1and1 some jpeg library was missing > > Artur I just noticed that you want SWF -> JPG not FLV -> JPG I read "flash movie" and assumed .flv I am not sure if ffmpeg can do swf - check their docs Artur From jcampbell1 at gmail.com Thu Sep 18 14:40:14 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 18 Sep 2008 14:40:14 -0400 Subject: [nycphp-talk] SWF -> JPEG/GIF? In-Reply-To: References: Message-ID: <8f0676b40809181140q47c658d9r5a5850a51cd61d93@mail.gmail.com> On Wed, Sep 17, 2008 at 3:38 PM, Ajai Khattri wrote: > > Is there any way to generate a thumbnail image of a Flash movie (SWF) in > PHP? There is nothing for PHP. Your best bet is to setup service running on a desktop computer that can take screenshots. You can set it up with AppleScript+Safari or IE+VBScript. From zippy1981 at gmail.com Fri Sep 19 09:14:37 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Fri, 19 Sep 2008 09:14:37 -0400 Subject: [nycphp-talk] Need a code diagrammer Message-ID: <5458db3c0809190614j4bfd51f7w6d7ed399de84a22a@mail.gmail.com> Folks, Can anyone recommend something to make code diagrams from PHP code. My requirements are as follows: 1) Pretty looking but somewhat functional. I'm presenting code to other programmers, but I'd like something to put in a powerpoint slide. 2) I'd prefer if it generated bitmap (png, jpeg, gif tiff) images. Again, I want this to go in a powerpoint presentation. Since I can take screenshots this is not that big a requirement. 3) It has to handle non object code and smarty templates. Most of my code is contained in classes, but I have a file of functions that are not in a static class and I'd like to to diagram the scripts in the webroot. I also don't want it to compile the smarty templates into PHP and diagram them. 4) (Unrelated) Does anyone know of a tool for diagramming MS SQL databases? Visio's "Reverse engineer database" is ok, Sql management studio database diagrams are slightly better, but lack view support. Neither will diagram stored procs or functions, even though Visio claims it will. if anyone has a closed source tool that does this, I have a small open source database (will be released with the app after I give my presentation) and I can email you a small MDF or the sql schema. if you can get me a schema diagram appropriately sized for a powerpoint slide. Regards From dorgan at donaldorgan.com Fri Sep 19 09:20:47 2008 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Fri, 19 Sep 2008 09:20:47 -0400 (EDT) Subject: [nycphp-talk] Need a code diagrammer In-Reply-To: <5458db3c0809190614j4bfd51f7w6d7ed399de84a22a@mail.gmail.com> Message-ID: <14183512.01221830447299.JavaMail.root@twoguyshosting.com.> Try this. http://t3.dotgnu.info/blog/php/inclued-gives-you-clue.html ----- Original Message ----- From: "Justin Dearing" To: "NYPHP Talk" Sent: Friday, September 19, 2008 9:14:37 AM GMT -05:00 US/Canada Eastern Subject: [nycphp-talk] Need a code diagrammer Folks, Can anyone recommend something to make code diagrams from PHP code. My requirements are as follows: 1) Pretty looking but somewhat functional. I'm presenting code to other programmers, but I'd like something to put in a powerpoint slide. 2) I'd prefer if it generated bitmap (png, jpeg, gif tiff) images. Again, I want this to go in a powerpoint presentation. Since I can take screenshots this is not that big a requirement. 3) It has to handle non object code and smarty templates. Most of my code is contained in classes, but I have a file of functions that are not in a static class and I'd like to to diagram the scripts in the webroot. I also don't want it to compile the smarty templates into PHP and diagram them. 4) (Unrelated) Does anyone know of a tool for diagramming MS SQL databases? Visio's "Reverse engineer database" is ok, Sql management studio database diagrams are slightly better, but lack view support. Neither will diagram stored procs or functions, even though Visio claims it will. if anyone has a closed source tool that does this, I have a small open source database (will be released with the app after I give my presentation) and I can email you a small MDF or the sql schema. if you can get me a schema diagram appropriately sized for a powerpoint slide. Regards _______________________________________________ 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 bzcoder at bzcode.com Fri Sep 19 09:23:34 2008 From: bzcoder at bzcode.com (bzcoder) Date: Fri, 19 Sep 2008 09:23:34 -0400 Subject: [nycphp-talk] SWF -> JPEG/GIF? In-Reply-To: References: Message-ID: <48D3A7D6.5010107@bzcode.com> Ajai Khattri wrote: > Is there any way to generate a thumbnail image of a Flash movie (SWF) in > PHP? > > > Using ffmpeg, http://ffmpeg-php.sourceforge.net/ (you can also use the command line, but this is the utility all the youtube clone sites use) ffmpeg supports swf, but how easily it can pull the video is a subject of discussion. There are also various services, such as: http://heywatch.com/page/home Which have API's to convert video formats. Most, IIRC also produce a thumbnail of the conversion, so you could use them if you don't want to muck with ffmpeg yourself[and ffmpeg can be a nightmare to muck with. It can also go very easily, so I would tend to say try it on your site and see what happens.] From chsnyder at gmail.com Fri Sep 19 10:14:24 2008 From: chsnyder at gmail.com (csnyder) Date: Fri, 19 Sep 2008 10:14:24 -0400 Subject: [nycphp-talk] SWF -> JPEG/GIF? In-Reply-To: <48D3A7D6.5010107@bzcode.com> References: <48D3A7D6.5010107@bzcode.com> Message-ID: On Fri, Sep 19, 2008 at 9:23 AM, bzcoder wrote: > > Using ffmpeg, > http://ffmpeg-php.sourceforge.net/ > (you can also use the command line, but this is the utility all the youtube > clone sites use) > > ffmpeg supports swf, but how easily it can pull the video is a subject of > discussion. At first I thought you were confusing swf and flv. But then: /usr/local/bin/ffmpeg -formats | grep swf DE swf Flash format DEA adpcm_swf So it appears to be able to decode and encode in swf format. I have no idea what this means in practice... can ffmpeg actually create a Flash animation? But it would seem to mean that you could get a framegrab from a swf in much the same way that you can from a flv. Crazy. Wish I had time to try it. Chris Snyder http://chxor.chxo.com From bzcoder at bzcode.com Fri Sep 19 10:28:34 2008 From: bzcoder at bzcode.com (bzcoder) Date: Fri, 19 Sep 2008 10:28:34 -0400 Subject: [nycphp-talk] SWF -> JPEG/GIF? In-Reply-To: References: <48D3A7D6.5010107@bzcode.com> Message-ID: <48D3B712.3040202@bzcode.com> csnyder wrote: > idea what this means in practice... can ffmpeg actually create a Flash > animation? I don't know, I've only used ffmpeg for 2 purposes: 1) To translate avi and windows media files for a website to flash. Windows Media Files are a /pain/ to translate because you can have a perfectly playable windows media file but it has a bit of corruption which results in ffmpeg truncating the file. What was worse was that everything worked fine and then stopped one day and the client insisted they didn't do anything differently. After a week or so of investigating, they mentioned that they upgraded their software used to create the windows media file which resulted in it generating funky stuff at the end. [Hint: if your trying to troubleshoot a problem, the first thing to do is upload it to youtube and/or google video. This at least tells you if it is possible to convert the file to flash, as if they can't do it, I refuse to spend my time on a fixed price contract tracking down every little variable and testing it.] 2) I fiddled with some shell scripts on my mythtv box at home to convert tv to flash video format suitable for playing on the wii[so I could record to my PC and than watch it over the wireless network on the TV using the WII] In both cases, I was just converting, not creating from scratch. From ramons at gmx.net Fri Sep 19 12:42:25 2008 From: ramons at gmx.net (David Krings) Date: Fri, 19 Sep 2008 12:42:25 -0400 Subject: [nycphp-talk] Need a code diagrammer In-Reply-To: <5458db3c0809190614j4bfd51f7w6d7ed399de84a22a@mail.gmail.com> References: <5458db3c0809190614j4bfd51f7w6d7ed399de84a22a@mail.gmail.com> Message-ID: <48D3D671.7050400@gmx.net> Justin Dearing wrote: > 3) It has to handle non object code and smarty templates. Most of my > code is contained in classes, but I have a file of functions that are Huh? Aren't you supposed to make those diagrams before you write code? This is how they teach it in school and so far I met only one developer who does that (isn't me). His code is flawless most of the time. > not in a static class and I'd like to to diagram the scripts in the > webroot. I also don't want it to compile the smarty templates into PHP > and diagram them. The only application I ever saw for this task is this one: http://www.vista-files.org/programs/cad-kas-gbr/c-delphi-basic-code-2-flowchart.html It will cost you, which is something you may not have planned on. > 4) (Unrelated) Does anyone know of a tool for diagramming MS SQL > databases? Visio's "Reverse engineer database" is ok, Sql management > studio database diagrams are slightly better, but lack view support. > Neither will diagram stored procs or functions, even though Visio > claims it will. if anyone has a closed source tool that does this, I > have a small open source database (will be released with the app after > I give my presentation) and I can email you a small MDF or the sql > schema. if you can get me a schema diagram appropriately sized for a > powerpoint slide. I work with some MSSQL gurus...I'll ask them. David From ramons at gmx.net Fri Sep 19 12:49:21 2008 From: ramons at gmx.net (David Krings) Date: Fri, 19 Sep 2008 12:49:21 -0400 Subject: [nycphp-talk] SWF -> JPEG/GIF? In-Reply-To: <48D3B712.3040202@bzcode.com> References: <48D3A7D6.5010107@bzcode.com> <48D3B712.3040202@bzcode.com> Message-ID: <48D3D811.5040900@gmx.net> bzcoder wrote: > 2) I fiddled with some shell scripts on my mythtv box at home to convert > tv to flash video format suitable for playing on the wii[so I could > record to my PC and than watch it over the wireless network on the TV > using the WII] In case you are interested in something that requires less fiddling you can try the RivaVX encoder. Free to use and idiotproof (that's why I use it). It has two disadvantages, it runs only on Windoze and doesn't handle german Umlaute, unless they recently fixed that. One would guess they tested that since it is a german company.... Coming back to the original question. Does it need to be an automated process? How many videos would be need to be thumbnailed? If that is for adding a few dozen files once in a while making a quick screenshot is probably the easiest and quickest way, less kewl though. David From tmpvar at gmail.com Fri Sep 19 13:40:35 2008 From: tmpvar at gmail.com (Elijah Insua) Date: Fri, 19 Sep 2008 10:40:35 -0700 Subject: [nycphp-talk] Need a code diagrammer In-Reply-To: <48D3D671.7050400@gmx.net> References: <5458db3c0809190614j4bfd51f7w6d7ed399de84a22a@mail.gmail.com> <48D3D671.7050400@gmx.net> Message-ID: <2b4feca10809191040w390c1b16m52a18ba31b3c662b@mail.gmail.com> Hello, I love dbdesigner4, but it is MySQL only. -- Elijah On Fri, Sep 19, 2008 at 9:42 AM, David Krings wrote: > Justin Dearing wrote: > > 3) It has to handle non object code and smarty templates. Most of my >> code is contained in classes, but I have a file of functions that are >> > > Huh? Aren't you supposed to make those diagrams before you write code? This > is how they teach it in school and so far I met only one developer who does > that (isn't me). His code is flawless most of the time. > > not in a static class and I'd like to to diagram the scripts in the >> webroot. I also don't want it to compile the smarty templates into PHP >> and diagram them. >> > > The only application I ever saw for this task is this one: > > http://www.vista-files.org/programs/cad-kas-gbr/c-delphi-basic-code-2-flowchart.html > It will cost you, which is something you may not have planned on. > > > 4) (Unrelated) Does anyone know of a tool for diagramming MS SQL >> databases? Visio's "Reverse engineer database" is ok, Sql management >> studio database diagrams are slightly better, but lack view support. >> Neither will diagram stored procs or functions, even though Visio >> claims it will. if anyone has a closed source tool that does this, I >> have a small open source database (will be released with the app after >> I give my presentation) and I can email you a small MDF or the sql >> schema. if you can get me a schema diagram appropriately sized for a >> powerpoint slide. >> > > I work with some MSSQL gurus...I'll ask them. > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zippy1981 at gmail.com Fri Sep 19 13:56:57 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Fri, 19 Sep 2008 13:56:57 -0400 Subject: [nycphp-talk] Need a code diagrammer In-Reply-To: <48D3D671.7050400@gmx.net> References: <5458db3c0809190614j4bfd51f7w6d7ed399de84a22a@mail.gmail.com> <48D3D671.7050400@gmx.net> Message-ID: <5458db3c0809191056g554ba3e5ob5986e566f83ed95@mail.gmail.com> On Fri, Sep 19, 2008 at 12:42 PM, David Krings wrote: > Justin Dearing wrote: > >> 3) It has to handle non object code and smarty templates. Most of my >> code is contained in classes, but I have a file of functions that are > > Huh? Aren't you supposed to make those diagrams before you write code? This > is how they teach it in school and so far I met only one developer who does > that (isn't me). His code is flawless most of the time. Well there are tools for doing it either way at least in other languages. There's a special visio/visual studio 2003 combination where you can diagram your database/object model and your data center. it generates your classes, method stubs, and database for you. Most of that functionality still exists. For the reverse, in the land if .NET, you can make code diagrams in Visual Studio out of your classes. I do think the idea of drawing out your basic code and filling in the functionality is beneficial, especially if there is some sort of ORM tool involved so you draw your database schema and data access classes simultaneously. I think a better approach is to write out your schema in some sort of meta language. One place where this occurs is a application called Andromeda. http://sourceforge.net/projects/andro I happen to have made a few commits with regards to windows functionality to this app, but I've to write a real application with it. The schema file will even generate your security model and basic CRUD screens. Now regardless of what should happen in real life when you want to get real work done, I'm giving a presentation where I am demonstrating specific language features and specific API's. This means I'm writing code by hand, verbosely commenting it and looking to diagram it after the fact. I even tell people not to use this code in my presentation. >> not in a static class and I'd like to to diagram the scripts in the >> webroot. I also don't want it to compile the smarty templates into PHP >> and diagram them. > > The only application I ever saw for this task is this one: > http://www.vista-files.org/programs/cad-kas-gbr/c-delphi-basic-code-2-flowchart.html > It will cost you, which is something you may not have planned on. I shall check it out, but the screenshot seems to be the opposite level of verbosity as Donald's suggestion. Donalds suggestion tracked files, this one tracks almost at the level of lines of code. Ideally, I want a list of classes, function, and their parameter types, both explicitly stated where php allows, and the rest infered from the @param and @return tags in the php documentation blocks. Since that probably doesn't exist I'll use Donald'd suggestion . That will also force me to talk about the slide instead of repeating the slide. >> 4) (Unrelated) Does anyone know of a tool for diagramming MS SQL >> databases? Visio's "Reverse engineer database" is ok, Sql management >> studio database diagrams are slightly better, but lack view support. >> Neither will diagram stored procs or functions, even though Visio >> claims it will. if anyone has a closed source tool that does this, I >> have a small open source database (will be released with the app after >> I give my presentation) and I can email you a small MDF or the sql >> schema. if you can get me a schema diagram appropriately sized for a >> powerpoint slide. > > I work with some MSSQL gurus...I'll ask them. Thanks From mmwaldman at optonline.net Fri Sep 19 17:49:00 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 17:49:00 -0400 Subject: [nycphp-talk] Search function Message-ID: <0K7G00D6VPXN0X10@mta3.srv.hcvlny.cv.net> Does anyone know of a function or code I could use to quickly search my site for a document? I was thinking I could write a php function to open all of the files and search for a specific string. But, I'm guessing it's already been done with a better implementation. Thanks, Michele -------------- next part -------------- An HTML attachment was scrubbed... URL: From codebowl at gmail.com Fri Sep 19 17:51:30 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 19 Sep 2008 17:51:30 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G00D6VPXN0X10@mta3.srv.hcvlny.cv.net> References: <0K7G00D6VPXN0X10@mta3.srv.hcvlny.cv.net> Message-ID: <1B766D26-7597-4D35-AC1C-4E4998E2714E@gmail.com> If you have SSH access you could use grep, if not write a php script that will exec() the grep command. This is providing the hosts security allows for exec() On Sep 19, 2008, at 5:49 PM, (Margaret) Michele Waldman wrote: > Does anyone know of a function or code I could use to quickly search > my site for a document? > > I was thinking I could write a php function to open all of the files > and search for a specific string. > > But, I?m guessing it?s already been done with a better implementation. > > Thanks, > > Michele > _______________________________________________ > 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 mmwaldman at optonline.net Fri Sep 19 18:07:00 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 18:07:00 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <1B766D26-7597-4D35-AC1C-4E4998E2714E@gmail.com> Message-ID: <0K7G001KEQRN60Z0@mta2.srv.hcvlny.cv.net> Would instr get_file_contents be too slow? Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Joseph Crawford Sent: Friday, September 19, 2008 5:52 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function If you have SSH access you could use grep, if not write a php script that will exec() the grep command. This is providing the hosts security allows for exec() On Sep 19, 2008, at 5:49 PM, (Margaret) Michele Waldman wrote: Does anyone know of a function or code I could use to quickly search my site for a document? I was thinking I could write a php function to open all of the files and search for a specific string. But, I'm guessing it's already been done with a better implementation. Thanks, Michele _______________________________________________ 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 mmwaldman at optonline.net Fri Sep 19 18:08:05 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 18:08:05 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G001KEQRN60Z0@mta2.srv.hcvlny.cv.net> Message-ID: <0K7G00CSYQTGWN10@mta3.srv.hcvlny.cv.net> Also, if someone searches for html, should I not return all html docs? What's the rule here? Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of (Margaret) Michele Waldman Sent: Friday, September 19, 2008 6:07 PM To: 'NYPHP Talk' Subject: RE: [nycphp-talk] Search function Would instr get_file_contents be too slow? Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Joseph Crawford Sent: Friday, September 19, 2008 5:52 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function If you have SSH access you could use grep, if not write a php script that will exec() the grep command. This is providing the hosts security allows for exec() On Sep 19, 2008, at 5:49 PM, (Margaret) Michele Waldman wrote: Does anyone know of a function or code I could use to quickly search my site for a document? I was thinking I could write a php function to open all of the files and search for a specific string. But, I'm guessing it's already been done with a better implementation. Thanks, Michele _______________________________________________ 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 codebowl at gmail.com Fri Sep 19 18:10:18 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 19 Sep 2008 18:10:18 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G001KEQRN60Z0@mta2.srv.hcvlny.cv.net> References: <0K7G001KEQRN60Z0@mta2.srv.hcvlny.cv.net> Message-ID: You could probably use that however it would be a lot slower than the exec with grep. Also it will depend on how many files you have in the site. I guess you could try it and if you run into the issue of the script taking longer than allowed to execute just up the time with ini_set(); Joseph Crawford On Sep 19, 2008, at 6:07 PM, (Margaret) Michele Waldman wrote: > Would instr get_file_contents be too slow? > > Michele > > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org > ] On Behalf Of Joseph Crawford > Sent: Friday, September 19, 2008 5:52 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Search function > > If you have SSH access you could use grep, if not write a php script > that will exec() the grep command. This is providing the hosts > security allows for exec() > > On Sep 19, 2008, at 5:49 PM, (Margaret) Michele Waldman wrote: > > > Does anyone know of a function or code I could use to quickly search > my site for a document? > > I was thinking I could write a php function to open all of the files > and search for a specific string. > > But, I?m guessing it?s already been done with a better implementation. > > Thanks, > > Michele > _______________________________________________ > 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 mmwaldman at optonline.net Fri Sep 19 18:13:51 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 18:13:51 -0400 Subject: [nycphp-talk] Search function In-Reply-To: Message-ID: <0K7G00BKGR32N9R0@mta4.srv.hcvlny.cv.net> It's a fairly slow site. I try the php get_file_contents, etc and if too slow exec grep. Thanks, Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Joseph Crawford Sent: Friday, September 19, 2008 6:10 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function You could probably use that however it would be a lot slower than the exec with grep. Also it will depend on how many files you have in the site. I guess you could try it and if you run into the issue of the script taking longer than allowed to execute just up the time with ini_set(); Joseph Crawford On Sep 19, 2008, at 6:07 PM, (Margaret) Michele Waldman wrote: Would instr get_file_contents be too slow? Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Joseph Crawford Sent: Friday, September 19, 2008 5:52 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function If you have SSH access you could use grep, if not write a php script that will exec() the grep command. This is providing the hosts security allows for exec() On Sep 19, 2008, at 5:49 PM, (Margaret) Michele Waldman wrote: Does anyone know of a function or code I could use to quickly search my site for a document? I was thinking I could write a php function to open all of the files and search for a specific string. But, I'm guessing it's already been done with a better implementation. Thanks, Michele _______________________________________________ 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 mmwaldman at optonline.net Fri Sep 19 18:14:20 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 18:14:20 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G00BKGR32N9R0@mta4.srv.hcvlny.cv.net> Message-ID: <0K7G002TWR3VM5W0@mta2.srv.hcvlny.cv.net> *small _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of (Margaret) Michele Waldman Sent: Friday, September 19, 2008 6:14 PM To: 'NYPHP Talk' Subject: RE: [nycphp-talk] Search function It's a fairly slow site. I try the php get_file_contents, etc and if too slow exec grep. Thanks, Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Joseph Crawford Sent: Friday, September 19, 2008 6:10 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function You could probably use that however it would be a lot slower than the exec with grep. Also it will depend on how many files you have in the site. I guess you could try it and if you run into the issue of the script taking longer than allowed to execute just up the time with ini_set(); Joseph Crawford On Sep 19, 2008, at 6:07 PM, (Margaret) Michele Waldman wrote: Would instr get_file_contents be too slow? Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Joseph Crawford Sent: Friday, September 19, 2008 5:52 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function If you have SSH access you could use grep, if not write a php script that will exec() the grep command. This is providing the hosts security allows for exec() On Sep 19, 2008, at 5:49 PM, (Margaret) Michele Waldman wrote: Does anyone know of a function or code I could use to quickly search my site for a document? I was thinking I could write a php function to open all of the files and search for a specific string. But, I'm guessing it's already been done with a better implementation. Thanks, Michele _______________________________________________ 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 jcampbell1 at gmail.com Fri Sep 19 18:17:00 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Fri, 19 Sep 2008 18:17:00 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G001KEQRN60Z0@mta2.srv.hcvlny.cv.net> References: <1B766D26-7597-4D35-AC1C-4E4998E2714E@gmail.com> <0K7G001KEQRN60Z0@mta2.srv.hcvlny.cv.net> Message-ID: <8f0676b40809191517w1e290a21rd80ec4a6b1323762@mail.gmail.com> On Fri, Sep 19, 2008 at 6:07 PM, (Margaret) Michele Waldman wrote: > Would instr get_file_contents be too slow? This is a really bad idea in general... Is there a reason Google's site search won't work? If you do something like exec(grep), make sure you know how to escape everything properly. It is possible someone could wreck the site with a specially crafted query. -John C. From codebowl at gmail.com Fri Sep 19 18:24:13 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 19 Sep 2008 18:24:13 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <8f0676b40809191517w1e290a21rd80ec4a6b1323762@mail.gmail.com> References: <1B766D26-7597-4D35-AC1C-4E4998E2714E@gmail.com> <0K7G001KEQRN60Z0@mta2.srv.hcvlny.cv.net> <8f0676b40809191517w1e290a21rd80ec4a6b1323762@mail.gmail.com> Message-ID: <9017F117-D083-45D3-BF01-DABB65327C64@gmail.com> John, From my understanding this was not something she wanted for site users, I thought she was searching for a string. If you are going to deploy this to users then you don't want to use either method we spoke about and use John's suggestion and use Google Site Search On Sep 19, 2008, at 6:17 PM, John Campbell wrote: > On Fri, Sep 19, 2008 at 6:07 PM, (Margaret) Michele Waldman > wrote: >> Would instr get_file_contents be too slow? > > This is a really bad idea in general... Is there a reason Google's > site search won't work? > > If you do something like exec(grep), make sure you know how to escape > everything properly. It is possible someone could wreck the site with > a specially crafted query. > > -John C. > _______________________________________________ > 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 mmwaldman at optonline.net Fri Sep 19 18:30:26 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 18:30:26 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <9017F117-D083-45D3-BF01-DABB65327C64@gmail.com> Message-ID: <0K7G0001YRUQHU60@mta4.srv.hcvlny.cv.net> Googles annual pricing for using their function is: Number of web pages Search Query Limit (annual) Pricing (annual) Up to 5,000 250,000 $100 5,001 - 50,000 250,000 $500 50,001 - 100,000 500,000 $850 100,001 - 300,000 500,000 $2,250 > 300,000 > 500,000 Contact sales. Is everyone in agreement? I'm guessing I'm not going to cheaply or quickly write something as sophisticated. Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Joseph Crawford Sent: Friday, September 19, 2008 6:24 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function John, From my understanding this was not something she wanted for site users, I thought she was searching for a string. If you are going to deploy this to users then you don't want to use either method we spoke about and use John's suggestion and use Google Site Search On Sep 19, 2008, at 6:17 PM, John Campbell wrote: > On Fri, Sep 19, 2008 at 6:07 PM, (Margaret) Michele Waldman > wrote: >> Would instr get_file_contents be too slow? > > This is a really bad idea in general... Is there a reason Google's > site search won't work? > > If you do something like exec(grep), make sure you know how to escape > everything properly. It is possible someone could wreck the site with > a specially crafted query. > > -John C. > _______________________________________________ > 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 codebowl at gmail.com Fri Sep 19 18:36:09 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 19 Sep 2008 18:36:09 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G0001YRUQHU60@mta4.srv.hcvlny.cv.net> References: <0K7G0001YRUQHU60@mta4.srv.hcvlny.cv.net> Message-ID: <1FE8E47E-A2FB-4149-9E18-E4FA4F8E0826@gmail.com> Michelle, check the source for this site, http://googlewebmastercentral.blogspot.com/2008/04/crawling-through-html-forms.html They have the google search and doubt they pay for it, it's a free method I believe On Sep 19, 2008, at 6:30 PM, (Margaret) Michele Waldman wrote: > Googles annual pricing for using their function is: > > Number of web pages Search Query Limit (annual) Pricing (annual) > Up to 5,000 250,000 $100 > 5,001 - 50,000 250,000 $500 > 50,001 - 100,000 500,000 $850 > 100,001 - 300,000 500,000 $2,250 >> 300,000 > 500,000 Contact sales. > > Is everyone in agreement? > > I'm guessing I'm not going to cheaply or quickly write something as > sophisticated. > > Michele > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org > ] On > Behalf Of Joseph Crawford > Sent: Friday, September 19, 2008 6:24 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Search function > > John, > > From my understanding this was not something she wanted for site > users, I thought she was searching for a string. > > If you are going to deploy this to users then you don't want to use > either method we spoke about and use John's suggestion and use Google > Site Search > > On Sep 19, 2008, at 6:17 PM, John Campbell wrote: > >> On Fri, Sep 19, 2008 at 6:07 PM, (Margaret) Michele Waldman >> wrote: >>> Would instr get_file_contents be too slow? >> >> This is a really bad idea in general... Is there a reason Google's >> site search won't work? >> >> If you do something like exec(grep), make sure you know how to escape >> everything properly. It is possible someone could wreck the site >> with >> a specially crafted query. >> >> -John C. >> _______________________________________________ >> 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 jcampbell1 at gmail.com Fri Sep 19 18:46:34 2008 From: jcampbell1 at gmail.com (John Campbell) Date: Fri, 19 Sep 2008 18:46:34 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G0001YRUQHU60@mta4.srv.hcvlny.cv.net> References: <9017F117-D083-45D3-BF01-DABB65327C64@gmail.com> <0K7G0001YRUQHU60@mta4.srv.hcvlny.cv.net> Message-ID: <8f0676b40809191546gfd4cdb3x4d88e7dfb0c88142@mail.gmail.com> On Fri, Sep 19, 2008 at 6:30 PM, (Margaret) Michele Waldman wrote: > Googles annual pricing for using their function is: > > Number of web pages Search Query Limit (annual) Pricing (annual) > Up to 5,000 250,000 $100 > 5,001 - 50,000 250,000 $500 > 50,001 - 100,000 500,000 $850 > 100,001 - 300,000 500,000 $2,250 >> 300,000 > 500,000 Contact sales. > > Is everyone in agreement? Yes and no. Google does offer a free version... I think it is called something like custom search. The drawback to the free version is that your content must already be in Google's index for it to work and they will show ads along with the results. The paid version has the advantage that they will crawl your site even if the content doesn't make the main search index. Regards, John From mmwaldman at optonline.net Fri Sep 19 18:51:25 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 18:51:25 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <8f0676b40809191546gfd4cdb3x4d88e7dfb0c88142@mail.gmail.com> Message-ID: <0K7G00K6CSTPPOY0@mta5.srv.hcvlny.cv.net> Thanks. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of John Campbell Sent: Friday, September 19, 2008 6:47 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function On Fri, Sep 19, 2008 at 6:30 PM, (Margaret) Michele Waldman wrote: > Googles annual pricing for using their function is: > > Number of web pages Search Query Limit (annual) Pricing (annual) > Up to 5,000 250,000 $100 > 5,001 - 50,000 250,000 $500 > 50,001 - 100,000 500,000 $850 > 100,001 - 300,000 500,000 $2,250 >> 300,000 > 500,000 Contact sales. > > Is everyone in agreement? Yes and no. Google does offer a free version... I think it is called something like custom search. The drawback to the free version is that your content must already be in Google's index for it to work and they will show ads along with the results. The paid version has the advantage that they will crawl your site even if the content doesn't make the main search index. Regards, John _______________________________________________ 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 mmwaldman at optonline.net Fri Sep 19 18:54:48 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 18:54:48 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <8f0676b40809191546gfd4cdb3x4d88e7dfb0c88142@mail.gmail.com> Message-ID: <0K7G005K4SZBD6J0@mta3.srv.hcvlny.cv.net> It's seeming custom search is doing an actual google search, whereas site search searches the specified site? Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of John Campbell Sent: Friday, September 19, 2008 6:47 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function On Fri, Sep 19, 2008 at 6:30 PM, (Margaret) Michele Waldman wrote: > Googles annual pricing for using their function is: > > Number of web pages Search Query Limit (annual) Pricing (annual) > Up to 5,000 250,000 $100 > 5,001 - 50,000 250,000 $500 > 50,001 - 100,000 500,000 $850 > 100,001 - 300,000 500,000 $2,250 >> 300,000 > 500,000 Contact sales. > > Is everyone in agreement? Yes and no. Google does offer a free version... I think it is called something like custom search. The drawback to the free version is that your content must already be in Google's index for it to work and they will show ads along with the results. The paid version has the advantage that they will crawl your site even if the content doesn't make the main search index. Regards, John _______________________________________________ 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 mmwaldman at optonline.net Fri Sep 19 19:01:42 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 19:01:42 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G005K4SZBD6J0@mta3.srv.hcvlny.cv.net> Message-ID: <0K7G00MQBTATLFL0@mta1.srv.hcvlny.cv.net> O.k. It says it can limit it to one website. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of (Margaret) Michele Waldman Sent: Friday, September 19, 2008 6:55 PM To: 'NYPHP Talk' Subject: RE: [nycphp-talk] Search function It's seeming custom search is doing an actual google search, whereas site search searches the specified site? Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of John Campbell Sent: Friday, September 19, 2008 6:47 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function On Fri, Sep 19, 2008 at 6:30 PM, (Margaret) Michele Waldman wrote: > Googles annual pricing for using their function is: > > Number of web pages Search Query Limit (annual) Pricing (annual) > Up to 5,000 250,000 $100 > 5,001 - 50,000 250,000 $500 > 50,001 - 100,000 500,000 $850 > 100,001 - 300,000 500,000 $2,250 >> 300,000 > 500,000 Contact sales. > > Is everyone in agreement? Yes and no. Google does offer a free version... I think it is called something like custom search. The drawback to the free version is that your content must already be in Google's index for it to work and they will show ads along with the results. The paid version has the advantage that they will crawl your site even if the content doesn't make the main search index. Regards, John _______________________________________________ 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 ramons at gmx.net Fri Sep 19 20:30:11 2008 From: ramons at gmx.net (David Krings) Date: Fri, 19 Sep 2008 20:30:11 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G00D6VPXN0X10@mta3.srv.hcvlny.cv.net> References: <0K7G00D6VPXN0X10@mta3.srv.hcvlny.cv.net> Message-ID: <48D44413.1080902@gmx.net> (Margaret) Michele Waldman wrote: > Does anyone know of a function or code I could use to quickly search my > site for a document? > > > > I was thinking I could write a php function to open all of the files and > search for a specific string. > > > > But, I?m guessing it?s already been done with a better implementation. I made good experience using swish-e. It is fairly easy to figure out and you can make some simple calls against the index and display the results the way you like. One nice thing about swish-e is that it indexes more than just flat files, but also PDFs. http://swish-e.org/ David From mmwaldman at optonline.net Fri Sep 19 20:49:04 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 20:49:04 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <48D44413.1080902@gmx.net> Message-ID: <0K7G001EQY9RMP11@mta2.srv.hcvlny.cv.net> Thank you for your input. I went to google. Basically you need an xml file and some html. They didn't break it down simply enough, but it was simply enough to figure out with slightly little effort. Swish-e is not breaking through clearly enough quick enough for me. Can you break down the general idea? It's looking like perl calls. Is this the case? Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Krings Sent: Friday, September 19, 2008 8:30 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function (Margaret) Michele Waldman wrote: > Does anyone know of a function or code I could use to quickly search my > site for a document? > > > > I was thinking I could write a php function to open all of the files and > search for a specific string. > > > > But, I'm guessing it's already been done with a better implementation. I made good experience using swish-e. It is fairly easy to figure out and you can make some simple calls against the index and display the results the way you like. One nice thing about swish-e is that it indexes more than just flat files, but also PDFs. http://swish-e.org/ 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 ramons at gmx.net Fri Sep 19 21:32:06 2008 From: ramons at gmx.net (David Krings) Date: Fri, 19 Sep 2008 21:32:06 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G001EQY9RMP11@mta2.srv.hcvlny.cv.net> References: <0K7G001EQY9RMP11@mta2.srv.hcvlny.cv.net> Message-ID: <48D45296.8010602@gmx.net> (Margaret) Michele Waldman wrote: > Thank you for your input. > > I went to google. Basically you need an xml file and some html. They > didn't break it down simply enough, but it was simply enough to figure out > with slightly little effort. > > Swish-e is not breaking through clearly enough quick enough for me. Can you > break down the general idea? > > It's looking like perl calls. Is this the case? As far as I recall there are two ways. You can either execute an ad-hoc search and swish-e goes and digs through the files, or you can have it update a site index on a schedule and then execute searches against that index. I found it to be quite fast when I used it last and that was even by having swish-e create a temporary file (I think) that I then read in via PHP. The index works OK unless you have so many changes going on on your site that the reindexing would need to take place every minute and tie up resources. The site where I used it on is still up and you can give it a try. Go to http://irsupport.net/search/search.htm and search for the word "lock". You get an excessive amount of hits and yet the page still loads quickly. I may have the code floating around somewhere, but would need to search for it. I did this years ago when I started with PHP and found it quite easy after figuring out the command line parameters for swish-e. That site runs on WAMPP. Well, I did have a good idea where I might have a backup of that code and I did find it. See the attached archive. It contains the search entry page as well as the script that executes the search against the index and then generates the results. I only looked at the first few lines, but it should be well commented. The documentation for how to create the index files is here: http://www.swish-e.org/docs/swish-run.html HTH, David -------------- next part -------------- A non-text attachment was scrubbed... Name: search.zip Type: application/x-zip-compressed Size: 3802 bytes Desc: not available URL: From mmwaldman at optonline.net Fri Sep 19 21:36:38 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 21:36:38 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <48D45296.8010602@gmx.net> Message-ID: <0K7H000DL0H1TMY0@mta3.srv.hcvlny.cv.net> Then, I would probably have to create a cron job to re-index the website periodically? I'm thinking the google custom search is much easier. Thanks for the info though. If I decide to be other-website-independent, I might do this. Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Krings Sent: Friday, September 19, 2008 9:32 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function (Margaret) Michele Waldman wrote: > Thank you for your input. > > I went to google. Basically you need an xml file and some html. They > didn't break it down simply enough, but it was simply enough to figure out > with slightly little effort. > > Swish-e is not breaking through clearly enough quick enough for me. Can you > break down the general idea? > > It's looking like perl calls. Is this the case? As far as I recall there are two ways. You can either execute an ad-hoc search and swish-e goes and digs through the files, or you can have it update a site index on a schedule and then execute searches against that index. I found it to be quite fast when I used it last and that was even by having swish-e create a temporary file (I think) that I then read in via PHP. The index works OK unless you have so many changes going on on your site that the reindexing would need to take place every minute and tie up resources. The site where I used it on is still up and you can give it a try. Go to http://irsupport.net/search/search.htm and search for the word "lock". You get an excessive amount of hits and yet the page still loads quickly. I may have the code floating around somewhere, but would need to search for it. I did this years ago when I started with PHP and found it quite easy after figuring out the command line parameters for swish-e. That site runs on WAMPP. Well, I did have a good idea where I might have a backup of that code and I did find it. See the attached archive. It contains the search entry page as well as the script that executes the search against the index and then generates the results. I only looked at the first few lines, but it should be well commented. The documentation for how to create the index files is here: http://www.swish-e.org/docs/swish-run.html HTH, David From smanes at magpie.com Fri Sep 19 21:58:40 2008 From: smanes at magpie.com (Steve Manes) Date: Fri, 19 Sep 2008 21:58:40 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G00D6VPXN0X10@mta3.srv.hcvlny.cv.net> References: <0K7G00D6VPXN0X10@mta3.srv.hcvlny.cv.net> Message-ID: <48D458D0.7030803@magpie.com> (Margaret) Michele Waldman wrote: > Does anyone know of a function or code I could use to quickly search my > site for a document? If you want something permanent for your web site, this is the GNU successor to ht://Dig. http://hyperestraier.sourceforge.net/ Otherwise, for shell searches I use this handy little perl script I've had for about 12 years. It could be converted to a CGI script pretty easily (with appropriate security considerations). #!/usr/bin/perl # tgrep # grep only text files (ignore binary files) # # Usage: tgrep [-l] pattern [files] $nameonly = 0; if ($ARGV[0] eq '-l') { $nameonly = 1; shift; } # Get pattern and protect the delimiter. $pat = shift; $pat =~ s/!/\\!/g; &dodir(""); sub dodir { local($dir) = @_; local(@names); opendir(DIR, ".") || die "Can't open directory .\n"; @names = readdir(DIR); closedir(DIR); foreach $file (@names) { next if $file eq '.'; next if $file eq '..'; if (-d $file) { chdir $file || die "Can't chdir to $file"; &dodir("$dir/$file"); chdir(".."); next; } next if -B $file; # Ignore binaries open(FILE, "<$file") || do { print "Can't open $file: $!\n"; next; }; while () { if ( m!$pat! ) { if ($nameonly) { print "$dir/$file\n"; } else { print "$dir/$file",":\t",$_; } } } close FILE; } } From mmwaldman at optonline.net Fri Sep 19 22:02:27 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 19 Sep 2008 22:02:27 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <48D458D0.7030803@magpie.com> Message-ID: <0K7H00MTS1O24331@mta3.srv.hcvlny.cv.net> Thank you. That was what I was thinking, but google I'm sure parses out the html tags, etc, etc. I'm pushing google to the client. I'm betting you, that their custom search is quite more complicated. Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Steve Manes Sent: Friday, September 19, 2008 9:59 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function (Margaret) Michele Waldman wrote: > Does anyone know of a function or code I could use to quickly search my > site for a document? If you want something permanent for your web site, this is the GNU successor to ht://Dig. http://hyperestraier.sourceforge.net/ Otherwise, for shell searches I use this handy little perl script I've had for about 12 years. It could be converted to a CGI script pretty easily (with appropriate security considerations). #!/usr/bin/perl # tgrep # grep only text files (ignore binary files) # # Usage: tgrep [-l] pattern [files] $nameonly = 0; if ($ARGV[0] eq '-l') { $nameonly = 1; shift; } # Get pattern and protect the delimiter. $pat = shift; $pat =~ s/!/\\!/g; &dodir(""); sub dodir { local($dir) = @_; local(@names); opendir(DIR, ".") || die "Can't open directory .\n"; @names = readdir(DIR); closedir(DIR); foreach $file (@names) { next if $file eq '.'; next if $file eq '..'; if (-d $file) { chdir $file || die "Can't chdir to $file"; &dodir("$dir/$file"); chdir(".."); next; } next if -B $file; # Ignore binaries open(FILE, "<$file") || do { print "Can't open $file: $!\n"; next; }; while () { if ( m!$pat! ) { if ($nameonly) { print "$dir/$file\n"; } else { print "$dir/$file",":\t",$_; } } } close FILE; } } _______________________________________________ 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 Sat Sep 20 08:43:02 2008 From: tedd at sperling.com (tedd) Date: Sat, 20 Sep 2008 08:43:02 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G00D6VPXN0X10@mta3.srv.hcvlny.cv.net> References: <0K7G00D6VPXN0X10@mta3.srv.hcvlny.cv.net> Message-ID: At 5:49 PM -0400 9/19/08, (Margaret) Michele Waldman wrote: >Does anyone know of a function or code I could use to quickly search >my site for a document? > >I was thinking I could write a php function to open all of the files >and search for a specific string. > >But, I'm guessing it's already been done with a better implementation. > >Thanks, > >Michele Try: http://sperling.com/examples/search/ tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From ramons at gmx.net Sat Sep 20 09:02:56 2008 From: ramons at gmx.net (David Krings) Date: Sat, 20 Sep 2008 09:02:56 -0400 Subject: [nycphp-talk] Need a code diagrammer In-Reply-To: <5458db3c0809191056g554ba3e5ob5986e566f83ed95@mail.gmail.com> References: <5458db3c0809190614j4bfd51f7w6d7ed399de84a22a@mail.gmail.com> <48D3D671.7050400@gmx.net> <5458db3c0809191056g554ba3e5ob5986e566f83ed95@mail.gmail.com> Message-ID: <48D4F480.3050504@gmx.net> Justin Dearing wrote: >> I work with some MSSQL gurus...I'll ask them. > > Thanks The only thing they could think of is ERwin from CA. http://www.ca.com/us/products/product.aspx?id=260 Seems to be a bit extreme for what you intend to do. David From zippy1981 at gmail.com Sat Sep 20 10:17:36 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Sat, 20 Sep 2008 10:17:36 -0400 Subject: [nycphp-talk] Need a code diagrammer In-Reply-To: <48D4F480.3050504@gmx.net> References: <5458db3c0809190614j4bfd51f7w6d7ed399de84a22a@mail.gmail.com> <48D3D671.7050400@gmx.net> <5458db3c0809191056g554ba3e5ob5986e566f83ed95@mail.gmail.com> <48D4F480.3050504@gmx.net> Message-ID: <5458db3c0809200717r333f84cds34ec41f2be39337e@mail.gmail.com> Yeah if Visio would display the column types and the signatures the stored procs and user defined types that would be perfect. Might be a way to display all that. Visio stores all the schema details internally and I think theres even a way to go from visio diagram to database. I think I should ask this questions on another list though. On Sat, Sep 20, 2008 at 9:02 AM, David Krings wrote: > Justin Dearing wrote: >>> >>> I work with some MSSQL gurus...I'll ask them. >> >> Thanks > > The only thing they could think of is ERwin from CA. > http://www.ca.com/us/products/product.aspx?id=260 > > Seems to be a bit extreme for what you intend to do. > > 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 zippy1981 at gmail.com Sat Sep 20 10:24:41 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Sat, 20 Sep 2008 10:24:41 -0400 Subject: [nycphp-talk] LIPHP Talk September 29th 8pm Message-ID: <5458db3c0809200724o29ea247agb47f8c72c5ee4489@mail.gmail.com> Hello everyone, For those of you in the Happuage area, I'd like to invite you to my talk at the Long Island PHP user group on September 29th at 8pm. I will be discussing the new MS Sql server driver for PHP. The talk will center around a small example app I built. I will cover some of the capabilities of SQL server, and dealing with SQL releated errors in PHP. There will be free food. RSVPing is not required, but I'd appreciate it so we know how much food to get. You can RSVP to my email address (zippy1981 at gmail.com). Regards, Justin Dearing From mmwaldman at optonline.net Sat Sep 20 15:45:29 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Sat, 20 Sep 2008 15:45:29 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7G005K4SZBD6J0@mta3.srv.hcvlny.cv.net> Message-ID: <0K7I00IUYEVS2G60@mta1.srv.hcvlny.cv.net> The difference between google custom search and site search is custom search is free but also has ads and site search costs but it ad free. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of (Margaret) Michele Waldman Sent: Friday, September 19, 2008 6:55 PM To: 'NYPHP Talk' Subject: RE: [nycphp-talk] Search function It's seeming custom search is doing an actual google search, whereas site search searches the specified site? Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of John Campbell Sent: Friday, September 19, 2008 6:47 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function On Fri, Sep 19, 2008 at 6:30 PM, (Margaret) Michele Waldman wrote: > Googles annual pricing for using their function is: > > Number of web pages Search Query Limit (annual) Pricing (annual) > Up to 5,000 250,000 $100 > 5,001 - 50,000 250,000 $500 > 50,001 - 100,000 500,000 $850 > 100,001 - 300,000 500,000 $2,250 >> 300,000 > 500,000 Contact sales. > > Is everyone in agreement? Yes and no. Google does offer a free version... I think it is called something like custom search. The drawback to the free version is that your content must already be in Google's index for it to work and they will show ads along with the results. The paid version has the advantage that they will crawl your site even if the content doesn't make the main search index. Regards, John _______________________________________________ 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 zippy1981 at gmail.com Sun Sep 21 21:25:25 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Sun, 21 Sep 2008 21:25:25 -0400 Subject: [nycphp-talk] Re: LIPHP Talk September 29th 8pm In-Reply-To: <5458db3c0809200724o29ea247agb47f8c72c5ee4489@mail.gmail.com> References: <5458db3c0809200724o29ea247agb47f8c72c5ee4489@mail.gmail.com> Message-ID: <5458db3c0809211825x2f70ed75l2774c8b10c4541ad@mail.gmail.com> Forgot to put the link with directions/etc. http://www.liphp.org/ On Sat, Sep 20, 2008 at 10:24 AM, Justin Dearing wrote: > Hello everyone, > > For those of you in the Happuage area, I'd like to invite you to my > talk at the Long Island PHP user group on September 29th at 8pm. I > will be discussing the new MS Sql server driver for PHP. The talk will > center around a small example app I built. I will cover some of the > capabilities of SQL server, and dealing with SQL releated errors in > PHP. > > There will be free food. RSVPing is not required, but I'd appreciate > it so we know how much food to get. You can RSVP to my email address > (zippy1981 at gmail.com). > > Regards, > > Justin Dearing > From ajai at bitblit.net Mon Sep 22 12:30:34 2008 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 22 Sep 2008 12:30:34 -0400 (EDT) Subject: [nycphp-talk] SWF -> JPEG/GIF? In-Reply-To: Message-ID: Ive decided to not mess with ffmpeg/screenshots/desktop computers. In the end I just told Flash to render the movie at a smaller size instead of making a thumbnail image (the resulting image is a little crappy but this is for a backend interface so it's OK). -- Aj. From greg.rundlett at gmail.com Mon Sep 22 22:35:47 2008 From: greg.rundlett at gmail.com (Greg Rundlett) Date: Mon, 22 Sep 2008 22:35:47 -0400 Subject: [nycphp-talk] Need a code diagrammer In-Reply-To: <5458db3c0809200717r333f84cds34ec41f2be39337e@mail.gmail.com> References: <5458db3c0809190614j4bfd51f7w6d7ed399de84a22a@mail.gmail.com> <48D3D671.7050400@gmx.net> <5458db3c0809191056g554ba3e5ob5986e566f83ed95@mail.gmail.com> <48D4F480.3050504@gmx.net> <5458db3c0809200717r333f84cds34ec41f2be39337e@mail.gmail.com> Message-ID: <5e2aaca40809221935v401f0c6dpcd5860b8917cb36d@mail.gmail.com> Umbrello is a great modelling tool http://uml.sourceforge.net/ But, I don't think it yet draws diagrams from PHP code. (It will create stub PHP classes based on UML) I haven't used ArgoUML (or variants like Poseidon), but supposedly the PHP plugin is intended to do round-trip PHP5 code to UML http://argouml.tigris.org/ -- Greg From nynj.tech at hotmail.com Wed Sep 24 11:39:59 2008 From: nynj.tech at hotmail.com (chad qian) Date: Wed, 24 Sep 2008 11:39:59 -0400 Subject: [nycphp-talk] one question about change line in "detail" textbox Message-ID: I setup details as varchar(600) in mysql. On CMS,people can input "details". One guy inputs: good morning,ny good afternoon,ny good night,ny However,"details" is displayed on frontend page as: good morning,nygood afternoon,ny,good night,ny I need the same as input: good morning,ny good afternnon,ny good night,ny How to fix this problem?Thanks! chad _________________________________________________________________ See how Windows Mobile brings your life together?at home, work, or on the go. http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From guilhermeblanco at gmail.com Wed Sep 24 11:49:54 2008 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Wed, 24 Sep 2008 12:49:54 -0300 Subject: [nycphp-talk] one question about change line in "detail" textbox In-Reply-To: References: Message-ID: Use nl2br Cheers, On Wed, Sep 24, 2008 at 12:39 PM, chad qian wrote: > I setup details as varchar(600) in mysql. > On CMS,people can input "details". > One guy inputs: > good morning,ny > good afternoon,ny > good night,ny > > However,"details" is displayed on frontend page as: > good morning,nygood afternoon,ny,good night,ny > > I need the same as input: > good morning,ny > good afternnon,ny > good night,ny > > How to fix this problem?Thanks! > > chad > > ________________________________ > See how Windows Mobile brings your life together?at home, work, or on the > go. See Now > _______________________________________________ > 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 > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9166-6902 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com Rio de Janeiro - RJ/Brazil From jeff at comprehensivity.com Wed Sep 24 12:09:00 2008 From: jeff at comprehensivity.com (Jeff Knight) Date: Wed, 24 Sep 2008 11:09:00 -0500 Subject: [nycphp-talk] Help with gdlib [ID:EYH7Qx4] In-Reply-To: <108920-22008931723194478@kerstel-solutions.de> References: <108920-22008931723194478@kerstel-solutions.de> Message-ID: The 3 images were created by hand in photoshop. btn_shadow is the bottom and is only used for the final buttons *uncolored* drop shadow. The solid black pill portion of that image could be blank or white or anything in between, as it is covered up by the btn_body image it sits beneath. btn_body is the main image and a translucent image. The black areas show as 100% of the color determined by the code, and the lightest show through 100% of the background color. The interplay between these two levels gives the button its shape and are determined by the artist. btn_highlight is an overlay that provides and *uncolored* highlight, as any white in btn_body will reveal the background color. On Wed, Sep 17, 2008 at 6:19 PM, Ralf Kronen wrote: > Hello, > > i want to create an Button with your example in the GDLib Presentation. My > Button looks like this: http://www.kerstel-solutions.de/button.jpg, the > color (green) comes from the database. > > How must i make the 3 images (btn_body.png, btn_highlight.png, > btn_shadow.png) that it shows like my button? > > Best Regards > > Ralf > > > _______________________________________________ > 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 joeyd473 at nyc.rr.com Thu Sep 25 14:27:26 2008 From: joeyd473 at nyc.rr.com (Joseph (Joey) Derrico) Date: Thu, 25 Sep 2008 14:27:26 -0400 Subject: [nycphp-talk] Adding PostgreSQL with an XAMPP Install Message-ID: <15390143.651761222367246752.JavaMail.root@hrndva-web15-z02> Since I am (still) in college I decided to finally take a class on scripting in PHP. I have been using XAMPP for years. unfortunately for this class the professor I have likes PostgreSQL instead of MySQL. So now I need to install PostgreSQL on my PC (XP) and my laptop (Vista) for the class. unfortunately I have never been good at installing servers and DB (thus why I have XAMPP). I was hoping someone can guide me through installing it and getting it working with the XAMPP setup XAMPP version 1.6.7 (on Laptop, Vista), Not 100% sure which version on PC, but I'm not home to check PostgreSQL version Downloaded:8.3.4 Joey Derrico From zippy1981 at gmail.com Thu Sep 25 14:57:56 2008 From: zippy1981 at gmail.com (Justin Dearing) Date: Thu, 25 Sep 2008 14:57:56 -0400 Subject: [nycphp-talk] Adding PostgreSQL with an XAMPP Install In-Reply-To: <15390143.651761222367246752.JavaMail.root@hrndva-web15-z02> References: <15390143.651761222367246752.JavaMail.root@hrndva-web15-z02> Message-ID: <5458db3c0809251157t6427b8d6uaacb2cc8fcb27628@mail.gmail.com> Joey, Postgresql is a very good database. Its got a featureset closer to Oracle or MS SQL. But enough on database religion, and on to your question. If you downloaded the postgres MSI for windows.It basically just works, and gives you an OK gui as well as a command line utility. Postgres should run as a service with no problems after installing the MSI. Then you should just be able to enable php_pgsql.dll in php.ini (its already included in the ext folder in xampp) On Thu, Sep 25, 2008 at 2:27 PM, Joseph (Joey) Derrico wrote: > Since I am (still) in college I decided to finally take a class on scripting in PHP. I have been using XAMPP for years. unfortunately for this class the professor I have likes PostgreSQL instead of MySQL. So now I need to install PostgreSQL on my PC (XP) and my laptop (Vista) for the class. unfortunately I have never been good at installing servers and DB (thus why I have XAMPP). I was hoping someone can guide me through installing it and getting it working with the XAMPP setup > > XAMPP version 1.6.7 (on Laptop, Vista), Not 100% sure which version on PC, but I'm not home to check > PostgreSQL version Downloaded:8.3.4 > > Joey Derrico > _______________________________________________ > 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 mmwaldman at optonline.net Fri Sep 26 21:02:43 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 26 Sep 2008 21:02:43 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <1FE8E47E-A2FB-4149-9E18-E4FA4F8E0826@gmail.com> Message-ID: <0K7T001K3XKG7321@mta1.srv.hcvlny.cv.net> I went with google search. The search results are black font on a white background. I don't know what color the links are yet, because the site hasn't been indexed. I don't think it's customizable, which fully means it was a lousy choice. If it's not I'm going to advise my customer to cancel her account and I'll use swish-e. Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Joseph Crawford Sent: Friday, September 19, 2008 6:36 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Search function Michelle, check the source for this site, http://googlewebmastercentral.blogspot.com/2008/04/crawling-through-html-for ms.html They have the google search and doubt they pay for it, it's a free method I believe On Sep 19, 2008, at 6:30 PM, (Margaret) Michele Waldman wrote: > Googles annual pricing for using their function is: > > Number of web pages Search Query Limit (annual) Pricing (annual) > Up to 5,000 250,000 $100 > 5,001 - 50,000 250,000 $500 > 50,001 - 100,000 500,000 $850 > 100,001 - 300,000 500,000 $2,250 >> 300,000 > 500,000 Contact sales. > > Is everyone in agreement? > > I'm guessing I'm not going to cheaply or quickly write something as > sophisticated. > > Michele > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org > ] On > Behalf Of Joseph Crawford > Sent: Friday, September 19, 2008 6:24 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Search function > > John, > > From my understanding this was not something she wanted for site > users, I thought she was searching for a string. > > If you are going to deploy this to users then you don't want to use > either method we spoke about and use John's suggestion and use Google > Site Search > > On Sep 19, 2008, at 6:17 PM, John Campbell wrote: > >> On Fri, Sep 19, 2008 at 6:07 PM, (Margaret) Michele Waldman >> wrote: >>> Would instr get_file_contents be too slow? >> >> This is a really bad idea in general... Is there a reason Google's >> site search won't work? >> >> If you do something like exec(grep), make sure you know how to escape >> everything properly. It is possible someone could wreck the site >> with >> a specially crafted query. >> >> -John C. >> _______________________________________________ >> 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 _______________________________________________ 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 sbeam at onsetcorps.net Fri Sep 26 21:49:28 2008 From: sbeam at onsetcorps.net (sbeam) Date: Fri, 26 Sep 2008 21:49:28 -0400 Subject: [nycphp-talk] Search function In-Reply-To: <0K7T001K3XKG7321@mta1.srv.hcvlny.cv.net> References: <0K7T001K3XKG7321@mta1.srv.hcvlny.cv.net> Message-ID: <200809262149.28828.sbeam@onsetcorps.net> On Friday 26 September 2008 21:02, (Margaret) Michele Waldman wrote: > I went with google search. > > The search results are black font on a white background. ?I don't know what > color the links are yet, because the site hasn't been indexed. > > I don't think it's customizable, which fully means it was a lousy choice. > > If it's not I'm going to advise my customer to cancel her account and I'll > use swish-e. Sorry I am late to this thread, but Yahoo! has! a! webservice! for! search! http://developer.yahoo.com/search/web/ no ads, no cost. It's limited to something like 5000 queries a day, which shouldn't be a problem for small sites. You can limit the results to your site of course. It will even return the results as a serialized php array, which you can unserialize and then iterate over to display it however you want. Couldn't be much easier. example: http://www.copleysociety.org/ The disadvantage v/s your own local spider like SWISH-E is that you can't control it - a change to your site might take a week or more to show up in search results. Also you can't index things that are password protected. [The disadvantage with SWISH-E is that it is completely useless as a search engine. The matching algorithm is primitive to say the least. It does however a good job of thrashing your server when it runs.] There is of course no direct financial benefit to Yahoo! to doing this, I am not sure why they do. (If MSFT had bought them you can be sure this would be the kind of thing kicked to the curb immediately :) Sam From JoeyD473 at nyc.rr.com Sat Sep 27 17:34:39 2008 From: JoeyD473 at nyc.rr.com (Joey Derrico) Date: Sat, 27 Sep 2008 17:34:39 -0400 Subject: [nycphp-talk] Adding PostgreSQL with an XAMPP Install In-Reply-To: <5458db3c0809251157t6427b8d6uaacb2cc8fcb27628@mail.gmail.com> References: <15390143.651761222367246752.JavaMail.root@hrndva-web15-z02> <5458db3c0809251157t6427b8d6uaacb2cc8fcb27628@mail.gmail.com> Message-ID: <48DEA6EF.5010802@nyc.rr.com> I never said it wasn't a good DB. I just said it wasn't MySQL whichI had up and running for several years and was used to using I got it installed and running. Thanks Joey Justin Dearing wrote: > Joey, > > Postgresql is a very good database. Its got a featureset closer to > Oracle or MS SQL. But enough on database religion, and on to your > question. > > If you downloaded the postgres MSI for windows.It basically just > works, and gives you an OK gui as well as a command line utility. > Postgres should run as a service with no problems after installing the > MSI. > > Then you should just be able to enable php_pgsql.dll in php.ini (its > already included in the ext folder in xampp) > > > > On Thu, Sep 25, 2008 at 2:27 PM, Joseph (Joey) Derrico > wrote: > >> Since I am (still) in college I decided to finally take a class on scripting in PHP. I have been using XAMPP for years. unfortunately for this class the professor I have likes PostgreSQL instead of MySQL. So now I need to install PostgreSQL on my PC (XP) and my laptop (Vista) for the class. unfortunately I have never been good at installing servers and DB (thus why I have XAMPP). I was hoping someone can guide me through installing it and getting it working with the XAMPP setup >> >> XAMPP version 1.6.7 (on Laptop, Vista), Not 100% sure which version on PC, but I'm not home to check >> PostgreSQL version Downloaded:8.3.4 >> >> Joey Derrico >> _______________________________________________ >> 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 danielc at analysisandsolutions.com Sat Sep 27 20:32:14 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 27 Sep 2008 20:32:14 -0400 Subject: [nycphp-talk] Table Indexes In-Reply-To: <8f0676b40809071131r7e6f15c7uc15c7223a0896b90@mail.gmail.com> References: <78c6bd860809070917s2cffc729h86c80850e081cdd4@mail.gmail.com> <8f0676b40809071131r7e6f15c7uc15c7223a0896b90@mail.gmail.com> Message-ID: <20080928003213.GA21378@panix.com> Hi John: On Sun, Sep 07, 2008 at 02:31:48PM -0400, John Campbell wrote: > > With MySQL the fastest is often: > Primary(a,b) > index(b) I agree. > And in sometimes you even want: > Primary(a,b) > index(a) > index(b) The second index of "a" would duplicate the index of "a" in the primary 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 ioplex at gmail.com Sat Sep 27 20:54:10 2008 From: ioplex at gmail.com (Michael B Allen) Date: Sat, 27 Sep 2008 20:54:10 -0400 Subject: [nycphp-talk] Table Indexes In-Reply-To: <20080928003213.GA21378@panix.com> References: <78c6bd860809070917s2cffc729h86c80850e081cdd4@mail.gmail.com> <8f0676b40809071131r7e6f15c7uc15c7223a0896b90@mail.gmail.com> <20080928003213.GA21378@panix.com> Message-ID: <78c6bd860809271754ifd3cf04gb45c273f9920fee7@mail.gmail.com> On Sat, Sep 27, 2008 at 8:32 PM, Daniel Convissor wrote: > Hi John: > > On Sun, Sep 07, 2008 at 02:31:48PM -0400, John Campbell wrote: >> >> With MySQL the fastest is often: >> Primary(a,b) >> index(b) > > I agree. > > >> And in sometimes you even want: >> Primary(a,b) >> index(a) >> index(b) > > The second index of "a" would duplicate the index of "a" in the primary > key. So is the first column of a primary key always also an index? I thought I read somewhere that the columns are concatenated together to form one index? Something else of interest that I have learned is that MySQL can only use one index per SELECT. So unfortunately OR-ing all the joins is actually quite slow. If I use UNIONs instead, the query is a LOT faster. Currently I am using the second case above. I'll make a point of dropping the INDEX(a) in the next iteration of the code and see how that affects performance. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From danielc at analysisandsolutions.com Sun Sep 28 10:50:06 2008 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sun, 28 Sep 2008 10:50:06 -0400 Subject: [nycphp-talk] Table Indexes In-Reply-To: <78c6bd860809271754ifd3cf04gb45c273f9920fee7@mail.gmail.com> References: <78c6bd860809070917s2cffc729h86c80850e081cdd4@mail.gmail.com> <8f0676b40809071131r7e6f15c7uc15c7223a0896b90@mail.gmail.com> <20080928003213.GA21378@panix.com> <78c6bd860809271754ifd3cf04gb45c273f9920fee7@mail.gmail.com> Message-ID: <20080928145005.GA1298@panix.com> On Sat, Sep 27, 2008 at 08:54:10PM -0400, Michael B Allen wrote: > > So is the first column of a primary key always also an index? I > thought I read somewhere that the columns are concatenated together to > form one index? I don't think they're actually concatenated. The manual says: A multiple-column index can be _considered_ a sorted array containing values that are created by concatenating the values of the indexed columns. Emphasis on "considered" is mine. However MySQL stores it, the engine has the ability to utilize it. More information (and the quote above) are from http://dev.mysql.com/doc/refman/5.0/en/multiple-column-indexes.html --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From lists at zaunere.com Sun Sep 28 15:02:44 2008 From: lists at zaunere.com (Hans Zaunere) Date: Sun, 28 Sep 2008 15:02:44 -0400 Subject: [nycphp-talk] Table Indexes In-Reply-To: <20080928145005.GA1298@panix.com> References: <78c6bd860809070917s2cffc729h86c80850e081cdd4@mail.gmail.com> <8f0676b40809071131r7e6f15c7uc15c7223a0896b90@mail.gmail.com> <20080928003213.GA21378@panix.com> <78c6bd860809271754ifd3cf04gb45c273f9920fee7@mail.gmail.com> <20080928145005.GA1298@panix.com> Message-ID: <007c01c9219c$c9e654e0$5db2fea0$@com> > > So is the first column of a primary key always also an index? I > > thought I read somewhere that the columns are concatenated together to > > form one index? > > I don't think they're actually concatenated. The manual says: > > A multiple-column index can be _considered_ a sorted array > containing values that are created by concatenating the values > of the indexed columns. > > Emphasis on "considered" is mine. However MySQL stores it, the engine > has the ability to utilize it. More information (and the quote above) > are from > http://dev.mysql.com/doc/refman/5.0/en/multiple-column-indexes.html It's all about what's available left-to-right. MySQL can't - still AFAIK - use parts of an index that are not sequential when using it left-to-right. See: http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html And use EXPLAIN a lot. H From mmwaldman at optonline.net Sun Sep 28 15:56:11 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Sun, 28 Sep 2008 15:56:11 -0400 Subject: [nycphp-talk] Off the topic Message-ID: <0K7X007008PN1K60@mta5.srv.hcvlny.cv.net> I'm looking for one of those websites that will show you screen shots of your css in different browsers. My work looks perfect from my end, but my client is saying there's an alignment problem. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Sun Sep 28 16:10:53 2008 From: ramons at gmx.net (David Krings) Date: Sun, 28 Sep 2008 16:10:53 -0400 Subject: [nycphp-talk] Off the topic In-Reply-To: <0K7X007008PN1K60@mta5.srv.hcvlny.cv.net> References: <0K7X007008PN1K60@mta5.srv.hcvlny.cv.net> Message-ID: <48DFE4CD.8040900@gmx.net> (Margaret) Michele Waldman wrote: > I?m looking for one of those websites that will show you screen shots of > your css in different browsers. > > > > My work looks perfect from my end, but my client is saying there?s an > alignment problem. I have that at work, but use the bative browsers. The problem is really only with the different versions of IE as Microsoft always only allows to have one version installed. But there is a trick for that: DLL redirection. Get the tool from TredoSoft (http://tredosoft.com/Multiple_IE) and install that. It works quite well, just that the different IE versions crash even more often than they already do. Firefox versions live happily next to each other when you install them into different directories. The same applies to Opera. I also have the latest Netscape version on the system (although that is no longer offered or supported, AOL has its own browser based on IE, but ironically recommends that Netscape users switch over to FF). Safari and Chrome round it off, which each display web pages differently although they use the same rendering engine (WebKit). And that all will not do a thing as the user can use a local style sheet to override whatever your style sheet defined. HTH, David From mmwaldman at optonline.net Sun Sep 28 16:17:04 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Sun, 28 Sep 2008 16:17:04 -0400 Subject: [nycphp-talk] Off the topic In-Reply-To: <48DFE4CD.8040900@gmx.net> Message-ID: <0K7X00EU99OFQFD0@mta1.srv.hcvlny.cv.net> Cool. Thanks to the tip. I'll try Multiple_IE cause I don't like virtual pc, but I found one of the websites browsercam. They was $50/month roughly following the 24-hour free trial. More website will be appreciated. Margaret -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Krings Sent: Sunday, September 28, 2008 4:11 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Off the topic (Margaret) Michele Waldman wrote: > I'm looking for one of those websites that will show you screen shots of > your css in different browsers. > > > > My work looks perfect from my end, but my client is saying there's an > alignment problem. I have that at work, but use the bative browsers. The problem is really only with the different versions of IE as Microsoft always only allows to have one version installed. But there is a trick for that: DLL redirection. Get the tool from TredoSoft (http://tredosoft.com/Multiple_IE) and install that. It works quite well, just that the different IE versions crash even more often than they already do. Firefox versions live happily next to each other when you install them into different directories. The same applies to Opera. I also have the latest Netscape version on the system (although that is no longer offered or supported, AOL has its own browser based on IE, but ironically recommends that Netscape users switch over to FF). Safari and Chrome round it off, which each display web pages differently although they use the same rendering engine (WebKit). And that all will not do a thing as the user can use a local style sheet to override whatever your style sheet defined. HTH, 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 mmwaldman at optonline.net Sun Sep 28 17:05:45 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Sun, 28 Sep 2008 17:05:45 -0400 Subject: [nycphp-talk] 3.0.1 Support Message-ID: <0K7X0080IBXLN0I0@mta4.srv.hcvlny.cv.net> Is anyone office Firefox 3.0.1 support? My client is on it and "everything is screwed up". Well not everything, just one thing. Michele -------------- next part -------------- An HTML attachment was scrubbed... URL: From ioplex at gmail.com Sun Sep 28 17:11:06 2008 From: ioplex at gmail.com (Michael B Allen) Date: Sun, 28 Sep 2008 17:11:06 -0400 Subject: [nycphp-talk] Table Indexes In-Reply-To: <007c01c9219c$c9e654e0$5db2fea0$@com> References: <78c6bd860809070917s2cffc729h86c80850e081cdd4@mail.gmail.com> <8f0676b40809071131r7e6f15c7uc15c7223a0896b90@mail.gmail.com> <20080928003213.GA21378@panix.com> <78c6bd860809271754ifd3cf04gb45c273f9920fee7@mail.gmail.com> <20080928145005.GA1298@panix.com> <007c01c9219c$c9e654e0$5db2fea0$@com> Message-ID: <78c6bd860809281411r4fc90858g67ad0962d83c4543@mail.gmail.com> On Sun, Sep 28, 2008 at 3:02 PM, Hans Zaunere wrote: >> > So is the first column of a primary key always also an index? I >> > thought I read somewhere that the columns are concatenated together to >> > form one index? >> >> I don't think they're actually concatenated. The manual says: >> >> A multiple-column index can be _considered_ a sorted array >> containing values that are created by concatenating the values >> of the indexed columns. >> >> Emphasis on "considered" is mine. However MySQL stores it, the engine >> has the ability to utilize it. More information (and the quote above) >> are from >> http://dev.mysql.com/doc/refman/5.0/en/multiple-column-indexes.html > > It's all about what's available left-to-right. MySQL can't - still AFAIK - > use parts of an index that are not sequential when using it left-to-right. > See: > > http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html > > And use EXPLAIN a lot. I think I'm starting to understand this. So if I do: PRIMARY KEY (a, b), INDEX (b) the PRIMARY KEY (a, b) index makes WHERE with a or a and b fast. The INDEX(b) is used for a WHERE with only b. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ From ramons at gmx.net Sun Sep 28 18:29:23 2008 From: ramons at gmx.net (David Krings) Date: Sun, 28 Sep 2008 18:29:23 -0400 Subject: [nycphp-talk] 3.0.1 Support In-Reply-To: <0K7X0080IBXLN0I0@mta4.srv.hcvlny.cv.net> References: <0K7X0080IBXLN0I0@mta4.srv.hcvlny.cv.net> Message-ID: <48E00543.5020805@gmx.net> (Margaret) Michele Waldman wrote: > Is anyone office Firefox 3.0.1 support? Huh? I can only guess that this has something to do with Firefox 3.0.1, but no idea what....other than that 3.0.3 is available. > My client is on it and ?everything is screwed up?. > > Well not everything, just one thing. I don't want to sound like Simon Cowell, but we would need some more specifics. Like...what that one thing is. David From mmwaldman at optonline.net Sun Sep 28 18:41:41 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Sun, 28 Sep 2008 18:41:41 -0400 Subject: [nycphp-talk] 3.0.1 Support In-Reply-To: <48E00543.5020805@gmx.net> Message-ID: <0K7X00DCCGDGMMC0@mta4.srv.hcvlny.cv.net> I don't need to go into details. All is good on my front. Browsercam.com kicks *ss. I gave them m $40/month and they earned it. Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Krings Sent: Sunday, September 28, 2008 6:29 PM To: NYPHP Talk Subject: Re: [nycphp-talk] 3.0.1 Support (Margaret) Michele Waldman wrote: > Is anyone office Firefox 3.0.1 support? Huh? I can only guess that this has something to do with Firefox 3.0.1, but no idea what....other than that 3.0.3 is available. > My client is on it and "everything is screwed up". > > Well not everything, just one thing. I don't want to sound like Simon Cowell, but we would need some more specifics. Like...what that one thing is. 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 mmwaldman at optonline.net Sun Sep 28 19:11:40 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Sun, 28 Sep 2008 19:11:40 -0400 Subject: [nycphp-talk] 3.0.1 Support In-Reply-To: <0K7X00DCCGDGMMC0@mta4.srv.hcvlny.cv.net> Message-ID: <0K7X006S7HRGPM00@mta1.srv.hcvlny.cv.net> Browsercam just shows the upper left hand view, not practical enough. Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of (Margaret) Michele Waldman Sent: Sunday, September 28, 2008 6:42 PM To: 'NYPHP Talk' Subject: RE: [nycphp-talk] 3.0.1 Support I don't need to go into details. All is good on my front. Browsercam.com kicks *ss. I gave them m $40/month and they earned it. Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Krings Sent: Sunday, September 28, 2008 6:29 PM To: NYPHP Talk Subject: Re: [nycphp-talk] 3.0.1 Support (Margaret) Michele Waldman wrote: > Is anyone office Firefox 3.0.1 support? Huh? I can only guess that this has something to do with Firefox 3.0.1, but no idea what....other than that 3.0.3 is available. > My client is on it and "everything is screwed up". > > Well not everything, just one thing. I don't want to sound like Simon Cowell, but we would need some more specifics. Like...what that one thing is. 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 codebowl at gmail.com Sun Sep 28 19:19:38 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Sun, 28 Sep 2008 19:19:38 -0400 Subject: [nycphp-talk] 3.0.1 Support In-Reply-To: <0K7X006S7HRGPM00@mta1.srv.hcvlny.cv.net> References: <0K7X006S7HRGPM00@mta1.srv.hcvlny.cv.net> Message-ID: <0088E03F-B26E-404F-B566-8E617381038E@gmail.com> I am not sure if they do mobile devices (i'm sure it would not be difficult) but www.browsershots.org is a free service that I have used in the past. Looking at them now they are quick as they also support Google's new Chrome browser. why spend $40/mo when other places have it free? On Sep 28, 2008, at 7:11 PM, (Margaret) Michele Waldman wrote: > Browsercam.com From mmwaldman at optonline.net Sun Sep 28 19:28:56 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Sun, 28 Sep 2008 19:28:56 -0400 Subject: [nycphp-talk] 3.0.1 Support In-Reply-To: <0088E03F-B26E-404F-B566-8E617381038E@gmail.com> Message-ID: <0K7X002I5IK8J7W0@mta2.srv.hcvlny.cv.net> Thank you. Browershots is much better as far as views go. M* -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Joseph Crawford Sent: Sunday, September 28, 2008 7:20 PM To: NYPHP Talk Subject: Re: [nycphp-talk] 3.0.1 Support I am not sure if they do mobile devices (i'm sure it would not be difficult) but www.browsershots.org is a free service that I have used in the past. Looking at them now they are quick as they also support Google's new Chrome browser. why spend $40/mo when other places have it free? On Sep 28, 2008, at 7:11 PM, (Margaret) Michele Waldman wrote: > Browsercam.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 lists at zaunere.com Sun Sep 28 21:18:50 2008 From: lists at zaunere.com (Hans Zaunere) Date: Sun, 28 Sep 2008 21:18:50 -0400 Subject: [nycphp-talk] Table Indexes In-Reply-To: <78c6bd860809281411r4fc90858g67ad0962d83c4543@mail.gmail.com> References: <78c6bd860809070917s2cffc729h86c80850e081cdd4@mail.gmail.com> <8f0676b40809071131r7e6f15c7uc15c7223a0896b90@mail.gmail.com> <20080928003213.GA21378@panix.com> <78c6bd860809271754ifd3cf04gb45c273f9920fee7@mail.gmail.com> <20080928145005.GA1298@panix.com> <007c01c9219c$c9e654e0$5db2fea0$@com> <78c6bd860809281411r4fc90858g67ad0962d83c4543@mail.gmail.com> Message-ID: <00d101c921d1$54923800$fdb6a800$@com> > > It's all about what's available left-to-right. MySQL can't - still AFAIK - > > use parts of an index that are not sequential when using it left-to-right. > > See: > > > > http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html > > > > And use EXPLAIN a lot. > > I think I'm starting to understand this. > > So if I do: > > PRIMARY KEY (a, b), > INDEX (b) > > the PRIMARY KEY (a, b) index makes WHERE with a or a and b fast. The > INDEX(b) is used for a WHERE with only b. Yes - but be careful with the use of the term "fast" - it'll make MySQL "use the index". If you only have a handful of rows, though, a table scan will be "faster" :) And that said, the optimizer in MySQL isn't known for its, duh, intelligence. Sometimes you'll need to force an index to be used - thus, always check things with EXPLAIN. H From tedd at sperling.com Mon Sep 29 09:19:34 2008 From: tedd at sperling.com (tedd) Date: Mon, 29 Sep 2008 09:19:34 -0400 Subject: [nycphp-talk] 3.0.1 Support In-Reply-To: <0K7X006S7HRGPM00@mta1.srv.hcvlny.cv.net> References: <0K7X006S7HRGPM00@mta1.srv.hcvlny.cv.net> Message-ID: At 7:11 PM -0400 9/28/08, (Margaret) Michele Waldman wrote: >Browsercam just shows the upper left hand view, not practical enough. > >Michele Excuse me? BrowserCam does a lot more than that. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Mon Sep 29 10:41:39 2008 From: tedd at sperling.com (tedd) Date: Mon, 29 Sep 2008 10:41:39 -0400 Subject: [nycphp-talk] Off the topic In-Reply-To: <0K7X007008PN1K60@mta5.srv.hcvlny.cv.net> References: <0K7X007008PN1K60@mta5.srv.hcvlny.cv.net> Message-ID: At 3:56 PM -0400 9/28/08, (Margaret) Michele Waldman wrote: >I'm looking for one of those websites that will show you screen >shots of your css in different browsers. > >My work looks perfect from my end, but my client is saying there's >an alignment problem. Waldman: I use BrowserCam: http://www.browsercam.com It's too expensive for one, but many can join together to purchase access -- which is perfectly legal for this. I think my year's cost was around $40 US. However, you have to find a group who is renewing their subscription to join. While one might think that css list would allow discussion of that, it's considered off-topic and not permitted. However, everyone once in a while someone slips. My current group leader is: -- you might inquire there to see if a position is open -- our group's period started 5/12/08. Good luck in finding a group. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From paulcheung at tiscali.co.uk Tue Sep 30 04:49:01 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Tue, 30 Sep 2008 09:49:01 +0100 Subject: [nycphp-talk] E-Commerce Shopping Carts References: <48D3A7D6.5010107@bzcode.com> Message-ID: <36BD7471D53749159291E011CC23B5D1@X9183> Hi, Can anybody help?? I have run into a major problem, I do not understand how shopping carts work. I have tried asking technical support of the likes of PayPal, while they are all very knowledgeable businesswise, they are not PHP developers. I was told that I should check my email periodically. As a shopping cart newbie using PHP, I am lost. I understand it is develop myself or much the easiest and best way is to use a shopping cart, which I agree with. >From a merchant's point of view, here is what I want. Once payment has been made and confirmed, I want a token confirming payment (payment info) to be sent to my site and then, without manual intervention, I want to dispatch a confirmation email to the customer an invoice and then the goods/services to the customer. Is there a way of automatically polling for this info?? Is there a better of doing things?? Cheers Paul From tmpvar at gmail.com Tue Sep 30 06:45:12 2008 From: tmpvar at gmail.com (Elijah Insua) Date: Tue, 30 Sep 2008 03:45:12 -0700 Subject: [nycphp-talk] E-Commerce Shopping Carts In-Reply-To: <36BD7471D53749159291E011CC23B5D1@X9183> References: <48D3A7D6.5010107@bzcode.com> <36BD7471D53749159291E011CC23B5D1@X9183> Message-ID: <2b4feca10809300345q370bb1eu2cb73735ed65a0de@mail.gmail.com> Paul, It seems like what you would want is a payment gateway, which would process the payment immediately. From there I would recommend using an Observer OOP pattern to attach events to the payment transaction. -- Elijah On Tue, Sep 30, 2008 at 1:49 AM, PaulCheung wrote: > Hi, > > Can anybody help?? I have run into a major problem, I do not understand how > shopping carts work. I have tried asking technical support of the likes of > PayPal, while they are all very knowledgeable businesswise, they are not PHP > developers. I was told that I should check my email periodically. > > As a shopping cart newbie using PHP, I am lost. I understand it is develop > myself or much the easiest and best way is to use a shopping cart, which I > agree with. > > From a merchant's point of view, here is what I want. Once payment has >> been >> > made and confirmed, I want a token confirming payment (payment info) to be > sent to my site and then, without manual intervention, I want to dispatch a > confirmation email to the customer an invoice and then the goods/services to > the customer. > > Is there a way of automatically polling for this info?? Is there a better > of doing things?? > > Cheers > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulcheung at tiscali.co.uk Tue Sep 30 07:07:29 2008 From: paulcheung at tiscali.co.uk (PaulCheung) Date: Tue, 30 Sep 2008 12:07:29 +0100 Subject: [nycphp-talk] E-Commerce Shopping Carts References: <48D3A7D6.5010107@bzcode.com><36BD7471D53749159291E011CC23B5D1@X9183> <2b4feca10809300345q370bb1eu2cb73735ed65a0de@mail.gmail.com> Message-ID: <0B0CCAF78F144B748D5246A6105E0DF5@X9183> Cheers Elijah I'll Check it out right away Paul ----- Original Message ----- From: Elijah Insua To: NYPHP Talk Sent: Tuesday, September 30, 2008 11:45 AM Subject: Re: [nycphp-talk] E-Commerce Shopping Carts Paul, It seems like what you would want is a payment gateway, which would process the payment immediately. From there I would recommend using an Observer OOP pattern to attach events to the payment transaction. -- Elijah On Tue, Sep 30, 2008 at 1:49 AM, PaulCheung wrote: Hi, Can anybody help?? I have run into a major problem, I do not understand how shopping carts work. I have tried asking technical support of the likes of PayPal, while they are all very knowledgeable businesswise, they are not PHP developers. I was told that I should check my email periodically. As a shopping cart newbie using PHP, I am lost. I understand it is develop myself or much the easiest and best way is to use a shopping cart, which I agree with. >From a merchant's point of view, here is what I want. Once payment has been made and confirmed, I want a token confirming payment (payment info) to be sent to my site and then, without manual intervention, I want to dispatch a confirmation email to the customer an invoice and then the goods/services to the customer. Is there a way of automatically polling for this info?? Is there a better of doing things?? Cheers 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 ------------------------------------------------------------------------------ _______________________________________________ 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 mmwaldman at optonline.net Tue Sep 30 07:23:30 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Tue, 30 Sep 2008 07:23:30 -0400 Subject: [nycphp-talk] E-Commerce Shopping Carts In-Reply-To: <36BD7471D53749159291E011CC23B5D1@X9183> Message-ID: <0K80001GJAB5CFT0@mta5.srv.hcvlny.cv.net> Paul, Are you writing a shopping cart from scatch. I don't think this is the easiest way to implement a shopping cart. There are two open source shopping carts that I know about, oscommerce and zencart. Plus, there are many inexpensive shopping carts. Zencart handles the payment notifications. If you use a non supported or merchant that doesn't have a plugin available, you have to write some of the gateway yourself, but all of the email notifications come canned. As far as the payment gateway. If I'm correct, via curl or whatever you sent connect to the merchant and request a payment, they return a success or non success value, after which you can send an email. You get the response right away, so I don't know why you want to poll. Here's so snippets of code: $QBMS_XML_Credit_Card_Charge = ' '.$QBMS_Auth.' '.$QBMS_TransRequestID.' '.$_POST['CreditCardNumber'].' '.$_POST['ExpirationMonth'].' '.$_POST['ExpirationYear'].' true '.$_POST['Amount'].' '.$_POST['CreditCardOwner'].' '.$_POST['CreditCardAddress'].' '.$_POST['CreditCardPostalCode'].' '.$_POST['CardSecurityCode'].' '; $QBMS_chargeRq = $this->qbms_call($QBMS_ApplicationPath, $QBMS_XML_Credit_Card_Charge, MODULE_PAYMENT_QBMS_SSL_CERT); // Get the statusCode $QBMS_ChargeRq_Status = 1; $posLeft = strpos($QBMS_chargeRq, "qbms_charge_success($QBMS_chargeRq); return; case 10301: case 10400: case 10401: case 10402: case 10404: case 10407: case 10409: $error = MODULE_PAYMENT_QBMS_TEXT_DECLINED; break; default: $error = MODULE_PAYMENT_QBMS_TEXT_SYSTEM_ERROR . " " . $QBMS_ChargeRq_Status . " "; break; } $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&qbms_cc_owner=' . urlencode($_POST['CreditCardOwner']) . '&qbms_cc_expires_month=' . $_POST['ExpirationMonth'] . '&qbms_cc_expires_year=' . $_POST['ExpirationYear']; zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); } function qbms_call($qbmsURL, $qbmsRequest, $qbmsCert) { global $_POST; $PHP_Header[] = "Content-type: application/x-qbmsxml"; $PHP_Header[] = "Content-length: ".strlen($qbmsRequest); $clientURL = curl_init(); curl_setopt($clientURL, CURLOPT_POST, 1); curl_setopt($clientURL, CURLOPT_RETURNTRANSFER, 1); curl_setopt($clientURL, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($clientURL, CURLOPT_URL, $qbmsURL); // curl_setopt($clientURL, CURLOPT_TIMEOUT, 60); curl_setopt($clientURL, CURLOPT_HTTPHEADER, $PHP_Header); curl_setopt($clientURL, CURLOPT_POSTFIELDS, $qbmsRequest); curl_setopt($clientURL, CURLOPT_VERBOSE, 1); curl_setopt($clientURL, CURLOPT_SSL_VERIFYPEER, 1); // if (MODULE_PAYMENT_QBMS_HOSTEDORDESKTOP == 'Hosted') { // curl_setopt($clientURL, CURLOPT_SSLCERT, $qbmsCert); // } curl_setopt($clientURL, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); //?? curl_setopt ($clientURL, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_setopt ($clientURL, CURLOPT_PROXY,"http://proxy.shr.secureserver.net:3128"); // if (MODULE_PAYMENT_QBMS_IP_ADDRESS != '') { // curl_setopt($clientURL, CURLOPT_INTERFACE, MODULE_PAYMENT_QBMS_IP_ADDRESS); // } $qbmsResponse = curl_exec($clientURL); if ((curl_errno($clientURL)) || ($qbmsResponse == 1)) { $curlerrno = curl_errno($clientURL); $error = MODULE_PAYMENT_QBMS_TEXT_SYSTEM_ERROR; $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&qbms_cc_owner=' . urlencode($_POST['CreditCardOwner']) . '&qbms_cc_expires_month=' . $_POST['ExpirationMonth'] . '&qbms_cc_expires_year=' . $_POST['ExpirationYear']; zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); } else { curl_close($clientURL); } return $qbmsResponse; } Michele -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of PaulCheung Sent: Tuesday, September 30, 2008 4:49 AM To: NYPHP Talk Subject: [nycphp-talk] E-Commerce Shopping Carts Hi, Can anybody help?? I have run into a major problem, I do not understand how shopping carts work. I have tried asking technical support of the likes of PayPal, while they are all very knowledgeable businesswise, they are not PHP developers. I was told that I should check my email periodically. As a shopping cart newbie using PHP, I am lost. I understand it is develop myself or much the easiest and best way is to use a shopping cart, which I agree with. >From a merchant's point of view, here is what I want. Once payment has been made and confirmed, I want a token confirming payment (payment info) to be sent to my site and then, without manual intervention, I want to dispatch a confirmation email to the customer an invoice and then the goods/services to the customer. Is there a way of automatically polling for this info?? Is there a better of doing things?? Cheers 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 From mmwaldman at optonline.net Tue Sep 30 16:19:16 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Tue, 30 Sep 2008 16:19:16 -0400 Subject: [nycphp-talk] New browsercam group Message-ID: <0K8000K32Z437JR0@mta4.srv.hcvlny.cv.net> Hi all, I'm starting a browsercam group. I add people to the account and we split the cost of browsercam. Browsercam shows you your website, in up to over 200 browsers. An absolute must for a web developer. I will limit the group to 10 people. I have the basic capture plan. Membership would be $48/year. Join me in the agony and triumph of seeing your creations in ways you never expected. Michele Waldman Sovereign Sites L.L.C. To join the group contact me at mmwaldman at optonline.net. -------------- next part -------------- An HTML attachment was scrubbed... URL: From codebowl at gmail.com Tue Sep 30 16:21:32 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Tue, 30 Sep 2008 16:21:32 -0400 Subject: [nycphp-talk] New browsercam group In-Reply-To: <0K8000K32Z437JR0@mta4.srv.hcvlny.cv.net> References: <0K8000K32Z437JR0@mta4.srv.hcvlny.cv.net> Message-ID: <889B085C-57ED-4C52-8952-20EFB93D9E10@gmail.com> I take it browsershots.org did not fulfill your needs :) On Sep 30, 2008, at 4:19 PM, (Margaret) Michele Waldman wrote: > Hi all, > I?m starting a browsercam group. > I add people to the account and we split the cost of browsercam. > Browsercam shows you your website, in up to over 200 browsers. > An absolute must for a web developer. > I will limit the group to 10 people. > I have the basic capture plan. Membership would be $48/year. > Join me in the agony and triumph of seeing your creations in ways > you never expected. > Michele Waldman > Sovereign Sites L.L.C. > To join the group contact me at mmwaldman at optonline.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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at optonline.net Tue Sep 30 16:25:00 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Tue, 30 Sep 2008 16:25:00 -0400 Subject: [nycphp-talk] New browsercam group In-Reply-To: <889B085C-57ED-4C52-8952-20EFB93D9E10@gmail.com> Message-ID: <0K80008XUZDNEXB0@mta1.srv.hcvlny.cv.net> Dude! :-) I live in CA too long. Browsershots only processes every 30 minutes. You can't make changes and check the changes right away. I can't work under those constraints. I will still use browsershots, but after I'm finished. I paid browsershots the $15 to upgrade my priority processing, but I didn't know that meant they'd only process me still every 30 minutes. That $15 bought my results being processed 1 minute faster. Woohoo! Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Joseph Crawford Sent: Tuesday, September 30, 2008 4:22 PM To: NYPHP Talk Subject: Re: [nycphp-talk] New browsercam group I take it browsershots.org did not fulfill your needs :) On Sep 30, 2008, at 4:19 PM, (Margaret) Michele Waldman wrote: Hi all, I'm starting a browsercam group. I add people to the account and we split the cost of browsercam. Browsercam shows you your website, in up to over 200 browsers. An absolute must for a web developer. I will limit the group to 10 people. I have the basic capture plan. Membership would be $48/year. Join me in the agony and triumph of seeing your creations in ways you never expected. Michele Waldman Sovereign Sites L.L.C. To join the group contact me at mmwaldman at optonline.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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From codebowl at gmail.com Tue Sep 30 16:32:10 2008 From: codebowl at gmail.com (Joseph Crawford) Date: Tue, 30 Sep 2008 16:32:10 -0400 Subject: [nycphp-talk] New browsercam group In-Reply-To: <0K80008XUZDNEXB0@mta1.srv.hcvlny.cv.net> References: <0K80008XUZDNEXB0@mta1.srv.hcvlny.cv.net> Message-ID: HAHA I didn't even know they offered faster processing ;) I also did not realize it took 30 minutes they must have changed that because I remember it being almost instant no more than 5 minutes for about 20 different browsers. I think they have just grown beyond the number of machines they have which is why the queue is so large. Sorry it has been a while since I used the service :) Joseph Crawford On Sep 30, 2008, at 4:25 PM, (Margaret) Michele Waldman wrote: > Dude! J I live in CA too long. > > Browsershots only processes every 30 minutes. > > You can?t make changes and check the changes right away. I can?t > work under those constraints. > > I will still use browsershots, but after I?m finished. > > I paid browsershots the $15 to upgrade my priority processing, but I > didn?t know that meant they?d only process me still every 30 minutes. > > That $15 bought my results being processed 1 minute faster. Woohoo! > > Michele > > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org > ] On Behalf Of Joseph Crawford > Sent: Tuesday, September 30, 2008 4:22 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] New browsercam group > > I take it browsershots.org did not fulfill your needs :) > > > On Sep 30, 2008, at 4:19 PM, (Margaret) Michele Waldman wrote: > > > Hi all, > I?m starting a browsercam group. > I add people to the account and we split the cost of browsercam. > Browsercam shows you your website, in up to over 200 browsers. > An absolute must for a web developer. > I will limit the group to 10 people. > I have the basic capture plan. Membership would be $48/year. > Join me in the agony and triumph of seeing your creations in ways > you never expected. > Michele Waldman > Sovereign Sites L.L.C. > To join the group contact me at mmwaldman at optonline.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 -------------- next part -------------- An HTML attachment was scrubbed... URL: