From brenttech at gmail.com Mon Nov 1 17:01:15 2010 From: brenttech at gmail.com (Brent Baisley) Date: Mon, 1 Nov 2010 17:01:15 -0400 Subject: [nycphp-talk] Squashing accented characters In-Reply-To: <4CC1DD13.5030003@devonianfarm.com> References: <4CC1DD13.5030003@devonianfarm.com> Message-ID: If you are using mysql on the backend, you can make your table UTF8, then your indexes would use utf8_general_ci collation by default. That collation basically strips out all accent marks on the data, then indexes it. So if you search for Dusseldorf or D?sseldorf, they will both come up with the same set of records. The you don't have to do anything on the PHP side. Regards, Brent On Oct 22, 2010, at 2:50 PM, Paul A Houle wrote: > For my site at > > http://ookaboo.com/ > > I'm running into the problem that people are searching for "Dusseldorf" but the name of the place is "D?sseldorf", so they don't find it. > > It seems to me a good answer to this is to have some function that squashes accented characters down to unaccented forms. I'd index the unaccented forms and also squash down queries so they'd always match up. I definitely need to do both ISO-Latin-1 and the Latin-Extended-A, because fate has given me a lot of place names that have the Polish dark L in them (?). It also seems like there are a lot of characters in Latin Extended-B that would also map plausably to unaccented characters. > > I can see how to write something like this, I'd need to parse out the Unicode code points from UTF-8 and run them through a lookup table, but it's a lot of details and I wonder if anybody has written a PHP function to do this already. > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From leam.hall.ctr at usmc.mil Tue Nov 2 07:00:39 2010 From: leam.hall.ctr at usmc.mil (Hall CTR Leam) Date: Tue, 2 Nov 2010 07:00:39 -0400 Subject: [nycphp-talk] Squashing accented characters In-Reply-To: References: <4CC1DD13.5030003@devonianfarm.com> Message-ID: <06A7A82C48A99643B8B77C99946AFECB087B944B@mcusquanez02v.mcdsus.mcds.usmc.mil> I can't remember the federal agency that tracks names, but they have a phonetic system that is useful when you're doing genealogy research. Their system breaks the words down a bit and eliminates doubles, accented characters, and some other things as well, IIRC. Wish I could remember the name of the place. Maybe the National Archives? Leam -------------------------------------------- Leam Hall Linux/Unix/Network Administrator Contractor for Smartronix ( CMMI Level 3 ISO 9001:2000 FS 91000 ) Com: 229.639.6028 Cell: 704.607.6747 Email: Leam.Hall.ctr at usmc.mil -------------------------------------------- -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Brent Baisley Sent: Monday, November 01, 2010 17:01 To: NYPHP Talk Subject: Re: [nycphp-talk] Squashing accented characters If you are using mysql on the backend, you can make your table UTF8, then your indexes would use utf8_general_ci collation by default. That collation basically strips out all accent marks on the data, then indexes it. So if you search for Dusseldorf or D?sseldorf, they will both come up with the same set of records. The you don't have to do anything on the PHP side. Regards, Brent On Oct 22, 2010, at 2:50 PM, Paul A Houle wrote: For my site at http://ookaboo.com/ I'm running into the problem that people are searching for "Dusseldorf" but the name of the place is "D?sseldorf", so they don't find it. It seems to me a good answer to this is to have some function that squashes accented characters down to unaccented forms. I'd index the unaccented forms and also squash down queries so they'd always match up. I definitely need to do both ISO-Latin-1 and the Latin-Extended-A, because fate has given me a lot of place names that have the Polish dark L in them (? ). It also seems like there are a lot of characters in Latin Extended-B that would also map plausably to unaccented characters. I can see how to write something like this, I'd need to parse out the Unicode code points from UTF-8 and run them through a lookup table, but it's a lot of details and I wonder if anybody has written a PHP function to do this already. _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 5678 bytes Desc: not available URL: From ps at blu-studio.com Thu Nov 4 08:32:31 2010 From: ps at blu-studio.com (ps at blu-studio.com) Date: Thu, 04 Nov 2010 05:32:31 -0700 Subject: [nycphp-talk] Searching an Entire MySQL Database Message-ID: <20101104053231.69a71d519390b8693ef02edaf26f7b19.c654d8bfd6.wbe@email00.secureserver.net> An HTML attachment was scrubbed... URL: From cmerlo at ncc.edu Thu Nov 4 08:42:38 2010 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Thu, 4 Nov 2010 08:42:38 -0400 Subject: [nycphp-talk] Searching an Entire MySQL Database In-Reply-To: <20101104053231.69a71d519390b8693ef02edaf26f7b19.c654d8bfd6.wbe@email00.secureserver.net> References: <20101104053231.69a71d519390b8693ef02edaf26f7b19.c654d8bfd6.wbe@email00.secureserver.net> Message-ID: On Thursday, November 4, 2010, wrote: > I am wondering if anyone has had to search an entire database and do a search and replace on a string. That is to search in every table, in every row, in every field. I'm having a hard time imagining a practical application of this, or even how it could ever be a good idea. If there's a particular problem you're trying to solve, maybe you need to reevaluate it, and find the path to a simpler, more helpful solution, and I've seen members of this list help with that hundreds of times. $0.02, -c From michael.southwell at nyphp.com Thu Nov 4 09:11:59 2010 From: michael.southwell at nyphp.com (Michael Southwell) Date: Thu, 04 Nov 2010 09:11:59 -0400 Subject: [nycphp-talk] Searching an Entire MySQL Database In-Reply-To: <20101104053231.69a71d519390b8693ef02edaf26f7b19.c654d8bfd6.wbe@email00.secureserver.net> References: <20101104053231.69a71d519390b8693ef02edaf26f7b19.c654d8bfd6.wbe@email00.secureserver.net> Message-ID: <4CD2B11F.7080901@nyphp.com> On 11/4/2010 08:32, ps at blu-studio.com wrote: > I am wondering if anyone has had to search an entire database and do a > search and replace on a string. That is to search in every table, in > every row, in every field. export the entire database into a file use PHP (or a good editor) to make the replacement line by line drop the database re-create it by importing the modified file Feasible only if the db is not gigantic and you can afford to have it down momentarily -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From cmerlo at ncc.edu Thu Nov 4 09:22:25 2010 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Thu, 4 Nov 2010 09:22:25 -0400 Subject: [nycphp-talk] Searching an Entire MySQL Database In-Reply-To: <4CD2B11F.7080901@nyphp.com> References: <20101104053231.69a71d519390b8693ef02edaf26f7b19.c654d8bfd6.wbe@email00.secureserver.net> <4CD2B11F.7080901@nyphp.com> Message-ID: On Thursday, November 4, 2010, Michael Southwell wrote: > On 11/4/2010 08:32, ps at blu-studio.com wrote: > > I am wondering if anyone has had to search an entire database and do a > search and replace on a string. That is to search in every table, in > every row, in every field. > > > export the entire database into a file > use PHP (or a good editor) to make the replacement line by line > drop the database > re-create it by importing the modified file This is potentially very dangerous, because you can inadvertently change column names, table names, etc. From ps at blu-studio.com Thu Nov 4 09:26:51 2010 From: ps at blu-studio.com (ps at blu-studio.com) Date: Thu, 04 Nov 2010 06:26:51 -0700 Subject: [nycphp-talk] Searching an Entire MySQL Database Message-ID: <20101104062651.69a71d519390b8693ef02edaf26f7b19.a5ea614cdb.wbe@email00.secureserver.net> An HTML attachment was scrubbed... URL: From dcech at phpwerx.net Thu Nov 4 09:29:23 2010 From: dcech at phpwerx.net (Dan Cech) Date: Thu, 04 Nov 2010 09:29:23 -0400 Subject: [nycphp-talk] Searching an Entire MySQL Database In-Reply-To: <20101104053231.69a71d519390b8693ef02edaf26f7b19.c654d8bfd6.wbe@email00.secureserver.net> References: <20101104053231.69a71d519390b8693ef02edaf26f7b19.c654d8bfd6.wbe@email00.secureserver.net> Message-ID: <4CD2B533.8080100@phpwerx.net> On 11/4/2010 8:32 AM, ps at blu-studio.com wrote: > I am wondering if anyone has had to search an entire database and do a search > and replace on a string. That is to search in every table, in every row, in > every field. The simplest way will be to loop through the tables in php (use SHOW TABLES), constructing & executing an UPDATE statement for each one like: UPDATE table SET field1=REPLACE(field1,'from','to'), ... fieldN=REPLACE(fieldN,'from','to'); You can use DESCRIBE TABLE table; to get the list of fields, and to cut them down to only the fields containing text based on the field type. Dan From rmarscher at beaffinitive.com Thu Nov 4 09:41:10 2010 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 4 Nov 2010 09:41:10 -0400 Subject: [nycphp-talk] Searching an Entire MySQL Database In-Reply-To: <20101104062651.69a71d519390b8693ef02edaf26f7b19.a5ea614cdb.wbe@email00.secureserver.net> References: <20101104062651.69a71d519390b8693ef02edaf26f7b19.a5ea614cdb.wbe@email00.secureserver.net> Message-ID: <3F3A4854-8EEF-448A-9C78-F0B41B60D296@beaffinitive.com> > On 11/4/2010 08:32, ps at blu-studio.com wrote: > > I am wondering if anyone has had to search an entire database and do a > > search and replace on a string. That is to search in every table, in > > every row, in every field. > export the entire database into a file > use PHP (or a good editor) to make the replacement line by line > drop the database > re-create it by importing the modified file I've had to do something similar. Yes, use mysqldump. Then use sed (if you're on a *nix machine). Sed does search and replace by streaming the file rather than buffering the whole thing so it won't run out of memory no matter how big your dump is. You can send the output to a new file. Definitely test out importing it back in on a non-production machine. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew at plexpod.com Thu Nov 4 11:00:12 2010 From: andrew at plexpod.com (Andrew Yochum) Date: Thu, 4 Nov 2010 11:00:12 -0400 Subject: [nycphp-talk] Searching an Entire MySQL Database In-Reply-To: <3F3A4854-8EEF-448A-9C78-F0B41B60D296@beaffinitive.com> References: <20101104062651.69a71d519390b8693ef02edaf26f7b19.a5ea614cdb.wbe@email00.secureserver.net> <3F3A4854-8EEF-448A-9C78-F0B41B60D296@beaffinitive.com> Message-ID: On Nov 4, 2010, at 9:41 AM, Rob Marscher wrote: >> On 11/4/2010 08:32, ps at blu-studio.com wrote: >> > I am wondering if anyone has had to search an entire database and do a >> > search and replace on a string. That is to search in every table, in >> > every row, in every field. >> export the entire database into a file >> use PHP (or a good editor) to make the replacement line by line >> drop the database >> re-create it by importing the modified file > I've had to do something similar. Yes, use mysqldump. Then use sed (if you're on a *nix machine). Sed does search and replace by streaming the file rather than buffering the whole thing so it won't run out of memory no matter how big your dump is. You can send the output to a new file. Definitely test out importing it back in on a non-production machine. This is a sane method. But you probably want to either: 1. Run on a schema-only dump and make sure it doesn't touch any columns or table DDL before you run it on a data dump 2. Make sure your search pattern matches things within a SQL quoted string. Dan's solution of looping over tables and columns works well too. Mysql has regex funcs you can use if necessary. HTH. Regards, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Thu Nov 4 11:03:06 2010 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Thu, 4 Nov 2010 11:03:06 -0400 Subject: [nycphp-talk] Searching an Entire MySQL Database In-Reply-To: References: <20101104062651.69a71d519390b8693ef02edaf26f7b19.a5ea614cdb.wbe@email00.secureserver.net><3F3A4854-8EEF-448A-9C78-F0B41B60D296@beaffinitive.com> Message-ID: <30E17DC80C7A46E1AC3DE67FF54953D9@michelePC> And, make a backup. Michele From: Andrew Yochum Sent: Thursday, November 04, 2010 11:00 AM To: NYPHP Talk Cc: NYPHP Talk Subject: Re: [nycphp-talk] Searching an Entire MySQL Database On Nov 4, 2010, at 9:41 AM, Rob Marscher wrote: On 11/4/2010 08:32, ps at blu-studio.com wrote: > I am wondering if anyone has had to search an entire database and do a > search and replace on a string. That is to search in every table, in > every row, in every field. export the entire database into a file use PHP (or a good editor) to make the replacement line by line drop the database re-create it by importing the modified file I've had to do something similar. Yes, use mysqldump. Then use sed (if you're on a *nix machine). Sed does search and replace by streaming the file rather than buffering the whole thing so it won't run out of memory no matter how big your dump is. You can send the output to a new file. Definitely test out importing it back in on a non-production machine. This is a sane method. But you probably want to either: 1. Run on a schema-only dump and make sure it doesn't touch any columns or table DDL before you run it on a data dump 2. Make sure your search pattern matches things within a SQL quoted string. Dan's solution of looping over tables and columns works well too. Mysql has regex funcs you can use if necessary. HTH. Regards, Andrew -------------------------------------------------------------------------------- _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at atopia.net Thu Nov 4 16:16:35 2010 From: matt at atopia.net (Matt Juszczak) Date: Thu, 4 Nov 2010 20:16:35 +0000 Subject: [nycphp-talk] Searching an Entire MySQL Database Message-ID: <217064016-1288901799-cardhu_decombobulator_blackberry.rim.net-228795021-@bda671.bisx.prod.on.blackberry> You could also do a mysqldump, find and replace with sed, then import. ------Original Message------ From: Dan Cech Sender: talk-bounces at lists.nyphp.org To: talk at lists.nyphp.org ReplyTo: NYPHP Talk Subject: Re: [nycphp-talk] Searching an Entire MySQL Database Sent: Nov 4, 2010 09:29 On 11/4/2010 8:32 AM, ps at blu-studio.com wrote: > I am wondering if anyone has had to search an entire database and do a search > and replace on a string. That is to search in every table, in every row, in > every field. The simplest way will be to loop through the tables in php (use SHOW TABLES), constructing & executing an UPDATE statement for each one like: UPDATE table SET field1=REPLACE(field1,'from','to'), ... fieldN=REPLACE(fieldN,'from','to'); You can use DESCRIBE TABLE table; to get the list of fields, and to cut them down to only the fields containing text based on the field type. Dan _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation From winterbeef at gmail.com Fri Nov 5 09:57:10 2010 From: winterbeef at gmail.com (Wellington Fan) Date: Fri, 5 Nov 2010 09:57:10 -0400 Subject: [nycphp-talk] Searching an Entire MySQL Database In-Reply-To: References: <20101104062651.69a71d519390b8693ef02edaf26f7b19.a5ea614cdb.wbe@email00.secureserver.net> <3F3A4854-8EEF-448A-9C78-F0B41B60D296@beaffinitive.com> Message-ID: I think the "-t" flag to mysqldump dumps just the data, and not the schema. this might be useful in ensuring that you don't accidentally change the schema with your sed. -- wellington From andrew at plexpod.com Fri Nov 5 10:18:06 2010 From: andrew at plexpod.com (Andrew Yochum) Date: Fri, 05 Nov 2010 10:18:06 -0400 Subject: [nycphp-talk] Searching an Entire MySQL Database In-Reply-To: References: <20101104062651.69a71d519390b8693ef02edaf26f7b19.a5ea614cdb.wbe@email00.secureserver.net> <3F3A4854-8EEF-448A-9C78-F0B41B60D296@beaffinitive.com> Message-ID: <4CD4121E.4040405@plexpod.com> On 11/5/10 9:57 AM, Wellington Fan wrote: > I think the "-t" flag to mysqldump dumps just the data, and not the schema. this might be useful in ensuring that you don't accidentally change the schema with your sed. Right, but the point of testing against the schema file is so that you ensure you're not matching table or column names - which will still be in a data-only dump. -- Andrew Yochum Plexpod andrew at plexpod.com office: 718-360-0879 mobile: 347-688-4699 fax: 718-504-6289 From mmwaldman at nyc.rr.com Sun Nov 7 09:40:17 2010 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Sun, 7 Nov 2010 09:40:17 -0500 Subject: [nycphp-talk] blogging softward Message-ID: <032D35CDE61D4A6ABC4AE8FC31B0EEBB@michelePC> Hey, I want to start a forum website. Which package should I use? Thanks. Michele -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Sun Nov 7 12:21:34 2010 From: ramons at gmx.net (David Krings) Date: Sun, 07 Nov 2010 12:21:34 -0500 Subject: [nycphp-talk] blogging softward In-Reply-To: <032D35CDE61D4A6ABC4AE8FC31B0EEBB@michelePC> References: <032D35CDE61D4A6ABC4AE8FC31B0EEBB@michelePC> Message-ID: <4CD6E01E.4040108@gmx.net> On 11/7/2010 9:40, Michele Waldman wrote: > Hey, I want to start a forum website. > Which package should I use? > Thanks. > Michele Hi! Blog (subject) or web forum (body)? For a forum use phpBB, can't think of anything else that is so comfortable, current, and easy to use. For a blog, never bothered with it. There are already way too many people blogging about things the world doesn't care about. No need for me to do the same. David From ajai at bitblit.net Sun Nov 7 20:51:00 2010 From: ajai at bitblit.net (Ajai Khattri) Date: Sun, 7 Nov 2010 20:51:00 -0500 (EST) Subject: [nycphp-talk] blogging softward In-Reply-To: <032D35CDE61D4A6ABC4AE8FC31B0EEBB@michelePC> Message-ID: On Sun, 7 Nov 2010, Michele Waldman wrote: > Hey, I want to start a forum website. http://vanillaforums.org/ -- A From paulcheung at tiscali.co.uk Wed Nov 10 04:08:18 2010 From: paulcheung at tiscali.co.uk (Paul Cheung) Date: Wed, 10 Nov 2010 09:08:18 -0000 Subject: [nycphp-talk] blogging softward In-Reply-To: <032D35CDE61D4A6ABC4AE8FC31B0EEBB@michelePC> References: <032D35CDE61D4A6ABC4AE8FC31B0EEBB@michelePC> Message-ID: <2E12168294174C538EDE447991700F55@X9183> Hello Michele, There are three main CMS contenders out there each has its own pros and cons, massive fan base, tons of support and are all open source. A bit like PHP really. In alphabetical order they are: Drupal Joomla Wordpress It is just a question of choosing the one you like best and feel most confortable with. Cheers - Paul ----- Original Message ----- From: Michele Waldman To: NYPHP Talk Sent: Sunday, November 07, 2010 2:40 PM Subject: [nycphp-talk] blogging softward Hey, I want to start a forum website. Which package should I use? Thanks. Michele ------------------------------------------------------------------------------ _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Wed Nov 10 05:36:48 2010 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 10 Nov 2010 05:36:48 -0500 Subject: [nycphp-talk] blogging softward In-Reply-To: <2E12168294174C538EDE447991700F55@X9183> References: <032D35CDE61D4A6ABC4AE8FC31B0EEBB@michelePC> <2E12168294174C538EDE447991700F55@X9183> Message-ID: <8B3B1A7D0E764CF5865788198FC231F0@michelePC> I didn't want to use a CMS for a forum. From: Paul Cheung Sent: Wednesday, November 10, 2010 4:08 AM To: NYPHP Talk Subject: Re: [nycphp-talk] blogging softward Hello Michele, There are three main CMS contenders out there each has its own pros and cons, massive fan base, tons of support and are all open source. A bit like PHP really. In alphabetical order they are: Drupal Joomla Wordpress It is just a question of choosing the one you like best and feel most confortable with. Cheers - Paul ----- Original Message ----- From: Michele Waldman To: NYPHP Talk Sent: Sunday, November 07, 2010 2:40 PM Subject: [nycphp-talk] blogging softward Hey, I want to start a forum website. Which package should I use? Thanks. Michele ------------------------------------------------------------------------------ _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation -------------------------------------------------------------------------------- _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Wed Nov 10 05:37:54 2010 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 10 Nov 2010 05:37:54 -0500 Subject: [nycphp-talk] blogging softward In-Reply-To: <2E12168294174C538EDE447991700F55@X9183> References: <032D35CDE61D4A6ABC4AE8FC31B0EEBB@michelePC> <2E12168294174C538EDE447991700F55@X9183> Message-ID: I must have been half asleep when I typed the subject line. I know blogging software. I need forum software. From: Paul Cheung Sent: Wednesday, November 10, 2010 4:08 AM To: NYPHP Talk Subject: Re: [nycphp-talk] blogging softward Hello Michele, There are three main CMS contenders out there each has its own pros and cons, massive fan base, tons of support and are all open source. A bit like PHP really. In alphabetical order they are: Drupal Joomla Wordpress It is just a question of choosing the one you like best and feel most confortable with. Cheers - Paul ----- Original Message ----- From: Michele Waldman To: NYPHP Talk Sent: Sunday, November 07, 2010 2:40 PM Subject: [nycphp-talk] blogging softward Hey, I want to start a forum website. Which package should I use? Thanks. Michele ------------------------------------------------------------------------------ _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation -------------------------------------------------------------------------------- _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Wed Nov 10 05:39:09 2010 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 10 Nov 2010 05:39:09 -0500 Subject: [nycphp-talk] blogging softward In-Reply-To: <8B3B1A7D0E764CF5865788198FC231F0@michelePC> References: <032D35CDE61D4A6ABC4AE8FC31B0EEBB@michelePC><2E12168294174C538EDE447991700F55@X9183> <8B3B1A7D0E764CF5865788198FC231F0@michelePC> Message-ID: <427540D50FC34128B4DB24CC0465BF28@michelePC> I mean I don't want to use blogging software for a forum. From: Michele Waldman Sent: Wednesday, November 10, 2010 5:36 AM To: NYPHP Talk Subject: Re: [nycphp-talk] blogging softward I didn't want to use a CMS for a forum. From: Paul Cheung Sent: Wednesday, November 10, 2010 4:08 AM To: NYPHP Talk Subject: Re: [nycphp-talk] blogging softward Hello Michele, There are three main CMS contenders out there each has its own pros and cons, massive fan base, tons of support and are all open source. A bit like PHP really. In alphabetical order they are: Drupal Joomla Wordpress It is just a question of choosing the one you like best and feel most confortable with. Cheers - Paul ----- Original Message ----- From: Michele Waldman To: NYPHP Talk Sent: Sunday, November 07, 2010 2:40 PM Subject: [nycphp-talk] blogging softward Hey, I want to start a forum website. Which package should I use? Thanks. Michele ------------------------------------------------------------------------------ _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation -------------------------------------------------------------------------------- _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation -------------------------------------------------------------------------------- _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Wed Nov 10 07:13:21 2010 From: ramons at gmx.net (David Krings) Date: Wed, 10 Nov 2010 07:13:21 -0500 Subject: [nycphp-talk] blogging softward In-Reply-To: References: <032D35CDE61D4A6ABC4AE8FC31B0EEBB@michelePC> <2E12168294174C538EDE447991700F55@X9183> Message-ID: <4CDA8C61.6050905@gmx.net> On 11/10/2010 5:37, Michele Waldman wrote: > I must have been half asleep when I typed the subject line. I know blogging > software. I need forum software. Despite my post being autoplagiarism, use phpBB. And since it is written in PHP you can tweak it the way you want. David From rmarscher at beaffinitive.com Wed Nov 10 10:16:43 2010 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 10 Nov 2010 10:16:43 -0500 Subject: [nycphp-talk] blogging softward In-Reply-To: <4CDA8C61.6050905@gmx.net> References: <032D35CDE61D4A6ABC4AE8FC31B0EEBB@michelePC> <2E12168294174C538EDE447991700F55@X9183> <4CDA8C61.6050905@gmx.net> Message-ID: <58A14206-65FD-42F2-B49C-D8CEC3809488@beaffinitive.com> On Nov 10, 2010, at 7:13 AM, David Krings wrote: > On 11/10/2010 5:37, Michele Waldman wrote: >> I must have been half asleep when I typed the subject line. I know blogging >> software. I need forum software. > Despite my post being autoplagiarism, use phpBB. And since it is written in PHP you can tweak it the way you want. PunBB is another option -- possibly more lightweight and simple than phpBB which I think of as the big old flagship of php forums. http://punbb.informer.com/ As Ajai mentioned, Vanilla looks really nice too -- probably the newest of the major options out there. http://vanillaforums.org/ From jbaltz at altzman.com Wed Nov 10 15:31:38 2010 From: jbaltz at altzman.com (Jerry B. Altzman) Date: Wed, 10 Nov 2010 15:31:38 -0500 Subject: [nycphp-talk] SPROCs in the MySQL/PostgreSQL + PHP crowd Message-ID: <4CDB012A.8030100@altzman.com> Hi all, Just a question for those of you out there dealing with the F/OSS RDBMS's out there: How many of you are using stored procedures (SPROCs) with any great regularity? I know that in the commercial database world use of stored procedures is The Way Things Are Pretty Much Done, but I've not seen it in my brief forays through the bulk of PHP code I've examined (and needless to say, written). Am I just out of it? Is it just not considered usual practice, or am I blind? In this I'm also including triggers and other stored functions, but not parametrized queries (they're something different yet). I'll be happy to summarize (and anonymize) to the list. Thanks! //jbaltz -- jerry b. altzman jbaltz at altzman.com www.jbaltz.com thank you for contributing to the heat death of the universe. From chsnyder at gmail.com Wed Nov 10 15:42:08 2010 From: chsnyder at gmail.com (Chris Snyder) Date: Wed, 10 Nov 2010 15:42:08 -0500 Subject: [nycphp-talk] SPROCs in the MySQL/PostgreSQL + PHP crowd In-Reply-To: <4CDB012A.8030100@altzman.com> References: <4CDB012A.8030100@altzman.com> Message-ID: On Wed, Nov 10, 2010 at 3:31 PM, Jerry B. Altzman wrote: > Hi all, > > Just a question for those of you out there dealing with the F/OSS RDBMS's > out there: > > How many of you are using stored procedures (SPROCs) with any great > regularity? > > I know that in the commercial database world use of stored procedures is The > Way Things Are Pretty Much Done, but I've not seen it in my brief forays > through the bulk of PHP code I've examined (and needless to say, written). > Am I just out of it? Is it just not considered usual practice, or am I > blind? > > In this I'm also including triggers and other stored functions, but not > parametrized queries (they're something different yet). > > I'll be happy to summarize (and anonymize) to the list. > > Thanks! > > //jbaltz > -- I started in PHP/MySQL development before stored procedures were even an option, and learned to make due without them. Obviously a heretical approach, but when you know that the database is unlikely to be accessed by anything other than your php code, it makes sense to keep the logic in the application where it is easier to work with (and subject to version control). From rmarscher at beaffinitive.com Wed Nov 10 16:37:51 2010 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Wed, 10 Nov 2010 16:37:51 -0500 Subject: [nycphp-talk] SPROCs in the MySQL/PostgreSQL + PHP crowd In-Reply-To: <4CDB012A.8030100@altzman.com> References: <4CDB012A.8030100@altzman.com> Message-ID: <5C12BDFA-5AFA-4634-AE6F-8CB92E466F1B@beaffinitive.com> On Nov 10, 2010, at 3:31 PM, Jerry B. Altzman wrote: > I know that in the commercial database world use of stored procedures is The Way Things Are Pretty Much Done, but I've not seen it in my brief forays through the bulk of PHP code I've examined (and needless to say, written). Am I just out of it? Is it just not considered usual practice, or am I blind? Personally, I think stored procedures are useful when you have DBAs in control of the database and critical business logic and they don't trust the developers interacting with the data. Also useful if you have several different codebases acting on the data. A lot of php code is done with the least common denominator in mind (i.e. somebody on a free shared hosting account), so it won't take advantage of the advanced tools available (non-default extensions, db features that require more recent versions of mysql [although most are probably on 5.0+ now], etc). However, if you do essentially have one codebase doing all of your data manipulation and you don't have dedicated DBAs, I think using stored procedures doesn't really make sense because it's dividing up where your business logic is located and potentially making things more confusing or harder to debug. From dwang at udfi.biz Wed Nov 10 16:48:03 2010 From: dwang at udfi.biz (David Wang) Date: Wed, 10 Nov 2010 16:48:03 -0500 Subject: [nycphp-talk] SPROCs in the MySQL/PostgreSQL + PHP crowd In-Reply-To: References: <4CDB012A.8030100@altzman.com> Message-ID: <5D5493F1-908D-4E37-A017-A444F060F726@udfi.biz> I'll second this. The problem i've always had in the past with sprocs is that it adds another layer of abstraction to the business logic and difficult to manage changes for. I've always told my developers to move it out of the sprocs and into the code so we see what's going on and can manage changes in a code repository. The only time i've bit the bullet and moved logic into sprocs was when there was a mixed language environment. Instead of duplicating logic, we put the logic in the database using sprocs so that both languages had access and logic didn't have to be duplicated. -d -- David Wang Entrepreneur in Training +1 (434) 298 4588 | dwang at udfi.biz | www.udfi.biz | @daSn0wie On Nov 10, 2010, at 3:42 PM, Chris Snyder wrote: > On Wed, Nov 10, 2010 at 3:31 PM, Jerry B. Altzman wrote: >> Hi all, >> >> Just a question for those of you out there dealing with the F/OSS RDBMS's >> out there: >> >> How many of you are using stored procedures (SPROCs) with any great >> regularity? >> >> I know that in the commercial database world use of stored procedures is The >> Way Things Are Pretty Much Done, but I've not seen it in my brief forays >> through the bulk of PHP code I've examined (and needless to say, written). >> Am I just out of it? Is it just not considered usual practice, or am I >> blind? >> >> In this I'm also including triggers and other stored functions, but not >> parametrized queries (they're something different yet). >> >> I'll be happy to summarize (and anonymize) to the list. >> >> Thanks! >> >> //jbaltz >> -- > > I started in PHP/MySQL development before stored procedures were even > an option, and learned to make due without them. Obviously a heretical > approach, but when you know that the database is unlikely to be > accessed by anything other than your php code, it makes sense to keep > the logic in the application where it is easier to work with (and > subject to version control). > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at devonianfarm.com Wed Nov 10 17:09:30 2010 From: paul at devonianfarm.com (Paul A Houle) Date: Wed, 10 Nov 2010 17:09:30 -0500 Subject: [nycphp-talk] SPROCs in the MySQL/PostgreSQL + PHP crowd In-Reply-To: <5D5493F1-908D-4E37-A017-A444F060F726@udfi.biz> References: <4CDB012A.8030100@altzman.com> <5D5493F1-908D-4E37-A017-A444F060F726@udfi.biz> Message-ID: <4CDB181A.5060300@devonianfarm.com> On 11/10/2010 4:48 PM, David Wang wrote: > I'll second this. The problem i've always had in the past with sprocs > is that it adds another layer of abstraction to the business logic and > difficult to manage changes for. I've always told my developers to > move it out of the sprocs and into the code so we see what's going on > and can manage changes in a code repository. > > The only time i've bit the bullet and moved logic into sprocs was when > there was a mixed language environment. Instead of duplicating logic, > we put the logic in the database using sprocs so that both languages > had access and logic didn't have to be duplicated. Most of the system I've worked on do not use sprocs, or only use them in a minor way. I have worked on two projects that were heavily sproc-based, and it really wasn't that bad. We addressed the version control problem by using migration scripts that worked, more or less, like migrations in Ruby On Rails. This gave us acceptable version control, although of course we didn't get a complete change log from our VCS. (It wouldn't be much effort to build some script that would help with this, however) I've used sprocs quite a bit in MS SQL server to "add commands" to do things that are a pain to do in the SQL monitor, for instance http://gen5.info/q/2008/06/06/how-to-drop-a-primary-key-in-microsoft-sql-server/ --- Note that a possible architecture for a db app is to have a class/source code file/folder that has all of your SQL statements in it, wrapped up in functions. An app built like this looks a lot like one that's based on stored procedures, but has the advantage that it's all written in one language. It's also easy to make a system like this compatible with different database systems by swapping out different versions of this class. (Wrappers like this are also logical to put around real sprocs too...) Of course, this architecture and the sproc-based architecture is incompatible with the popular ORM-based architecture, which takes it's own approach to the database abstraction problem. From ramons at gmx.net Wed Nov 10 20:27:08 2010 From: ramons at gmx.net (David Krings) Date: Wed, 10 Nov 2010 20:27:08 -0500 Subject: [nycphp-talk] SPROCs in the MySQL/PostgreSQL + PHP crowd In-Reply-To: <5C12BDFA-5AFA-4634-AE6F-8CB92E466F1B@beaffinitive.com> References: <4CDB012A.8030100@altzman.com> <5C12BDFA-5AFA-4634-AE6F-8CB92E466F1B@beaffinitive.com> Message-ID: <4CDB466C.2000504@gmx.net> On 11/10/2010 16:37, Rob Marscher wrote: > On Nov 10, 2010, at 3:31 PM, Jerry B. Altzman wrote: >> I know that in the commercial database world use of stored procedures is The Way Things Are Pretty Much Done, but I've not seen it in my brief forays through the bulk of PHP code I've examined (and needless to say, written). Am I just out of it? Is it just not considered usual practice, or am I blind? > > Personally, I think stored procedures are useful when you have DBAs in control of the database and critical business logic and they don't trust the developers interacting with the data. Also useful if you have several different codebases acting on the data. A lot of php code is done with the least common denominator in mind (i.e. somebody on a free shared hosting account), so it won't take advantage of the advanced tools available (non-default extensions, db features that require more recent versions of mysql [although most are probably on 5.0+ now], etc). > > However, if you do essentially have one codebase doing all of your data manipulation and you don't have dedicated DBAs, I think using stored procedures doesn't really make sense because it's dividing up where your business logic is located and potentially making things more confusing or harder to debug. It also depends on how many systems access your database and perform more or less the same tasks. If you have a dozen systems accessing the same database then shifting business logic and tasks to the database server will make it work the same across all systems. That way you don't have to reinvent the wheel and keep it pumped up on every system. Also, sprocs can help distributing processing load from the web server to the database server. Depending on how the systems are used that may be a benefit. Besides that, sprocs can be used by other apps that are not written in PHP whereas your PHP code cannot. Then again, why would anyone use something other than PHP.... David From willie at pdfsystems.com Fri Nov 12 16:02:02 2010 From: willie at pdfsystems.com (willie klein) Date: Fri, 12 Nov 2010 16:02:02 -0500 Subject: [nycphp-talk] mysql connection Message-ID: <2ED7A9E36E3A8845A484675D7BBF1CF9727091D797@VirtualExchange.pdfkqs.local> Hi All Setting up a new server and finally splitting my apache server and mysql server into 2 virtual boxes. For some reason I can't connect to the remote server with php but I can connect with mysql command line. I think it must be some way I compiled php, tried just using rpms also. Here is my configure statement './configure' '--with-mysql=/usr/' '--with-mysqli=/usr/bin/mysql_config' '--with-apxs2=/usr/sbin/apxs' '--with-zlib' '--enable-ftp' Seems like it should work, works on a local mysql server. Thanks wil -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Fri Nov 12 16:07:42 2010 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 12 Nov 2010 16:07:42 -0500 Subject: [nycphp-talk] mysql connection In-Reply-To: <2ED7A9E36E3A8845A484675D7BBF1CF9727091D797@VirtualExchange.pdfkqs.local> References: <2ED7A9E36E3A8845A484675D7BBF1CF9727091D797@VirtualExchange.pdfkqs.local> Message-ID: On Nov 12, 2010, at 4:02 PM, willie klein wrote: > Setting up a new server and finally splitting my apache server and mysql server into 2 virtual boxes. > For some reason I can?t connect to the remote server with php but I can connect with mysql command line. > I think it must be some way I compiled php, tried just using rpms also. I'm not sure it's your php compilation. What about mysql permissions? Can you connect via mysql command line running on your apache server to the mysql server? Also want to make sure the port is open on the mysql server (usually 3306) and that the mysql server doesn't have "skip-networking" in it's my.cnf. The permissions for mysql users includes the hostname that user is allowed to connect from. If you want to open up the permissions for the user so they can connect from any server, you want to do something like this: CREATE USER 'username'@'%' IDENTIFIED BY 'password'; GRANT USAGE ON *.* TO 'username'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON `dbname` . * TO 'username'@'%'; FLUSH PRIVILEGES; The % wildcard allows the user to connect from any host. -------------- next part -------------- An HTML attachment was scrubbed... URL: From willie at pdfsystems.com Fri Nov 12 16:32:31 2010 From: willie at pdfsystems.com (William Klein) Date: Fri, 12 Nov 2010 16:32:31 -0500 Subject: [nycphp-talk] mysql connection In-Reply-To: References: <2ED7A9E36E3A8845A484675D7BBF1CF9727091D797@VirtualExchange.pdfkqs.local> Message-ID: <126301cb82b1$2ea6d9a0$8bf48ce0$@com> Yeah I understand that. I can connect from the apache server with mysql -u root -h 192.168.199.31 -p but the php connect fails with Warning: mysql_connect() [function.mysql-connect ]: Can't connect to MySQL server on '192.168.199.31' (13) in /var/www/html/order/test.php on line 2 Could not connect number2003 error Can't connect to MySQL server on '192.168.199.31' (13) Error 2003 is permission denied and so is 13 but I'm using the same user: Test code: Strange, which is why I was looking at the php complile. The phpinfo() command does mention the mysql sock in /var/lib/mysql but no mention of a tcp connection I thought perhaps there was a compile parameter I'm missing. From: Rob Marscher [mailto:rmarscher at beaffinitive.com] Sent: Friday, November 12, 2010 4:08 PM To: NYPHP Talk Subject: Re: [nycphp-talk] mysql connection On Nov 12, 2010, at 4:02 PM, willie klein wrote: Setting up a new server and finally splitting my apache server and mysql server into 2 virtual boxes. For some reason I can't connect to the remote server with php but I can connect with mysql command line. I think it must be some way I compiled php, tried just using rpms also. I'm not sure it's your php compilation. What about mysql permissions? Can you connect via mysql command line running on your apache server to the mysql server? Also want to make sure the port is open on the mysql server (usually 3306) and that the mysql server doesn't have "skip-networking" in it's my.cnf. The permissions for mysql users includes the hostname that user is allowed to connect from. If you want to open up the permissions for the user so they can connect from any server, you want to do something like this: CREATE USER 'username'@'%' IDENTIFIED BY 'password'; GRANT USAGE ON *.* TO 'username'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON `dbname` . * TO 'username'@'%'; FLUSH PRIVILEGES; The % wildcard allows the user to connect from any host. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dorgan at donaldorgan.com Fri Nov 12 16:31:29 2010 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Fri, 12 Nov 2010 16:31:29 -0500 (EST) Subject: [nycphp-talk] mysql connection In-Reply-To: <2ED7A9E36E3A8845A484675D7BBF1CF9727091D797@VirtualExchange.pdfkqs.local> Message-ID: <8049556.4.1289597489789.JavaMail.root@mail.twoguyshosting.com> Sounds like your mysql server is not listening on your private IP address...you probably need to edit my.cnf and tell it to listen on your private(internal) ip address. ----- Original Message ----- From: "willie klein" To: talk at lists.nyphp.org Sent: Friday, November 12, 2010 4:02:02 PM Subject: [nycphp-talk] mysql connection Hi All Setting up a new server and finally splitting my apache server and mysql server into 2 virtual boxes. For some reason I can?t connect to the remote server with php but I can connect with mysql command line. I think it must be some way I compiled php, tried just using rpms also. Here is my configure statement './configure' '--with-mysql=/usr/' '--with-mysqli=/usr/bin/mysql_config' '--with-apxs2=/usr/sbin/apxs' '--with-zlib' '--enable-ftp' Seems like it should work, works on a local mysql server. Thanks wil _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From willie at pdfsystems.com Fri Nov 12 16:47:02 2010 From: willie at pdfsystems.com (William Klein) Date: Fri, 12 Nov 2010 16:47:02 -0500 Subject: [nycphp-talk] mysql connection In-Reply-To: <126301cb82b1$2ea6d9a0$8bf48ce0$@com> References: <2ED7A9E36E3A8845A484675D7BBF1CF9727091D797@VirtualExchange.pdfkqs.local> <126301cb82b1$2ea6d9a0$8bf48ce0$@com> Message-ID: <126e01cb82b3$35b51d90$a11f58b0$@com> I figured it out it was SELINUX Now I need to figure out how to get SELINUX not to interfere with the apache-mysql connection. If anyone knows I wouldn't mind but it's really time to start my research on that, most likely on a different list. Thanks From: William Klein [mailto:willie at pdfsystems.com] Sent: Friday, November 12, 2010 4:33 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] mysql connection Yeah I understand that. I can connect from the apache server with mysql -u root -h 192.168.199.31 -p but the php connect fails with Warning: mysql_connect() [function.mysql-connect ]: Can't connect to MySQL server on '192.168.199.31' (13) in /var/www/html/order/test.php on line 2 Could not connect number2003 error Can't connect to MySQL server on '192.168.199.31' (13) Error 2003 is permission denied and so is 13 but I'm using the same user: Test code: Strange, which is why I was looking at the php complile. The phpinfo() command does mention the mysql sock in /var/lib/mysql but no mention of a tcp connection I thought perhaps there was a compile parameter I'm missing. From: Rob Marscher [mailto:rmarscher at beaffinitive.com] Sent: Friday, November 12, 2010 4:08 PM To: NYPHP Talk Subject: Re: [nycphp-talk] mysql connection On Nov 12, 2010, at 4:02 PM, willie klein wrote: Setting up a new server and finally splitting my apache server and mysql server into 2 virtual boxes. For some reason I can't connect to the remote server with php but I can connect with mysql command line. I think it must be some way I compiled php, tried just using rpms also. I'm not sure it's your php compilation. What about mysql permissions? Can you connect via mysql command line running on your apache server to the mysql server? Also want to make sure the port is open on the mysql server (usually 3306) and that the mysql server doesn't have "skip-networking" in it's my.cnf. The permissions for mysql users includes the hostname that user is allowed to connect from. If you want to open up the permissions for the user so they can connect from any server, you want to do something like this: CREATE USER 'username'@'%' IDENTIFIED BY 'password'; GRANT USAGE ON *.* TO 'username'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON `dbname` . * TO 'username'@'%'; FLUSH PRIVILEGES; The % wildcard allows the user to connect from any host. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dorgan at donaldorgan.com Fri Nov 12 22:00:15 2010 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Fri, 12 Nov 2010 22:00:15 -0500 (EST) Subject: [nycphp-talk] mysql connection In-Reply-To: <126e01cb82b3$35b51d90$a11f58b0$@com> Message-ID: <3143077.6.1289617215050.JavaMail.root@mail.twoguyshosting.com> Apache doesn't connect to mysql.... I believe your issue is what I stated earlier mySQL is not listening on your private ip address....edit your my.cnf file From willie at pdfsystems.com Mon Nov 15 11:16:56 2010 From: willie at pdfsystems.com (William Klein) Date: Mon, 15 Nov 2010 11:16:56 -0500 Subject: [nycphp-talk] mysql connection In-Reply-To: <3143077.6.1289617215050.JavaMail.root@mail.twoguyshosting.com> References: <126e01cb82b3$35b51d90$a11f58b0$@com> <3143077.6.1289617215050.JavaMail.root@mail.twoguyshosting.com> Message-ID: <12db01cb84e0$98147790$c83d66b0$@com> When I get to the bottom of what's happening I will post my ultimate resolution. But the MySQL server is listening on the port. Here's why I thought it was my PHP setup The apache server will connect to mysql running on the local host with selinux enforcing I can connect to the remote mysql server with command line mysql commands Mysql -u root -h 192.168.199.31 -p The apache server will not connect to the remote server with selinux enforcing. The apache server will connect to the remote server with selinux in permissive mode. Therefore I have come to the conclusion that my issue is with selinux. Since I want the security enhanced features of selinux I will figure out what the issue is and post the ultimate resolution. I appreciate all the input and I will post back what I find. -----Original Message----- From: Donald J. Organ IV [mailto:dorgan at donaldorgan.com] Sent: Friday, November 12, 2010 10:00 PM To: NYPHP Talk Subject: Re: [nycphp-talk] mysql connection Apache doesn't connect to mysql.... I believe your issue is what I stated earlier mySQL is not listening on your private ip address....edit your my.cnf file _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation From cmerlo at ncc.edu Mon Nov 15 13:25:47 2010 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 15 Nov 2010 13:25:47 -0500 Subject: [nycphp-talk] PHP & Google Calendar Message-ID: Hi everyone. I'm having a problem trying to use the Zend-provided PHP hooks into Google Calendar. After Googling, I found one person who seems to have had the same problem, but it's not clear what resolution, if any, that person achieved. Briefly, I'm using the ClientLogin method to connect to Google, which works fine. I instantiate the Zend_Gdata_Calendar object, and that works fine (because I can see all its guts in a print_r). But any call to the object's getCalendarListFeed( ) or getCalendarEventFeed( ) methods not only doesn't work, the PHP script immediately dies. No exception to catch, no more output, nothing. But the syntax is ok (and php -l script_name.php confirms this). Any help will be appreciated. Thanks. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.reeves at gmail.com Mon Nov 15 13:30:05 2010 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Mon, 15 Nov 2010 13:30:05 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: Message-ID: Are you getting any php errors? Thank You Chuck Reeves On Mon, Nov 15, 2010 at 1:25 PM, Christopher R. Merlo wrote: > Hi everyone. I'm having a problem trying to use the Zend-provided PHP > hooks into Google Calendar. After Googling, I found one person who seems to > have had the same problem, but it's not clear what resolution, if any, that > person achieved. > > Briefly, I'm using the ClientLogin method to connect to Google, which works > fine. I instantiate the Zend_Gdata_Calendar object, and that works fine > (because I can see all its guts in a print_r). But any call to the object's > getCalendarListFeed( ) or getCalendarEventFeed( ) methods not only doesn't > work, the PHP script immediately dies. No exception to catch, no more > output, nothing. But the syntax is ok (and php -l script_name.php confirms > this). Any help will be appreciated. Thanks. > -Chris > > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmerlo at ncc.edu Mon Nov 15 13:34:30 2010 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 15 Nov 2010 13:34:30 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: Message-ID: On Mon, Nov 15, 2010 at 1:30 PM, Chuck Reeves wrote: > Are you getting any php errors? Nothing. It just stops dead. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Mon Nov 15 13:40:51 2010 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Mon, 15 Nov 2010 13:40:51 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: Message-ID: <8E0A661E-9519-4DCB-81B6-1405F3637B0F@beaffinitive.com> > On Mon, Nov 15, 2010 at 1:30 PM, Chuck Reeves wrote: > Are you getting any php errors? On Nov 15, 2010, at 1:34 PM, Christopher R. Merlo wrote: > Nothing. It just stops dead. Could it be that Google calendar is down right now? http://mashable.com/2010/11/15/google-calendar-down-november-15/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmerlo at ncc.edu Mon Nov 15 13:48:59 2010 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 15 Nov 2010 13:48:59 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: <8E0A661E-9519-4DCB-81B6-1405F3637B0F@beaffinitive.com> References: <8E0A661E-9519-4DCB-81B6-1405F3637B0F@beaffinitive.com> Message-ID: On Mon, Nov 15, 2010 at 1:40 PM, Rob Marscher wrote: Could it be that Google calendar is down right now? > http://mashable.com/2010/11/15/google-calendar-down-november-15/ > I suppose it could be. But my calendar comes up, and the authentication is happening successfully, as far as I can tell. I'll check Google's status and my code again when I'm done with class, and report back. Thanks for the link Rob. -c -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.reeves at gmail.com Mon Nov 15 13:51:41 2010 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Mon, 15 Nov 2010 13:51:41 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: <8E0A661E-9519-4DCB-81B6-1405F3637B0F@beaffinitive.com> Message-ID: Are you checking your calendar on the same machine that is running the PHP code? If you are on long island and the server is in NYC, then google could have an issue with just NYC. I have had that happen before when they switched from XO to level three. Thank You Chuck Reeves On Mon, Nov 15, 2010 at 1:48 PM, Christopher R. Merlo wrote: > On Mon, Nov 15, 2010 at 1:40 PM, Rob Marscher wrote: > > Could it be that Google calendar is down right now? >> http://mashable.com/2010/11/15/google-calendar-down-november-15/ >> > > I suppose it could be. But my calendar comes up, and the authentication is > happening successfully, as far as I can tell. I'll check Google's status > and my code again when I'm done with class, and report back. Thanks for the > link Rob. > -c > > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Mon Nov 15 13:58:55 2010 From: chsnyder at gmail.com (Chris Snyder) Date: Mon, 15 Nov 2010 13:58:55 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: Message-ID: On Mon, Nov 15, 2010 at 1:34 PM, Christopher R. Merlo wrote: > On Mon, Nov 15, 2010 at 1:30 PM, Chuck Reeves > wrote: >> >> Are you getting any php errors? > > Nothing. ?It just stops dead. And you don't have php set to log errors, by any chance? From cmerlo at ncc.edu Mon Nov 15 15:18:56 2010 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 15 Nov 2010 15:18:56 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: <8E0A661E-9519-4DCB-81B6-1405F3637B0F@beaffinitive.com> Message-ID: On Mon, Nov 15, 2010 at 1:51 PM, Chuck Reeves wrote: > Are you checking your calendar on the same machine that is running the PHP > code? No, but they (my laptop and the department's web server) have the same connection to outside, and the same external IP. > If you are on long island and the server is in NYC, then google could have > an issue with just NYC. I have had that happen before when they switched > from XO to level three. Anyone hear anything about that possibility? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmerlo at ncc.edu Mon Nov 15 15:20:28 2010 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 15 Nov 2010 15:20:28 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: Message-ID: On Mon, Nov 15, 2010 at 1:58 PM, Chris Snyder wrote: And you don't have php set to log errors, by any chance? > According to phpinfo( ), log errors is on. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.reeves at gmail.com Mon Nov 15 15:22:40 2010 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Mon, 15 Nov 2010 15:22:40 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: <8E0A661E-9519-4DCB-81B6-1405F3637B0F@beaffinitive.com> Message-ID: > > If you are on long island and the server is in NYC, then google could have > an issue with just NYC. I have had that happen before when they switched > from XO to level three. It happed during the summer I remember I could get gmail on my phone but not at my work machine. Thank You Chuck Reeves On Mon, Nov 15, 2010 at 3:18 PM, Christopher R. Merlo wrote: > On Mon, Nov 15, 2010 at 1:51 PM, Chuck Reeves wrote: > >> Are you checking your calendar on the same machine that is running the PHP >> code? > > > No, but they (my laptop and the department's web server) have the same > connection to outside, and the same external IP. > > >> If you are on long island and the server is in NYC, then google could >> have an issue with just NYC. I have had that happen before when they >> switched from XO to level three. > > > Anyone hear anything about that possibility? > > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zippy1981 at gmail.com Mon Nov 15 15:32:18 2010 From: zippy1981 at gmail.com (Justin Dearing) Date: Mon, 15 Nov 2010 15:32:18 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: Message-ID: Chris, Two suggestions: 1) Be sure logging is on by calling trigger_error() at all the severities. http://www.php.net/manual/en/function.trigger-error.php 2) Install wireshark (via ports or dmg on your mac) and sniff the traffic On Mon, Nov 15, 2010 at 3:20 PM, Christopher R. Merlo wrote: > On Mon, Nov 15, 2010 at 1:58 PM, Chris Snyder wrote: >> >> And you don't have php set to log errors, by any chance? > > According to phpinfo( ), log errors is on. > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > From danielc at analysisandsolutions.com Mon Nov 15 15:54:36 2010 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 15 Nov 2010 15:54:36 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: Message-ID: <20101115205435.GA26622@panix.com> Hola: > According to phpinfo( ), log errors is on. And does anything show up _in_ the log? --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 rolan at omnistep.com Mon Nov 15 16:51:30 2010 From: rolan at omnistep.com (Rolan Yang) Date: Mon, 15 Nov 2010 16:51:30 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: Message-ID: <4CE1AB62.3030209@omnistep.com> On 11/15/2010 1:34 PM, Christopher R. Merlo wrote: > On Mon, Nov 15, 2010 at 1:30 PM, Chuck Reeves > wrote: > > Are you getting any php errors? > > > Nothing. It just stops dead. I've seen PHP die like that when a required library or dependency is missing. Dump your phpinfo output here or email it to me. ~Rolan -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmerlo at ncc.edu Mon Nov 15 17:07:52 2010 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 15 Nov 2010 17:07:52 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: <4CE1AB62.3030209@omnistep.com> References: <4CE1AB62.3030209@omnistep.com> Message-ID: On Mon, Nov 15, 2010 at 4:51 PM, Rolan Yang wrote: I've seen PHP die like that when a required library or dependency is > missing. > Dump your phpinfo output here or email it to me. > Sent privately. I did have to download the client library, but I'm able to connect to it. Dan asked about what's in the log. I don't have access to it, so I have to wait till I can get downstairs and get with the admin and look through it with him. (On a side note, why are logs like that always read-protected?) -c -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Mon Nov 15 17:45:41 2010 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 15 Nov 2010 17:45:41 -0500 (EST) Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: Message-ID: On Mon, 15 Nov 2010, Christopher R. Merlo wrote: > Dan asked about what's in the log. I don't have access to it, so I have to > wait till I can get downstairs and get with the admin and look through it > with him. The web server error log is the FIRST place I would log for scripts that just die... -- Aj. facebook.com/ajaikhattri From danielc at analysisandsolutions.com Mon Nov 15 18:10:00 2010 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 15 Nov 2010 18:10:00 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: <4CE1AB62.3030209@omnistep.com> Message-ID: <20101115230959.GA7915@panix.com> Heya: On Mon, Nov 15, 2010 at 05:07:52PM -0500, Christopher R. Merlo wrote: > > Dan asked about what's in the log. I don't have access to it, so I have to > wait till I can get downstairs and get with the admin and look through it > with him. > > (On a side note, why are logs like that always read-protected?) Because your admin doesn't know what they're doing? :) --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 cmerlo at ncc.edu Mon Nov 15 20:39:00 2010 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 15 Nov 2010 20:39:00 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: <20101115230959.GA7915@panix.com> References: <4CE1AB62.3030209@omnistep.com> <20101115230959.GA7915@panix.com> Message-ID: On Mon, Nov 15, 2010 at 6:10 PM, Daniel Convissor < danielc at analysisandsolutions.com> wrote: > Heya: > > > (On a side note, why are logs like that always read-protected?) > > Because your admin doesn't know what they're doing? :) But that seems to be the default on Linux boxes and/or on Apache. Is there some hideous security flaw that can be exploited by something in the logs? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Mon Nov 15 20:49:36 2010 From: chsnyder at gmail.com (Chris Snyder) Date: Mon, 15 Nov 2010 20:49:36 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: <4CE1AB62.3030209@omnistep.com> <20101115230959.GA7915@panix.com> Message-ID: On Mon, Nov 15, 2010 at 8:39 PM, Christopher R. Merlo wrote: > On Mon, Nov 15, 2010 at 6:10 PM, Daniel Convissor > wrote: >> >> Heya: >> >> > (On a side note, why are logs like that always read-protected?) >> >> Because your admin doesn't know what they're doing? :) > > But that seems to be the default on Linux boxes and/or on Apache. ?Is there > some hideous security flaw that can be exploited by something in the logs? Yes and no? But exposing them to you is probably safe. :-) The defaults are conservative, which is good. But developers should have access if that's where their errors are going. From chuck.reeves at gmail.com Tue Nov 16 08:17:14 2010 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Tue, 16 Nov 2010 08:17:14 -0500 Subject: [nycphp-talk] PHP & Google Calendar In-Reply-To: References: <4CE1AB62.3030209@omnistep.com> <20101115230959.GA7915@panix.com> Message-ID: Side note, if the php error is empty,try the apache error log On Nov 15, 2010 8:49 PM, "Chris Snyder" wrote: > On Mon, Nov 15, 2010 at 8:39 PM, Christopher R. Merlo wrote: >> On Mon, Nov 15, 2010 at 6:10 PM, Daniel Convissor >> wrote: >>> >>> Heya: >>> >>> > (On a side note, why are logs like that always read-protected?) >>> >>> Because your admin doesn't know what they're doing? :) >> >> But that seems to be the default on Linux boxes and/or on Apache. Is there >> some hideous security flaw that can be exploited by something in the logs? > > Yes and no? But exposing them to you is probably safe. :-) > > The defaults are conservative, which is good. But developers should > have access if that's where their errors are going. > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From garyamort at gmail.com Tue Nov 16 13:58:36 2010 From: garyamort at gmail.com (Gary Mort) Date: Tue, 16 Nov 2010 13:58:36 -0500 Subject: [nycphp-talk] Amazon's new Free Tier Message-ID: FYI, as a birthday gift to me[my birthday was October 20th and they announced it on the 21st, clearly geared towards me!], Amazon has introduced a new "free" pricing tier. http://aws.amazon.com/free/ If you sign up for a new AWS developer account, you get a bunch of free storage space and server time each month for a year. Highlights are: - 750 hours of Amazon EC2 Linux Micro Instance usage (613 MB of memory and 32-bit and 64-bit platform support) ? enough hours to run continuously each month* - 10 GB of Amazon Elastic Block Storage , plus 1 million I/Os, 1 GB of snapshot storage, 10,000 snapshot Get Requests and 1,000 snapshot Put Requests* - 5 GB of Amazon S3 storage , 20,000 Get Requests, and 2,000 Put Requests* - 30 GB per of internet data transfer (15 GB of data transfer ?in? and 15 GB of data transfer ?out? across all services except Amazon CloudFront)* - So, basically you can run a VPS on their micro instance for free, equivalent to a virtual linux server that you rent from others for upwards of 20$ a month. The only downside is that at the moment, most public EBS images are sized to 15GB, so you can't run that image all month long for free[though if you run it for half the month, since that is 7.5GB on average for the month it will be free!] I am in the process of resizing the official Alestic Ubuntu images...my aim is to fit them into a 5GB image so in theory you could run 2 of them and only pay for the extra hours. Also pre-installing a decent LAMP[and NAMP] environment and maybe a one click Joomla/Drupal setup. Note: I find that it is 613MB of memory DOES sometimes have a problem with installing some of the heftier apps[it stalled on installing the Java based Amazon EC2 tools] - so at times you will need to run the heftier small image size where you get over 1.5GB of memory... you can launch an EBS based AMI from any Amazon package....but to take full advantage of them you need to run them through the api or command line so you can attach your ephermeral storage on boot. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Tue Nov 16 14:09:32 2010 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Tue, 16 Nov 2010 14:09:32 -0500 Subject: [nycphp-talk] Amazon's new Free Tier In-Reply-To: References: Message-ID: <42EB9134-A726-4445-A496-D4791DD153A8@beaffinitive.com> Thanks for the notes. I've been excited about this, but haven't created a new account yet. Good to know about the EBS sizing and launching an instance with more memory. On Nov 16, 2010, at 1:58 PM, Gary Mort wrote: > FYI, as a birthday gift to me[my birthday was October 20th and they announced it on the 21st, clearly geared towards me!], Amazon has introduced a new "free" pricing tier. > > http://aws.amazon.com/free/ > > If you sign up for a new AWS developer account, you get a bunch of free storage space and server time each month for a year. Highlights are: > 750 hours of Amazon EC2 Linux Micro Instance usage (613 MB of memory and 32-bit and 64-bit platform support) ? enough hours to run continuously each month* > 10 GB of Amazon Elastic Block Storage, plus 1 million I/Os, 1 GB of snapshot storage, 10,000 snapshot Get Requests and 1,000 snapshot Put Requests* > 5 GB of Amazon S3 storage, 20,000 Get Requests, and 2,000 Put Requests* > 30 GB per of internet data transfer (15 GB of data transfer ?in? and 15 GB of data transfer ?out? across all services except Amazon CloudFront)* > > So, basically you can run a VPS on their micro instance for free, equivalent to a virtual linux server that you rent from others for upwards of 20$ a month. > > The only downside is that at the moment, most public EBS images are sized to 15GB, so you can't run that image all month long for free[though if you run it for half the month, since that is 7.5GB on average for the month it will be free!] > > I am in the process of resizing the official Alestic Ubuntu images...my aim is to fit them into a 5GB image so in theory you could run 2 of them and only pay for the extra hours. Also pre-installing a decent LAMP[and NAMP] environment and maybe a one click Joomla/Drupal setup. > > Note: I find that it is 613MB of memory DOES sometimes have a problem with installing some of the heftier apps[it stalled on installing the Java based Amazon EC2 tools] - so at times you will need to run the heftier small image size where you get over 1.5GB of memory... you can launch an EBS based AMI from any Amazon package....but to take full advantage of them you need to run them through the api or command line so you can attach your ephermeral storage on boot. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alan at alanseiden.com Tue Nov 16 14:41:18 2010 From: alan at alanseiden.com (Alan Seiden) Date: Tue, 16 Nov 2010 14:41:18 -0500 Subject: [nycphp-talk] ZendCon attendees wanted for roundtable next Tuesday Message-ID: <4CE2DE5E.2040701@alanseiden.com> Those of us who were lucky enough to attend ZendCon a couple of weeks ago will be presenting a roundtable discussion next Tuesday, 11/23/10, at Suspenders restaurant (formal announcement to come). We'll share the PHP trends, info, and stories from the conference that will help us plan our PHP strategy and careers in the year ahead. So far, the presenters include Neveo and me. Anyone else out there who was at ZendCon? Let us know and we'll put you on the presenters list for next Tuesday. Thanks! Alan -- Alan Seiden PHP for IBM i Consultant and Developer Zend Certified Engineer for Zend Framework Strategic Business Systems, Inc. alan at alanseiden.com | 201-327-8746 x144 | blog/articles: alanseiden.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at devonianfarm.com Tue Nov 16 14:42:27 2010 From: paul at devonianfarm.com (Paul A Houle) Date: Tue, 16 Nov 2010 14:42:27 -0500 Subject: [nycphp-talk] Amazon's new Free Tier In-Reply-To: References: Message-ID: <4CE2DEA3.7000000@devonianfarm.com> On 11/16/2010 1:58 PM, Gary Mort wrote: > FYI, as a birthday gift to me[my birthday was October 20th and they > announced it on the 21st, clearly geared towards me!], Amazon has > introduced a new "free" pricing tier. > > http://aws.amazon.com/free/ > > I'm mad because I've got an existing AWS account (I use S3 and Mturk heavily) and I don't get the free offer. Still, I'm thinking of moving my infrastructure to AWS. For a long time I've had one big server that I put everything on but lately I've had a mysql database get huge, I'm having problems w/ memory pressure and on top of that from time to time I run massive batch jobs that hose my websites. The ability to easily provision a cluster of machines on AWS looks awesome and I'm going to do development for next mini-project on them. From willie at pdfsystems.com Tue Nov 16 15:14:37 2010 From: willie at pdfsystems.com (William Klein) Date: Tue, 16 Nov 2010 15:14:37 -0500 Subject: [nycphp-talk] mysql connection In-Reply-To: <12db01cb84e0$98147790$c83d66b0$@com> References: <126e01cb82b3$35b51d90$a11f58b0$@com> <3143077.6.1289617215050.JavaMail.root@mail.twoguyshosting.com> <12db01cb84e0$98147790$c83d66b0$@com> Message-ID: <144d01cb85ca$f6678ae0$e336a0a0$@com> Here is the solution. Selinux will not allow httpd to connect to other network servers by default. The command to change this behavior is setsebool -P httpd_can_network_connect=1 Everything works immediately and survives a reboot -----Original Message----- From: William Klein [mailto:willie at pdfsystems.com] Sent: Monday, November 15, 2010 11:17 AM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] mysql connection When I get to the bottom of what's happening I will post my ultimate resolution. But the MySQL server is listening on the port. Here's why I thought it was my PHP setup The apache server will connect to mysql running on the local host with selinux enforcing I can connect to the remote mysql server with command line mysql commands Mysql -u root -h 192.168.199.31 -p The apache server will not connect to the remote server with selinux enforcing. The apache server will connect to the remote server with selinux in permissive mode. Therefore I have come to the conclusion that my issue is with selinux. Since I want the security enhanced features of selinux I will figure out what the issue is and post the ultimate resolution. I appreciate all the input and I will post back what I find. -----Original Message----- From: Donald J. Organ IV [mailto:dorgan at donaldorgan.com] Sent: Friday, November 12, 2010 10:00 PM To: NYPHP Talk Subject: Re: [nycphp-talk] mysql connection Apache doesn't connect to mysql.... I believe your issue is what I stated earlier mySQL is not listening on your private ip address....edit your my.cnf file _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation From jbaltz at altzman.com Tue Nov 16 15:18:38 2010 From: jbaltz at altzman.com (Jerry B. Altzman) Date: Tue, 16 Nov 2010 15:18:38 -0500 Subject: [nycphp-talk] Amazon's new Free Tier In-Reply-To: References: Message-ID: <4CE2E71E.1080201@altzman.com> on 11/16/2010 1:58 PM Gary Mort said the following: > FYI, as a birthday gift to me[my birthday was October 20th and they > announced it on the 21st, clearly geared towards me!], Amazon has > introduced a new "free" pricing tier. Like everything else, beware that if you go over on ANYTHING, they bill you. And it's only free the first year, after that, they bill you. Nothing in life is free. :-) //jbaltz -- jerry b. altzman | jbaltz at altzman.com | www.jbaltz.com | twitter:@lorvax thank you for contributing to the heat death of the universe. From matt at atopia.net Tue Nov 16 16:08:08 2010 From: matt at atopia.net (Matt Juszczak) Date: Tue, 16 Nov 2010 16:08:08 -0500 (EST) Subject: [nycphp-talk] Amazon's new Free Tier In-Reply-To: <4CE2DEA3.7000000@devonianfarm.com> References: <4CE2DEA3.7000000@devonianfarm.com> Message-ID: For those open to other solutions, I highly highly recommend Rackspace Cloud over EC2. But just my personal opinion. http://www.rackspacecloud.com -Matt On Tue, 16 Nov 2010, Paul A Houle wrote: > On 11/16/2010 1:58 PM, Gary Mort wrote: >> FYI, as a birthday gift to me[my birthday was October 20th and they >> announced it on the 21st, clearly geared towards me!], Amazon has >> introduced a new "free" pricing tier. >> >> http://aws.amazon.com/free/ >> >> > I'm mad because I've got an existing AWS account (I use S3 and Mturk > heavily) and I don't get the free offer. Still, I'm thinking of moving my > infrastructure to AWS. For a long time I've had one big server that I put > everything on but lately I've had a mysql database get huge, I'm having > problems w/ memory pressure and on top of that from time to time I run > massive batch jobs that hose my websites. The ability to easily provision a > cluster of machines on AWS looks awesome and I'm going to do development for > next mini-project on them. > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > From garyamort at gmail.com Tue Nov 16 16:34:37 2010 From: garyamort at gmail.com (Gary Mort) Date: Tue, 16 Nov 2010 16:34:37 -0500 Subject: [nycphp-talk] Amazon's new Free Tier In-Reply-To: <4CE2E71E.1080201@altzman.com> References: <4CE2E71E.1080201@altzman.com> Message-ID: <4CE2F8ED.9030201@gmail.com> On 11/16/2010 3:18 PM, Jerry B. Altzman wrote: > on 11/16/2010 1:58 PM Gary Mort said the following: >> FYI, as a birthday gift to me[my birthday was October 20th and they >> announced it on the 21st, clearly geared towards me!], Amazon has >> introduced a new "free" pricing tier. > > Like everything else, beware that if you go over on ANYTHING, they > bill you. And it's only free the first year, after that, they bill > you. Nothing in life is free. :-) Well, I figured I am posting on the NYPHP list, so anyone here concerned about going over would simply write their own monitoring script using the Amazon PHP class libraries... :-) Seriously though, I've gotten very tired of doing things from the command line and while the various dashboards are nice...either their in Java(yuck!) or they don't do what I want, so I figure I'm going to be writing a simple dashboard/monitor anyway - I hadn't considered of monitoring usage against the free tiers, but now that you mention it, that's a good idea. For me, the "free" micro hours are useful as it lets me model things like setting up apps to monitor load on a set of instances and then spin up extra servers as load goes up. Something I wouldn't want to go out of control on a pay per hour system[as even one mistake can be pricey], but with 750 free hours a month, I could muck up and launch 100 duplicate instances and still only be down 100 "Free" hours. From jmcgraw1 at gmail.com Tue Nov 16 16:39:19 2010 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Tue, 16 Nov 2010 16:39:19 -0500 Subject: [nycphp-talk] Amazon's new Free Tier In-Reply-To: <4CE2F8ED.9030201@gmail.com> References: <4CE2E71E.1080201@altzman.com> <4CE2F8ED.9030201@gmail.com> Message-ID: I'd highly recommend Linode. They've got a datacenter in NJ, which is super fast for us NYC residents, great uptime when compared to shared hosting providers, fast turnaround time for tickets and their smallest instance (512MB RAM, 16GB space, 100GB transfer) is only $20 a month. - jake On Tue, Nov 16, 2010 at 4:34 PM, Gary Mort wrote: > On 11/16/2010 3:18 PM, Jerry B. Altzman wrote: >> >> on 11/16/2010 1:58 PM Gary Mort said the following: >>> >>> FYI, as a birthday gift to me[my birthday was October 20th and they >>> announced it on the 21st, clearly geared towards me!], Amazon has >>> introduced a new "free" pricing tier. >> >> Like everything else, beware that if you go over on ANYTHING, they bill >> you. And it's only free the first year, after that, they bill you. Nothing >> in life is free. :-) > > Well, I figured I am posting on the NYPHP list, so anyone here concerned > about going over would simply write their own monitoring script using the > Amazon PHP class libraries... :-) > > Seriously though, I've gotten very tired of doing things from the command > line and while the various dashboards are nice...either their in Java(yuck!) > or they don't do what I want, so I figure I'm going to be writing a simple > dashboard/monitor anyway - I hadn't considered of monitoring usage against > the free tiers, but now that you mention it, that's a good idea. > > For me, the "free" micro hours are useful as it lets me model things like > setting up apps to monitor load on a set of instances and then spin up extra > servers as load goes up. ?Something I wouldn't want to go out of control on > a pay per hour system[as even one mistake can be pricey], but with 750 free > hours a month, I could muck up and launch 100 duplicate instances and still > only be down 100 "Free" hours. > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > From garyamort at gmail.com Tue Nov 16 16:39:43 2010 From: garyamort at gmail.com (Gary Mort) Date: Tue, 16 Nov 2010 16:39:43 -0500 Subject: [nycphp-talk] Amazon's new Free Tier In-Reply-To: References: <4CE2DEA3.7000000@devonianfarm.com> Message-ID: <4CE2FA1F.7080200@gmail.com> On 11/16/2010 4:08 PM, Matt Juszczak wrote: > For those open to other solutions, I highly highly recommend Rackspace > Cloud over EC2. But just my personal opinion. > At the moment, since building apps for the Amazon API lets you also learn how to build apps for the Eucalyptus API[since they are the same API, http://open.eucalyptus.com/ ] I'm tending towards Amazon as a starting place. But once it comes to deployment...well, that's open to whatever fits your needs best. My initial plans fit best into the Amazon environment. From garyamort at gmail.com Tue Nov 16 17:43:53 2010 From: garyamort at gmail.com (Gary Mort) Date: Tue, 16 Nov 2010 17:43:53 -0500 Subject: [nycphp-talk] SPROCs in the MySQL/PostgreSQL + PHP crowd In-Reply-To: <4CDB012A.8030100@altzman.com> References: <4CDB012A.8030100@altzman.com> Message-ID: On Wed, Nov 10, 2010 at 3:31 PM, Jerry B. Altzman wrote: > Hi all, > > Just a question for those of you out there dealing with the F/OSS RDBMS's > out there: > > How many of you are using stored procedures (SPROCs) with any great > regularity? > > I know that in the commercial database world use of stored procedures is > The Way Things Are Pretty Much Done, but I've not seen it in my brief forays > through the bulk of PHP code I've examined (and needless to say, written). > Am I just out of it? Is it just not considered usual practice, or am I > blind? > > The basic question is: is the application written from a coder or a dba's point of view? In the open source world, code tends to be written from a coders point of view. As such, things which would be done via stored procedures, views, triggers, etc are instead done inside code. It's quicker and easier to change it there. It also means that the application doesn't have to specify a version of MySQL, making it more broadly used. When maintenance of such business logic gets out of hand, coders re-invent the code and move all the database access to specific table "classes" and objects, where you can now code the rules directly into the program[or use something like Doctrine which can do the same thing]. Triggers, foreign keys, views, etc work well from a DBA's point of view where the data is carefully laid out and you don't want some undisciplined coder coming along and mucking things up by arbitrarily setting their own auto increment numbers, or deleting half of the data for a record but missing the related data from other tables. Of course, business culture will tend to favor one direction or another. If when the data is mucked up by bad code that incorrectly implements business logic, if the DBA is held responsible, or worse yet has to come in over the weekend to restore the last backup and somehow merge the data to keep all the good changes..... well, he's certainly going to want to /control/ this situation in the future. Whereas if the programmer is under a time crunch and the DBA is insisting on a week to review business logic changes[because he has just as many, if not more, things on his plate and needs to find the time to review it] then you can get business logic creeping into code so as to get the job done. But maybe I'm just being cynical here. :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From willie at pdfsystems.com Wed Nov 17 09:47:03 2010 From: willie at pdfsystems.com (William Klein) Date: Wed, 17 Nov 2010 09:47:03 -0500 Subject: [nycphp-talk] mysql connection In-Reply-To: <144d01cb85ca$f6678ae0$e336a0a0$@com> References: <126e01cb82b3$35b51d90$a11f58b0$@com> <3143077.6.1289617215050.JavaMail.root@mail.twoguyshosting.com> <12db01cb84e0$98147790$c83d66b0$@com> <144d01cb85ca$f6678ae0$e336a0a0$@com> Message-ID: <149201cb8666$5e24b040$1a6e10c0$@com> I realize I'm getting way off topic here but someone might want to do this someday(it's LAMP related) If you want apache to be able to read and write to a nfs share you need to mount it with a context mount -t nfs -o context=user_u:object_r:public_content_rw_t 192.168.199.32:/home/nfsShare /ordertmp/ since this getting off topic I leave it there. -----Original Message----- From: William Klein [mailto:willie at pdfsystems.com] Sent: Tuesday, November 16, 2010 3:15 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] mysql connection Here is the solution. Selinux will not allow httpd to connect to other network servers by default. The command to change this behavior is setsebool -P httpd_can_network_connect=1 Everything works immediately and survives a reboot -----Original Message----- From: William Klein [mailto:willie at pdfsystems.com] Sent: Monday, November 15, 2010 11:17 AM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] mysql connection When I get to the bottom of what's happening I will post my ultimate resolution. But the MySQL server is listening on the port. Here's why I thought it was my PHP setup The apache server will connect to mysql running on the local host with selinux enforcing I can connect to the remote mysql server with command line mysql commands Mysql -u root -h 192.168.199.31 -p The apache server will not connect to the remote server with selinux enforcing. The apache server will connect to the remote server with selinux in permissive mode. Therefore I have come to the conclusion that my issue is with selinux. Since I want the security enhanced features of selinux I will figure out what the issue is and post the ultimate resolution. I appreciate all the input and I will post back what I find. -----Original Message----- From: Donald J. Organ IV [mailto:dorgan at donaldorgan.com] Sent: Friday, November 12, 2010 10:00 PM To: NYPHP Talk Subject: Re: [nycphp-talk] mysql connection Apache doesn't connect to mysql.... I believe your issue is what I stated earlier mySQL is not listening on your private ip address....edit your my.cnf file _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation From jessesanford at gmail.com Thu Nov 18 17:12:10 2010 From: jessesanford at gmail.com (Jesse Sanford) Date: Thu, 18 Nov 2010 17:12:10 -0500 Subject: [nycphp-talk] Tonight in NYC Symfony Meetup with Jonathan Wage of the Doctrine project. Topic: Doctrine and mongo and the new Doctrine ODM Message-ID: Free pizza, beer and soda! Door prizes! Come fill your stomach and your mind! 7:00 PM 632 Broadway FLR 10 NY NY From ps at blu-studio.com Fri Nov 19 06:45:02 2010 From: ps at blu-studio.com (Peter Sawczynec) Date: Fri, 19 Nov 2010 06:45:02 -0500 Subject: [nycphp-talk] PHP Regexp Classic Challenge Message-ID: <004001cb87df$35610a80$a0231f80$@com> I need to be able to grab the first 10 words or so from a HTML laden text string that is held in a db table field where the typical field content might be as follows below. After the processing, being left with only the straight text with punctuation would be fine

Fresh food makes for a great
snack.

Target bodu content begins here and may have any html tags interspersed. Plus, users can users can use parens (anywhere) too.


------

Another paragraph

I'm checking to see if over the years a best practice technique with regexp or php funcs has been established to readily sove this classic display challenge. Thanks for any . Warmest regards, Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ps at blu-studio.com Fri Nov 19 07:04:40 2010 From: ps at blu-studio.com (Peter Sawczynec) Date: Fri, 19 Nov 2010 07:04:40 -0500 Subject: [nycphp-talk] You Are Looking for strip_tags Func Peter Message-ID: <004501cb87e1$f285d6c0$d7918440$@com> You're right, thanks. $days=30; $state=($no_sleep > $days)? 'messed_up' : 'fine'; Warmest regards, Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.reeves at gmail.com Fri Nov 19 10:06:04 2010 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Fri, 19 Nov 2010 10:06:04 -0500 Subject: [nycphp-talk] PHP Regexp Classic Challenge In-Reply-To: <004001cb87df$35610a80$a0231f80$@com> References: <004001cb87df$35610a80$a0231f80$@com> Message-ID: I would recommend using DOMDocument instead of regex. Thank You Chuck Reeves 2010/11/19 Peter Sawczynec > I need to be able to grab the first 10 words or so from a HTML laden text > string that is held in a db table field where the typical field content > might be as follows below. After the processing, being left with only the > straight text with punctuation would be fine > > > >

Fresh food makes for a great
> snack.

> >

Target bodu content begins here and may have any html tags > interspersed. Plus, users can users can use parens (anywhere) too.

> >
------
> >

Another paragraph

> > > > I'm checking to see if over the years a best practice technique with regexp > or php funcs has been established to readily sove this classic display > challenge. > > > > Thanks for any . > > > > Warmest regards, > > > > Peter Sawczynec > > Technology Dir. > > bl?studio > > 941.893.0396 > > ps at blu-studio.com > > www.blu-studio.com > > > > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yitzchak.schaffer at gmx.com Fri Nov 19 11:27:09 2010 From: yitzchak.schaffer at gmx.com (Yitzchak Schaffer) Date: Fri, 19 Nov 2010 11:27:09 -0500 Subject: [nycphp-talk] PHP Regexp Classic Challenge In-Reply-To: References: <004001cb87df$35610a80$a0231f80$@com> Message-ID: <4CE6A55D.1070407@gmx.com> > 2010/11/19 Peter Sawczynec > > > I need to be able to grab the first 10 words or so from a HTML laden > text string that is held in a db table field where the typical field > content might be as follows below. After the processing, being left > with only the straight text with punctuation would be fine > On 19-Nov-10 10:06, Chuck Reeves wrote: > I would recommend using DOMDocument instead of regex. > ... unless of course the HTML is subject to wonkiness. -- Yitzchak Schaffer From chuck.reeves at gmail.com Fri Nov 19 11:29:34 2010 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Fri, 19 Nov 2010 11:29:34 -0500 Subject: [nycphp-talk] PHP Regexp Classic Challenge In-Reply-To: <4CE6A55D.1070407@gmx.com> References: <004001cb87df$35610a80$a0231f80$@com> <4CE6A55D.1070407@gmx.com> Message-ID: Which is why regex wont help that much. Using tidy with domdoc could help out very well: http://php.net/manual/en/book.tidy.php Thank You Chuck Reeves On Fri, Nov 19, 2010 at 11:27 AM, Yitzchak Schaffer < yitzchak.schaffer at gmx.com> wrote: > > 2010/11/19 Peter Sawczynec >> > > > > > I need to be able to grab the first 10 words or so from a HTML laden > > text string that is held in a db table field where the typical field > > content might be as follows below. After the processing, being left > > with only the straight text with punctuation would be fine > > > > On 19-Nov-10 10:06, Chuck Reeves wrote: > >> I would recommend using DOMDocument instead of regex. >> >> > ... unless of course the HTML is subject to wonkiness. > > -- > Yitzchak Schaffer > > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From edwardpotter at gmail.com Fri Nov 19 11:51:45 2010 From: edwardpotter at gmail.com (Edward Potter) Date: Fri, 19 Nov 2010 11:51:45 -0500 Subject: [nycphp-talk] PHP Regexp Classic Challenge In-Reply-To: <4CE6A55D.1070407@gmx.com> References: <004001cb87df$35610a80$a0231f80$@com> <4CE6A55D.1070407@gmx.com> Message-ID: but regex is just so much more hardcore! :-)))))))) http://www.delicious.com/ejpusa/regex On Fri, Nov 19, 2010 at 11:27 AM, Yitzchak Schaffer wrote: >> 2010/11/19 Peter Sawczynec > >> >> ? ? I need to be able to grab the first 10 words or so from a HTML laden >> ? ? text string that is held in a db table field where the typical field >> ? ? content might be as follows below. After the processing, being left >> ? ? with only the straight text with punctuation would be fine >> > > On 19-Nov-10 10:06, Chuck Reeves wrote: >> >> I would recommend using DOMDocument instead of regex. >> > > ... unless of course the HTML is subject to wonkiness. > > -- > Yitzchak Schaffer > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com From dwang at udfi.biz Fri Nov 19 12:16:59 2010 From: dwang at udfi.biz (David Wang) Date: Fri, 19 Nov 2010 12:16:59 -0500 Subject: [nycphp-talk] PHP Regexp Classic Challenge In-Reply-To: References: <004001cb87df$35610a80$a0231f80$@com> <4CE6A55D.1070407@gmx.com> Message-ID: <6C9E5FA1-5A6B-4E6F-83E2-48F22E0904A7@udfi.biz> strip_tags? -d -- David Wang Entrepreneur in Training +1 (434) 298 4588 | dwang at udfi.biz | www.udfi.biz | @daSn0wie On Nov 19, 2010, at 11:51 AM, Edward Potter wrote: > but regex is just so much more hardcore! :-)))))))) > > http://www.delicious.com/ejpusa/regex > > On Fri, Nov 19, 2010 at 11:27 AM, Yitzchak Schaffer > wrote: >>> 2010/11/19 Peter Sawczynec > >>> >>> I need to be able to grab the first 10 words or so from a HTML laden >>> text string that is held in a db table field where the typical field >>> content might be as follows below. After the processing, being left >>> with only the straight text with punctuation would be fine >>> >> >> On 19-Nov-10 10:06, Chuck Reeves wrote: >>> >>> I would recommend using DOMDocument instead of regex. >>> >> >> ... unless of course the HTML is subject to wonkiness. >> >> -- >> Yitzchak Schaffer >> _______________________________________________ >> New York PHP Users Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/Show-Participation >> > > > > -- > IM/iChat: ejpusa > Links: http://del.icio.us/ejpusa > Follow me: http://www.twitter.com/ejpusa > Karma: http://www.coderswithconscience.com > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From bmartin at mac.com Tue Nov 23 13:54:20 2010 From: bmartin at mac.com (Bruce Martin) Date: Tue, 23 Nov 2010 18:54:20 +0000 (GMT) Subject: [nycphp-talk] CakePHP Making a Model return data from a different database. Message-ID: <95a6248d-d681-e468-99e3-f88f0e387635@me.com> Hi all, I am assuming there are people on the list who are knowledgeable about cakePHP on this list. I'm still trying to wrap my head around it and so far I'm finding it a bit tricky. I'm currently reading a book about cakePHP, but nee to skip through to resolve the world hunger crisis before I know how to grow corn. The situation: I have a model/controller/views(item.php/items_controller.php/view->admin_index.ctp and admin_add.ctp) that display items from a Mysql database. This works just as cakePHP wants, the table is designed with cakePHP in mind and the records are displayed in a table or a single record can be passed to a form for editing. I did not write this code, so maybe my issues are in understanding the code rather than cakePHP. I need, or want, to create a view that will list records from a non-cakePHP compliant database/table, Informix, in an HTML table that when the user clicks a link, will pre-populate the admin_add.ctp views form.? I thought I could simply add my code to access this second database in the item.php model, and then call it via the controller, items_controller.php and send it to another view admin_select.ctp. However, I cannot get my function I wrote in the model to substitute the original table results with new results from the second database.? Am I going about this incorrectly? if so, how would you suggest doing this? The intent is to simply import data from the Informix database into the mysql database when the admin wants to add an item. Thanks, Bruce Martin The Martin Solution Bruce at martinsolution.com http://www.martinsolutioncom -------------- next part -------------- An HTML attachment was scrubbed... URL: From edwardpotter at gmail.com Tue Nov 23 14:37:15 2010 From: edwardpotter at gmail.com (Edward Potter) Date: Tue, 23 Nov 2010 14:37:15 -0500 Subject: [nycphp-talk] CakePHP Making a Model return data from a different database. In-Reply-To: <95a6248d-d681-e468-99e3-f88f0e387635@me.com> References: <95a6248d-d681-e468-99e3-f88f0e387635@me.com> Message-ID: In the end, I canned all the frameworks. And built my own. They are just so, so, so overkill. IMHO. But I digress, and I am not helping you at all. But there is a big Cake user group off the main site, probably a quick answer there. MVC sounds SO great in academic circles, but in the end, sometimes you have to break the rules. The M is cool, the C is cool. But the V is where you can break it out. I call that the P, for Presentation Layer. Is php really a good candidate for MVC? Sometime I'm not 100% sold on that idea. But that does not diminish at all what you can do with it. Actually it may make it much more versatile ---- because you can break the rules. :-) On Tue, Nov 23, 2010 at 1:54 PM, Bruce Martin wrote: > Hi all, > I am assuming there are people on the list who are knowledgeable about > cakePHP on this list. I'm still trying to wrap my head around it and so far > I'm finding it a bit tricky. I'm currently reading a book about cakePHP, but > nee to skip through to resolve the world hunger crisis before I know how to > grow corn. > > The situation: > I have a > model/controller/views(item.php/items_controller.php/view->admin_index.ctp > and admin_add.ctp) that display items from a Mysql database. This works just > as cakePHP wants, the table is designed with cakePHP in mind and the records > are displayed in a table or a single record can be passed to a form for > editing. I did not write this code, so maybe my issues are in understanding > the code rather than cakePHP. > > I need, or want, to create a view that will list records from a non-cakePHP > compliant database/table, Informix, in an HTML table that when the user > clicks a link, will pre-populate the admin_add.ctp views form. > > I thought I could simply add my code to access this second database in the > item.php model, and then call it via the controller, items_controller.php > and send it to another view admin_select.ctp. However, I cannot get my > function I wrote in the model to substitute the original table results with > new results from the second database. > > Am I going about this incorrectly? if so, how would you suggest doing this? > The intent is to simply import data from the Informix database into the > mysql database when the admin wants to add an item. > > Thanks, > > Bruce Martin > The Martin SolutionBruce at martinsolution.comhttp://www.martinsolution.com > > > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallluhuct at gmail.com Wed Nov 24 09:39:42 2010 From: mallluhuct at gmail.com (Bulat Shakirzyanov) Date: Wed, 24 Nov 2010 09:39:42 -0500 Subject: [nycphp-talk] Talk Proposal: Unit Testing Message-ID: Hi fellow PHP'ers! Yesterday I attended my very first NYC PHP UG meetup dedicated to the past ZendCon. I found it very interesting and could contribute to discussion a lot, since I've been there this year. It's a pity I didn't have a chance to meet Hans Zaunere as I wanted to propose a talk for one of the upcoming meetups. As a huge fan of testing, I'd like to share my experiences with it by giving a talk called "Unit Testing - a guide to writing clean, testable code, that will be easy to maintain and extend". I gave it to our local NYC Symfony meetup group and also won the ZendUncon with it this year. You can find the slides on slideshare: http://www.slideshare.net/avalanche123/clean-code-5609451 They are fairly easy to read and follow. I'd love any feedback you can give and would be honored to talk about unit testing at on of the NYC PHP UG meetups Best, -- *Bulat Shakirzyanov* | Software Alchemist *a: *about.me/avalanche123 *e:* mallluhuct at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.reeves at gmail.com Wed Nov 24 10:01:22 2010 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Wed, 24 Nov 2010 10:01:22 -0500 Subject: [nycphp-talk] Talk Proposal: Unit Testing In-Reply-To: References: Message-ID: I did a Unit testing talk with LIPHP back in September. Ping me back if you want to share points Thank You Chuck Reeves On Wed, Nov 24, 2010 at 9:39 AM, Bulat Shakirzyanov wrote: > Hi fellow PHP'ers! > > Yesterday I attended my very first NYC PHP UG meetup > dedicated to the past ZendCon. I found it very interesting > and could contribute to discussion a lot, since I've been > there this year. > > It's a pity I didn't have a chance to meet Hans Zaunere as > I wanted to propose a talk for one of the upcoming meetups. > As a huge fan of testing, I'd like to share my experiences > with it by giving a talk called "Unit Testing - a guide to writing > clean, testable code, that will be easy to maintain and > extend". I gave it to our local NYC Symfony meetup group > and also won the ZendUncon with it this year. > > You can find the slides on slideshare: > http://www.slideshare.net/avalanche123/clean-code-5609451 > They are fairly easy to read and follow. > > I'd love any feedback you can give and would be honored > to talk about unit testing at on of the NYC PHP UG meetups > > Best, > > -- > *Bulat Shakirzyanov* | Software Alchemist > > *a: *about.me/avalanche123 > *e:* mallluhuct at gmail.com > > > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallluhuct at gmail.com Wed Nov 24 10:02:49 2010 From: mallluhuct at gmail.com (Bulat Shakirzyanov) Date: Wed, 24 Nov 2010 10:02:49 -0500 Subject: [nycphp-talk] Talk Proposal: Unit Testing In-Reply-To: References: Message-ID: Point me to your slides, or a transcript, so I could familiarize myself Thanks! On Wed, Nov 24, 2010 at 10:01 AM, Chuck Reeves wrote: > I did a Unit testing talk with LIPHP back in September. Ping me back if > you want to share points > > Thank You > Chuck Reeves > > > > > On Wed, Nov 24, 2010 at 9:39 AM, Bulat Shakirzyanov wrote: > >> Hi fellow PHP'ers! >> >> Yesterday I attended my very first NYC PHP UG meetup >> dedicated to the past ZendCon. I found it very interesting >> and could contribute to discussion a lot, since I've been >> there this year. >> >> It's a pity I didn't have a chance to meet Hans Zaunere as >> I wanted to propose a talk for one of the upcoming meetups. >> As a huge fan of testing, I'd like to share my experiences >> with it by giving a talk called "Unit Testing - a guide to writing >> clean, testable code, that will be easy to maintain and >> extend". I gave it to our local NYC Symfony meetup group >> and also won the ZendUncon with it this year. >> >> You can find the slides on slideshare: >> http://www.slideshare.net/avalanche123/clean-code-5609451 >> They are fairly easy to read and follow. >> >> I'd love any feedback you can give and would be honored >> to talk about unit testing at on of the NYC PHP UG meetups >> >> Best, >> >> -- >> *Bulat Shakirzyanov* | Software Alchemist >> >> *a: *about.me/avalanche123 >> *e:* mallluhuct at gmail.com >> >> >> _______________________________________________ >> New York PHP Users Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/Show-Participation >> > > > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -- *Bulat Shakirzyanov* | Software Alchemist *a: *about.me/avalanche123 *e:* mallluhuct at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From zippy1981 at gmail.com Wed Nov 24 10:05:17 2010 From: zippy1981 at gmail.com (Justin Dearing) Date: Wed, 24 Nov 2010 10:05:17 -0500 Subject: [nycphp-talk] Talk Proposal: Unit Testing In-Reply-To: References: Message-ID: Bulat, I'd like to hear a unit test talk. Justin On Wed, Nov 24, 2010 at 10:01 AM, Chuck Reeves wrote: > I did a Unit testing talk with LIPHP back in September. Ping me back if > you want to share points > > Thank You > Chuck Reeves > > > > > On Wed, Nov 24, 2010 at 9:39 AM, Bulat Shakirzyanov wrote: > >> Hi fellow PHP'ers! >> >> Yesterday I attended my very first NYC PHP UG meetup >> dedicated to the past ZendCon. I found it very interesting >> and could contribute to discussion a lot, since I've been >> there this year. >> >> It's a pity I didn't have a chance to meet Hans Zaunere as >> I wanted to propose a talk for one of the upcoming meetups. >> As a huge fan of testing, I'd like to share my experiences >> with it by giving a talk called "Unit Testing - a guide to writing >> clean, testable code, that will be easy to maintain and >> extend". I gave it to our local NYC Symfony meetup group >> and also won the ZendUncon with it this year. >> >> You can find the slides on slideshare: >> http://www.slideshare.net/avalanche123/clean-code-5609451 >> They are fairly easy to read and follow. >> >> I'd love any feedback you can give and would be honored >> to talk about unit testing at on of the NYC PHP UG meetups >> >> Best, >> >> -- >> *Bulat Shakirzyanov* | Software Alchemist >> >> *a: *about.me/avalanche123 >> *e:* mallluhuct at gmail.com >> >> >> _______________________________________________ >> New York PHP Users Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/Show-Participation >> > > > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.reeves at gmail.com Wed Nov 24 10:05:18 2010 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Wed, 24 Nov 2010 10:05:18 -0500 Subject: [nycphp-talk] Talk Proposal: Unit Testing In-Reply-To: References: Message-ID: I just demonstrated with code: https://github.com/manchuck/LIPHP I added each test one by one and showed them fail then showed the code to make it work. Its a pretty good demo showing a more practical approach. Thank You Chuck Reeves On Wed, Nov 24, 2010 at 10:02 AM, Bulat Shakirzyanov wrote: > Point me to your slides, or a transcript, so I could familiarize myself > Thanks! > > > On Wed, Nov 24, 2010 at 10:01 AM, Chuck Reeves wrote: > >> I did a Unit testing talk with LIPHP back in September. Ping me back if >> you want to share points >> >> Thank You >> Chuck Reeves >> >> >> >> >> On Wed, Nov 24, 2010 at 9:39 AM, Bulat Shakirzyanov > > wrote: >> >>> Hi fellow PHP'ers! >>> >>> Yesterday I attended my very first NYC PHP UG meetup >>> dedicated to the past ZendCon. I found it very interesting >>> and could contribute to discussion a lot, since I've been >>> there this year. >>> >>> It's a pity I didn't have a chance to meet Hans Zaunere as >>> I wanted to propose a talk for one of the upcoming meetups. >>> As a huge fan of testing, I'd like to share my experiences >>> with it by giving a talk called "Unit Testing - a guide to writing >>> clean, testable code, that will be easy to maintain and >>> extend". I gave it to our local NYC Symfony meetup group >>> and also won the ZendUncon with it this year. >>> >>> You can find the slides on slideshare: >>> http://www.slideshare.net/avalanche123/clean-code-5609451 >>> They are fairly easy to read and follow. >>> >>> I'd love any feedback you can give and would be honored >>> to talk about unit testing at on of the NYC PHP UG meetups >>> >>> Best, >>> >>> -- >>> *Bulat Shakirzyanov* | Software Alchemist >>> >>> *a: *about.me/avalanche123 >>> *e:* mallluhuct at gmail.com >>> >>> >>> _______________________________________________ >>> New York PHP Users Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/Show-Participation >>> >> >> >> _______________________________________________ >> New York PHP Users Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/Show-Participation >> > > > > -- > *Bulat Shakirzyanov* | Software Alchemist > > *a: *about.me/avalanche123 > *e:* mallluhuct at gmail.com > > > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallluhuct at gmail.com Wed Nov 24 10:22:04 2010 From: mallluhuct at gmail.com (Bulat Shakirzyanov) Date: Wed, 24 Nov 2010 10:22:04 -0500 Subject: [nycphp-talk] Talk Proposal: Unit Testing In-Reply-To: References: Message-ID: Thanks Chuck, I concentrate on Unit Testing and specifically - isolation and dependency injection. Your tests are mixed - integration and unit, since they execute db queries and not just test the query generation and are tightly couple with a db backend, since I can't use a mock connection, as its hardcoded - https://github.com/manchuck/LIPHP/commit/70639929ac6c33d77a806e87cc107bad5b45e458#L0R165 I understand that it was just a sample app to demonstrate TDD. I specifically cover isolation, dependency injection, mock objects and interface discovery in my talk. Best, On Wed, Nov 24, 2010 at 10:05 AM, Chuck Reeves wrote: > I just demonstrated with code: > > https://github.com/manchuck/LIPHP > > I added each test one by one and showed them fail then showed the code to > make it work. Its a pretty good demo showing a more practical approach. > > Thank You > Chuck Reeves > > > > > > On Wed, Nov 24, 2010 at 10:02 AM, Bulat Shakirzyanov > wrote: > >> Point me to your slides, or a transcript, so I could familiarize myself >> Thanks! >> >> >> On Wed, Nov 24, 2010 at 10:01 AM, Chuck Reeves wrote: >> >>> I did a Unit testing talk with LIPHP back in September. Ping me back if >>> you want to share points >>> >>> Thank You >>> Chuck Reeves >>> >>> >>> >>> >>> On Wed, Nov 24, 2010 at 9:39 AM, Bulat Shakirzyanov < >>> mallluhuct at gmail.com> wrote: >>> >>>> Hi fellow PHP'ers! >>>> >>>> Yesterday I attended my very first NYC PHP UG meetup >>>> dedicated to the past ZendCon. I found it very interesting >>>> and could contribute to discussion a lot, since I've been >>>> there this year. >>>> >>>> It's a pity I didn't have a chance to meet Hans Zaunere as >>>> I wanted to propose a talk for one of the upcoming meetups. >>>> As a huge fan of testing, I'd like to share my experiences >>>> with it by giving a talk called "Unit Testing - a guide to writing >>>> clean, testable code, that will be easy to maintain and >>>> extend". I gave it to our local NYC Symfony meetup group >>>> and also won the ZendUncon with it this year. >>>> >>>> You can find the slides on slideshare: >>>> http://www.slideshare.net/avalanche123/clean-code-5609451 >>>> They are fairly easy to read and follow. >>>> >>>> I'd love any feedback you can give and would be honored >>>> to talk about unit testing at on of the NYC PHP UG meetups >>>> >>>> Best, >>>> >>>> -- >>>> *Bulat Shakirzyanov* | Software Alchemist >>>> >>>> *a: *about.me/avalanche123 >>>> *e:* mallluhuct at gmail.com >>>> >>>> >>>> _______________________________________________ >>>> New York PHP Users Group Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> http://www.nyphp.org/Show-Participation >>>> >>> >>> >>> _______________________________________________ >>> New York PHP Users Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/Show-Participation >>> >> >> >> >> -- >> *Bulat Shakirzyanov* | Software Alchemist >> >> *a: *about.me/avalanche123 >> *e:* mallluhuct at gmail.com >> >> >> _______________________________________________ >> New York PHP Users Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/Show-Participation >> > > > _______________________________________________ > New York PHP Users Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/Show-Participation > -- *Bulat Shakirzyanov* | Software Alchemist *a: *about.me/avalanche123 *e:* mallluhuct at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at davidmintz.org Tue Nov 30 15:19:07 2010 From: david at davidmintz.org (David Mintz) Date: Tue, 30 Nov 2010 15:19:07 -0500 Subject: [nycphp-talk] can't change charset on Apache vhost Message-ID: Running Apache/2.2.12 (Ubuntu) PHP/5.2.10 on my development machine, I have a few vhosts and I need one of them to serve iso-8859-1 rather than UTF-8. Try as I might, it remains UTF-8. I have added AddDefaultCharset ISO-8859-1 to the vhost definition. In desperation I have also tried adding the same directive to httpd.conf and apache2.conf. Nothing works. Wondering if it had to do with PHP rather than static html, I have tried accessing a file that is indeed static: same story. Wondering if there was something peculiar about this particular vhost, I have tried setting and resetting the same value in other vhosts and looking at the response headers after reloading the modified config, and it works as it's supposed to. So, the question is, what's different? Answer: I don't know. Is the charset getting overridden by a local .htaccess file? No. Am I remembering to tell Apache to reload its config after changing its config? Yes. The offending host definition looks like this: ServerAdmin david_mintz at nysd.uscourts.gov Servername interps3 AddDefaultCharset ISO-8859-1 DocumentRoot /var/www/interps3 Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all ErrorLog /var/log/apache2/interps3.error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined and yet... root at interps3:/etc/apache2/sites-available# curl -I interps3/index.php HTTP/1.1 200 OK Date: Tue, 30 Nov 2010 20:13:27 GMT Server: Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.5 with Suhosin-Patch X-Powered-By: PHP/5.2.10-2ubuntu6.5 Vary: Accept-Encoding Content-Type: text/html; charset=utf-8 By the way, the reason I care is that there are MySQL tables defined as latin1 with accented characters that aren't getting displayed correctly, and I have been through this before and am reasonably certain that it's a charset mismatch issue. I am mystified. Any suggestions? Gratefully, -- David Mintz http://davidmintz.org/ It ain't over: http://www.healthcare-now.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at davidmintz.org Tue Nov 30 15:31:04 2010 From: david at davidmintz.org (David Mintz) Date: Tue, 30 Nov 2010 15:31:04 -0500 Subject: [nycphp-talk] can't change charset on Apache vhost In-Reply-To: References: Message-ID: Forget it! I think it's a php-related issue after all. If I am wrong and can't figure it out, I'll be back! (-: On Tue, Nov 30, 2010 at 3:19 PM, David Mintz wrote: > Running Apache/2.2.12 (Ubuntu) PHP/5.2.10 on my development machine, I have > a few vhosts and I need one of them to serve iso-8859-1 rather than UTF-8. > Try as I might, it remains UTF-8. I have added AddDefaultCharset ISO-8859-1 > to the vhost definition. In desperation I have also tried adding the same > directive to httpd.conf and apache2.conf. Nothing works. Wondering if it had > to do with PHP rather than static html, I have tried accessing a file that > is indeed static: same story. > > Wondering if there was something peculiar about this particular vhost, I > have tried setting and resetting the same value in other vhosts and looking > at the response headers after reloading the modified config, and it works as > it's supposed to. So, the question is, what's different? Answer: I don't > know. Is the charset getting overridden by a local .htaccess file? No. Am I > remembering to tell Apache to reload its config after changing its config? > Yes. > > The offending host definition looks like this: > > > ServerAdmin david_mintz at nysd.uscourts.gov > Servername interps3 > AddDefaultCharset ISO-8859-1 > DocumentRoot /var/www/interps3 > > Options FollowSymLinks > AllowOverride None > > > Options Indexes FollowSymLinks MultiViews > AllowOverride All > Order allow,deny > allow from all > > > ErrorLog /var/log/apache2/interps3.error.log > > # Possible values include: debug, info, notice, warn, error, crit, > # alert, emerg. > LogLevel warn > CustomLog /var/log/apache2/access.log combined > > > and yet... > > > root at interps3:/etc/apache2/sites-available# curl -I interps3/index.php > > HTTP/1.1 200 OK > Date: Tue, 30 Nov 2010 20:13:27 GMT > Server: Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.5 with Suhosin-Patch > X-Powered-By: PHP/5.2.10-2ubuntu6.5 > Vary: Accept-Encoding > Content-Type: text/html; charset=utf-8 > > By the way, the reason I care is that there are MySQL tables defined as > latin1 with accented characters that aren't getting displayed correctly, and > I have been through this before and am reasonably certain that it's a > charset mismatch issue. > > > I am mystified. Any suggestions? > > Gratefully, > > > > -- > David Mintz > http://davidmintz.org/ > It ain't over: > http://www.healthcare-now.org/ > > > -- David Mintz http://davidmintz.org/ It ain't over: http://www.healthcare-now.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: