From david at davidmintz.org Wed Jul 1 10:48:28 2009 From: david at davidmintz.org (David Mintz) Date: Wed, 1 Jul 2009 10:48:28 -0400 Subject: [nycphp-talk] where in filesystem to install php application Message-ID: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> Perhaps this is one of those things that doesn't matter a helluva lot, but: when you have a freshly installed Debian-style LAMP (actually Ubuntu server 9.04) and you are looking for a place in the filesystem to install your PHP application files -- where do you like to put them? /usr/local/share/... ? Or /usr/local/lib/php/... ? /opt/...? It's nice if it isn't /something/too/terribly/hideously/long/to/type although there are always shortcuts, like environment vars. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From oorza2k5 at gmail.com Wed Jul 1 11:01:01 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Wed, 1 Jul 2009 11:01:01 -0400 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> References: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> Message-ID: <68de37340907010801v4b3ea23n1c1c609fcb894757@mail.gmail.com> On Wed, Jul 1, 2009 at 10:48 AM, David Mintz wrote: > Perhaps this is one of those things that doesn't matter a helluva lot, but: > when you have a freshly installed Debian-style LAMP (actually Ubuntu server > 9.04) and you are looking for a place in the filesystem to install your PHP > application files -- where do you like to put them? /usr/local/share/... ? > Or /usr/local/lib/php/... ? /opt/...? > > It's nice if it isn't /something/too/terribly/hideously/long/to/type > although there are always shortcuts, like environment vars. > > -- > David Mintz > http://davidmintz.org/ > > The subtle source is clear and bright > The tributary streams flow through the darkness > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > I'm fond of the /usr/local/phpVER/ approach $ ls /usr/local/php* /usr/local/php530 /usr/local/php5210 /usr/local/php529 etc etc From sequethin at gmail.com Wed Jul 1 11:03:05 2009 From: sequethin at gmail.com (Michael Hernandez) Date: Wed, 01 Jul 2009 11:03:05 -0400 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> References: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> Message-ID: <1246460585.23178.150.camel@mikeh-ubuntu> On Wed, 2009-07-01 at 10:48 -0400, David Mintz wrote: > Perhaps this is one of those things that doesn't matter a helluva lot, > but: when you have a freshly installed Debian-style LAMP (actually > Ubuntu server 9.04) and you are looking for a place in the filesystem > to install your PHP application files -- where do you like to put > them? /usr/local/share/... ? Or /usr/local/lib/php/... ? /opt/...? > > It's nice if it isn't /something/too/terribly/hideously/long/to/type > although there are always shortcuts, like environment vars. > It really doesn't matter, as you said, but on ubuntu I tend to use /opt since I don't know of any official ubuntu packages that would ever use /opt for anything. I worry that using /usr/local for stuff might end up with an accidental delete or overwrite by the package manager. Just my .02 :) --Mike H From lists at zaunere.com Wed Jul 1 11:03:35 2009 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 1 Jul 2009 11:03:35 -0400 Subject: [nycphp-talk] oci8 bind error In-Reply-To: References: Message-ID: <016f01c9fa5d$1ba28cb0$52e7a610$@com> Hello, > Warning: oci_bind_by_name(): ORA-01036: illegal variable name/number in > /appl/wideacc/CustMast/in/OCIpreptest.php on line 23 > Below is the test code I'm running; > > > //Connect to the Database > $dbUser = 'c1'; > $dbPSWD = p1'; > $db = 'db1'; > $con = oci_connect($dbUser, $dbPSWD, $db); > if (!$con) die ('Connect to DB failed'); > //$insSQL = 'INSERT INTO KB_TEST (TESTNAME) VALUES (:TESTNAME)'; > $insSQL = "INSERT INTO KB_TEST VALUES (:TESTNAME)"; > $insSQL = strtoupper($insSQL); // upper case since ORACLE prefers upper I'd ditch this... > and we know we do not have a case issue > echo "SQL is $insSQL \n"; > $stmt = oci_parse($con, $insSql); > if (!$stmt) die ('Parse for insert failed'); > > //oci_bind_by_name ($stmt, ":TESTNAME", "ERIC"); This one seems as though it should work - are you sure the oci_parse() is successful and that the first column in that table is really a varchar? H From lists at zaunere.com Wed Jul 1 11:04:50 2009 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 1 Jul 2009 11:04:50 -0400 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> References: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> Message-ID: <017001c9fa5d$480ffe40$d82ffac0$@com> > Perhaps this is one of those things that doesn't matter a helluva lot, > but: when you have a freshly installed Debian-style LAMP (actually > Ubuntu server 9.04) and you are looking for a place in the filesystem > to install your PHP application files -- where do you like to put them? > /usr/local/share/... ? Or /usr/local/lib/php/... ? /opt/...? Assuming a fairly well organized application: /usr/local/include/php/com.domainname.www <-- backend code /var/www/www.domainname.com <-- document root/front-end/css/images/js/etc Why? Yeah, because I'm crazy... > It's nice if it isn't /something/too/terribly/hideously/long/to/type > although there are always shortcuts, like environment vars. And symlinks. H From randalrust at gmail.com Wed Jul 1 11:32:44 2009 From: randalrust at gmail.com (Randal Rust) Date: Wed, 1 Jul 2009 11:32:44 -0400 Subject: [nycphp-talk] Help Finding an HTML Email View in CakePHP Application Message-ID: We have inherited a CakePHP application that sends a formatted HTML email when someone completes the site's registration process. The method that invokes the email is: $this->Invoice->send($districtInfo['District']['invoiceEmail'], 'PO Order', $insert_data) The problem I'm having is that I cannot find the view for the HTML formatting. If I look at the Invoice model, I cannot figure out where the code (see below) calls the view. This does not seem to follow anything that I see here: http://book.cakephp.org/view/269/Sending-a-basic-message ============================================ function send($email, $invoice_id, $insert_data) { if (! preg_match(VALID_EMAIL, $email)) { return false; } if (preg_match('/^[0-9]{1,10}$/', $invoice_id)) { $result = $this->find(('`Invoice`.`id` = ' . $invoice_id)); } else { $result = $this->find(('`Invoice`.`name` = "' . $this->mrClean->sql($invoice_id) . '"')); } if (empty($result)) { return false; } $tokens = array(); $replacements = array(); foreach ($insert_data as $key => $value) { $tokens[] = '%' . $key . '%'; $replacements[] = $value; } $message = str_replace($tokens, $replacements, $result['Invoice']['invoice']); $headers = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'From: ' . $this->adminEmail . "\r\n" . 'Reply-To: ' . $this->adminEmail . "\r\n" . 'Bcc: ' . 'test at example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); if (mail($email, $result['Invoice']['name'], $message, $headers, ('-f' . $this->adminEmail)) && mail($this->adminEmail, $result['Invoice']['name'], $message, $headers, ('-f' . $this->adminEmail))) { return true; } else { return false; } } Apologies to anyone on Evolt for the cross-post. That was not intentional. I picked the wrong email address. -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From ant92083 at gmail.com Wed Jul 1 11:44:23 2009 From: ant92083 at gmail.com (Anthony Wlodarski) Date: Wed, 1 Jul 2009 11:44:23 -0400 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <017001c9fa5d$480ffe40$d82ffac0$@com> References: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> <017001c9fa5d$480ffe40$d82ffac0$@com> Message-ID: <43bc541c0907010844r1f629948h32cfe085d4180b54@mail.gmail.com> I myself have used the "/var/www/www.domainname.com" method myself. Another scheme I find worthwhile is to do "/var/www/apps/applciation_name" so I don't need clog the doc root with URL's depending on the client. -Anthony On Wed, Jul 1, 2009 at 11:04 AM, Hans Zaunere wrote: > > Perhaps this is one of those things that doesn't matter a helluva lot, > > but: when you have a freshly installed Debian-style LAMP (actually > > Ubuntu server 9.04) and you are looking for a place in the filesystem > > to install your PHP application files -- where do you like to put them? > > /usr/local/share/... ? Or /usr/local/lib/php/... ? /opt/...? > > Assuming a fairly well organized application: > > /usr/local/include/php/com.domainname.www <-- backend code > > /var/www/www.domainname.com <-- document > root/front-end/css/images/js/etc > > Why? Yeah, because I'm crazy... > > > It's nice if it isn't /something/too/terribly/hideously/long/to/type > > although there are always shortcuts, like environment vars. > > And symlinks. > > H > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Anthony W. ant92083 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Jul 1 11:54:29 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 1 Jul 2009 11:54:29 -0400 (EDT) Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <1246460585.23178.150.camel@mikeh-ubuntu> Message-ID: On Wed, 1 Jul 2009, Michael Hernandez wrote: > I worry that using /usr/local for stuff might > end up with an accidental delete or overwrite by the package manager. Why? System packages never install into /usr/local. Traditionally, /usr/local has always been for "local" stuff. When I build stuff from source, I generally will install everything in /usr/local. Most Linux distros generally follow the FHS standard, see: http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHIERARCHY -- Aj. From eric.gewirtz at solutiononecdi.com Wed Jul 1 11:59:03 2009 From: eric.gewirtz at solutiononecdi.com (Eric Gewirtz) Date: Wed, 1 Jul 2009 11:59:03 -0400 Subject: [nycphp-talk] oci8 bind error In-Reply-To: <016f01c9fa5d$1ba28cb0$52e7a610$@com> Message-ID: <839B1683CF254BC99BF6EE4780FE141B@Libby> Hi Hans, Thks for the reply. I have double checked and the table I am testing with (KB_TEST) has one field and it is VARCHAR(25). I believe the oci_parse() is working since I'm not "dieing" with an error message and the code gets to the oci_bind_by_name(). To your point that this "oci_bind_by_name ($stmt, ":TESTNAME", "ERIC");" should work - I do not get the oracle error when run this statment, I get a PHP fatal error: Only variables can be passed by reference. This makes no sense to me either. I get the oracle error when I run; $val = 'ERIC'; $bindVar = ':TESTNAME'; oci_bind_by_name ($stmt, $bindVar, $val) So I just added some primitive type checking on the variables I'm passing to the bind and confirmed that $stmt is a resource, $val and $bindVar are strings. I'm using is_string() and is_resource(). As to the ditching the "$insSQL = strtoupper($insSQL);"; I only added it because I was running out of ideas and I know ORACLE like to work with upper case (you can use mixed case but it is not fun). Eric SolutionOne Eric Gewirtz 162 Turk Hill Road Brewster NY, 10509 Phone: 845-729-7800 FAX: 845-279-5502 >-----Original Message----- >From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On >Behalf Of Hans Zaunere >Sent: Wednesday, July 01, 2009 11:04 AM >To: 'NYPHP Talk' >Subject: Re: [nycphp-talk] oci8 bind error > >Hello, > >> Warning: oci_bind_by_name(): ORA-01036: illegal variable name/number in >> /appl/wideacc/CustMast/in/OCIpreptest.php on line 23 > > >> Below is the test code I'm running; >> >> >> //Connect to the Database >> $dbUser = 'c1'; >> $dbPSWD = p1'; >> $db = 'db1'; >> $con = oci_connect($dbUser, $dbPSWD, $db); >> if (!$con) die ('Connect to DB failed'); >> //$insSQL = 'INSERT INTO KB_TEST (TESTNAME) VALUES (:TESTNAME)'; >> $insSQL = "INSERT INTO KB_TEST VALUES (:TESTNAME)"; >> $insSQL = strtoupper($insSQL); // upper case since ORACLE prefers upper > >I'd ditch this... > >> and we know we do not have a case issue >> echo "SQL is $insSQL \n"; >> $stmt = oci_parse($con, $insSql); >> if (!$stmt) die ('Parse for insert failed'); >> >> //oci_bind_by_name ($stmt, ":TESTNAME", "ERIC"); > >This one seems as though it should work - are you sure the oci_parse() is >successful and that the first column in that table is really a varchar? > >H > > >_______________________________________________ >New York PHP User Group Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >http://www.nyphp.org/show_participation.php From jcampbell1 at gmail.com Wed Jul 1 12:00:02 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 1 Jul 2009 12:00:02 -0400 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> References: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> Message-ID: <8f0676b40907010900h7e42af38k13d6f16f5a24890b@mail.gmail.com> On Wed, Jul 1, 2009 at 10:48 AM, David Mintz wrote: > Perhaps this is one of those things that doesn't matter a helluva lot, but: > when you have a freshly installed Debian-style LAMP (actually Ubuntu server > 9.04) and you are looking for a place in the filesystem to install your PHP > application files -- where do you like to put them? /usr/local/share/... ? > Or /usr/local/lib/php/... ? /opt/...? I might be crazy, but I use /home/prod/application_name/ with the document root as: /home/prod/application_name/html/ Each developer's code is available via: /home/username/application_name/ The reason I like doing it that way, is I find it easier to maintain multiple checkouts of the code. Each developer gets their own copy of the code running on the server, and I also have copies for test and production. I can control who has access to the different copies of the code through group permissions. I don't have a strong opinion on the matter, but what is important to me is that the entire application and a test database can be checked out, and up and running on a fresh MAMP/WAMP/LAMP stack in a few minutes, and the developers can start working on the code from their local machine without an internet connection. If code and dependancies are spread out all over the file system, it makes it difficult to run multiple copies of the code. -John C. From sequethin at gmail.com Wed Jul 1 12:01:32 2009 From: sequethin at gmail.com (Michael Hernandez) Date: Wed, 01 Jul 2009 12:01:32 -0400 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: References: Message-ID: <1246464092.23178.185.camel@mikeh-ubuntu> On Wed, 2009-07-01 at 11:54 -0400, Ajai Khattri wrote: > On Wed, 1 Jul 2009, Michael Hernandez wrote: > > > I worry that using /usr/local for stuff might > > end up with an accidental delete or overwrite by the package manager. > > Why? System packages never install into /usr/local. Traditionally, > /usr/local has always been for "local" stuff. When I build stuff from > source, I generally will install everything in /usr/local. > > Most Linux distros generally follow the FHS standard, see: > http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHIERARCHY > > > I only say that because there is stuff in /usr/local on my ubuntu system that I didn't put there (at least not manually), and /opt is completely empty. --Mike H From brian at realm3.com Wed Jul 1 12:05:25 2009 From: brian at realm3.com (Brian D.) Date: Wed, 1 Jul 2009 11:05:25 -0500 Subject: [nycphp-talk] Help Finding an HTML Email View in CakePHP Application In-Reply-To: References: Message-ID: It looks to me like it's pulling data from the 'Invoices.invoice' column in the database, replacing string tokens, and using it as the message body. -Brian realm3 web applications [realm3.com] Information architecture, application development. phone: (917) 512-3594 fax: (440) 744-3559 On Wed, Jul 1, 2009 at 10:32 AM, Randal Rust wrote: > We have inherited a CakePHP application that sends a formatted HTML > email when someone completes the site's registration process. The > method that invokes the email is: > > $this->Invoice->send($districtInfo['District']['invoiceEmail'], 'PO > Order', $insert_data) > > The problem I'm having is that I cannot find the view for the HTML > formatting. If I look at the Invoice model, I cannot figure out where > the code (see below) calls the view. This does not seem to follow > anything that I see here: > > http://book.cakephp.org/view/269/Sending-a-basic-message > > ============================================ > > ? ? ? function send($email, $invoice_id, $insert_data) > ? ? ? { > ? ? ? ? ? ? ? if (! preg_match(VALID_EMAIL, $email)) { > ? ? ? ? ? ? ? ? ? ? ? return false; > ? ? ? ? ? ? ? } > ? ? ? ? ? ? ? if (preg_match('/^[0-9]{1,10}$/', $invoice_id)) { > ? ? ? ? ? ? ? ? ? ? ? $result = $this->find(('`Invoice`.`id` = ' . > $invoice_id)); > ? ? ? ? ? ? ? } else { > ? ? ? ? ? ? ? ? ? ? ? $result = $this->find(('`Invoice`.`name` = "' . > $this->mrClean->sql($invoice_id) . '"')); > ? ? ? ? ? ? ? } > ? ? ? ? ? ? ? if (empty($result)) { > ? ? ? ? ? ? ? ? ? ? ? return false; > ? ? ? ? ? ? ? } > > ? ? ? ? ? ? ? $tokens = array(); > ? ? ? ? ? ? ? $replacements = array(); > ? ? ? ? ? ? ? foreach ($insert_data as $key => $value) { > ? ? ? ? ? ? ? ? ? ? ? $tokens[] = '%' . $key . '%'; > ? ? ? ? ? ? ? ? ? ? ? $replacements[] = $value; > ? ? ? ? ? ? ? } > ? ? ? ? ? ? ? $message = str_replace($tokens, $replacements, > $result['Invoice']['invoice']); > ? ? ? ? ? ? ? $headers = ? ? ?'MIME-Version: 1.0' . "\r\n" . > ? ? ? ? ? ? ? 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . > ? ? ? ? ? ? ? 'From: ' . $this->adminEmail . "\r\n" . > ? ? ? ? ? ? ? 'Reply-To: ' . $this->adminEmail . "\r\n" . > ? ? ? ? ? ? ? 'Bcc: ' . 'test at example.com' . "\r\n" . > ? ? ? ? ? ? ? 'X-Mailer: PHP/' . phpversion(); > ? ? ? ? ? ? ? if (mail($email, $result['Invoice']['name'], $message, $headers, > ('-f' . $this->adminEmail)) && > ? ? ? ? ? ? ? mail($this->adminEmail, $result['Invoice']['name'], $message, > $headers, ('-f' . $this->adminEmail))) { > ? ? ? ? ? ? ? ? ? ? ? return true; > ? ? ? ? ? ? ? } else { > ? ? ? ? ? ? ? ? ? ? ? return false; > ? ? ? ? ? ? ? } > ? ? ? } > > Apologies to anyone on Evolt for the cross-post. That was not > intentional. I picked the wrong email address. > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From jcampbell1 at gmail.com Wed Jul 1 12:10:54 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 1 Jul 2009 12:10:54 -0400 Subject: [nycphp-talk] Help Finding an HTML Email View in CakePHP Application In-Reply-To: References: Message-ID: <8f0676b40907010910g60e362abu9493bde5ccb68ce0@mail.gmail.com> It looks like the html is in the database. The message is generated from $result['Invoice']['invoice']. My guess is the invoice is generated somewhere else and stored in database, as a permanent record. This email code is just retrieving the html from the database and sending it. On Wed, Jul 1, 2009 at 11:32 AM, Randal Rust wrote: > We have inherited a CakePHP application that sends a formatted HTML > email when someone completes the site's registration process. The > method that invokes the email is: > > $this->Invoice->send($districtInfo['District']['invoiceEmail'], 'PO > Order', $insert_data) > > The problem I'm having is that I cannot find the view for the HTML > formatting. If I look at the Invoice model, I cannot figure out where > the code (see below) calls the view. This does not seem to follow > anything that I see here: > > http://book.cakephp.org/view/269/Sending-a-basic-message > > ============================================ > > ? ? ? function send($email, $invoice_id, $insert_data) > ? ? ? { > ? ? ? ? ? ? ? if (! preg_match(VALID_EMAIL, $email)) { > ? ? ? ? ? ? ? ? ? ? ? return false; > ? ? ? ? ? ? ? } > ? ? ? ? ? ? ? if (preg_match('/^[0-9]{1,10}$/', $invoice_id)) { > ? ? ? ? ? ? ? ? ? ? ? $result = $this->find(('`Invoice`.`id` = ' . > $invoice_id)); > ? ? ? ? ? ? ? } else { > ? ? ? ? ? ? ? ? ? ? ? $result = $this->find(('`Invoice`.`name` = "' . > $this->mrClean->sql($invoice_id) . '"')); > ? ? ? ? ? ? ? } > ? ? ? ? ? ? ? if (empty($result)) { > ? ? ? ? ? ? ? ? ? ? ? return false; > ? ? ? ? ? ? ? } > > ? ? ? ? ? ? ? $tokens = array(); > ? ? ? ? ? ? ? $replacements = array(); > ? ? ? ? ? ? ? foreach ($insert_data as $key => $value) { > ? ? ? ? ? ? ? ? ? ? ? $tokens[] = '%' . $key . '%'; > ? ? ? ? ? ? ? ? ? ? ? $replacements[] = $value; > ? ? ? ? ? ? ? } > ? ? ? ? ? ? ? $message = str_replace($tokens, $replacements, > $result['Invoice']['invoice']); > ? ? ? ? ? ? ? $headers = ? ? ?'MIME-Version: 1.0' . "\r\n" . > ? ? ? ? ? ? ? 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . > ? ? ? ? ? ? ? 'From: ' . $this->adminEmail . "\r\n" . > ? ? ? ? ? ? ? 'Reply-To: ' . $this->adminEmail . "\r\n" . > ? ? ? ? ? ? ? 'Bcc: ' . 'test at example.com' . "\r\n" . > ? ? ? ? ? ? ? 'X-Mailer: PHP/' . phpversion(); > ? ? ? ? ? ? ? if (mail($email, $result['Invoice']['name'], $message, $headers, > ('-f' . $this->adminEmail)) && > ? ? ? ? ? ? ? mail($this->adminEmail, $result['Invoice']['name'], $message, > $headers, ('-f' . $this->adminEmail))) { > ? ? ? ? ? ? ? ? ? ? ? return true; > ? ? ? ? ? ? ? } else { > ? ? ? ? ? ? ? ? ? ? ? return false; > ? ? ? ? ? ? ? } > ? ? ? } > > Apologies to anyone on Evolt for the cross-post. That was not > intentional. I picked the wrong email address. > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From nate at cakephp.org Wed Jul 1 12:21:59 2009 From: nate at cakephp.org (Nate Abele) Date: Wed, 1 Jul 2009 12:21:59 -0400 Subject: [nycphp-talk] talk Digest, Vol 33, Issue 2 In-Reply-To: References: Message-ID: <799A2710-6E97-4E45-9ED8-EF4E43D1C7AD@cakephp.org> On Jul 1, 2009, at 12:00 PM, talk-request at lists.nyphp.org wrote: > Date: Wed, 1 Jul 2009 11:32:44 -0400 > From: Randal Rust > To: NYPHP Talk > Subject: [nycphp-talk] Help Finding an HTML Email View in CakePHP > Application > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > We have inherited a CakePHP application that sends a formatted HTML > email when someone completes the site's registration process. The > method that invokes the email is: > > $this->Invoice->send($districtInfo['District']['invoiceEmail'], 'PO > Order', $insert_data) > > The problem I'm having is that I cannot find the view for the HTML > formatting. If I look at the Invoice model, I cannot figure out where > the code (see below) calls the view. This does not seem to follow > anything that I see here: > > http://book.cakephp.org/view/269/Sending-a-basic-message > > ============================================ > > function send($email, $invoice_id, $insert_data) > { > if (! preg_match(VALID_EMAIL, $email)) { > return false; > } > if (preg_match('/^[0-9]{1,10}$/', $invoice_id)) { > $result = $this->find(('`Invoice`.`id` = ' . > $invoice_id)); > } else { > $result = $this->find(('`Invoice`.`name` = "' . > $this->mrClean->sql($invoice_id) . '"')); > } > if (empty($result)) { > return false; > } > > $tokens = array(); > $replacements = array(); > foreach ($insert_data as $key => $value) { > $tokens[] = '%' . $key . '%'; > $replacements[] = $value; > } > $message = str_replace($tokens, $replacements, > $result['Invoice']['invoice']); > $headers = 'MIME-Version: 1.0' . "\r\n" . > 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . > 'From: ' . $this->adminEmail . "\r\n" . > 'Reply-To: ' . $this->adminEmail . "\r\n" . > 'Bcc: ' . 'test at example.com' . "\r\n" . > 'X-Mailer: PHP/' . phpversion(); > if (mail($email, $result['Invoice']['name'], $message, > $headers, > ('-f' . $this->adminEmail)) && > mail($this->adminEmail, $result['Invoice']['name'], > $message, > $headers, ('-f' . $this->adminEmail))) { > return true; > } else { > return false; > } > } > > Apologies to anyone on Evolt for the cross-post. That was not > intentional. I picked the wrong email address. > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > > > ------------------------------ This doesn't appear to follow normal CakePHP conventions on sending email, but it looks like the content is coming from $result['Invoice'] ['invoice'], which is a Cake database result record. FWIW, by convention, HTML email templates are stored in /views/elements/ email/html. - Nate Abele Lead Developer, CakePHP -------------- next part -------------- An HTML attachment was scrubbed... URL: From randalrust at gmail.com Wed Jul 1 12:22:59 2009 From: randalrust at gmail.com (Randal Rust) Date: Wed, 1 Jul 2009 12:22:59 -0400 Subject: [nycphp-talk] Help Finding an HTML Email View in CakePHP Application In-Reply-To: References: Message-ID: On Wed, Jul 1, 2009 at 12:05 PM, Brian D. wrote: > It looks to me like it's pulling data from the 'Invoices.invoice' > column in the database, replacing string tokens, and using it as the > message body. Yeah, I figured that out about 5 minutes after I sent my message. Thanks though. This was driving me absolutely nuts. -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From ajai at bitblit.net Wed Jul 1 12:26:56 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 1 Jul 2009 12:26:56 -0400 (EDT) Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <1246464092.23178.185.camel@mikeh-ubuntu> Message-ID: On Wed, 1 Jul 2009, Michael Hernandez wrote: > I only say that because there is stuff in /usr/local on my ubuntu system > that I didn't put there (at least not manually) Yes, the FHS standard mandates that certain directories should exist there (they are mostly empty) which is why most distros create folders there when you initially install Linux. -- Aj. From oorza2k5 at gmail.com Wed Jul 1 12:29:00 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Wed, 1 Jul 2009 12:29:00 -0400 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <1246464092.23178.185.camel@mikeh-ubuntu> References: <1246464092.23178.185.camel@mikeh-ubuntu> Message-ID: <68de37340907010929j7f166e85g7d69fa58bcae2c4d@mail.gmail.com> On Wed, Jul 1, 2009 at 12:01 PM, Michael Hernandez wrote: > On Wed, 2009-07-01 at 11:54 -0400, Ajai Khattri wrote: >> On Wed, 1 Jul 2009, Michael Hernandez wrote: >> >> > I worry that using /usr/local for stuff might >> > end up with an accidental delete or overwrite by the package manager. >> >> Why? System packages never install into /usr/local. Traditionally, >> /usr/local has always been for "local" stuff. When I build stuff from >> source, I generally will install everything in /usr/local. >> >> Most Linux distros generally follow the FHS standard, see: >> http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHIERARCHY >> >> >> > > I only say that because there is stuff in /usr/local on my ubuntu system > that I didn't put there (at least not manually), and /opt is completely > empty. > > --Mike H > Holy hell, I totally misinterpreted the question, so you can go ahead and ignore that previous email (unless you want to have several versions of PHP installed at once ;]). If there's more than one site running the same software: /home/user/software/ <--- the repository for the actual software /home/user/webroots/ <--- the repository for the static files and symlinks to the software that are app specific Every application that I run is a new user that doesn't have permission to r/w out of its /home/ so that collaboration with people on several projects means no one's snooping anyone else's sourcecode. The apache user is in all of their groups, for obvious reasons :P From mitch.pirtle at gmail.com Wed Jul 1 12:33:54 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Wed, 1 Jul 2009 12:33:54 -0400 Subject: [nycphp-talk] [OT] Managed hosting on the east coast? Message-ID: <330532b60907010933v5c49b973tdf0fa2e1f2d18ee5@mail.gmail.com> Hey gang, Taking a long hard look at Peer 1, wondering what the rest of you think about them as a managed hosting provider. I need a relatively common infrastructure (firewall, loadbalancer, webservers, database servers) need and am scrambling to find desirable suitors. Any advice from the NYPHP folks for me? -- Mitch From ajai at bitblit.net Wed Jul 1 13:11:47 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 1 Jul 2009 13:11:47 -0400 (EDT) Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <68de37340907010929j7f166e85g7d69fa58bcae2c4d@mail.gmail.com> Message-ID: On Wed, 1 Jul 2009, Eddie Drapkin wrote: > Every application that I run is a new user that doesn't have > permission to r/w out of its /home/ so that collaboration with people > on several projects means no one's snooping anyone else's sourcecode. > The apache user is in all of their groups, for obvious reasons :P Not that that stops application *code* from snooping other folders... :-) Generally, if the whole server is dedicated to one app, then I would just create a user and put the application under that. Since the whole server is dedicated to the app, you can make sym links to different versions (a la Rails deployment) and organize the folders any way you like. For shared hosting, these days I create folders named after the domain under /home/vhosts (i.e. /home/vhosts/domain.com), inside each I have the usual cgi-bin, htdocs and logs folders and an etc folder for files that should never be web-accessible. For most modern frameworks, like Cake or symfony, most of the code lies in etc, with only images, css, Javascript and the front controllers in htdocs. This setup is similar to mail server setups using qmail with vpopmail, where all the mailboxes live under /home/vpopmail/domains. -- Aj. From ajai at bitblit.net Wed Jul 1 13:14:55 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 1 Jul 2009 13:14:55 -0400 (EDT) Subject: [nycphp-talk] [OT] Managed hosting on the east coast? In-Reply-To: <330532b60907010933v5c49b973tdf0fa2e1f2d18ee5@mail.gmail.com> Message-ID: On Wed, 1 Jul 2009, Mitch Pirtle wrote: > Taking a long hard look at Peer 1, wondering what the rest of you > think about them as a managed hosting provider. I need a relatively > common infrastructure (firewall, loadbalancer, webservers, database > servers) need and am scrambling to find desirable suitors. > > Any advice from the NYPHP folks for me? By managed, I take that to mean you dont ever want to update your own servers? Generally its the most expensive hosting solution... -- Aj. From lists at zaunere.com Wed Jul 1 13:10:36 2009 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 1 Jul 2009 13:10:36 -0400 Subject: [nycphp-talk] oci8 bind error In-Reply-To: <839B1683CF254BC99BF6EE4780FE141B@Libby> References: <016f01c9fa5d$1ba28cb0$52e7a610$@com> <839B1683CF254BC99BF6EE4780FE141B@Libby> Message-ID: <01f001c9fa6e$d9f57ae0$8de070a0$@com> Hi, Hmm, strange - I've googled around and this is a pretty common error where the resolution is generally some subtle way the variables are defined and bound. I can't spot the problem, but play around with the query, perhaps some lowercase stuff, etc., and flags to the oci_bind_by_name() call. H > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk- > bounces at lists.nyphp.org] On Behalf Of Eric Gewirtz > Sent: Wednesday, July 01, 2009 11:59 AM > To: 'NYPHP Talk' > Subject: Re: [nycphp-talk] oci8 bind error > > Hi Hans, > > Thks for the reply. > > I have double checked and the table I am testing with (KB_TEST) has one > field and it is VARCHAR(25). I believe the oci_parse() is working since > I'm > not "dieing" with an error message and the code gets to the > oci_bind_by_name(). > > > To your point that this "oci_bind_by_name ($stmt, ":TESTNAME", > "ERIC");" > should work - I do not get the oracle error when run this statment, I > get a > PHP fatal error: Only variables can be passed by reference. This makes > no > sense to me either. I get the oracle error when I run; > $val = 'ERIC'; > $bindVar = ':TESTNAME'; > oci_bind_by_name ($stmt, $bindVar, $val) > > So I just added some primitive type checking on the variables I'm > passing to > the bind and confirmed that $stmt is a resource, $val and $bindVar are > strings. > > I'm using is_string() and is_resource(). > > As to the ditching the "$insSQL = strtoupper($insSQL);"; I only added > it > because I was running out of ideas and I know ORACLE like to work with > upper > case (you can use mixed case but it is not fun). > > Eric > > > > SolutionOne > Eric Gewirtz > 162 Turk Hill Road > Brewster NY, 10509 > Phone: 845-729-7800 > FAX: 845-279-5502 > > > >-----Original Message----- > >From: talk-bounces at lists.nyphp.org [mailto:talk- > bounces at lists.nyphp.org] On > >Behalf Of Hans Zaunere > >Sent: Wednesday, July 01, 2009 11:04 AM > >To: 'NYPHP Talk' > >Subject: Re: [nycphp-talk] oci8 bind error > > > >Hello, > > > >> Warning: oci_bind_by_name(): ORA-01036: illegal variable name/number > in > >> /appl/wideacc/CustMast/in/OCIpreptest.php on line 23 > > > > > >> Below is the test code I'm running; > >> > >> > >> //Connect to the Database > >> $dbUser = 'c1'; > >> $dbPSWD = p1'; > >> $db = 'db1'; > >> $con = oci_connect($dbUser, $dbPSWD, $db); > >> if (!$con) die ('Connect to DB failed'); > >> //$insSQL = 'INSERT INTO KB_TEST (TESTNAME) VALUES (:TESTNAME)'; > >> $insSQL = "INSERT INTO KB_TEST VALUES (:TESTNAME)"; > >> $insSQL = strtoupper($insSQL); // upper case since ORACLE prefers > upper > > > >I'd ditch this... > > > >> and we know we do not have a case issue > >> echo "SQL is $insSQL \n"; > >> $stmt = oci_parse($con, $insSql); > >> if (!$stmt) die ('Parse for insert failed'); > >> > >> //oci_bind_by_name ($stmt, ":TESTNAME", "ERIC"); > > > >This one seems as though it should work - are you sure the oci_parse() > is > >successful and that the first column in that table is really a > varchar? > > > >H > > > > > >_______________________________________________ > >New York PHP User Group Community Talk Mailing List > >http://lists.nyphp.org/mailman/listinfo/talk > > > >http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From lists at zaunere.com Wed Jul 1 13:11:53 2009 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 1 Jul 2009 13:11:53 -0400 Subject: [nycphp-talk] [OT] Managed hosting on the east coast? In-Reply-To: <330532b60907010933v5c49b973tdf0fa2e1f2d18ee5@mail.gmail.com> References: <330532b60907010933v5c49b973tdf0fa2e1f2d18ee5@mail.gmail.com> Message-ID: <01f101c9fa6f$07b69590$1723c0b0$@com> > Taking a long hard look at Peer 1, wondering what the rest of you > think about them as a managed hosting provider. I need a relatively > common infrastructure (firewall, loadbalancer, webservers, database > servers) need and am scrambling to find desirable suitors. > > Any advice from the NYPHP folks for me? I haven't used Peer 1 per se, but know nyi.net, pilosoft.com and logicworks.com pretty well. H From krozinov at gmail.com Wed Jul 1 13:44:17 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Wed, 1 Jul 2009 13:44:17 -0400 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: References: <68de37340907010929j7f166e85g7d69fa58bcae2c4d@mail.gmail.com> Message-ID: <865a7acf0907011044o7c13f971u175429b6198a5b01@mail.gmail.com> If you're installing linux packages/apps into /usr/local, which is most common, it's highly recommended to use gnu stow to manage them. I create /usr/local/stow dir....install all my linux packages there (apache, php, mysql, etc)...and then do a simple `stow -v package_dir/` from /usr/local/stow. If I have to get a new version, I do `stow -Dv old_package_dir/` and relink the new package.... saves time, and keeps everything organzied, and no need to delete older versions (but u can if u want to) On Wed, Jul 1, 2009 at 1:11 PM, Ajai Khattri wrote: > On Wed, 1 Jul 2009, Eddie Drapkin wrote: > >> Every application that I run is a new user that doesn't have >> permission to r/w out of its /home/ so that collaboration with people >> on several projects means no one's snooping anyone else's sourcecode. >> The apache user is in all of their groups, for obvious reasons :P > > Not that that stops application *code* from snooping other folders... :-) > > Generally, if the whole server is dedicated to one app, then I would just > create a user and put the application under that. Since the whole server > is dedicated to the app, you can make sym links to different versions (a > la Rails deployment) and organize the folders any way you like. > > For shared hosting, these days I create folders named after the domain > under /home/vhosts (i.e. /home/vhosts/domain.com), inside each I have the > usual cgi-bin, htdocs and logs folders and an etc folder for files that > should never be web-accessible. For most modern frameworks, like Cake or > symfony, most of the code lies in etc, with only images, css, > Javascript and the front controllers in htdocs. This setup is similar to > mail server setups using qmail with vpopmail, where all the mailboxes live > under /home/vpopmail/domains. > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From dan.horning at planetnoc.com Wed Jul 1 17:30:51 2009 From: dan.horning at planetnoc.com (dan.horning at planetnoc.com) Date: Wed, 1 Jul 2009 21:30:51 +0000 Subject: [nycphp-talk] [OT] Managed hosting on the east coast? Message-ID: <371686320-1246483905-cardhu_decombobulator_blackberry.rim.net-125905797-@bxe1304.bisx.prod.on.blackberry> Give me a call and I'll give you a detail understanding. I've had and have many servers with them. 518-444-0213 x502 Call anytime. Dan ------Original Message------ From: Mitch Pirtle Sender: talk-bounces at lists.nyphp.org To: NYPHP Talk ReplyTo: NYPHP Talk Subject: [nycphp-talk] [OT] Managed hosting on the east coast? Sent: Jul 1, 2009 12:33 PM Hey gang, Taking a long hard look at Peer 1, wondering what the rest of you think about them as a managed hosting provider. I need a relatively common infrastructure (firewall, loadbalancer, webservers, database servers) need and am scrambling to find desirable suitors. Any advice from the NYPHP folks for me? -- Mitch _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -- sent via blackberry -- Dan Horning American Digital Services - Where you are only limited by imagination. dan.horning at planetnoc.com :: http://www.americandigitalservices.com 1-518-444-0213 x502 . toll free 1-800-863-3854 . fax 1-888-474-6133 15 Third Street, PO Box 746, Troy, NY 12180 (by appointment only) From danielc at analysisandsolutions.com Wed Jul 1 17:51:56 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 1 Jul 2009 17:51:56 -0400 Subject: [nycphp-talk] oci8 bind error In-Reply-To: <839B1683CF254BC99BF6EE4780FE141B@Libby> References: <016f01c9fa5d$1ba28cb0$52e7a610$@com> <839B1683CF254BC99BF6EE4780FE141B@Libby> Message-ID: <20090701215156.GA1397@panix.com> Hey Eric: > To your point that this "oci_bind_by_name ($stmt, ":TESTNAME", "ERIC");" > should work - I do not get the oracle error when run this statment, I get a > PHP fatal error: Only variables can be passed by reference. This makes no > sense to me either. Binding allows input to and output from the database. In the event there is output from the query/procedure on that binding, PHP needs a place to store said output. That place is a variable. Pass something other than a variable and PHP kvetches. I recently needed more space on my hard disk, so removed Oracle, thus I can't test your code myself. Alas. Anyway, try this out: References: <68de37340907010929j7f166e85g7d69fa58bcae2c4d@mail.gmail.com> <865a7acf0907011044o7c13f971u175429b6198a5b01@mail.gmail.com> Message-ID: <721f1cc50907020729x3cf7b9fcvc514e6fea6c74716@mail.gmail.com> This has been quite enlightening, thanks. I ended up deciding on opt/www for web apps, and /usr/share/php will house the system-wide libs like Zend Framework. Yes it could be /usr/local/whatever but... wtf. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.gewirtz at solutiononecdi.com Thu Jul 2 13:32:22 2009 From: eric.gewirtz at solutiononecdi.com (Eric Gewirtz) Date: Thu, 2 Jul 2009 13:32:22 -0400 Subject: [nycphp-talk] oci8 bind error In-Reply-To: <20090701215156.GA1397@panix.com> Message-ID: <0010EDC47B81481AB16CCF49A619D5E6@Libby> Hi Daniel, Thanks I truly appreciate your help - With some minor tweaks this code does work so at least I know it is not our version of php on the SUN box. I'm not yet sure why the bind works here and not in my sample because I also passed in variables to the bind and I'm in the process of trying to get mine to work. I have now gone as far as dropping my table that I created outside the code and I am creating the table inside the code and that has not helped either (this should not matter and I'm glad that it didn't). I can not wait to find the bug, I know it is something really dumb ... If anyone else out there is trying to run Daniel's code, you need to 1. fix the Insert syntax, it is missing a parenthesis before the table field is defined and then you would need closing parenthesis at the end. 2. $variable in the bind should be $field_value otherwise a null is inserted into the table 3. even if bind fails the "insert worked" message will echo out because there is no break or die to end the if else checking so it drops down to the echo stmt that says the insert worked SolutionOne Eric Gewirtz 162 Turk Hill Road Brewster NY, 10509 Phone: 845-729-7800 FAX: 845-279-5502 >-----Original Message----- >From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On >Behalf Of Daniel Convissor >Sent: Wednesday, July 01, 2009 5:52 PM >To: NYPHP Talk >Subject: Re: [nycphp-talk] oci8 bind error > >Hey Eric: > >> To your point that this "oci_bind_by_name ($stmt, ":TESTNAME", "ERIC");" >> should work - I do not get the oracle error when run this statment, I get >a >> PHP fatal error: Only variables can be passed by reference. This makes no >> sense to me either. > >Binding allows input to and output from the database. In the event there >is output from the query/procedure on that binding, PHP needs a place to >store said output. That place is a variable. Pass something other than >a variable and PHP kvetches. > >I recently needed more space on my hard disk, so removed Oracle, thus I >can't test your code myself. Alas. Anyway, try this out: > > >/* > * SET THESE. > */ > >$put_colon_on_placeholder = true; // TRY THIS BOTH TRUE AND FALSE. > >$username = ''; >$password = ''; >$dbname = ''; > > >/* > * Leave these alone (for the most part). > */ > >$table_name = 'dan_test'; >$field_name = 'the_field'; >$max_length = '25'; >$field_value = 'testing 123'; > > >/* > * Connect. > */ >$dbh = oci_connect($username, $password, $dbname); >if (!$dbh) { > die('CONNECT ERROR: ' . oci_error() . "\n"); >} > > >/* > * Create table. > */ > >$statement = 'CREATE TABLE ' . $table_name . ' ' > . $field_name . ' VARCHAR2(' . $max_length . ')'; >echo $statement . "\n"; > >$sth = oci_parse($dbh, $statement); >if ($sth) { > if (!oci_execute($sth, OCI_DEFAULT)) { > die('EXECUTE ERROR: ' . oci_error($sth) . "\n"); > } > > if (!oci_free_statement($sth)) { > echo 'FREE ERROR: ' . oci_error($dbh) . "\n"; > } >} else { > die('STATEMENT PARSE ERROR: ' . oci_error($dbh) . "\n"); >} > > >/* > * Let's try binding. > */ > >if ($put_colon_on_placeholder) { > $ph_name = ':' . $field_name; >} else { > $ph_name = $field_name; >} >$statement = 'INSERT INTO ' . $table_name > . ' (' . $field_name > . ') VALUES (' . $ph_name . ')'; >echo $statement . "\n"; > >$sth = oci_parse($dbh, $statement); >if ($sth) { > $bind = oci_bind_by_name($sth, $ph_name, $variable, > $max_length, SQLT_CHR); > if ($bind) { > if (!oci_execute($sth, OCI_COMMIT_ON_SUCCESS)) { > echo 'EXECUTE ERROR: ' . oci_error($sth) . "\n"; > } > } else { > echo 'BIND ERROR: ' . oci_error($sth) . "\n"; > } > > if (!oci_free_statement($sth)) { > echo 'FREE ERROR: ' . oci_error($dbh) . "\n"; > } > > echo 'The insert seems to have worked.' . "\n"; >} else { > echo 'STATEMENT PARSE ERROR: ' . oci_error($dbh) . "\n"; >} > > >/* > * Drop table. > */ > >$statement = 'DROP TABLE ' . $table_name; >echo $statement . "\n"; > >$sth = oci_parse($dbh, $statement); >if ($sth) { > if (!oci_execute($sth, OCI_DEFAULT)) { > die('EXECUTE ERROR: ' . oci_error($sth) . "\n"); > } > > if (!oci_free_statement($sth)) { > echo 'FREE ERROR: ' . oci_error($dbh) . "\n"; > } >} else { > die('STATEMENT PARSE ERROR: ' . oci_error($dbh) . "\n"); >} > > >if (!oci_close($dbh)) { > echo 'CLOSE ERROR: ' . oci_error($dbh) . "\n"; >} > >-- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 >_______________________________________________ >New York PHP User Group Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >http://www.nyphp.org/show_participation.php From danielc at analysisandsolutions.com Thu Jul 2 19:34:26 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 2 Jul 2009 19:34:26 -0400 Subject: [nycphp-talk] oci8 bind error In-Reply-To: <0010EDC47B81481AB16CCF49A619D5E6@Libby> References: <20090701215156.GA1397@panix.com> <0010EDC47B81481AB16CCF49A619D5E6@Libby> Message-ID: <20090702233425.GA8833@panix.com> Hi Eric: On Thu, Jul 02, 2009 at 01:32:22PM -0400, Eric Gewirtz wrote: > > Thanks I truly appreciate your help - With some minor tweaks this code does > work so at least I know it is not our version of php on the SUN box. Good. Sorry it had some bugs. I hate sending out code without testing it myself. > I'm not > yet sure why the bind works here and not in my sample because I also passed > in variables to the bind and I'm in the process of trying to get mine to > work. Your code doesn't set the length and the type parameters in the bind call. Not sure if that's why it's failing, but it's possible. Enjoy the long weekend, --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 eric.gewirtz at solutiononecdi.com Thu Jul 2 22:35:54 2009 From: eric.gewirtz at solutiononecdi.com (Eric Gewirtz) Date: Thu, 2 Jul 2009 22:35:54 -0400 Subject: [nycphp-talk] oci8 bind error In-Reply-To: <20090702233425.GA8833@panix.com> Message-ID: Hi Dan, I found my bug (actually my partner found it)- embarrassed to admit it but here it is - the sql to parse is being stored in a var called $insSQL and the oci_parse is using $insSql (note the QL vs ql) I knew it was something dumb :-(. Interesting that the oci_parse() does not throw an error on a null or empty var. $insSQL = "INSERT INTO KB_TEST VALUES (:TESTNAME)"; $stmt = oci_parse($con, $insSql); if (!$stmt) die ('Parse for insert failed'); $val = 'ERIC'; $bindVar = ':TESTNAME'; ioci_bind_by_name ($stmt, $bindVar, $val)) Thks again. Btw, I tested without the length parm and the bind worked. Eric SolutionOne Eric Gewirtz 162 Turk Hill Road Brewster NY, 10509 Phone: 845-729-7800 FAX: 845-279-5502 >-----Original Message----- >From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On >Behalf Of Daniel Convissor >Sent: Thursday, July 02, 2009 7:34 PM >To: NYPHP Talk >Subject: Re: [nycphp-talk] oci8 bind error > >Hi Eric: > >On Thu, Jul 02, 2009 at 01:32:22PM -0400, Eric Gewirtz wrote: >> >> Thanks I truly appreciate your help - With some minor tweaks this code >does >> work so at least I know it is not our version of php on the SUN box. > >Good. Sorry it had some bugs. I hate sending out code without testing >it myself. > > >> I'm not >> yet sure why the bind works here and not in my sample because I also >passed >> in variables to the bind and I'm in the process of trying to get mine to >> work. > >Your code doesn't set the length and the type parameters in the bind >call. Not sure if that's why it's failing, but it's possible. > >Enjoy the long weekend, > >--Dan > >-- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 >_______________________________________________ >New York PHP User Group Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >http://www.nyphp.org/show_participation.php From danielc at analysisandsolutions.com Thu Jul 2 23:27:52 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 2 Jul 2009 23:27:52 -0400 Subject: [nycphp-talk] oci8 bind error In-Reply-To: References: <20090702233425.GA8833@panix.com> Message-ID: <20090703032751.GA28869@panix.com> Hi Eric: > I found my bug (actually my partner found it)- embarrassed to admit it but > here it is - the sql to parse is being stored in a var called $insSQL and > the oci_parse is using $insSql (note the QL vs ql) Ugh! :) That should have generated a notice saying $insSql is being used before being defined. Are you running with E_NOTICE turned off? If so, it's highly recommended to run error_reporting set to E_ALL, at least in development, so you can catch these things right off. --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 eric.gewirtz at solutiononecdi.com Fri Jul 3 09:18:45 2009 From: eric.gewirtz at solutiononecdi.com (Eric Gewirtz) Date: Fri, 3 Jul 2009 09:18:45 -0400 Subject: [nycphp-talk] oci8 bind error In-Reply-To: <20090703032751.GA28869@panix.com> Message-ID: <9A9ABA34EB9C410199D7D1F9D70BC236@Libby> Hi Dan, I did not have E_NOTICE turned on (shame on me). I just tested the code with the dumb typo bug with error_reporting(E_ALL) and it did show the warning. Thanks again Eric SolutionOne Eric Gewirtz 162 Turk Hill Road Brewster NY, 10509 Phone: 845-729-7800 FAX: 845-279-5502 >-----Original Message----- >From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On >Behalf Of Daniel Convissor >Sent: Thursday, July 02, 2009 11:28 PM >To: NYPHP Talk >Subject: Re: [nycphp-talk] oci8 bind error > >Hi Eric: > >> I found my bug (actually my partner found it)- embarrassed to admit it >but >> here it is - the sql to parse is being stored in a var called $insSQL and >> the oci_parse is using $insSql (note the QL vs ql) > >Ugh! :) > >That should have generated a notice saying $insSql is being used before >being defined. Are you running with E_NOTICE turned off? If so, it's >highly recommended to run error_reporting set to E_ALL, at least in >development, so you can catch these things right off. > >--Dan > >-- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 >_______________________________________________ >New York PHP User Group Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >http://www.nyphp.org/show_participation.php From leam at reuel.net Sun Jul 5 16:19:47 2009 From: leam at reuel.net (Leam Hall) Date: Sun, 05 Jul 2009 16:19:47 -0400 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> References: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> Message-ID: <4A510AE3.40309@reuel.net> David Mintz wrote: > Perhaps this is one of those things that doesn't matter a helluva lot, but: > when you have a freshly installed Debian-style LAMP (actually Ubuntu server > 9.04) and you are looking for a place in the filesystem to install your PHP > application files -- where do you like to put them? /usr/local/share/... ? > Or /usr/local/lib/php/... ? /opt/...? > > It's nice if it isn't /something/too/terribly/hideously/long/to/type > although there are always shortcuts, like environment vars. /opt is for anything an application might use. The logic is that /opt is generally a separate filesystem and if an application mis-behaves and writes lots of logs you're not crashing the box. Just the application. It also lets you bind mount to wherever you need, and if you need to work on the machine in single user mode you don't have to mount /opt to make server stuff work. Also, for those who work in mixed environments; /opt is a Unix-ism. /usr/local is a Linux-ism. Leam From matt at atopia.net Sun Jul 5 16:30:36 2009 From: matt at atopia.net (Matt Juszczak) Date: Sun, 5 Jul 2009 16:30:36 -0400 (EDT) Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <4A510AE3.40309@reuel.net> References: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> <4A510AE3.40309@reuel.net> Message-ID: > Also, for those who work in mixed environments; /opt is a Unix-ism. > /usr/local is a Linux-ism. I see FreeBSD do this (separate user-installed packages into /usr/local), but Linux always seems to install extra packages and user-generated content in /usr as the root. IE: mysql & apache. Always wondered why the separation was never there. From anoland at indigente.net Sun Jul 5 17:41:11 2009 From: anoland at indigente.net (Adrian Noland) Date: Sun, 5 Jul 2009 16:41:11 -0500 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> References: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> Message-ID: <1d8a0e930907051441r43659005je9744afc4ae998ff@mail.gmail.com> On Wed, Jul 1, 2009 at 9:48 AM, David Mintz wrote: > Perhaps this is one of those things that doesn't matter a helluva lot, > but: when you have a freshly installed Debian-style LAMP (actually Ubuntu > server 9.04) and you are looking for a place in the filesystem to install > your PHP application files -- where do you like to put them? > /usr/local/share/... ? Or /usr/local/lib/php/... ? /opt/...? > > It's nice if it isn't /something/too/terribly/hideously/long/to/type > although there are always shortcuts, like environment vars. > According to Zend: http://devzone.zend.com/article/4683-Zend-Framework---Location-Location-Location > > -- > David Mintz > http://davidmintz.org/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Mon Jul 6 08:18:24 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 6 Jul 2009 08:18:24 -0400 (EDT) Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: Message-ID: On Sun, 5 Jul 2009, Matt Juszczak wrote: > I see FreeBSD do this (separate user-installed packages into /usr/local), > but Linux always seems to install extra packages and user-generated > content in /usr as the root. IE: mysql & apache. Always wondered why the > separation was never there. Why would they? If you built the package yourself then /usr/local makes sense. If you're installing a package provided by the distro vendor then they will merge it with the rest of the system. -- Aj. From vtbludgeon at gmail.com Mon Jul 6 16:36:24 2009 From: vtbludgeon at gmail.com (David Mintz) Date: Mon, 6 Jul 2009 16:36:24 -0400 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: <1d8a0e930907051441r43659005je9744afc4ae998ff@mail.gmail.com> References: <721f1cc50907010748r338b7d3ar31a9e49ae2802dcd@mail.gmail.com> <1d8a0e930907051441r43659005je9744afc4ae998ff@mail.gmail.com> Message-ID: <721f1cc50907061336j2a56b0b4kfd55632af04edb4@mail.gmail.com> On Sun, Jul 5, 2009 at 5:41 PM, Adrian Noland wrote: > > > On Wed, Jul 1, 2009 at 9:48 AM, David Mintz wrote: > >> Perhaps this is one of those things that doesn't matter a helluva lot, >> but: when you have a freshly installed Debian-style LAMP (actually Ubuntu >> server 9.04) and you are looking for a place in the filesystem to install >> your PHP application files -- where do you like to put them? >> /usr/local/share/... ? Or /usr/local/lib/php/... ? /opt/...? >> >> It's nice if it isn't /something/too/terribly/hideously/long/to/type >> although there are always shortcuts, like environment vars. >> > > According to Zend: > > > http://devzone.zend.com/article/4683-Zend-Framework---Location-Location-Location > > I saw that article before. Seems to me are talking about where to put the ZF libs, while I was talking about where to put my own application files (non-public). Also, since they don't seem to be presupposing a sophisticated reader, they should have mentioned that setting things like include_path via .htaccess directives doesn't work iwhen (1) an AllowOverride directive doesn't explicitly allow it, or (2) you are running php as a cgi -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From leam at reuel.net Mon Jul 6 18:24:23 2009 From: leam at reuel.net (Leam Hall) Date: Mon, 06 Jul 2009 18:24:23 -0400 Subject: [nycphp-talk] where in filesystem to install php application In-Reply-To: References: Message-ID: <4A527997.3030104@reuel.net> Ajai Khattri wrote: > On Sun, 5 Jul 2009, Matt Juszczak wrote: > >> I see FreeBSD do this (separate user-installed packages into /usr/local), >> but Linux always seems to install extra packages and user-generated >> content in /usr as the root. IE: mysql & apache. Always wondered why the >> separation was never there. > > > Why would they? If you built the package yourself then /usr/local makes > sense. If you're installing a package provided by the distro vendor then > they will merge it with the rest of the system. /usr/local as an application spot pre-dates *BSD and Linux being in the production mainstream. For commercial unix, /opt is where optional packages go. Simply put, if it's an application you're making available off the server, it goes in /opt. Even stuff that works *on* the server goes in /opt if the server can get along without it. This is probably due to the legacy idea of small disk drives. /usr was often mounted read-only so that it was less likely to get messed with. /opt could have it's own drive, and since business applications were demanding large space they could pay for the large space while the system partitions stayed small. Of course, this is a simplification. Some unix versions put odd things in odd places, like user home directories in /usr, and system applications in /etc... Leam From lists at zaunere.com Wed Jul 15 10:31:14 2009 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 15 Jul 2009 10:31:14 -0400 Subject: [nycphp-talk] JSON and MVC Message-ID: <075701ca0558$e84753d0$b8d5fb70$@com> Hello, As I work with and need to support JSON applications more and more, I quickly remember why the mantra "don't use javascript" from yesteryear was in place. Worse, perhaps, is how the browser and server need to interface with each other in complex JSON based applications. We're all familiar with the typical MVC pattern, and the use of templates to organize and manipulate fragments of HTML/etc. This is a very well solved problem that's been established for years. Web 2.0, if you will, is "fragment" requests/responses. I think of this as the basic Ajax type of website, whereby the server is now sending back these fragments of HTML rather than assembling them into complete documents and sending that back. The Javascript on the browser actually assembles and moves things around as needed on the client side. Web 3.0 (insert kitsch marketing term here), I've found as being the complete manipulation, in real time, of nearly the entire document. Vast chunks of the document are living and breathing, and being effected by events, timers, user interaction, server polling, etc. In order to the support this, a high degree of granularity for dealing with HTML tags and IDs is needed. Using fragments as we did in Web 2.0 doesn't provide this level of granularity so pure JSON is required. What this means (to me) basically is that tag content itself or even elemental HTML fragments (very small chunks, like single p, h1, img, etc) need to be manipulated both on the server and browser side. The problem with this, however, is that it causes the server-side to retrace to the ugly days of mixing and mashing PHP/HTML/etc. For example, to push out a set of IDs to the client, I no longer use a template to spit back a fragment. Rather, I put tags and data into an array directly, and then json_encode() that, and send that back to the client. For example, a dynamic forum type of thing: $JSON['ID']["mi_$GID"] = "ImagesURL}lr/icon_phone.png\" />"; $JSON['ID']["bl_$GID"] = "{$M->BylineDate} | {$M->FirstName} {$M->LastName}"; $JSON['ID']["rcb_$GID"] = $M->ReplyCount; $JSON['ID']["hc_$GID"] = $M->Title; echo json_encode($JSON['ID']); The Javascript then takes each element from the array and manipulates the DOM as appropriate. Why not just stuff things in innerHTML you may ask? Because that's not granular enough, and should the user be interactive with that particular element, the user has just lost his current state. So hopefully others have run into these types of issues and I'm curious as to how others deal with it. Thoughts, experiences, etc? I've thought about how to use some type of elemental templating, but there doesn't appear to be anything that's a fit for this type of thing. And no easy way I can think of for building something to handle this. Or, perhaps I'm completely missing some elementary concept that makes all this moot...? Looking forward to everyone's thoughts. H From jmcgraw1 at gmail.com Wed Jul 15 10:47:54 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Wed, 15 Jul 2009 10:47:54 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <075701ca0558$e84753d0$b8d5fb70$@com> References: <075701ca0558$e84753d0$b8d5fb70$@com> Message-ID: I've had great success using Zend Framework ContextSwitch Action Helper: http://woo.ly/9it It is a plugin for the Zend MVC system that detects what format you're requesting a page in, using explicitly set context (format) in the page request: http://myzendapp.com/module/controller/action?format=json (?format=json sets the context to JSON encoding) or automatically detecting the context based on the request type. For example, many JavaScript frameworks submit a special header to differentiate an AJAX request from a standard HTTP request. The ContextSwitch (in this case the AjaxContext) will detect this and seamlessly deliver JSON. Other useful features include disabling layouts, automatically encoding output to JSON and rerouting request based on context type. Granted you'll have to work with Zend MVC, so this isn't a general solution to the problem, but perhaps you can glean some theory of operation from the way that they have set it up. - jake On Wed, Jul 15, 2009 at 10:31 AM, Hans Zaunere wrote: > Hello, > > As I work with and need to support JSON applications more and more, I > quickly remember why the mantra "don't use javascript" from yesteryear was > in place. ?Worse, perhaps, is how the browser and server need to interface > with each other in complex JSON based applications. > > We're all familiar with the typical MVC pattern, and the use of templates to > organize and manipulate fragments of HTML/etc. ?This is a very well solved > problem that's been established for years. > > Web 2.0, if you will, is "fragment" requests/responses. ?I think of this as > the basic Ajax type of website, whereby the server is now sending back these > fragments of HTML rather than assembling them into complete documents and > sending that back. ?The Javascript on the browser actually assembles and > moves things around as needed on the client side. > > Web 3.0 (insert kitsch marketing term here), I've found as being the > complete manipulation, in real time, of nearly the entire document. ?Vast > chunks of the document are living and breathing, and being effected by > events, timers, user interaction, server polling, etc. > > In order to the support this, a high degree of granularity for dealing with > HTML tags and IDs is needed. ?Using fragments as we did in Web 2.0 doesn't > provide this level of granularity so pure JSON is required. ?What this means > (to me) basically is that tag content itself or even elemental HTML > fragments (very small chunks, like single p, h1, img, etc) need to be > manipulated both on the server and browser side. > > The problem with this, however, is that it causes the server-side to retrace > to the ugly days of mixing and mashing PHP/HTML/etc. ?For example, to push > out a set of IDs to the client, I no longer use a template to spit back a > fragment. ?Rather, I put tags and data into an array directly, and then > json_encode() that, and send that back to the client. > > For example, a dynamic forum type of thing: > > $JSON['ID']["mi_$GID"] = "ImagesURL}lr/icon_phone.png\" > />"; > > $JSON['ID']["bl_$GID"] = "{$M->BylineDate} | {$M->FirstName} > {$M->LastName}"; > > $JSON['ID']["rcb_$GID"] = $M->ReplyCount; > > $JSON['ID']["hc_$GID"] = $M->Title; > > echo json_encode($JSON['ID']); > > > The Javascript then takes each element from the array and manipulates the > DOM as appropriate. ?Why not just stuff things in innerHTML you may ask? > Because that's not granular enough, and should the user be interactive with > that particular element, the user has just lost his current state. > > So hopefully others have run into these types of issues and I'm curious as > to how others deal with it. ?Thoughts, experiences, etc? ?I've thought about > how to use some type of elemental templating, but there doesn't appear to be > anything that's a fit for this type of thing. ?And no easy way I can think > of for building something to handle this. > > Or, perhaps I'm completely missing some elementary concept that makes all > this moot...? > > Looking forward to everyone's thoughts. > > H > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From chsnyder at gmail.com Wed Jul 15 11:49:28 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Wed, 15 Jul 2009 11:49:28 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <075701ca0558$e84753d0$b8d5fb70$@com> References: <075701ca0558$e84753d0$b8d5fb70$@com> Message-ID: On Wed, Jul 15, 2009 at 10:31 AM, Hans Zaunere wrote: > The Javascript then takes each element from the array and manipulates the > DOM as appropriate. ?Why not just stuff things in innerHTML you may ask? > Because that's not granular enough, and should the user be interactive with > that particular element, the user has just lost his current state. Maybe you need a javascript template system? That way you would only be passing data in JSON, and then coercing that into a template on the client side. Template may == DOM-building-function if that's more suitable than string replacement and innerHTML stuffing. In other words, if the client knows how to add events to a calendar (using DOM), then you can just send a stream of event details using JSON. Very lightweight on the server side, and you're not mixing markup and data anymore. As a bonus, that approach sets you up for thinking in terms of a local database, which leads to offline functionality. From lists at zaunere.com Wed Jul 15 11:52:06 2009 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 15 Jul 2009 11:52:06 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: References: <075701ca0558$e84753d0$b8d5fb70$@com> Message-ID: <07aa01ca0564$347baf70$9d730e50$@com> > I've had great success using Zend Framework ContextSwitch Action > Helper: > > http://woo.ly/9it > > It is a plugin for the Zend MVC system that detects what format you're > requesting a page in, using explicitly set context (format) in the > page request: > > http://myzendapp.com/module/controller/action?format=json > (?format=json sets the context to JSON encoding) > > or automatically detecting the context based on the request type. For > example, many JavaScript frameworks submit a special header to > differentiate an AJAX request from a standard HTTP request. The > ContextSwitch (in this case the AjaxContext) will detect this and > seamlessly deliver JSON. Other useful features include disabling > layouts, automatically encoding output to JSON and rerouting request > based on context type. > > Granted you'll have to work with Zend MVC, so this isn't a general > solution to the problem, but perhaps you can glean some theory of > operation from the way that they have set it up. Hi Jake, thanks for the info. The context switching I can manage pretty easily, but it's the actual rendering and output of the data in the format needed for JSON. I don't see any examples from the above links on how the template/data output is actually handled - have you seen any examples of this? H > On Wed, Jul 15, 2009 at 10:31 AM, Hans Zaunere > wrote: > > Hello, > > > > As I work with and need to support JSON applications more and more, I > > quickly remember why the mantra "don't use javascript" from > yesteryear was > > in place. ?Worse, perhaps, is how the browser and server need to > interface > > with each other in complex JSON based applications. > > > > We're all familiar with the typical MVC pattern, and the use of > templates to > > organize and manipulate fragments of HTML/etc. ?This is a very well > solved > > problem that's been established for years. > > > > Web 2.0, if you will, is "fragment" requests/responses. ?I think of > this as > > the basic Ajax type of website, whereby the server is now sending > back these > > fragments of HTML rather than assembling them into complete documents > and > > sending that back. ?The Javascript on the browser actually assembles > and > > moves things around as needed on the client side. > > > > Web 3.0 (insert kitsch marketing term here), I've found as being the > > complete manipulation, in real time, of nearly the entire document. > ?Vast > > chunks of the document are living and breathing, and being effected > by > > events, timers, user interaction, server polling, etc. > > > > In order to the support this, a high degree of granularity for > dealing with > > HTML tags and IDs is needed. ?Using fragments as we did in Web 2.0 > doesn't > > provide this level of granularity so pure JSON is required. ?What > this means > > (to me) basically is that tag content itself or even elemental HTML > > fragments (very small chunks, like single p, h1, img, etc) need to be > > manipulated both on the server and browser side. > > > > The problem with this, however, is that it causes the server-side to > retrace > > to the ugly days of mixing and mashing PHP/HTML/etc. ?For example, to > push > > out a set of IDs to the client, I no longer use a template to spit > back a > > fragment. ?Rather, I put tags and data into an array directly, and > then > > json_encode() that, and send that back to the client. > > > > For example, a dynamic forum type of thing: > > > > $JSON['ID']["mi_$GID"] = " >ImagesURL}lr/icon_phone.png\" > > />"; > > > > $JSON['ID']["bl_$GID"] = "{$M->BylineDate} | {$M->FirstName} > > {$M->LastName}"; > > > > $JSON['ID']["rcb_$GID"] = $M->ReplyCount; > > > > $JSON['ID']["hc_$GID"] = $M->Title; > > > > echo json_encode($JSON['ID']); > > > > > > The Javascript then takes each element from the array and manipulates > the > > DOM as appropriate. ?Why not just stuff things in innerHTML you may > ask? > > Because that's not granular enough, and should the user be > interactive with > > that particular element, the user has just lost his current state. > > > > So hopefully others have run into these types of issues and I'm > curious as > > to how others deal with it. ?Thoughts, experiences, etc? ?I've > thought about > > how to use some type of elemental templating, but there doesn't > appear to be > > anything that's a fit for this type of thing. ?And no easy way I can > think > > of for building something to handle this. > > > > Or, perhaps I'm completely missing some elementary concept that makes > all > > this moot...? > > > > Looking forward to everyone's thoughts. > > > > H > > > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From lists at zaunere.com Wed Jul 15 11:59:32 2009 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 15 Jul 2009 11:59:32 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: References: <075701ca0558$e84753d0$b8d5fb70$@com> Message-ID: <07b701ca0565$3df654f0$b9e2fed0$@com> > > The Javascript then takes each element from the array and manipulates the > > DOM as appropriate. Why not just stuff things in innerHTML you may ask? > > Because that's not granular enough, and should the user be interactive with > > that particular element, the user has just lost his current state. > > Maybe you need a javascript template system? That way you would only > be passing data in JSON, and then coercing that into a template on the > client side. Template may == DOM-building-function if that's more > suitable than string replacement and innerHTML stuffing. > > In other words, if the client knows how to add events to a calendar > (using DOM), then you can just send a stream of event details using > JSON. Very lightweight on the server side, and you're not mixing > markup and data anymore. > > As a bonus, that approach sets you up for thinking in terms of a local > database, which leads to offline functionality. So I think I see what you're saying. Keep all markup (aside from perhaps the initial request) off the server. I thought about this, and played around with it a bit. There are a couple of problems, or at least contradictions... -- everyone I talk to says do as much as you can on the server -- and with good reason, since complex JS is just a hack after another -- if I do only receive raw "bare-metal" data points via JSON from the server, it seems that the JS complexity gets astronomic, which has obvious problems and frankly greatly reduces overall application agility in my opinion (ie, markup structure, visual appearance, and application logic are once again lumped together). Seems as though it's 2003 again... Is this what you mean by JS templating, or is there some techniques/examples that are better/easier/faster/cheaper? H From chsnyder at gmail.com Wed Jul 15 12:06:03 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Wed, 15 Jul 2009 12:06:03 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <07b701ca0565$3df654f0$b9e2fed0$@com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <07b701ca0565$3df654f0$b9e2fed0$@com> Message-ID: On Wed, Jul 15, 2009 at 11:59 AM, Hans Zaunere wrote: > So I think I see what you're saying. ?Keep all markup (aside from perhaps the initial request) off the server. > > I thought about this, and played around with it a bit. ?There are a couple of problems, or at least contradictions... > > -- everyone I talk to says do as much as you can on the server > > -- and with good reason, since complex JS is just a hack after another > > -- if I do only receive raw "bare-metal" data points via JSON from the server, it seems that the JS complexity gets astronomic, which has obvious problems and frankly greatly reduces overall application agility in my opinion (ie, markup structure, visual appearance, and application logic are once again lumped together). > It's just another type of file. You can have the front-end request the template, and then the data if you like. You could even send the template with the data, although that seems icky to me. Point is, there's as little reason to mix your template js with your logic js or framework as there is to mix template php with action php. But yes, your application has expanded. You now have one model, but two view/controller sets. > Seems as though it's 2003 again... > Yes, but with closures. :-) From lists at zaunere.com Wed Jul 15 12:35:19 2009 From: lists at zaunere.com (Hans Zaunere) Date: Wed, 15 Jul 2009 12:35:19 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: References: <075701ca0558$e84753d0$b8d5fb70$@com> <07b701ca0565$3df654f0$b9e2fed0$@com> Message-ID: <07ca01ca056a$3de99170$b9bcb450$@com> > > So I think I see what you're saying. Keep all markup (aside from > > perhaps the initial request) off the server. > > > > I thought about this, and played around with it a bit. There are a > > couple of problems, or at least contradictions... > > > > -- everyone I talk to says do as much as you can on the server > > > > -- and with good reason, since complex JS is just a hack after another > > > > -- if I do only receive raw "bare-metal" data points via JSON from > > the server, it seems that the JS complexity gets astronomic, which has > > obvious problems and frankly greatly reduces overall application > > agility in my opinion (ie, markup structure, visual appearance, and > > application logic are once again lumped together). > > > > It's just another type of file. You can have the front-end request the > template, and then the data if you like. You could even send the > template with the data, although that seems icky to me. > > Point is, there's as little reason to mix your template js with your > logic js or framework as there is to mix template php with action php. > But yes, your application has expanded. You now have one model, but > two view/controller sets. Yeah definitely there's no problem with various types of output contexts as Jake pointed out. We've been doing this for a while - XML for web services, HTML for web sites, CSV sometimes, etc. But what would a template for this look like? What I'm having trouble streamlining is what those actual templates look like. They're not outputting dynamically generated text anymore, per se. They're outputting low level data structures (like an array) which classic templating doesn't seem to jive with. The quick correlation to existing template methodology, in my opinion, would be to build the JSON "markup" directly, just like we've done for HTML/XML, using presentation logic and the template engine. For example something roughly like this: [" {\"MessageGID\":\"MessageGID?>\", \"LRGID\":\"LRGID?>\", \"AccountGID\":\"AccountGID?>\", \"Status\":Status?>}, \"mi_\":\"ImgSrc?>" \\\/>\" "] Where $Messages/$M are adapted object that correctly escapes/formats things for the JSON syntax - just like they've done for HTML. But obviously this negates the need for json_encode(). Is this what people are doing? Say it ain't so... > > Seems as though it's 2003 again... > > > > Yes, but with closures. :-) Yah - say it ain't so :) H From ajai at bitblit.net Wed Jul 15 12:39:00 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 15 Jul 2009 12:39:00 -0400 (EDT) Subject: [nycphp-talk] JSON and MVC In-Reply-To: Message-ID: On Wed, 15 Jul 2009, Jake McGraw wrote: > It is a plugin for the Zend MVC system that detects what format you're > requesting a page in, using explicitly set context (format) in the Support for different output formats like this is built-in to symfony since 1.1: http://www.symfony-project.org/blog/2008/06/09/how-to-create-an-optimized-version-of-your-website-for-the-iphone-in-symfony-1-1 -- Aj. From jmcgraw1 at gmail.com Wed Jul 15 12:56:57 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Wed, 15 Jul 2009 12:56:57 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <07aa01ca0564$347baf70$9d730e50$@com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <07aa01ca0564$347baf70$9d730e50$@com> Message-ID: On Wed, Jul 15, 2009 at 11:52 AM, Hans Zaunere wrote: >> I've had great success using Zend Framework ContextSwitch Action >> Helper: >> >> http://woo.ly/9it >> >> It is a plugin for the Zend MVC system that detects what format you're >> requesting a page in, using explicitly set context (format) in the >> page request: >> >> http://myzendapp.com/module/controller/action?format=json >> (?format=json sets the context to JSON encoding) >> >> or automatically detecting the context based on the request type. For >> example, many JavaScript frameworks submit a special header to >> differentiate an AJAX request from a standard HTTP request. The >> ContextSwitch (in this case the AjaxContext) will detect this and >> seamlessly deliver JSON. Other useful features include disabling >> layouts, automatically encoding output to JSON and rerouting request >> based on context type. >> >> Granted you'll have to work with Zend MVC, so this isn't a general >> solution to the problem, but perhaps you can glean some theory of >> operation from the way that they have set it up. > > Hi Jake, thanks for the info. ?The context switching I can manage pretty > easily, but it's the actual rendering and output of the data in the format > needed for JSON. > > I don't see any examples from the above links on how the template/data > output is actually handled - have you seen any examples of this? > See: http://jakemcgraw.com/php/zend/ContextSwitchExample.html There are four actions, three of which will switch into Ajax mode if the request originated from XHR: The "view" action will disable the layout and render the "comment/view.ajax.phtml" template if requested via Ajax. The "form" action will disable the layout and render the "comment/form.ajax.phtml" template if requested via Ajax. The "process" action will disable the layout and view rendering, and dump a JSON encoding of the "$this->view" member if requested via Ajax. It also sends an updated Content-type header. Finally, the "index" action will use the layout and render the "comment/index.phtml" template regardless of being requested via a normal request or XHR. So, ContextSwitch not only directs request to the correct action, but also points to the correct template (or for JSON, simply dumps the variables). Hope that helps! - jake > H > > >> On Wed, Jul 15, 2009 at 10:31 AM, Hans Zaunere >> wrote: >> > Hello, >> > >> > As I work with and need to support JSON applications more and more, I >> > quickly remember why the mantra "don't use javascript" from >> yesteryear was >> > in place. ?Worse, perhaps, is how the browser and server need to >> interface >> > with each other in complex JSON based applications. >> > >> > We're all familiar with the typical MVC pattern, and the use of >> templates to >> > organize and manipulate fragments of HTML/etc. ?This is a very well >> solved >> > problem that's been established for years. >> > >> > Web 2.0, if you will, is "fragment" requests/responses. ?I think of >> this as >> > the basic Ajax type of website, whereby the server is now sending >> back these >> > fragments of HTML rather than assembling them into complete documents >> and >> > sending that back. ?The Javascript on the browser actually assembles >> and >> > moves things around as needed on the client side. >> > >> > Web 3.0 (insert kitsch marketing term here), I've found as being the >> > complete manipulation, in real time, of nearly the entire document. >> ?Vast >> > chunks of the document are living and breathing, and being effected >> by >> > events, timers, user interaction, server polling, etc. >> > >> > In order to the support this, a high degree of granularity for >> dealing with >> > HTML tags and IDs is needed. ?Using fragments as we did in Web 2.0 >> doesn't >> > provide this level of granularity so pure JSON is required. ?What >> this means >> > (to me) basically is that tag content itself or even elemental HTML >> > fragments (very small chunks, like single p, h1, img, etc) need to be >> > manipulated both on the server and browser side. >> > >> > The problem with this, however, is that it causes the server-side to >> retrace >> > to the ugly days of mixing and mashing PHP/HTML/etc. ?For example, to >> push >> > out a set of IDs to the client, I no longer use a template to spit >> back a >> > fragment. ?Rather, I put tags and data into an array directly, and >> then >> > json_encode() that, and send that back to the client. >> > >> > For example, a dynamic forum type of thing: >> > >> > $JSON['ID']["mi_$GID"] = "> >ImagesURL}lr/icon_phone.png\" >> > />"; >> > >> > $JSON['ID']["bl_$GID"] = "{$M->BylineDate} | {$M->FirstName} >> > {$M->LastName}"; >> > >> > $JSON['ID']["rcb_$GID"] = $M->ReplyCount; >> > >> > $JSON['ID']["hc_$GID"] = $M->Title; >> > >> > echo json_encode($JSON['ID']); >> > >> > >> > The Javascript then takes each element from the array and manipulates >> the >> > DOM as appropriate. ?Why not just stuff things in innerHTML you may >> ask? >> > Because that's not granular enough, and should the user be >> interactive with >> > that particular element, the user has just lost his current state. >> > >> > So hopefully others have run into these types of issues and I'm >> curious as >> > to how others deal with it. ?Thoughts, experiences, etc? ?I've >> thought about >> > how to use some type of elemental templating, but there doesn't >> appear to be >> > anything that's a fit for this type of thing. ?And no easy way I can >> think >> > of for building something to handle this. >> > >> > Or, perhaps I'm completely missing some elementary concept that makes >> all >> > this moot...? >> > >> > Looking forward to everyone's thoughts. >> > >> > H >> > >> > >> > _______________________________________________ >> > New York PHP User Group Community Talk Mailing List >> > http://lists.nyphp.org/mailman/listinfo/talk >> > >> > http://www.nyphp.org/show_participation.php >> > >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From chsnyder at gmail.com Wed Jul 15 14:22:11 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Wed, 15 Jul 2009 14:22:11 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <07ca01ca056a$3de99170$b9bcb450$@com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <07b701ca0565$3df654f0$b9e2fed0$@com> <07ca01ca056a$3de99170$b9bcb450$@com> Message-ID: On Wed, Jul 15, 2009 at 12:35 PM, Hans Zaunere wrote: > But what would a template for this look like? ?What I'm having trouble streamlining is what those actual templates look like. ?They're not outputting dynamically generated text anymore, per se. ?They're outputting low level data structures (like an array) which classic templating doesn't seem to jive with. So say I want to end up with a series of messages that look like:

Message Subject

Posted by Author on Date

Lorem ipsum dolor sit amet...
...
So I create a template function that renders a message from a data structure (obj) and attaches it to some container element (using MochiKit DOM functions): // template / view // note, this code assumes that data properties already been html escaped... function appendMessageFromData( element, data ) { var newDOM = DIV( {"id": data.id, "class": "message"}, H3( data.subject ), P( "Posted by " + data.author + " on " + data.date ), DIV( {"class": "content"}, data.content ) ); element.appendChild( newDOM ); } // controller //var messages = loadJSONDoc(url); var messages = [ { "id": "123abc", "subject": "First Post", "author": "Hans Zaunere", "date": "July 15, 2009", "content": "Lorem ipsum dolor sit amet" }, ... ]; // append messages to #Messages for( var i=0; i > The quick correlation to existing template methodology, in my opinion, would be to build the JSON "markup" directly, just like we've done for HTML/XML, using presentation logic and the template engine. ?For example something roughly like this: > > [" > > {\"MessageGID\":\"MessageGID?>\", > \"LRGID\":\"LRGID?>\", > \"AccountGID\":\"AccountGID?>\", > \"Status\":Status?>}, > \"mi_\":\"ImgSrc?>" \\\/>\" > > "] > But that's harder than just building an array of key=>value pairs and then calling json_encode(). Think of JSON as the Model in MVC. You PHP code is exporting the data model to this other MVC app that runs on the client. I don't get why you'd want to do everything on the server? Offloading it to the client is a little harder to get right, but it scales like crazy once you do. From tim_lists at o2group.com Wed Jul 15 14:31:28 2009 From: tim_lists at o2group.com (Tim Lieberman) Date: Wed, 15 Jul 2009 14:31:28 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <07b701ca0565$3df654f0$b9e2fed0$@com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <07b701ca0565$3df654f0$b9e2fed0$@com> Message-ID: <9B1B3B33-1AE1-4920-B645-47856899E809@o2group.com> On Jul 15, 2009, at 11:59 AM, Hans Zaunere wrote: > > So I think I see what you're saying. Keep all markup (aside from > perhaps the initial request) off the server. > > I thought about this, and played around with it a bit. There are a > couple of problems, or at least contradictions... > > -- everyone I talk to says do as much as you can on the server Why? In the sort of app you're describing, the view code is (mostly, almost nearly entirely) javascript. > -- and with good reason, since complex JS is just a hack after another Don't fear the javascript. With the various compatibility/helper libraries, it's actually a pretty predictable environment to work in. Look at what the ExtJS guys have done, for example. Your typical "do a desktop-style-app-in-a-browser" application has only enough HTML to output a script tag or two and load a stylesheet. > -- if I do only receive raw "bare-metal" data points via JSON from > the server, it seems that the JS complexity gets astronomic, which > has obvious problems and frankly greatly reduces overall application > agility in my opinion (ie, markup structure, visual appearance, and > application logic are once again lumped together). Yes, the javascript gets complicated, but you can abstract a lot of that, with a little elbow grease. You end up with a javascript environment that looks a lot like the event-driven kind of environment from desktop UI libraries. Now, this kind of architecture isn't going to degrade, let alone gracefully, if the user doesn't have javascript, but in many cases that ends up being acceptable. From y2rob at aol.com Wed Jul 15 15:53:08 2009 From: y2rob at aol.com (y2rob at aol.com) Date: Wed, 15 Jul 2009 15:53:08 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <9B1B3B33-1AE1-4920-B645-47856899E809@o2group.com> References: <075701ca0558$e84753d0$b8d5fb70$@com><07b701ca0565$3df654f0$b9e2fed0$@com> <9B1B3B33-1AE1-4920-B645-47856899E809@o2group.com> Message-ID: <8CBD39D0295614B-15D0-3A2@WEBMAIL-DZ34.sysops.aol.com> hello, yeah i'd look into extjs. ?i'm working with extjs now and all you need to do is pass it json and it will render grids for you based off a store you define in extjs calling your rest/service/gateway that renders the json. ?there are minor things you need to do like define a root for the data within your json as well as the meta data for the columns associated with the data in order to render the grid, but that's not too difficult to do. ?i might suggest creating a method to do this with the db abstraction you're using. there is sorting, all done in extjs and done on the javascript level without having to make callbacks to your backend code. i'd use the latest before 3.0, that way you can use plugins, which haven't been ported over yet. have fun, ~rob -----Original Message----- From: Tim Lieberman To: NYPHP Talk Sent: Wed, Jul 15, 2009 2:31 pm Subject: Re: [nycphp-talk] JSON and MVC On Jul 15, 2009, at 11:59 AM, Hans Zaunere wrote:? ? >? > So I think I see what you're saying. Keep all markup (aside from > perhaps the initial request) off the server.? >? > I thought about this, and played around with it a bit. There are a > couple of problems, or at least contradictions...? >? > -- everyone I talk to says do as much as you can on the server? ? Why? In the sort of app you're describing, the view code is (mostly, almost nearly entirely) javascript.? ? > -- and with good reason, since complex JS is just a hack after another? ? Don't fear the javascript. With the various compatibility/helper libraries, it's actually a pretty predictable environment to work in.? ? Look at what the ExtJS guys have done, for example. Your typical "do a desktop-style-app-in-a-browser" application has only enough HTML to output a script tag or two and load a stylesheet.? ? > -- if I do only receive raw "bare-metal" data points via JSON from > the server, it seems that the JS complexity gets astronomic, which > has obvious problems and frankly greatly reduces overall application > agility in my opinion (ie, markup structure, visual appearance, and > application logic are once again lumped together).? ? Yes, the javascript gets complicated, but you can abstract a lot of that, with a little elbow grease.? ? You end up with a javascript environment that looks a lot like the event-driven kind of environment from desktop UI libraries.? ? Now, this kind of architecture isn't going to degrade, let alone gracefully, if the user doesn't have javascript, but in many cases that ends up being acceptable.? ? _______________________________________________? New York PHP User Group Community Talk Mailing List? http://lists.nyphp.org/mailman/listinfo/talk? ? http://www.nyphp.org/show_participation.php? -------------- next part -------------- An HTML attachment was scrubbed... URL: From arzala at gmail.com Thu Jul 16 00:42:50 2009 From: arzala at gmail.com (Anirudhsinh Zala) Date: Thu, 16 Jul 2009 10:12:50 +0530 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <075701ca0558$e84753d0$b8d5fb70$@com> References: <075701ca0558$e84753d0$b8d5fb70$@com> Message-ID: <200907161012.50901.arzala@gmail.com> On Wednesday 15 Jul 2009 8:01:14 pm Hans Zaunere wrote: > Hello, > > As I work with and need to support JSON applications more and more, I > quickly remember why the mantra "don't use javascript" from yesteryear was > in place. Worse, perhaps, is how the browser and server need to interface > with each other in complex JSON based applications. > > We're all familiar with the typical MVC pattern, and the use of templates > to organize and manipulate fragments of HTML/etc. This is a very well > solved problem that's been established for years. > > Web 2.0, if you will, is "fragment" requests/responses. I think of this as > the basic Ajax type of website, whereby the server is now sending back > these fragments of HTML rather than assembling them into complete documents > and sending that back. The Javascript on the browser actually assembles > and moves things around as needed on the client side. > > Web 3.0 (insert kitsch marketing term here), I've found as being the > complete manipulation, in real time, of nearly the entire document. Vast > chunks of the document are living and breathing, and being effected by > events, timers, user interaction, server polling, etc. > > In order to the support this, a high degree of granularity for dealing with > HTML tags and IDs is needed. Using fragments as we did in Web 2.0 doesn't > provide this level of granularity so pure JSON is required. What this > means (to me) basically is that tag content itself or even elemental HTML > fragments (very small chunks, like single p, h1, img, etc) need to be > manipulated both on the server and browser side. > > The problem with this, however, is that it causes the server-side to > retrace to the ugly days of mixing and mashing PHP/HTML/etc. For example, > to push out a set of IDs to the client, I no longer use a template to spit > back a fragment. Rather, I put tags and data into an array directly, and > then json_encode() that, and send that back to the client. > > For example, a dynamic forum type of thing: > > $JSON['ID']["mi_$GID"] = "ImagesURL}lr/icon_phone.png\" > />"; > > $JSON['ID']["bl_$GID"] = "{$M->BylineDate} | {$M->FirstName} > {$M->LastName}"; > > $JSON['ID']["rcb_$GID"] = $M->ReplyCount; > > $JSON['ID']["hc_$GID"] = $M->Title; > > echo json_encode($JSON['ID']); > > > The Javascript then takes each element from the array and manipulates the > DOM as appropriate. Why not just stuff things in innerHTML you may ask? > Because that's not granular enough, and should the user be interactive with > that particular element, the user has just lost his current state. > > So hopefully others have run into these types of issues and I'm curious as > to how others deal with it. Thoughts, experiences, etc? I've thought > about how to use some type of elemental templating, but there doesn't > appear to be anything that's a fit for this type of thing. And no easy way > I can think of for building something to handle this. > > Or, perhaps I'm completely missing some elementary concept that makes all > this moot...? There are 2 possible solutions, if I have understood your problem correctly. 1st: If presentation logic and data both would be sent in certain format say JSON, then why not just to send whole rendered document in HTML to client and let DOM just display it. Why DOM has to bother about parsing those data and presentation logic 1st into JS and then displaying into browser? You may ask that purposes are to minimize server parsing, save bandwidth or faster transmission. They are correct but then if data is of small amount then you can just send complete rendered HTML to client to just display it using Ajax as said above 2nd: But if there are large amount of data and/or JSON is must to use then XSLT type of technology is needed preloaded at client side where DOM would read that rendering information from there and read data from JSON and then display it in browser. In short those XSLT/JSLT would be called as JS templates as said by Chris. Thanks Anirudh Zala > > Looking forward to everyone's thoughts. > > H > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From chendry at gmail.com Fri Jul 17 10:06:39 2009 From: chendry at gmail.com (Christopher Hendry) Date: Fri, 17 Jul 2009 10:06:39 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: References: <075701ca0558$e84753d0$b8d5fb70$@com> <07b701ca0565$3df654f0$b9e2fed0$@com> <07ca01ca056a$3de99170$b9bcb450$@com> Message-ID: <769e4ce0907170706x7ee4e3cdsb4f831e19683956c@mail.gmail.com> As Anirudh and Snyder (and pretty much everyone else) has said, it comes down to either innerHTML and blocks of server-side rendered HTML or js templating. I'm curious though about javascript's introspection abilities, might it be possible for an element to look into itself (or clone its children) and render from there? Working from Snyder's example (and thanks Chris, I didn't know about MochiKit) can we expand to include the data elements in the original template? >
>
>

Message Subject

>

Posted by Author on data_element="date">Date

>
> Lorem ipsum dolor sit amet... >
>
> ... >
> > Then all of the javascript/function/templating (appendMessageFromData) which you'd need to create for each active element - rewriting yet another view for your templates - gets abstracted into one method (which it's too early for me to write). My point is, we already have the view, the first time the page is rendered. I guess this is the XSLT/JSLT approach that Anirudh mentioned, but I still get sick to my stomach when I hear XSLT. Though I haven't used it, the thought of JSLT makes me shiver... I don't get why you'd want to do everything on the server? Offloading > it to the client is a little harder to get right, but it scales like > crazy once you do. > > Overall, I still use innerHTML for the most part, unless I'm doing something that is strictly key=>values (like select elements) mostly because I'm still concerned about the client's parsing abilities. Sure, _we_ all have sleek computers and fast browsers, but most people don't. So, yes, offloading to the client makes sense (until the next browser comes along and screws things up), but as we approach Web 3.0 I'm concerned about request/response/parse/render overhead for the average user - sure it scales, until the next version on windows comes out. The real question is - why is it that I live in the middle of the Catskills and it's nearly impossible to find decent firewood? - Chris -- "When you do things right, people won't be sure you've done anything at all." -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri Jul 17 11:03:05 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Fri, 17 Jul 2009 11:03:05 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <769e4ce0907170706x7ee4e3cdsb4f831e19683956c@mail.gmail.com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <07b701ca0565$3df654f0$b9e2fed0$@com> <07ca01ca056a$3de99170$b9bcb450$@com> <769e4ce0907170706x7ee4e3cdsb4f831e19683956c@mail.gmail.com> Message-ID: On Fri, Jul 17, 2009 at 10:06 AM, Christopher Hendry wrote: > I'm curious though about javascript's introspection abilities, might it be > possible for an element to look into itself (or clone its children) and > render from there? Yes! I've seen schemes that used class names () or custom attributes (data_element="subject") like you used in your example. If you've managed to escape the tyranny of strict markup, then custom attributes probably make the most sense. > Overall, I still use innerHTML for the most part, unless I'm doing something > that is strictly key=>values (like select elements) mostly because I'm still > concerned about the client's parsing abilities.? Sure, _we_ all have sleek > computers and fast browsers, but most people don't.? So, yes, offloading to > the client makes sense (until the next browser comes along and screws things > up), but as we approach Web 3.0 I'm concerned about > request/response/parse/render overhead for the average user - sure it > scales, until the next version on windows comes out. The only disadvantage I've seen to wanton innerHTML replacement is that you lose any events or listeners that you might have attached in the soup somewhere. Maybe other folks have other reasons, besides just an irrational love of DOM methods. From michael.southwell at nyphp.com Fri Jul 17 11:51:02 2009 From: michael.southwell at nyphp.com (Michael Southwell) Date: Fri, 17 Jul 2009 11:51:02 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <769e4ce0907170706x7ee4e3cdsb4f831e19683956c@mail.gmail.com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <07b701ca0565$3df654f0$b9e2fed0$@com> <07ca01ca056a$3de99170$b9bcb450$@com> <769e4ce0907170706x7ee4e3cdsb4f831e19683956c@mail.gmail.com> Message-ID: <4A609DE6.8050807@nyphp.com> Christopher Hendry wrote: > The real question is - why is it that I live in the middle of the > Catskills and it's nearly impossible to find decent firewood? uhh, find? What kind of chainsaw do you have? -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From krozinov at gmail.com Fri Jul 17 13:47:06 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Fri, 17 Jul 2009 13:47:06 -0400 Subject: [nycphp-talk] Using APC to improve performance. In-Reply-To: <117286890903302149j40391042j13468768fd6ecafd@mail.gmail.com> References: <865a7acf0903301703y595b79a9w1c97802763c74a9f@mail.gmail.com> <117286890903302149j40391042j13468768fd6ecafd@mail.gmail.com> Message-ID: <865a7acf0907171047o25cb4659m2ecb0c8f337609f9@mail.gmail.com> Hey guys, Just a follow-up question about APC. In production, I have apc.stat set to 0, so files aren't stat()ed everytime they're accessed for improved performance. Is it possible to have APC just re-stat() a single configuration file if I made some changes to it (without setting apc.stat to 0 and restarting apache) ? Thanks for any insights, Konstantin On Tue, Mar 31, 2009 at 12:49 AM, Tom Melendez wrote: >> 4. Any links to really good APC howtos or tutorials would be greatly >> appreciated! >> > > Not at all what you asked, but.... > > If you're using absolute paths in your require/include files and you > turn this off you should see gains: > > http://us.php.net/manual/en/apc.configuration.php#ini.apc.stat > > In setting it to zero, you tell it not to stat the file. ?If you are > using some beefy framework with lots of includes this can be a big > win. > > Leave it set to 1 for development though. > > Thanks, > > Tom > http://www.liphp.org > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From oorza2k5 at gmail.com Fri Jul 17 14:23:24 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Fri, 17 Jul 2009 14:23:24 -0400 Subject: [nycphp-talk] Using APC to improve performance. In-Reply-To: <865a7acf0907171047o25cb4659m2ecb0c8f337609f9@mail.gmail.com> References: <865a7acf0903301703y595b79a9w1c97802763c74a9f@mail.gmail.com> <117286890903302149j40391042j13468768fd6ecafd@mail.gmail.com> <865a7acf0907171047o25cb4659m2ecb0c8f337609f9@mail.gmail.com> Message-ID: <68de37340907171123g4cf7b6a4oc01efb0031cfa554@mail.gmail.com> On Fri, Jul 17, 2009 at 1:47 PM, Konstantin Rozinov wrote: > Hey guys, > > Just a follow-up question about APC. > > In production, I have apc.stat set to 0, so files aren't stat()ed > everytime they're accessed for improved performance. > Is it possible to have APC just re-stat() a single configuration file > if I made some changes to it ?(without setting apc.stat to 0 and > restarting apache) ? > > Thanks for any insights, > Konstantin > > > > On Tue, Mar 31, 2009 at 12:49 AM, Tom Melendez wrote: >>> 4. Any links to really good APC howtos or tutorials would be greatly >>> appreciated! >>> >> >> Not at all what you asked, but.... >> >> If you're using absolute paths in your require/include files and you >> turn this off you should see gains: >> >> http://us.php.net/manual/en/apc.configuration.php#ini.apc.stat >> >> In setting it to zero, you tell it not to stat the file. ?If you are >> using some beefy framework with lots of includes this can be a big >> win. >> >> Leave it set to 1 for development though. >> >> Thanks, >> >> Tom >> http://www.liphp.org >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > Manually compile it with apc_compile_file(). From krozinov at gmail.com Fri Jul 17 15:37:41 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Fri, 17 Jul 2009 15:37:41 -0400 Subject: [nycphp-talk] Using APC to improve performance. In-Reply-To: <68de37340907171123g4cf7b6a4oc01efb0031cfa554@mail.gmail.com> References: <865a7acf0903301703y595b79a9w1c97802763c74a9f@mail.gmail.com> <117286890903302149j40391042j13468768fd6ecafd@mail.gmail.com> <865a7acf0907171047o25cb4659m2ecb0c8f337609f9@mail.gmail.com> <68de37340907171123g4cf7b6a4oc01efb0031cfa554@mail.gmail.com> Message-ID: <865a7acf0907171237y4c3bbe58sed3e0bd9a9dc718@mail.gmail.com> Ah yes! I should've been more careful reading the documentation. Thanks for the tip! Konstantin On Fri, Jul 17, 2009 at 2:23 PM, Eddie Drapkin wrote: > On Fri, Jul 17, 2009 at 1:47 PM, Konstantin Rozinov wrote: >> Hey guys, >> >> Just a follow-up question about APC. >> >> In production, I have apc.stat set to 0, so files aren't stat()ed >> everytime they're accessed for improved performance. >> Is it possible to have APC just re-stat() a single configuration file >> if I made some changes to it ?(without setting apc.stat to 0 and >> restarting apache) ? >> >> Thanks for any insights, >> Konstantin >> >> >> >> On Tue, Mar 31, 2009 at 12:49 AM, Tom Melendez wrote: >>>> 4. Any links to really good APC howtos or tutorials would be greatly >>>> appreciated! >>>> >>> >>> Not at all what you asked, but.... >>> >>> If you're using absolute paths in your require/include files and you >>> turn this off you should see gains: >>> >>> http://us.php.net/manual/en/apc.configuration.php#ini.apc.stat >>> >>> In setting it to zero, you tell it not to stat the file. ?If you are >>> using some beefy framework with lots of includes this can be a big >>> win. >>> >>> Leave it set to 1 for development though. >>> >>> Thanks, >>> >>> Tom >>> http://www.liphp.org >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >>> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > Manually compile it with apc_compile_file(). > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From oorza2k5 at gmail.com Fri Jul 17 15:55:39 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Fri, 17 Jul 2009 15:55:39 -0400 Subject: [nycphp-talk] Using APC to improve performance. In-Reply-To: <865a7acf0907171237y4c3bbe58sed3e0bd9a9dc718@mail.gmail.com> References: <865a7acf0903301703y595b79a9w1c97802763c74a9f@mail.gmail.com> <117286890903302149j40391042j13468768fd6ecafd@mail.gmail.com> <865a7acf0907171047o25cb4659m2ecb0c8f337609f9@mail.gmail.com> <68de37340907171123g4cf7b6a4oc01efb0031cfa554@mail.gmail.com> <865a7acf0907171237y4c3bbe58sed3e0bd9a9dc718@mail.gmail.com> Message-ID: <68de37340907171255h7dbf1a08l21760ed83dfe1b34@mail.gmail.com> No problem, took me a while to figure out why that function existed a few weeks back ;) On Fri, Jul 17, 2009 at 3:37 PM, Konstantin Rozinov wrote: > Ah yes! ?I should've been more careful reading the documentation. > > Thanks for the tip! > > Konstantin > > On Fri, Jul 17, 2009 at 2:23 PM, Eddie Drapkin wrote: >> On Fri, Jul 17, 2009 at 1:47 PM, Konstantin Rozinov wrote: >>> Hey guys, >>> >>> Just a follow-up question about APC. >>> >>> In production, I have apc.stat set to 0, so files aren't stat()ed >>> everytime they're accessed for improved performance. >>> Is it possible to have APC just re-stat() a single configuration file >>> if I made some changes to it ?(without setting apc.stat to 0 and >>> restarting apache) ? >>> >>> Thanks for any insights, >>> Konstantin >>> >>> >>> >>> On Tue, Mar 31, 2009 at 12:49 AM, Tom Melendez wrote: >>>>> 4. Any links to really good APC howtos or tutorials would be greatly >>>>> appreciated! >>>>> >>>> >>>> Not at all what you asked, but.... >>>> >>>> If you're using absolute paths in your require/include files and you >>>> turn this off you should see gains: >>>> >>>> http://us.php.net/manual/en/apc.configuration.php#ini.apc.stat >>>> >>>> In setting it to zero, you tell it not to stat the file. ?If you are >>>> using some beefy framework with lots of includes this can be a big >>>> win. >>>> >>>> Leave it set to 1 for development though. >>>> >>>> Thanks, >>>> >>>> Tom >>>> http://www.liphp.org >>>> _______________________________________________ >>>> New York PHP User Group Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> http://www.nyphp.org/show_participation.php >>>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >>> >> >> Manually compile it with apc_compile_file(). >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From dorgan at donaldorgan.com Fri Jul 17 15:59:02 2009 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Fri, 17 Jul 2009 15:59:02 -0400 (EDT) Subject: [nycphp-talk] Zend Gdata Message-ID: <15073601.10451247860742040.JavaMail.root@twoguyshosting.com.> Has anyone done any work with Zend Gdata and more specifically Gbase?? I am trying to adding the shipping field to the gbase item entry but it seems that I need to add child elements in order to do so, anyone know how to do that? The exact error I am getting back is: "Text not allowed in this element. Please specify country, region, service, and price child elements instead. " From seth at ghiek.com Fri Jul 17 16:08:19 2009 From: seth at ghiek.com (Seth J Hersh) Date: Fri, 17 Jul 2009 16:08:19 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <4A609DE6.8050807@nyphp.com> References: <075701ca0558$e84753d0$b8d5fb70$@com><07b701ca0565$3df654f0$b9e2fed0$@com><07ca01ca056a$3de99170$b9bcb450$@com><769e4ce0907170706x7ee4e3cdsb4f831e19683956c@mail.gmail.com> <4A609DE6.8050807@nyphp.com> Message-ID: Hmmmm...i live in the Catskills (near Fleischmanns) and cannot run out of firewood. Seth j hersh -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michael Southwell Sent: Friday, July 17, 2009 11:51 AM To: NYPHP Talk Subject: Re: [nycphp-talk] JSON and MVC Christopher Hendry wrote: > The real question is - why is it that I live in the middle of the > Catskills and it's nearly impossible to find decent firewood? uhh, find? What kind of chainsaw do you have? -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php __________ NOD32 4254 (20090717) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From ajai at bitblit.net Fri Jul 17 18:21:21 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 17 Jul 2009 18:21:21 -0400 (EDT) Subject: [nycphp-talk] Using APC to improve performance. In-Reply-To: <68de37340907171255h7dbf1a08l21760ed83dfe1b34@mail.gmail.com> Message-ID: On Fri, 17 Jul 2009, Eddie Drapkin wrote: > No problem, took me a while to figure out why that function existed a few weeks back ;) How does APC compare to eaccelerator? -- Aj. From oorza2k5 at gmail.com Fri Jul 17 19:42:14 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Fri, 17 Jul 2009 19:42:14 -0400 Subject: [nycphp-talk] Using APC to improve performance. In-Reply-To: References: <68de37340907171255h7dbf1a08l21760ed83dfe1b34@mail.gmail.com> Message-ID: <68de37340907171642m2bdb12b6m77350bdbe0968510@mail.gmail.com> On Fri, Jul 17, 2009 at 6:21 PM, Ajai Khattri wrote: > On Fri, 17 Jul 2009, Eddie Drapkin wrote: > >> No problem, took me a while to figure out why that function existed a > few weeks back ;) > > How does APC compare to eaccelerator? > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > I've tested it to be a little slower. That said, the difference is mostly marginal (<10%) and APC has some really useful other features (apc_store and apc_fetch) and is more closely developed with PHP and afaik APC trunk is the only opcode cache that's properly working with 5.3.0 at the moment. From chendry at gmail.com Fri Jul 17 20:13:04 2009 From: chendry at gmail.com (Christopher Hendry) Date: Fri, 17 Jul 2009 20:13:04 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: References: <075701ca0558$e84753d0$b8d5fb70$@com> <07b701ca0565$3df654f0$b9e2fed0$@com> <07ca01ca056a$3de99170$b9bcb450$@com> <769e4ce0907170706x7ee4e3cdsb4f831e19683956c@mail.gmail.com> <4A609DE6.8050807@nyphp.com> Message-ID: <769e4ce0907171713q517e72f7ob638aa0c07072c60@mail.gmail.com> On Fri, Jul 17, 2009 at 4:08 PM, Seth J Hersh wrote: > Hmmmm...i live in the Catskills (near Fleischmanns) and cannot run out of > firewood. > Nice - we should get the Catskills PHP group started then! I'm in Boiceville. Ok, lemme be more specific. Firewood that doesn't burn up in 3 seconds. I swear, if it wasn't raining so much up here the place would burn down from a spark... -------------- next part -------------- An HTML attachment was scrubbed... URL: From chendry at gmail.com Fri Jul 17 20:20:00 2009 From: chendry at gmail.com (Christopher Hendry) Date: Fri, 17 Jul 2009 20:20:00 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: References: <075701ca0558$e84753d0$b8d5fb70$@com> <07b701ca0565$3df654f0$b9e2fed0$@com> <07ca01ca056a$3de99170$b9bcb450$@com> <769e4ce0907170706x7ee4e3cdsb4f831e19683956c@mail.gmail.com> Message-ID: <769e4ce0907171720y34aba8e5y8a13ac679f15f441@mail.gmail.com> On Fri, Jul 17, 2009 at 11:03 AM, Chris Snyder wrote: > On Fri, Jul 17, 2009 at 10:06 AM, Christopher Hendry > wrote: > > > I'm curious though about javascript's introspection abilities, might it > be > > possible for an element to look into itself (or clone its children) and > > render from there? > > Yes! I've seen schemes that used class names ( class="data_subject">) or custom attributes (data_element="subject") > like you used in your example. If you've managed to escape the tyranny > of strict markup, then custom attributes probably make the most sense. > Damn the doctype! Must admit, as much as I try, I always end up back at strict markup. > > Overall, I still use innerHTML for the most part, unless I'm doing > something > > that is strictly key=>values (like select elements) mostly because I'm > still > > concerned about the client's parsing abilities. Sure, _we_ all have > sleek > > computers and fast browsers, but most people don't. So, yes, offloading > to > > the client makes sense (until the next browser comes along and screws > things > > up), but as we approach Web 3.0 I'm concerned about > > request/response/parse/render overhead for the average user - sure it > > scales, until the next version on windows comes out. > > The only disadvantage I've seen to wanton innerHTML replacement is > that you lose any events or listeners that you might have attached in > the soup somewhere. Maybe other folks have other reasons, besides just > an irrational love of DOM methods. > > Again spoiled by Snyder. Good point. I was wondering about this just the other day - there's no way to force the DOM to refresh itself without actually refreshing the page? C "When you do things right, people won't be sure you've done anything at all." -------------- next part -------------- An HTML attachment was scrubbed... URL: From webmaster at vbplusme.com Sat Jul 18 06:24:15 2009 From: webmaster at vbplusme.com (webmaster at vbplusme.com) Date: Sat, 18 Jul 2009 18:24:15 +0800 Subject: [nycphp-talk] PHP parsing to Javascript questions Message-ID: <1984338636.20090718182415@vbplusme.com> Hello talk, Hello and greetings. I have a standalone javascript that I have customized to do a banner display and I have a PHP script that loads link information into a MySQL. The javascript uses these links currently in its display but the links are manually entered into the javascript data definition, for example: [code] var pausecontent=new Array() pausecontent[0]='' pausecontent[1]='' pausecontent[2]='' pausecontent[3]='' pausecontent[4]='' //the rest of the javascript that processes the array is here [/code] I would like to generate this array information in PHP and insert it into the javascript dynamically. Javascript doesn't have an include and the ones that I have been able to find are pretty ugly. I was thinking that I could use a PHP script to dynamically generate the whole script and storing it or possibly split the javascript into pieces, generate the array (array.js) part of the script dynamically and store the run part(main.js) of it with out the array definition then use php to put them together at run time. For example ( I haven't tested this yet so I don't know if it works): [code] // contents of allscripts.php [/code] // this call would replace the one I am using now The links that populate the array periodically change so I use PHP and MySQL to track and store the most current versions. I want to be able to do a query to populate the array and do a seamless merge into the javascript to do the display. This all seams pretty kludgy to me so I am open to any suggestions about how to do it more elegantly. TIA for any ideas. -- Best regards, From mmwaldman at nyc.rr.com Sat Jul 18 06:58:59 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Sat, 18 Jul 2009 06:58:59 -0400 Subject: [nycphp-talk] PHP parsing to Javascript questions In-Reply-To: <1984338636.20090718182415@vbplusme.com> Message-ID: <20090718110028392.MABD15636@hrndva-omta03.mail.rr.com> This is a long post. When you say dynamically I think of ajax. It sounds like you only need this at runtime though. You could javascript eval and php json formatted variable. The downside is the json contents are visible when the user views source. Do you really need to place the links into javascript to display them? Why not generate the html in the html file as follows. It's added to the dom and you can still manipulate it the javascript. link."'>".$the_json_array[$cnt]->display.""; } ?> Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of webmaster at vbplusme.com > Sent: Saturday, July 18, 2009 6:24 AM > To: talk at lists.nyphp.org > Subject: [nycphp-talk] PHP parsing to Javascript questions > > Hello talk, > > Hello and greetings. > > I have a standalone javascript that I have customized to do a banner > display and I have a PHP script that loads link information into a > MySQL. The javascript uses these links currently in its display but > the links are manually entered into the javascript data definition, > for example: > [code] > > var pausecontent=new Array() > pausecontent[0]='' > pausecontent[1]='' > pausecontent[2]='' > pausecontent[3]='' > pausecontent[4]='' > > //the rest of the javascript that processes the array is here > > [/code] > > I would like to generate this array information in PHP and insert it > into the javascript dynamically. Javascript doesn't have an include > and the ones that I have been able to find are pretty ugly. > > I was thinking that I could use a PHP script to dynamically generate > the whole script and storing it or possibly split the javascript into > pieces, generate the array (array.js) part of the script dynamically and > store > the run part(main.js) of it with out the array definition then use php to > put > them together at run time. For example ( I haven't tested this yet > so I don't know if it works): > > [code] > // contents of allscripts.php > header("Content-Type: text/javascript"); > include "main.js"; > include "array.js"; > ?> > [/code] > > // this call would replace the one I am using now > > > > The links that populate the array periodically change so I use PHP and > MySQL to track and store the most current versions. I want to be able > to do a query to populate the array and do a seamless merge into the > javascript to do the display. > > This all seams pretty kludgy to me so I am open to any suggestions > about how to do it more elegantly. > > TIA for any ideas. > > > -- > Best regards, > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From webmaster at vbplusme.com Sat Jul 18 07:27:29 2009 From: webmaster at vbplusme.com (webmaster at vbplusme.com) Date: Sat, 18 Jul 2009 19:27:29 +0800 Subject: [nycphp-talk] PHP parsing to Javascript questions In-Reply-To: <20090718110028392.MABD15636@hrndva-omta03.mail.rr.com> References: <1984338636.20090718182415@vbplusme.com> <20090718110028392.MABD15636@hrndva-omta03.mail.rr.com> Message-ID: <702304901.20090718192729@vbplusme.com> Hello Michele, Saturday, July 18, 2009, 6:58:59 PM, you wrote: > This is a long post. > When you say dynamically I think of ajax. > It sounds like you only need this at runtime though. > You could javascript eval and php json formatted variable. > The downside is the json contents are visible when the user views source. > Do you really need to place the links into javascript to display them? > Why not generate the html in the html file as follows. It's added to the > dom and you can still manipulate it the javascript. > echo " href='".$the_json_array[$cnt]->link."'>".$the_json_array[$cnt]->display.">"; } ?>> > Michele >> -----Original Message----- >> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >> On Behalf Of webmaster at vbplusme.com >> Sent: Saturday, July 18, 2009 6:24 AM >> To: talk at lists.nyphp.org >> Subject: [nycphp-talk] PHP parsing to Javascript questions >> >> Hello talk, >> >> Hello and greetings. >> >> I have a standalone javascript that I have customized to do a banner >> display and I have a PHP script that loads link information into a >> MySQL. The javascript uses these links currently in its display but >> the links are manually entered into the javascript data definition, >> for example: >> [code] >> >> var pausecontent=new Array() >> pausecontent[0]='' >> pausecontent[1]='' >> pausecontent[2]='' >> pausecontent[3]='' >> pausecontent[4]='' >> >> //the rest of the javascript that processes the array is here >> >> [/code] >> >> I would like to generate this array information in PHP and insert it >> into the javascript dynamically. Javascript doesn't have an include >> and the ones that I have been able to find are pretty ugly. >> >> I was thinking that I could use a PHP script to dynamically generate >> the whole script and storing it or possibly split the javascript into >> pieces, generate the array (array.js) part of the script dynamically and >> store >> the run part(main.js) of it with out the array definition then use php to >> put >> them together at run time. For example ( I haven't tested this yet >> so I don't know if it works): >> >> [code] >> // contents of allscripts.php >> > header("Content-Type: text/javascript"); >> include "main.js"; >> include "array.js"; >> ?> >> [/code] >> >> // this call would replace the one I am using now >> >> >> >> The links that populate the array periodically change so I use PHP and >> MySQL to track and store the most current versions. I want to be able >> to do a query to populate the array and do a seamless merge into the >> javascript to do the display. >> >> This all seams pretty kludgy to me so I am open to any suggestions >> about how to do it more elegantly. >> >> TIA for any ideas. >> >> >> -- >> Best regards, >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org/show_participation.php > __________ Information from ESET NOD32 Antivirus, version of virus > signature database 4256 (20090718) __________ > The message was checked by ESET NOD32 Antivirus. > http://www.eset.com Sorry for the long post, I have been thinking about the problem for a couple of days so my question mushroomed on me, lol. The javascript is loaded in the at runtime inside the head tags from a .js file that contains the arrays and script. I hacked it so that I could run it inside a vBulletin template. The original script only had two or three links and I modified it to accommodate 20. The problem I ended up with is that I have now twenty links inside the javascript and because they need to be "modifiable" because they are sponsor links that occasionally change, I wanted to move them into the database instead of the javascript for easier management. I have to think about how I would implement the json solution and yes, I think ajax might be the real answer but because I do almost all of my mod work in PHP, I was leaning in that direction. thanks for the reply. Michael From ajai at bitblit.net Sat Jul 18 08:17:48 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sat, 18 Jul 2009 08:17:48 -0400 (EDT) Subject: [nycphp-talk] PHP parsing to Javascript questions In-Reply-To: <20090718110028392.MABD15636@hrndva-omta03.mail.rr.com> Message-ID: On Sat, 18 Jul 2009, Michele Waldman wrote: > When you say dynamically I think of ajax. Technically, PHP pages are dynamic... -- Aj. From ajai at bitblit.net Sat Jul 18 08:23:48 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sat, 18 Jul 2009 08:23:48 -0400 (EDT) Subject: [nycphp-talk] PHP parsing to Javascript questions In-Reply-To: <1984338636.20090718182415@vbplusme.com> Message-ID: On Sat, 18 Jul 2009, webmaster at vbplusme.com wrote: > The links that populate the array periodically change so I use PHP and > MySQL to track and store the most current versions. I want to be able > to do a query to populate the array and do a seamless merge into the > javascript to do the display. > > This all seams pretty kludgy to me Much better to have PHP run the MySQL query and generate the JavaScript directly. -- Aj. From webmaster at vbplusme.com Sat Jul 18 10:24:46 2009 From: webmaster at vbplusme.com (webmaster at vbplusme.com) Date: Sat, 18 Jul 2009 22:24:46 +0800 Subject: [nycphp-talk] PHP parsing to Javascript questions In-Reply-To: References: <1984338636.20090718182415@vbplusme.com> Message-ID: <1401012299.20090718222446@vbplusme.com> Hello Ajai, Saturday, July 18, 2009, 8:23:48 PM, you wrote: > On Sat, 18 Jul 2009, webmaster at vbplusme.com wrote: >> The links that populate the array periodically change so I use PHP and >> MySQL to track and store the most current versions. I want to be able >> to do a query to populate the array and do a seamless merge into the >> javascript to do the display. >> >> This all seams pretty kludgy to me > Much better to have PHP run the MySQL query and generate the JavaScript > directly. Thanks, I was thinking that was the best way too... I can easily generate the whole javascript after I get the query results from MySQL in PHP. -- Best regards, webmaster mailto:webmaster at vbplusme.com From danielc at analysisandsolutions.com Sat Jul 18 10:40:30 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 18 Jul 2009 10:40:30 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <075701ca0558$e84753d0$b8d5fb70$@com> References: <075701ca0558$e84753d0$b8d5fb70$@com> Message-ID: <20090718144030.GA10027@panix.com> Hey Hans: In a prior engagement, we were using XUL as the view and JSON as the communication protocol. This was nice, since the entire user interface resided on the user's desktop (as a Firefox Add-on), all we needed to transmit was the data. Of course, you need to be using HTML, so transpose the XUL I'm showing here into HTML. The framework we created used a consistent naming scheme, so the names of elements in the XUL matched identifiers in the database. This is a quick example. There's a lot more code and abstraction involved, of course. ----------------- ----------------- ; $out = array(); foreach ($result as $row) { $out[$row['loan_id']] = $row; } echo json_encode($out); ----------------- FYI, in XUL, a "tree" is an element that is used in situations where you need to automatically repeat the structure for each row to form a list/table like output. Pretty sweet. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Sat Jul 18 11:20:24 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 18 Jul 2009 11:20:24 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <20090718144030.GA10027@panix.com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <20090718144030.GA10027@panix.com> Message-ID: <20090718152024.GA27097@panix.com> Hello again: > $result = ; > > $out = array(); > foreach ($result as $row) { > $out[$row['loan_id']] = $row; > } > > echo json_encode($out); Oh, make that: $out[$row['loan_id']][] = $row; :/ --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 felix.shnir at gmail.com Sat Jul 18 20:20:34 2009 From: felix.shnir at gmail.com (Felix Shnir) Date: Sat, 18 Jul 2009 20:20:34 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <20090718152024.GA27097@panix.com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <20090718144030.GA10027@panix.com> <20090718152024.GA27097@panix.com> Message-ID: On Jul 18, 2009 11:20 AM, "Daniel Convissor" < danielc at analysisandsolutions.com> wrote: Hello again: > $result = ; > > $out = array(); > foreach ($result as $row) { > $out[$row['loa... Oh, make that: $out[$row['loan_id']][] = $row; :/ --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 in... -------------- next part -------------- An HTML attachment was scrubbed... URL: From krozinov at gmail.com Sun Jul 19 23:40:45 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Sun, 19 Jul 2009 23:40:45 -0400 Subject: [nycphp-talk] Using APC to improve performance. In-Reply-To: <68de37340907171642m2bdb12b6m77350bdbe0968510@mail.gmail.com> References: <68de37340907171255h7dbf1a08l21760ed83dfe1b34@mail.gmail.com> <68de37340907171642m2bdb12b6m77350bdbe0968510@mail.gmail.com> Message-ID: <865a7acf0907192040h2ffda1cfh3a995d6cebdff0d8@mail.gmail.com> apc_compile_file() seems to only work if you run it via the webserver. If you try to run it via the command line, it will fail. In other words, I have a script that apc_compile_file() a file that changes often. Calling that script from the command line fails to update the cached version. Calling it through the webserver succeeds. I want to avoid using the webserver to call this since these admin scripts will not be accessible to the public facing webserver. Have any of you found this to be true as well? Any ideas? Thanks, Konstantin On Fri, Jul 17, 2009 at 7:42 PM, Eddie Drapkin wrote: > On Fri, Jul 17, 2009 at 6:21 PM, Ajai Khattri wrote: >> On Fri, 17 Jul 2009, Eddie Drapkin wrote: >> >>> No problem, took me a while to figure out why that function existed a >> few weeks back ;) >> >> How does APC compare to eaccelerator? >> >> >> -- >> Aj. >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > I've tested it to be a little slower. ?That said, the difference is > mostly marginal (<10%) and APC has some really useful other features > (apc_store and apc_fetch) and is more closely developed with PHP and > afaik APC trunk is the only opcode cache that's properly working with > 5.3.0 at the moment. > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From krozinov at gmail.com Mon Jul 20 00:13:48 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Mon, 20 Jul 2009 00:13:48 -0400 Subject: [nycphp-talk] best way to run script? Message-ID: <865a7acf0907192113p49f085f5h2841572a636bf1ea@mail.gmail.com> Hey guys, I'm trying to run the same php script via the command line interface on several remote servers. I'd like to do it securely preferably over ssh. Right now, I'm using the ssh2 class from php, but getting very inconsistent results (sometimes the script runs, sometimes it doesn't via ssh2_exec) What do people use to run scripts on production machines? Thanks, Konstantin From chsnyder at gmail.com Mon Jul 20 08:00:52 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Mon, 20 Jul 2009 08:00:52 -0400 Subject: [nycphp-talk] best way to run script? In-Reply-To: <865a7acf0907192113p49f085f5h2841572a636bf1ea@mail.gmail.com> References: <865a7acf0907192113p49f085f5h2841572a636bf1ea@mail.gmail.com> Message-ID: On Mon, Jul 20, 2009 at 12:13 AM, Konstantin Rozinov wrote: > Hey guys, > > I'm trying to run the same php script via the command line interface > on several remote servers. > I'd like to do it securely preferably over ssh. Right now, I'm using > the ssh2 class from php, but getting very inconsistent results > (sometimes the script runs, sometimes it doesn't via ssh2_exec) > > What do people use to run scripts on production machines? > > Thanks, > Konstantin Cron? If you need central command and control, as opposed to just running the script periodically, you can still run it every 10 minutes or something using cron, but have the script check in to a central location via https to see what, if anything, it should do. Also, you don't need to use the ssh class to use ssh. If your script is interactive, you can use passthru() to execute command line ssh and get control of password prompt and/or remote script. If not, use ssh key authentication and exec(). Chris Snyder http://chxor.chxo.com/ From mitch.pirtle at gmail.com Mon Jul 20 08:38:45 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 20 Jul 2009 08:38:45 -0400 Subject: [nycphp-talk] best way to run script? In-Reply-To: <865a7acf0907192113p49f085f5h2841572a636bf1ea@mail.gmail.com> References: <865a7acf0907192113p49f085f5h2841572a636bf1ea@mail.gmail.com> Message-ID: <330532b60907200538g2bd07bb1p47f2721d2f6580e6@mail.gmail.com> You can take a look at phing, a php buildtool inspired by apache's ant: http://phing.info/trac/ You can use phing with the ssh2 extension and do what I think you are trying to do. -- Mitch On Mon, Jul 20, 2009 at 12:13 AM, Konstantin Rozinov wrote: > Hey guys, > > I'm trying to run the same php script via the command line interface > on several remote servers. > I'd like to do it securely preferably over ssh. ?Right now, I'm using > the ssh2 class from php, but getting very inconsistent results > (sometimes the script runs, sometimes it doesn't via ssh2_exec) > > What do people use to run scripts on production machines? > > Thanks, > Konstantin > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From lists at zaunere.com Mon Jul 20 09:21:00 2009 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 20 Jul 2009 09:21:00 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <20090718144030.GA10027@panix.com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <20090718144030.GA10027@panix.com> Message-ID: <08eb01ca093c$ec6e2690$c54a73b0$@com> > In a prior engagement, we were using XUL as the view and JSON as the > communication protocol. This was nice, since the entire user interface > resided on the user's desktop (as a Firefox Add-on), all we needed to > transmit was the data. Of course, you need to be using HTML, so > transpose the XUL I'm showing here into HTML. The framework we created > used a consistent naming scheme, so the names of elements in the XUL > matched identifiers in the database. Thanks Dan and all for their feedback. >From what I've gleamed from this discussion and others, Javascript code for any given modern web application, is ever increasing. It's getting more and more complex, to the point, dare I say, that much of the MVC functionality is actually living in the browser, and less so on the server - the server is becoming dumber and only performs simple operations and consistency/security checks. I think this really begs some questions on current server-side frameworks and the MVC methodology. Changes like this have already begun, namely in RoR and other platforms. Time for another framework folks :) H From oorza2k5 at gmail.com Mon Jul 20 09:27:45 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Mon, 20 Jul 2009 09:27:45 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <08eb01ca093c$ec6e2690$c54a73b0$@com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <20090718144030.GA10027@panix.com> <08eb01ca093c$ec6e2690$c54a73b0$@com> Message-ID: <68de37340907200627h11ccd5fdrb49021b5a40b2e34@mail.gmail.com> > I think this really begs some questions on current server-side frameworks > and the MVC methodology. ?Changes like this have already begun, namely in > RoR and other platforms. > > Time for another framework folks :) > > H > I think there are plenty of pre-existing questions about current MVC implementations in PHP and we don't need to raise another one. I've never been too much a huge fan of MVC in PHP, not that a single implementation I've seen is accurate with the original design pattern (which is functionally identical to the observer pattern). I've always thought something like the "view-first" PAC model makes much more sense for web development and MVC was/is a fad brought on by another fad, RoR. From ajai at bitblit.net Mon Jul 20 12:38:15 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 20 Jul 2009 12:38:15 -0400 (EDT) Subject: [nycphp-talk] JSON and MVC In-Reply-To: <08eb01ca093c$ec6e2690$c54a73b0$@com> Message-ID: On Mon, 20 Jul 2009, Hans Zaunere wrote: > I think this really begs some questions on current server-side frameworks > and the MVC methodology. Changes like this have already begun, namely in > RoR and other platforms. > > Time for another framework folks :) Time for dual framework applications (front-end and backend too). -- Aj. From ajai at bitblit.net Mon Jul 20 12:40:52 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 20 Jul 2009 12:40:52 -0400 (EDT) Subject: [nycphp-talk] JSON and MVC In-Reply-To: <68de37340907200627h11ccd5fdrb49021b5a40b2e34@mail.gmail.com> Message-ID: On Mon, 20 Jul 2009, Eddie Drapkin wrote: > ... I've > always thought something like the "view-first" PAC model makes much > more sense for web development and MVC was/is a fad brought on by > another fad, RoR. Mind you, RoR has been good in the sense that it encouraged developers to look more at design patterns, DRY and other generally good ideas. -- Aj. From jmcgraw1 at gmail.com Mon Jul 20 13:12:47 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Mon, 20 Jul 2009 13:12:47 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: References: <08eb01ca093c$ec6e2690$c54a73b0$@com> Message-ID: On Mon, Jul 20, 2009 at 12:38 PM, Ajai Khattri wrote: > On Mon, 20 Jul 2009, Hans Zaunere wrote: > >> I think this really begs some questions on current server-side frameworks >> and the MVC methodology. ?Changes like this have already begun, namely in >> RoR and other platforms. >> >> Time for another framework folks :) > > Time for dual framework applications (front-end and backend too). Zend Framework already does this with Dojo: http://woo.ly/zfdojo and jQuery (though not as extensively as Dojo): http://woo.ly/zfjquery - jake > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ajai at bitblit.net Mon Jul 20 14:27:35 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 20 Jul 2009 14:27:35 -0400 (EDT) Subject: [nycphp-talk] JSON and MVC In-Reply-To: Message-ID: On Mon, 20 Jul 2009, Jake McGraw wrote: > Zend Framework already does this with Dojo: > > http://woo.ly/zfdojo > > and jQuery (though not as extensively as Dojo): > > http://woo.ly/zfjquery symfony has a jQuery plugin that replaces the existing JS helpers which sounds similar. In addition, the support for automatic output MIME types in symfony takes care of data formatting. -- Aj. From nate at cakephp.org Tue Jul 21 13:08:19 2009 From: nate at cakephp.org (Nate Abele) Date: Tue, 21 Jul 2009 13:08:19 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: References: Message-ID: <6A76CB73-C38C-4ED2-959C-C830509306C5@cakephp.org> On Mon, 20 Jul 2009, Hans Zaunere wrote: > I think this really begs some questions on current server-side > frameworks > and the MVC methodology. Changes like this have already begun, > namely in > RoR and other platforms. In Cake 3.0 we have a class called Media (http://code.cakephp.org/cake3/source/libraries/cake/http/Media.php#47 ) that sits between the controller and view layers. Instead of worrying about context switching, you can attach handlers that work across your whole application, and respond for each different media type. Handlers can be a specific view class (the default, as in the case of HTML, etc.), a reference to a class method or function (i.e. "json_encode" for JSON) or a closure where you can define custom rules or transformations. The great thing is, while handlers can be overridden on a case by case basis, once they're attached, you never need to think about them again, they just work; and all the switching logic is kept out of your controller. - Nate Abele Lead Developer, CakePHP -------------- next part -------------- An HTML attachment was scrubbed... URL: From mitch.pirtle at gmail.com Tue Jul 21 13:17:18 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 21 Jul 2009 13:17:18 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <6A76CB73-C38C-4ED2-959C-C830509306C5@cakephp.org> References: <6A76CB73-C38C-4ED2-959C-C830509306C5@cakephp.org> Message-ID: <330532b60907211017h67d836d4q818dab6fb2f9b397@mail.gmail.com> Took the same approach with Jooma 1.5, although there is a little more work to it ;-) -- Mitch On Tue, Jul 21, 2009 at 1:08 PM, Nate Abele wrote: > On Mon, 20 Jul 2009, Hans Zaunere wrote: > > I think this really begs some questions on current server-side frameworks > > and the MVC methodology. ?Changes like this have already begun, namely in > > RoR and other platforms. > > In Cake 3.0 we have a class called Media > (http://code.cakephp.org/cake3/source/libraries/cake/http/Media.php#47) that > sits between the controller and view layers. ?Instead of worrying about > context switching, you can attach handlers that work across your whole > application, and respond for each different media type. ?Handlers can be a > specific view class (the default, as in the case of HTML, etc.), a reference > to a class method or function (i.e. "json_encode" for JSON) or a closure > where you can define custom rules or transformations. > The great > thing?is,?while?handlers?can?be?overridden?on?a?case?by?case?basis,?once?they're?attached,?you?never?need?to?think?about?them?again,?they?just?work;?and?all?the?switching > logic is kept out of your controller. > > - Nate Abele > ??Lead Developer, CakePHP > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From leam at reuel.net Tue Jul 21 15:46:24 2009 From: leam at reuel.net (Leam Hall) Date: Tue, 21 Jul 2009 15:46:24 -0400 Subject: [nycphp-talk] Old articles on OnLAMP at O'Reilly In-Reply-To: <4A1DC6BC.2060909@reuel.net> References: <4A1DC6BC.2060909@reuel.net> Message-ID: <4A661B10.2070109@reuel.net> I'm keeping up with the folks at O'Reilly. They're doing a site re-design so the oldness should eventually be phased out. I'm midling confident that they;ll be interested in current input, so be ready when they ask for it. Thanks! Leam Leam Hall wrote: > Yikes! > > http://www.onlamp.com/php/ > > If I see correctly, the oldest articles there are from 2006! Any of you > smart PHP folk want to add some resume bullets and post a few things to > keep us in the communal lime-light? > > Leam From zippy1981 at gmail.com Tue Jul 21 16:39:07 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Tue, 21 Jul 2009 16:39:07 -0400 Subject: [nycphp-talk] So what do people use to parse RSS these days? Message-ID: <5458db3c0907211339j1e279f17p84d9aefc607fc182@mail.gmail.com> I'm thinking of adding twitter feeds to three new websites I launched: http://lmsotfy.com http://lmsftfy.com http://lmsutfy.com They all have twitter accounts, and I plan on having them keep a twitter ticker of what people have searched for on the sites (with no referencing data of course). I was thinking I can use libcurl to update the tweets, but I'd also like to make them viewable via a popup div in the webpage. Last time I parsed RSS I used magpie, which worked fine and still has a lot of google juice. However, is there something better? The last magpie release was in 2005. Regards, Justin Dearing From jcampbell1 at gmail.com Tue Jul 21 17:35:15 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Tue, 21 Jul 2009 17:35:15 -0400 Subject: [nycphp-talk] So what do people use to parse RSS these days? In-Reply-To: <5458db3c0907211339j1e279f17p84d9aefc607fc182@mail.gmail.com> References: <5458db3c0907211339j1e279f17p84d9aefc607fc182@mail.gmail.com> Message-ID: <8f0676b40907211435g7f3e03afsc8f127284bedf758@mail.gmail.com> http://lmsotfy.com/index.php?q=Best+way+to+parse+RSS+feeds+with+PHP Sorry... couldn't help myself. -John Campbell From oorza2k5 at gmail.com Tue Jul 21 17:38:36 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Tue, 21 Jul 2009 17:38:36 -0400 Subject: [nycphp-talk] So what do people use to parse RSS these days? In-Reply-To: <8f0676b40907211435g7f3e03afsc8f127284bedf758@mail.gmail.com> References: <5458db3c0907211339j1e279f17p84d9aefc607fc182@mail.gmail.com> <8f0676b40907211435g7f3e03afsc8f127284bedf758@mail.gmail.com> Message-ID: <68de37340907211438o478e6763nbc2972a6c8732c64@mail.gmail.com> On Tue, Jul 21, 2009 at 5:35 PM, John Campbell wrote: > http://lmsotfy.com/index.php?q=Best+way+to+parse+RSS+feeds+with+PHP > > Sorry... couldn't help myself. > > -John Campbell > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > I think we have a winner, ladies and gentlemen. From zippy1981 at gmail.com Tue Jul 21 18:02:32 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Tue, 21 Jul 2009 18:02:32 -0400 Subject: [nycphp-talk] So what do people use to parse RSS these days? In-Reply-To: <68de37340907211438o478e6763nbc2972a6c8732c64@mail.gmail.com> References: <5458db3c0907211339j1e279f17p84d9aefc607fc182@mail.gmail.com> <8f0676b40907211435g7f3e03afsc8f127284bedf758@mail.gmail.com> <68de37340907211438o478e6763nbc2972a6c8732c64@mail.gmail.com> Message-ID: <5458db3c0907211502u18ed7b13n40dba44562c9ad6c@mail.gmail.com> I deserved that. Thanks for the suggestion. On Tue, Jul 21, 2009 at 5:38 PM, Eddie Drapkin wrote: > On Tue, Jul 21, 2009 at 5:35 PM, John Campbell wrote: >> http://lmsotfy.com/index.php?q=Best+way+to+parse+RSS+feeds+with+PHP >> >> Sorry... couldn't help myself. >> >> -John Campbell >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > > I think we have a winner, ladies and gentlemen. > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From justin at justinhileman.info Tue Jul 21 21:48:49 2009 From: justin at justinhileman.info (Justin Hileman) Date: Tue, 21 Jul 2009 21:48:49 -0400 Subject: [nycphp-talk] So what do people use to parse RSS these days? In-Reply-To: <5458db3c0907211339j1e279f17p84d9aefc607fc182@mail.gmail.com> References: <5458db3c0907211339j1e279f17p84d9aefc607fc182@mail.gmail.com> Message-ID: <4A667001.1040306@justinhileman.info> Justin Dearing wrote: > I was thinking I can use libcurl to update the tweets, but I'd also > like to make them viewable via a popup div in the webpage. Last time I > parsed RSS I used magpie, which worked fine and still has a lot of > google juice. However, is there something better? The last magpie > release was in 2005. This jQuery plugin is pretty hot: http://tweet.seaofclouds.com/ -- justin http://justinhileman.com From zippy1981 at gmail.com Tue Jul 21 22:41:18 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Tue, 21 Jul 2009 22:41:18 -0400 Subject: [nycphp-talk] So what do people use to parse RSS these days? In-Reply-To: <4A667001.1040306@justinhileman.info> References: <5458db3c0907211339j1e279f17p84d9aefc607fc182@mail.gmail.com> <4A667001.1040306@justinhileman.info> Message-ID: <5458db3c0907211941m4805f07cse6fe873120317324@mail.gmail.com> Sounds like a good suggestion, but I think I want an entirely server side tweet sending solution. Of course I'd like to make the call asynchronously on the server so I don't have to wait for it to return. Regards, Justin Dearing On Tue, Jul 21, 2009 at 9:48 PM, Justin Hileman wrote: > Justin Dearing wrote: >> >> I was thinking I can use libcurl to update the tweets, but I'd also >> like to make them viewable via a popup div in the webpage. Last time I >> parsed RSS I used magpie, which worked fine and still has a lot of >> google juice. However, is there something better? The last magpie >> release was in 2005. > > This jQuery plugin is pretty hot: http://tweet.seaofclouds.com/ > > -- > justin > http://justinhileman.com > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From zippy1981 at gmail.com Wed Jul 22 01:45:51 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Wed, 22 Jul 2009 01:45:51 -0400 Subject: [nycphp-talk] Do any URL Shortening services have an https accessiable url? Message-ID: <5458db3c0907212245x49dc4ee5kdb3da280ecb77091@mail.gmail.com> Before I fall victim to my own practical joke twice on this list in one day, I already asked on stackoverflow. http://stackoverflow.com/questions/1163226/do-any-url-shortening-services-with-link-tracking-have-a-https-accessiable-url From paul at devonianfarm.com Wed Jul 22 09:51:38 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Wed, 22 Jul 2009 09:51:38 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <330532b60907211017h67d836d4q818dab6fb2f9b397@mail.gmail.com> References: <6A76CB73-C38C-4ED2-959C-C830509306C5@cakephp.org> <330532b60907211017h67d836d4q818dab6fb2f9b397@mail.gmail.com> Message-ID: <4A67196A.6030306@devonianfarm.com> I'd say that practically frameworks need to have some way to disable the "view" layer, at least the HTML templates, to let a controller output raw data. In my experience, for instance, business applications often need to output csv or xls so that people can load content into a spreadsheet. Often you want to be able to format (nearly) the same content in different ways. I'm working on a public facing app that's oriented towards the semantic web; all pages are available in HTML, RDF/NT and RSS formats. Content is ~almost~ the same, but not quite. HTML output is paged in order of relevancy/quality (the page on topic X shows the top N content items related to topic X;) RDF format offers a unpaged dump of triples related to topic X (all of the triples that come from traversing the relationship tree coming from X in a specified way); RSS offers a limited number of items ordered by recency -- people can subscribe to a page via RSS and get updated when new content gets added. The framework involves a certain amount of codesign between models, views and controllers -- it's designed to produce a family of related sites with high reuse, not to be a system for building general business apps like Rails/Symfony/Cake... Administrative functions (editing content) are implemented in an AJAX-heavy manner, where the role of "MVC" is quite different from traditional. Layout templates aren't as important as a in conventional webapp, since we're not redrawing the page each time. However, in an AJAX application, the framework still must handle authentication for requests, and also needs to have a systematic way to bolt in business rules and handle violations. From jeff987654 at yahoo.com Wed Jul 22 12:44:52 2009 From: jeff987654 at yahoo.com (Jeff Siegel) Date: Wed, 22 Jul 2009 09:44:52 -0700 (PDT) Subject: [nycphp-talk] PHP Fileupload problem Message-ID: <860844.35974.qm@web110015.mail.gq1.yahoo.com> The code is real standard stuff (see below). A user selects a file. Clicks upload. When the upload is completed a refreshed page appears. This function works perfectly when I test it and when another consultant tests it. We are able to upload files of almost any size. When the upload is complete we see the new refreshed page and the uploaded file is in the correct directory. Of course...this does not work when the client does the uploading. The browser seems to time out when the file is about 1 meg or greater in size. There are no PHP errors, no PHP timeout errors. Just the browser saying that the page cannot be displayed. I tried the script running off of two different web hosts. It works for me. It works for the consultant. It doesn't work for the client. To make matters worse, the client's client has the same problem uploading files. Any thoughts on where else to look? Maybe I'm overlooking something that is real obvious. Jeff -------------- function UploadFile($IVF){ if($IVF){ $uploaddir = '/home/thisdirectory/'; $newFileName = RenameFile(trim($_POST['claimantname'])); $uploadfile = $uploaddir . $newFileName; } else { $uploaddir = '/home/thatdirectory/'; $newFileName = RenameFile(trim($_SESSION['claimant'])); $uploadfile = $uploaddir . $newFileName; } if(is_uploaded_file($_FILES['userfile']['tmp_name'])){ if(move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)){ return 1; } else { return 0; } } else { return 0; } } From dcech at phpwerx.net Wed Jul 22 13:03:29 2009 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 22 Jul 2009 13:03:29 -0400 Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <860844.35974.qm@web110015.mail.gq1.yahoo.com> References: <860844.35974.qm@web110015.mail.gq1.yahoo.com> Message-ID: <4A674661.3060503@phpwerx.net> Jeff, You may be falling afoul of one of the configuration options related to file uploads in PHP: upload_max_filesize "128M" post_max_size "50M" max_input_time 600 Or Apache: LimitRequestBody 53000000 The settings above are usually sufficient to allow uploads up to 40MB+, assuming the client is able to upload fast enough to complete the upload in under 10 minutes. Dan Jeff Siegel wrote: > The code is real standard stuff (see below). A user selects a file. > Clicks upload. When the upload is completed a refreshed page appears. > This function works perfectly when I test it and when another > consultant tests it. We are able to upload files of almost any size. > When the upload is complete we see the new refreshed page and the > uploaded file is in the correct directory. Of course...this does not > work when the client does the uploading. The browser seems to time > out when the file is about 1 meg or greater in size. There are no PHP > errors, no PHP timeout errors. Just the browser saying that the page > cannot be displayed. > > I tried the script running off of two different web hosts. It works > for me. It works for the consultant. It doesn't work for the client. > To make matters worse, the client's client has the same problem > uploading files. > > Any thoughts on where else to look? Maybe I'm overlooking something > that is real obvious. > > Jeff -------------- > > function UploadFile($IVF){ > > if($IVF){ $uploaddir = '/home/thisdirectory/'; $newFileName = > RenameFile(trim($_POST['claimantname'])); $uploadfile = $uploaddir . > $newFileName; } else { $uploaddir = '/home/thatdirectory/'; > $newFileName = RenameFile(trim($_SESSION['claimant'])); $uploadfile = > $uploaddir . $newFileName; } > > if(is_uploaded_file($_FILES['userfile']['tmp_name'])){ > if(move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)){ > return 1; > > } else { return 0; } } else { return 0; } } From jeff987654 at yahoo.com Wed Jul 22 13:14:44 2009 From: jeff987654 at yahoo.com (Jeff Siegel) Date: Wed, 22 Jul 2009 10:14:44 -0700 (PDT) Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <4A674661.3060503@phpwerx.net> References: <860844.35974.qm@web110015.mail.gq1.yahoo.com> <4A674661.3060503@phpwerx.net> Message-ID: <542893.83396.qm@web110004.mail.gq1.yahoo.com> Dan, Currently we have the following: ??? upload_max_filesize "25M" ??? post_max_size "25M" ??? max_input_time 1800 Since we're on a shared host...I have no clue about the setting for LimitRequestBody. The puzzle is that it doesn't take a large file to cause the problem. Just a file about 2meg will cause the timeout. Jeff ----- Original Message ---- From: Dan Cech To: NYPHP Talk Sent: Wednesday, July 22, 2009 1:03:29 PM Subject: Re: [nycphp-talk] PHP Fileupload problem Jeff, You may be falling afoul of one of the configuration options related to file uploads in PHP: ??? upload_max_filesize "128M" ??? post_max_size "50M" ??? max_input_time 600 Or Apache: ??? LimitRequestBody 53000000 The settings above are usually sufficient to allow uploads up to 40MB+, assuming the client is able to upload fast enough to complete the upload in under 10 minutes. Dan Jeff Siegel wrote: > The code is real standard stuff (see below). A user selects a file. > Clicks upload. When the upload is completed a refreshed page appears. > This function works perfectly when I test it and when another > consultant tests it. We are able to upload files of almost any size. > When the upload is complete we see the new refreshed page and the > uploaded file is in the correct directory. Of course...this does not > work? when the client does the uploading. The browser seems to time > out when the file is about 1 meg or greater in size. There are no PHP > errors, no PHP timeout errors. Just the browser saying that the page > cannot be displayed. > > I tried the script running off of two different web hosts. It works > for me. It works for the consultant. It doesn't work for the client. > To make matters worse, the client's client has the same problem > uploading files. > > Any thoughts on where else to look? Maybe I'm overlooking something > that is real obvious. > > Jeff -------------- > > function UploadFile($IVF){ > > if($IVF){ $uploaddir = '/home/thisdirectory/'; $newFileName = > RenameFile(trim($_POST['claimantname'])); $uploadfile = $uploaddir . > $newFileName; } else { $uploaddir = '/home/thatdirectory/'; > $newFileName = RenameFile(trim($_SESSION['claimant'])); $uploadfile = > $uploaddir . $newFileName; } > > if(is_uploaded_file($_FILES['userfile']['tmp_name'])){ > if(move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)){ >? return 1; > > } else { return 0; } } else { return 0; } } _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From ramons at gmx.net Wed Jul 22 13:22:44 2009 From: ramons at gmx.net (David Krings) Date: Wed, 22 Jul 2009 13:22:44 -0400 Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <860844.35974.qm@web110015.mail.gq1.yahoo.com> References: <860844.35974.qm@web110015.mail.gq1.yahoo.com> Message-ID: <4A674AE4.5080406@gmx.net> Jeff Siegel wrote: > The code is real standard stuff (see below). A user selects a file. Clicks upload. When the upload is completed a refreshed page appears. This function works perfectly when I test it and when another consultant tests it. We are able to upload files of almost any size. When the upload is complete we see the new refreshed page and the uploaded file is in the correct directory. Of course...this does not work when the client does the uploading. The browser seems to time out when the file is about 1 meg or greater in size. There are no PHP errors, no PHP timeout errors. Just the browser saying that the page cannot be displayed. > > I tried the script running off of two different web hosts. It works for me. It works for the consultant. It doesn't work for the client. To make matters worse, the client's client has the same problem uploading files. > Does uploading of even a small file fail as well? Which internet connection does the client have? Does the client have any other restrictions in place, for example particular traffic monitoring devices that kill any up- or download after a specific size? No clue what is happening, just some more things to look at. David From mitch.pirtle at gmail.com Wed Jul 22 13:23:24 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Wed, 22 Jul 2009 13:23:24 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <4A67196A.6030306@devonianfarm.com> References: <6A76CB73-C38C-4ED2-959C-C830509306C5@cakephp.org> <330532b60907211017h67d836d4q818dab6fb2f9b397@mail.gmail.com> <4A67196A.6030306@devonianfarm.com> Message-ID: <330532b60907221023t20932d5eq4a9fc36f7be65810@mail.gmail.com> Agreed - and Joomla does it by allowing you to assign the view as the document type. For example, you can create different views for html, rss, json output. As well, you can just output directly from the controller and exit. Been too busy with work to play with all the other frameworks out there, wanting to take a look at the new Zend framework as well as kohana. Wondering how all the other frameworks tackle this issue. -- Mitch On Wed, Jul 22, 2009 at 9:51 AM, Paul A Houle wrote: > ? I'd say that practically frameworks need to have some way to disable the > "view" layer, ?at least the HTML templates, ?to let a controller output raw > data. > > ? In my experience, ?for instance, ?business applications often need to > output csv or xls so that people can load content into a spreadsheet. ?Often > you want to be able to format (nearly) the same content in different ways. > > ? I'm working on a public facing app that's oriented towards the semantic > web; ?all pages are available in HTML, ?RDF/NT and RSS formats. ?Content is > ~almost~ the same, ?but not quite. ?HTML output is paged in order of > relevancy/quality (the page on topic X shows the top N content items related > to topic X;) ?RDF format offers a unpaged dump of triples related to topic X > (all of the triples that come from traversing the relationship tree coming > from X in a specified way); ?RSS offers a limited number of items ordered by > recency -- people can subscribe to a page via RSS and get updated when new > content gets added. > > ? The framework involves a certain amount of codesign between models, ?views > and controllers -- it's designed to produce a family of related sites with > high reuse, ?not to be a system for building general business apps like > Rails/Symfony/Cake... > > ? Administrative functions (editing content) are implemented in an > AJAX-heavy manner, ?where the role of "MVC" is quite different from > traditional. ?Layout templates aren't as important as a in conventional > webapp, ?since we're not redrawing the page each time. ? However, ?in an > AJAX application, ?the framework still must handle authentication for > requests, ?and also needs to have a systematic way to bolt in business rules > and handle violations. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From danielc at analysisandsolutions.com Wed Jul 22 13:27:43 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 22 Jul 2009 13:27:43 -0400 Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <860844.35974.qm@web110015.mail.gq1.yahoo.com> References: <860844.35974.qm@web110015.mail.gq1.yahoo.com> Message-ID: <20090722172743.GA11896@panix.com> Hi Jeff: Your client probably has a lousy internet connection when it comes to upstream bandwidth/reliability. Maybe have them try one of the internet speedometers: http://www.dslreports.com/stest http://www.speakeasy.net/speedtest/ --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 jeff987654 at yahoo.com Wed Jul 22 13:29:31 2009 From: jeff987654 at yahoo.com (Jeff Siegel) Date: Wed, 22 Jul 2009 10:29:31 -0700 (PDT) Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <4A674AE4.5080406@gmx.net> References: <860844.35974.qm@web110015.mail.gq1.yahoo.com> <4A674AE4.5080406@gmx.net> Message-ID: <161721.12759.qm@web110014.mail.gq1.yahoo.com> David, Small file uploads are no problem at all. Both clients who are having the problem are in business environments. (One is located in New York...the other is in Georgia.)? I'm working out of a home office in New York?using Verizon FIOS...the consultant I'm working with (who also doesn't have any problems with the upload) is using a home office in New York?and Cablevision. A head scratcher...no? Jeff ----- Original Message ---- From: David Krings To: NYPHP Talk Sent: Wednesday, July 22, 2009 1:22:44 PM Subject: Re: [nycphp-talk] PHP Fileupload problem Jeff Siegel wrote: > The code is real standard stuff (see below). A user selects a file. Clicks upload. When the upload is completed a refreshed page appears. This function works perfectly when I test it and when another consultant tests it. We are able to upload files of almost any size. When the upload is complete we see the new refreshed page and the uploaded file is in the correct directory. Of course...this does not work? when the client does the uploading. The browser seems to time out when the file is about 1 meg or greater in size. There are no PHP errors, no PHP timeout errors. Just the browser saying that the page cannot be displayed. > I tried the script running off of two different web hosts. It works for me. It works for the consultant. It doesn't work for the client. To make matters worse, the client's client has the same problem uploading files. Does uploading of even a small file fail as well? Which internet connection does the client have? Does the client have any other restrictions in place, for example particular traffic monitoring devices that kill any up- or download after a specific size? No clue what is happening, just some more things to look at. David _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From dorgan at donaldorgan.com Wed Jul 22 13:29:56 2009 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Wed, 22 Jul 2009 13:29:56 -0400 (EDT) Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <161721.12759.qm@web110014.mail.gq1.yahoo.com> Message-ID: <18963152.15991248283795955.JavaMail.root@twoguyshosting.com.> What is the max_execution_time set to?? ----- Original Message ----- From: "Jeff Siegel" To: "NYPHP Talk" Sent: Wednesday, July 22, 2009 5:29:31 PM Subject: Re: [nycphp-talk] PHP Fileupload problem David, Small file uploads are no problem at all. Both clients who are having the problem are in business environments. (One is located in New York...the other is in Georgia.)? I'm working out of a home office in New York?using Verizon FIOS...the consultant I'm working with (who also doesn't have any problems with the upload) is using a home office in New York?and Cablevision. A head scratcher...no? Jeff ----- Original Message ---- From: David Krings To: NYPHP Talk Sent: Wednesday, July 22, 2009 1:22:44 PM Subject: Re: [nycphp-talk] PHP Fileupload problem Jeff Siegel wrote: > The code is real standard stuff (see below). A user selects a file. Clicks upload. When the upload is completed a refreshed page appears. This function works perfectly when I test it and when another consultant tests it. We are able to upload files of almost any size. When the upload is complete we see the new refreshed page and the uploaded file is in the correct directory. Of course...this does not work? when the client does the uploading. The browser seems to time out when the file is about 1 meg or greater in size. There are no PHP errors, no PHP timeout errors. Just the browser saying that the page cannot be displayed. > I tried the script running off of two different web hosts. It works for me. It works for the consultant. It doesn't work for the client. To make matters worse, the client's client has the same problem uploading files. Does uploading of even a small file fail as well? Which internet connection does the client have? Does the client have any other restrictions in place, for example particular traffic monitoring devices that kill any up- or download after a specific size? No clue what is happening, just some more things to look at. David _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From tomsartain at gmail.com Wed Jul 22 13:39:23 2009 From: tomsartain at gmail.com (Tom Sartain) Date: Wed, 22 Jul 2009 13:39:23 -0400 Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <18963152.15991248283795955.JavaMail.root@twoguyshosting.com.> References: <161721.12759.qm@web110014.mail.gq1.yahoo.com> <18963152.15991248283795955.JavaMail.root@twoguyshosting.com.> Message-ID: <20190d950907221039p5316162egf70d40dbb6b412c3@mail.gmail.com> Just to reduce variables, is the client able to upload the same file to some other site? On Wed, Jul 22, 2009 at 1:29 PM, Donald J. Organ IV wrote: > What is the max_execution_time set to?? > > > ----- Original Message ----- > From: "Jeff Siegel" > To: "NYPHP Talk" > Sent: Wednesday, July 22, 2009 5:29:31 PM > Subject: Re: [nycphp-talk] PHP Fileupload problem > > David, > > Small file uploads are no problem at all. > > Both clients who are having the problem are in business environments. (One > is located in New York...the other is in Georgia.) > > I'm working out of a home office in New York using Verizon FIOS...the > consultant I'm working with (who also doesn't have any problems with the > upload) is using a home office in New York and Cablevision. > > A head scratcher...no? > > Jeff > > > > ----- Original Message ---- > From: David Krings > To: NYPHP Talk > Sent: Wednesday, July 22, 2009 1:22:44 PM > Subject: Re: [nycphp-talk] PHP Fileupload problem > > Jeff Siegel wrote: > > The code is real standard stuff (see below). A user selects a file. > Clicks upload. When the upload is completed a refreshed page appears. This > function works perfectly when I test it and when another consultant tests > it. We are able to upload files of almost any size. When the upload is > complete we see the new refreshed page and the uploaded file is in the > correct directory. Of course...this does not work when the client does the > uploading. The browser seems to time out when the file is about 1 meg or > greater in size. There are no PHP errors, no PHP timeout errors. Just the > browser saying that the page cannot be displayed. > > I tried the script running off of two different web hosts. It works for > me. It works for the consultant. It doesn't work for the client. To make > matters worse, the client's client has the same problem uploading files. > > Does uploading of even a small file fail as well? Which internet connection > does the client have? Does the client have any other restrictions in place, > for example particular traffic monitoring devices that kill any up- or > download after a specific size? > > No clue what is happening, just some more things to look at. > > David > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeff987654 at yahoo.com Wed Jul 22 13:41:08 2009 From: jeff987654 at yahoo.com (Jeff Siegel) Date: Wed, 22 Jul 2009 10:41:08 -0700 (PDT) Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <20090722172743.GA11896@panix.com> References: <860844.35974.qm@web110015.mail.gq1.yahoo.com> <20090722172743.GA11896@panix.com> Message-ID: <230451.40170.qm@web110011.mail.gq1.yahoo.com> There's definitely something to that theory. They don't have the peppiest connection. Jeff ----- Original Message ---- From: Daniel Convissor To: NYPHP Talk Sent: Wednesday, July 22, 2009 1:27:43 PM Subject: Re: [nycphp-talk] PHP Fileupload problem Hi Jeff: Your client probably has a lousy internet connection when it comes to upstream bandwidth/reliability. Maybe have them try one of the internet speedometers: http://www..dslreports.com/stest http://www.speakeasy.net/speedtest/ --Dan -- T H E? A N A L Y S I S? A N D? S O L U T I O N S? C O M P A N Y ? ? ? ? ? ? data intensive web and database programming ? ? ? ? ? ? ? ? http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232? v: 718-854-0335 f: 718-854-0409 _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From jeff987654 at yahoo.com Wed Jul 22 13:42:21 2009 From: jeff987654 at yahoo.com (Jeff Siegel) Date: Wed, 22 Jul 2009 10:42:21 -0700 (PDT) Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <18963152.15991248283795955.JavaMail.root@twoguyshosting.com.> References: <18963152.15991248283795955.JavaMail.root@twoguyshosting.com.> Message-ID: <319599.19944.qm@web110012.mail.gq1.yahoo.com> Donald, max_execution_time is 1800 Jeff ----- Original Message ---- From: Donald J. Organ IV To: NYPHP Talk Sent: Wednesday, July 22, 2009 1:29:56 PM Subject: Re: [nycphp-talk] PHP Fileupload problem What is the max_execution_time set to?? ----- Original Message ----- From: "Jeff Siegel" To: "NYPHP Talk" Sent: Wednesday, July 22, 2009 5:29:31 PM Subject: Re: [nycphp-talk] PHP Fileupload problem David, Small file uploads are no problem at all. Both clients who are having the problem are in business environments. (One is located in New York...the other is in Georgia.)? I'm working out of a home office in New York?using Verizon FIOS...the consultant I'm working with (who also doesn't have any problems with the upload) is using a home office in New York?and Cablevision. A head scratcher...no? Jeff ----- Original Message ---- From: David Krings To: NYPHP Talk Sent: Wednesday, July 22, 2009 1:22:44 PM Subject: Re: [nycphp-talk] PHP Fileupload problem Jeff Siegel wrote: > The code is real standard stuff (see below). A user selects a file. Clicks upload. When the upload is completed a refreshed page appears. This function works perfectly when I test it and when another consultant tests it. We are able to upload files of almost any size. When the upload is complete we see the new refreshed page and the uploaded file is in the correct directory. Of course...this does not work? when the client does the uploading. The browser seems to time out when the file is about 1 meg or greater in size. There are no PHP errors, no PHP timeout errors. Just the browser saying that the page cannot be displayed. > I tried the script running off of two different web hosts. It works for me. It works for the consultant. It doesn't work for the client. To make matters worse, the client's client has the same problem uploading files. Does uploading of even a small file fail as well? Which internet connection does the client have? Does the client have any other restrictions in place, for example particular traffic monitoring devices that kill any up- or download after a specific size? No clue what is happening, just some more things to look at. David _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php ? ? ? _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From dorgan at donaldorgan.com Wed Jul 22 13:43:32 2009 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Wed, 22 Jul 2009 13:43:32 -0400 (EDT) Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <319599.19944.qm@web110012.mail.gq1.yahoo.com> Message-ID: <28313327.16021248284612165.JavaMail.root@twoguyshosting.com.> Have you checked what browsers/version the client, and the client's client are using? Also does the form post to a relative URL?? If so are you going to www.domain.tld and everyone else is going to domain.tld?? Not sure this should effect anything but it would be a starting point. ----- Original Message ----- From: "Jeff Siegel" To: "NYPHP Talk" Sent: Wednesday, July 22, 2009 5:42:21 PM Subject: Re: [nycphp-talk] PHP Fileupload problem Donald, max_execution_time is 1800 Jeff ----- Original Message ---- From: Donald J. Organ IV To: NYPHP Talk Sent: Wednesday, July 22, 2009 1:29:56 PM Subject: Re: [nycphp-talk] PHP Fileupload problem What is the max_execution_time set to?? ----- Original Message ----- From: "Jeff Siegel" To: "NYPHP Talk" Sent: Wednesday, July 22, 2009 5:29:31 PM Subject: Re: [nycphp-talk] PHP Fileupload problem David, Small file uploads are no problem at all. Both clients who are having the problem are in business environments. (One is located in New York...the other is in Georgia.)? I'm working out of a home office in New York?using Verizon FIOS...the consultant I'm working with (who also doesn't have any problems with the upload) is using a home office in New York?and Cablevision. A head scratcher...no? Jeff ----- Original Message ---- From: David Krings To: NYPHP Talk Sent: Wednesday, July 22, 2009 1:22:44 PM Subject: Re: [nycphp-talk] PHP Fileupload problem Jeff Siegel wrote: > The code is real standard stuff (see below). A user selects a file. Clicks upload. When the upload is completed a refreshed page appears. This function works perfectly when I test it and when another consultant tests it. We are able to upload files of almost any size. When the upload is complete we see the new refreshed page and the uploaded file is in the correct directory. Of course...this does not work? when the client does the uploading. The browser seems to time out when the file is about 1 meg or greater in size. There are no PHP errors, no PHP timeout errors. Just the browser saying that the page cannot be displayed. > I tried the script running off of two different web hosts. It works for me. It works for the consultant. It doesn't work for the client. To make matters worse, the client's client has the same problem uploading files. Does uploading of even a small file fail as well? Which internet connection does the client have? Does the client have any other restrictions in place, for example particular traffic monitoring devices that kill any up- or download after a specific size? No clue what is happening, just some more things to look at. David _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php ? ? ? _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From jeff987654 at yahoo.com Wed Jul 22 13:48:59 2009 From: jeff987654 at yahoo.com (Jeff Siegel) Date: Wed, 22 Jul 2009 10:48:59 -0700 (PDT) Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <20190d950907221039p5316162egf70d40dbb6b412c3@mail.gmail.com> References: <161721.12759.qm@web110014.mail.gq1.yahoo.com> <18963152.15991248283795955.JavaMail.root@twoguyshosting.com.> <20190d950907221039p5316162egf70d40dbb6b412c3@mail.gmail.com> Message-ID: <310296.26044.qm@web110001.mail.gq1.yahoo.com> Tom, We thought it might be a file issue...however...I can upload the very same file as can the consultant. Further, we are running the code on two completely different servers (from two completely different hosting companies). Again...I can upload the file...the consultant can...the client cannot. Jeff ________________________________ From: Tom Sartain To: NYPHP Talk Sent: Wednesday, July 22, 2009 1:39:23 PM Subject: Re: [nycphp-talk] PHP Fileupload problem Just to reduce variables, is the client able to upload the same file to some other site?? On Wed, Jul 22, 2009 at 1:29 PM, Donald J. Organ IV wrote: What is the max_execution_time set to?? > > > >----- Original Message ----- >From: "Jeff Siegel" >To: "NYPHP Talk" > >Sent: Wednesday, July 22, 2009 5:29:31 PM >Subject: Re: [nycphp-talk] PHP Fileupload problem > >David, > >Small file uploads are no problem at all. > >Both clients who are having the problem are in business environments. (One is located in New York...the other is in Georgia.)? > >I'm working out of a home office in New York?using Verizon FIOS...the consultant I'm working with (who also doesn't have any problems with the upload) is using a home office in New York?and Cablevision. > >A head scratcher...no? > >Jeff > > > >----- Original Message ---- >From: David Krings >To: NYPHP Talk >Sent: Wednesday, July 22, 2009 1:22:44 PM >Subject: Re: [nycphp-talk] PHP Fileupload problem > >Jeff Siegel wrote: >> The code is real standard stuff (see below). A user selects a file. Clicks upload. When the upload is completed a refreshed page appears. This function works perfectly when I test it and when another consultant tests it. We are able to upload files of almost any size. When the upload is complete we see the new refreshed page and the uploaded file is in the correct directory. Of course...this does not work? when the client does the uploading. The browser seems to time out when the file is about 1 meg or greater in size. There are no PHP errors, no PHP timeout errors. Just the browser saying that the page cannot be displayed. >> I tried the script running off of two different web hosts. It works for me. It works for the consultant. It doesn't work for the client. To make matters worse, the client's client has the same problem uploading files. > >Does uploading of even a small file fail as well? Which internet connection does the client have? Does the client have any other restrictions in place, for example particular traffic monitoring devices that kill any up- or download after a specific size? > >No clue what is happening, just some more things to look at. > >David >_______________________________________________ >New York PHP User Group Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >http://www.nyphp.org/show_participation.php > > > > > >_______________________________________________ >New York PHP User Group Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >http://www.nyphp.org/show_participation.php >_______________________________________________ >New York PHP User Group Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomsartain at gmail.com Wed Jul 22 14:00:25 2009 From: tomsartain at gmail.com (Tom Sartain) Date: Wed, 22 Jul 2009 14:00:25 -0400 Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <310296.26044.qm@web110001.mail.gq1.yahoo.com> References: <161721.12759.qm@web110014.mail.gq1.yahoo.com> <18963152.15991248283795955.JavaMail.root@twoguyshosting.com.> <20190d950907221039p5316162egf70d40dbb6b412c3@mail.gmail.com> <310296.26044.qm@web110001.mail.gq1.yahoo.com> Message-ID: <20190d950907221100l7a7de5c6ydc550201fac4f27e@mail.gmail.com> On Wed, Jul 22, 2009 at 1:48 PM, Jeff Siegel wrote: > Tom, > > We thought it might be a file issue...however...I can upload the very same > file as can the consultant. Further, we are running the code on two > completely different servers (from two completely different hosting > companies). Again...I can upload the file...the consultant can...the client > cannot. > > Which just underscores the question of whether or not the client can even upload files anywhere. I wasn't thinking that the file was the issue, but the client's setup. Might be the internet connection, might be firewall type issues, might be browser configs... all of which would fall beyond your control. Would it be possible to have the client try to upload the file (or another file like it) to stashbox.org or GMail or any other place? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeff987654 at yahoo.com Wed Jul 22 15:17:56 2009 From: jeff987654 at yahoo.com (Jeff Siegel) Date: Wed, 22 Jul 2009 12:17:56 -0700 (PDT) Subject: [nycphp-talk] PHP Fileupload problem In-Reply-To: <20190d950907221100l7a7de5c6ydc550201fac4f27e@mail.gmail.com> References: <161721.12759.qm@web110014.mail.gq1.yahoo.com> <18963152.15991248283795955.JavaMail.root@twoguyshosting.com.> <20190d950907221039p5316162egf70d40dbb6b412c3@mail.gmail.com> <310296.26044.qm@web110001.mail.gq1.yahoo.com> <20190d950907221100l7a7de5c6ydc550201fac4f27e@mail.gmail.com> Message-ID: <975565.83337.qm@web110004.mail.gq1.yahoo.com> Tom (et al.), The client could NOT upload a 3.8meg file to stashbox. So...we're investigating their connectivity issues. Thank you and everyone on the list for your suggestions. Jeff ________________________________ From: Tom Sartain To: NYPHP Talk Sent: Wednesday, July 22, 2009 2:00:25 PM Subject: Re: [nycphp-talk] PHP Fileupload problem On Wed, Jul 22, 2009 at 1:48 PM, Jeff Siegel wrote: Tom, > >We thought it might be a file issue...however...I can upload the very same file as can the consultant. Further, we are running the code on two completely different servers (from two completely different hosting companies). Again...I can upload the file...the consultant can...the client cannot. > Which just underscores the question of whether or not the client can even upload files anywhere.? I wasn't thinking that the file was the issue, but the client's setup. Might be the internet connection, might be firewall type issues, might be browser configs... all of which would fall beyond your control. Would it be possible to have the client try to upload the file (or another file like it) to stashbox.org or GMail or any other place? -------------- next part -------------- An HTML attachment was scrubbed... URL: From y2rob at aol.com Wed Jul 22 15:20:28 2009 From: y2rob at aol.com (y2rob at aol.com) Date: Wed, 22 Jul 2009 15:20:28 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <330532b60907221023t20932d5eq4a9fc36f7be65810@mail.gmail.com> References: <6A76CB73-C38C-4ED2-959C-C830509306C5@cakephp.org><330532b60907211017h67d836d4q818dab6fb2f9b397@mail.gmail.com><4A67196A.6030306@devonianfarm.com> <330532b60907221023t20932d5eq4a9fc36f7be65810@mail.gmail.com> Message-ID: <8CBD9189B47A611-5C0-139B@webmail-dx07.sysops.aol.com> i believe this can be done with codeigniter and kohana (it's been a while since i've done this, fyi), but the view is set with the associated data from the called controller method, you probably could leave the set view out and set a header for this call. i hope this makes sense, if not i can clarify... ~rob -----Original Message----- From: Mitch Pirtle To: NYPHP Talk Sent: Wed, Jul 22, 2009 1:23 pm Subject: Re: [nycphp-talk] JSON and MVC Agreed - and Joomla does it by allowing you to assign the view as the document type. For example, you can create different views for html, rss, json output. As well, you can just output directly from the controller and exit. Been too busy with work to play with all the other frameworks out there, wanting to take a look at the new Zend framework as well as kohana. Wondering how all the other frameworks tackle this issue. -- Mitch On Wed, Jul 22, 2009 at 9:51 AM, Paul A Houle wrote: > ? I'd say that practically frameworks need to have some way to disable the > "view" layer, ?at least the HTML templates, ?to let a controller output raw > data. > > ? In my experience, ?for instance, ?business applications often need to > output csv or xls so that people can load content into a spreadsheet. ?Often > you want to be able to format (nearly) the same content in different ways. > > ? I'm working on a public facing app that's oriented towards the semantic > web; ?all pages are available in HTML, ?RDF/NT and RSS formats. ?Content is > ~almost~ the same, ?but not quite. ?HTML output is paged in order of > relevancy/quality (the page on topic X shows the top N content items related > to topic X;) ?RDF format offers a unpaged dump of triples related to topic X > (all of the triples that come from traversing the relationship tree coming > from X in a specified way); ?RSS offers a limited number of items ordered by > recency -- people can subscribe to a page via RSS and get updated when new > content gets added. > > ? The framework involves a certain amount of codesign between models, ?views > and controllers -- it's designed to produce a family of related sites with > high reuse, ?not to be a system for building general business apps like > Rails/Symfony/Cake... > > ? Administrative functions (editing content) are implemented in an > AJAX-heavy manner, ?where the role of "MVC" is quite different from > traditional. ?Layout templates aren't as important as a in conventional > webapp, ?since we're not redrawing the page each time. ? However, ?in an > AJAX application, ?the framework still must handle authentication for > requests, ?and also needs to have a systematic way to bolt in business rules > and handle violations. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at realm3.com Wed Jul 22 20:33:31 2009 From: brian at realm3.com (Brian D.) Date: Wed, 22 Jul 2009 19:33:31 -0500 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <08eb01ca093c$ec6e2690$c54a73b0$@com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <20090718144030.GA10027@panix.com> <08eb01ca093c$ec6e2690$c54a73b0$@com> Message-ID: > Time for another framework folks :) This technically is not a framework, but it's interesting: http://www.persvr.org/ - Brian D. realm3 web applications [realm3.com] Information architecture, application development. phone: (917) 512-3594 fax: (440) 744-3559 On Mon, Jul 20, 2009 at 8:21 AM, Hans Zaunere wrote: >> In a prior engagement, we were using XUL as the view and JSON as the >> communication protocol. ?This was nice, since the entire user interface >> resided on the user's desktop (as a Firefox Add-on), all we needed to >> transmit was the data. ?Of course, you need to be using HTML, so >> transpose the XUL I'm showing here into HTML. ?The framework we created >> used a consistent naming scheme, so the names of elements in the XUL >> matched identifiers in the database. > > Thanks Dan and all for their feedback. > > >From what I've gleamed from this discussion and others, Javascript code for > any given modern web application, is ever increasing. ?It's getting more and > more complex, to the point, dare I say, that much of the MVC functionality > is actually living in the browser, and less so on the server - the server is > becoming dumber and only performs simple operations and consistency/security > checks. > > I think this really begs some questions on current server-side frameworks > and the MVC methodology. ?Changes like this have already begun, namely in > RoR and other platforms. > > Time for another framework folks :) > > H > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From tim_lists at o2group.com Wed Jul 22 22:22:28 2009 From: tim_lists at o2group.com (Tim Lieberman) Date: Wed, 22 Jul 2009 22:22:28 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <330532b60907221023t20932d5eq4a9fc36f7be65810@mail.gmail.com> References: <6A76CB73-C38C-4ED2-959C-C830509306C5@cakephp.org> <330532b60907211017h67d836d4q818dab6fb2f9b397@mail.gmail.com> <4A67196A.6030306@devonianfarm.com> <330532b60907221023t20932d5eq4a9fc36f7be65810@mail.gmail.com> Message-ID: <8389391C-974B-4B97-B205-545A32F8A6A0@o2group.com> On Jul 22, 2009, at 1:23 PM, Mitch Pirtle wrote: > Agreed - and Joomla does it by allowing you to assign the view as the > document type. For example, you can create different views for html, > rss, json output. As well, you can just output directly from the > controller and exit. > > Been too busy with work to play with all the other frameworks out > there, wanting to take a look at the new Zend framework as well as > kohana. Wondering how all the other frameworks tackle this issue. Which MVC frameworks *don't* allow this? I know for Zend, Symfony, or Cake, it's something roughly like: function someControllerAction(){ $foo = someModel(); header("Content-Type: ..."); $foo->getSomethingIterableOrSomething->to[CSV|JSON|Something](); die(); } From zippy1981 at gmail.com Thu Jul 23 01:41:51 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Thu, 23 Jul 2009 01:41:51 -0400 Subject: [nycphp-talk] Designer Advice Message-ID: <5458db3c0907222241u41b68b18mca9cae9644a74236@mail.gmail.com> Hi, I've only ever worked with a designer once, and all he gave me was photoshop files that I used as references, and some flash stuff for this weird flash heavy site. However, I was thinking about a designer for my three websites I just launched, lmsotfy.com, lmsutfy.com and lmsftfy.com. Since I never worked with a designer before, I'm looking for how realistic my expectations are. Let me know if what I want is crazy, please. First of all price. I'd probably be looking to spend about $200. My sites are pretty simple without a lot of content. There is one PHP script that generates 2 versions of the same view.. Second, I'm looking for a designer that can give me actual html, or preferable edit the php file directly. Beingable to give them readonly svn accesss, or access to a branch and getting a patch would be ideal Third, I want someone who is a designer first. I spend more time looking at my webpages through a view source window or the xhtml validator than the actual page itself. I want a designer that thinks visually Fourth, I want validated xhtml 1.0 strict. I'd be willing to consider another html flavor, but only for a good reason. Fifthly, I don't care what country the person I hire lives in, but being local enough to meet in person would be a nice thing. In summary I mainly need someone with actual artistic vision to make my page look pretty. However, I don't want to be given a PSD file I'll have to chop up myself. Regards, Justin Dearing From oorza2k5 at gmail.com Thu Jul 23 01:58:16 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Thu, 23 Jul 2009 01:58:16 -0400 Subject: [nycphp-talk] Designer Advice In-Reply-To: <5458db3c0907222241u41b68b18mca9cae9644a74236@mail.gmail.com> References: <5458db3c0907222241u41b68b18mca9cae9644a74236@mail.gmail.com> Message-ID: <68de37340907222258m2b972e49uc4355baec9d5d265@mail.gmail.com> On Thu, Jul 23, 2009 at 1:41 AM, Justin Dearing wrote: > Hi, > > I've only ever worked with a designer once, and all he gave me was > photoshop files that I used as references, and some flash stuff for > this weird flash heavy site. However, I was thinking about a designer > for my three websites I just launched, lmsotfy.com, lmsutfy.com and > lmsftfy.com. Since I never worked with a designer before, I'm looking > for how realistic my expectations are. ?Let me know if what I want is > crazy, please. > > First of all price. I'd probably be looking to spend about $200. My > sites are pretty simple without a lot of content. There is one PHP > script that generates 2 versions of the same view.. > > Second, I'm looking for a designer that can give me actual html, or > preferable edit the php file directly. Beingable to give them readonly > svn accesss, or access to a branch and getting a patch would be ideal > > Third, I want someone who is a designer first. I spend more time > looking at my webpages through a view source window or the xhtml > validator than the actual page itself. I want a designer that thinks > visually > > Fourth, I want validated xhtml 1.0 strict. I'd be willing to consider > another html flavor, but only for a good reason. > > Fifthly, I don't care what country the person I hire lives in, but > being local enough to meet in person would be a nice thing. > > In summary I ?mainly need someone with actual artistic vision to make > my page look pretty. However, I don't want to be given a PSD file I'll > have to chop up myself. > > > Regards, > > Justin Dearing > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > At the shop, we make use of a fellow named Jesse Arnold, his site is here: http://mistermachine.com . He does some pretty solid work, provides HTML/CSS/PSD. He's based out of brooklyn, so he's local. I'd recommend (and I have before) him to anyone that needs design work. There's some examples of his work at his site and I for one usually wind up impressed when he takes some markup I've written and "makes it pretty" after I "make it work" as the office joke goes =) Probably not what you're expecting, but he fits your reqs (and probably your price, but that's between you and him :]) so I couldn't help but refer a friend. --Eddie From leam at reuel.net Thu Jul 23 05:47:24 2009 From: leam at reuel.net (Leam Hall) Date: Thu, 23 Jul 2009 05:47:24 -0400 Subject: [nycphp-talk] Designer Advice In-Reply-To: <68de37340907222258m2b972e49uc4355baec9d5d265@mail.gmail.com> References: <5458db3c0907222241u41b68b18mca9cae9644a74236@mail.gmail.com> <68de37340907222258m2b972e49uc4355baec9d5d265@mail.gmail.com> Message-ID: <4A6831AC.5040806@reuel.net> Wow...I like his site! Nice clean design! Now I know who to call, even though he's not local to me. :) Leam Eddie Drapkin wrote: > At the shop, we make use of a fellow named Jesse Arnold, his site is > here: http://mistermachine.com . He does some pretty solid work, > provides HTML/CSS/PSD. He's based out of brooklyn, so he's local. > I'd recommend (and I have before) him to anyone that needs design > work. There's some examples of his work at his site and I for one > usually wind up impressed when he takes some markup I've written and > "makes it pretty" after I "make it work" as the office joke goes =) > > Probably not what you're expecting, but he fits your reqs (and > probably your price, but that's between you and him :]) so I couldn't > help but refer a friend. > --Eddie From chsnyder at gmail.com Thu Jul 23 08:21:57 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 23 Jul 2009 08:21:57 -0400 Subject: [nycphp-talk] JSON and MVC In-Reply-To: <08eb01ca093c$ec6e2690$c54a73b0$@com> References: <075701ca0558$e84753d0$b8d5fb70$@com> <20090718144030.GA10027@panix.com> <08eb01ca093c$ec6e2690$c54a73b0$@com> Message-ID: Hey Hans, if you haven't moved on, or decided to ignore this thread already, take a look at http://johnnycoder.com/blog/2008/12/18/jtemplates-with-jquery-ajax-and-json/ (via Jon Baer's blog) Template system for jQuery, you just inline them with your HTML. From brian at realm3.com Fri Jul 24 12:46:32 2009 From: brian at realm3.com (Brian D.) Date: Fri, 24 Jul 2009 11:46:32 -0500 Subject: [nycphp-talk] Frameworks & Fast Iterations Message-ID: - How do you deal with quickly-morphing PHP frameworks when some applications tend to stay in production for years at a time? - Do any of you have a good experience with a framework that ages well? As others have pointed out, the more abstracted a given foundation is, the faster it changes. C code pretty much works the same way it did 10 years ago. PHP 5.3 is quite a bit different than the PHP3 code I wrote years ago. Frameworks (I've used Zend and CakePHP) change even faster - the code I wrote last year for Cake or Zend is quite a bit different than the code I write today. This causes an issue with applications that have a long life-span. They age very poorly. You basically have two choices: 1. Upgrade your application to fit new framework API changes. This leads to an inordinate amount of time upgrading, which means less time you can devote to actually improving the application itself. You're stuck upgrading existing functionality broken by new upgrades. In my experience, frameworks tend to be brittle. 2. Don't upgrade. You may miss out on security fixes or new functionality. You may even have to patch the framework code to fix security issues without breaking other functionality, which means now you have undocumented changes. Documentation for past frameworks may even be difficult to find (assuming it's even online). How do you guys handle this? - Brian -- realm3 web applications realm3.com/ twitter.com/brian_dailey/ p: 917-512-3594 f: 440-744-3559 From ajai at bitblit.net Fri Jul 24 14:12:09 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 24 Jul 2009 14:12:09 -0400 (EDT) Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: Message-ID: On Fri, 24 Jul 2009, Brian D. wrote: > This causes an issue with applications that have a long life-span. > They age very poorly. You basically have two choices: > 1. Upgrade your application to fit new framework API changes. This > leads to an inordinate amount of time upgrading, which means less time > you can devote to actually improving the application itself. You're > stuck upgrading existing functionality broken by new upgrades. In my > experience, frameworks tend to be brittle. > 2. Don't upgrade. You may miss out on security fixes or new > functionality. You may even have to patch the framework code to fix > security issues without breaking other functionality, which means now > you have undocumented changes. Documentation for past frameworks may > even be difficult to find (assuming it's even online). > > How do you guys handle this? I think it depends on the framework. symfony for example released 1.0 in 2007 and announced they would support it until 2010. Even after 1.1 and 1.2 were released, they introduced a compatibility option which required no porting of code even when running on the latest 1.2 code base. -- Aj. From jmcgraw1 at gmail.com Fri Jul 24 15:34:56 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Fri, 24 Jul 2009 15:34:56 -0400 Subject: [nycphp-talk] Do any URL Shortening services have an https accessiable url? In-Reply-To: <5458db3c0907212245x49dc4ee5kdb3da280ecb77091@mail.gmail.com> References: <5458db3c0907212245x49dc4ee5kdb3da280ecb77091@mail.gmail.com> Message-ID: I answered this on Stack Overflow, but I thought the NYPHP may want to take advantage of the new service I had a small part in developing: http://woo.ly supports https URLs and has an API and support for custom domains. - jake On Wed, Jul 22, 2009 at 1:45 AM, Justin Dearing wrote: > Before I fall victim to my own practical joke twice on this list in > one day, I already asked on stackoverflow. > > http://stackoverflow.com/questions/1163226/do-any-url-shortening-services-with-link-tracking-have-a-https-accessiable-url > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ajai at bitblit.net Fri Jul 24 16:59:13 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 24 Jul 2009 16:59:13 -0400 (EDT) Subject: [nycphp-talk] Caching, proxies, sharding and other scaling questions Message-ID: Can anyone recommend good online resources for (mailing lists, web sites, etc) which deal specifically with scaling issues, e.g. use of memcached, proxy servers, sharding, etc. -- Aj. From brian at realm3.com Fri Jul 24 17:00:40 2009 From: brian at realm3.com (Brian Dailey) Date: Fri, 24 Jul 2009 16:00:40 -0500 Subject: [nycphp-talk] Caching, proxies, sharding and other scaling questions In-Reply-To: References: Message-ID: <4A6A20F8.1080400@realm3.com> http://highscalability.com/ Ajai Khattri wrote: > Can anyone recommend good online resources for (mailing lists, web sites, > etc) which deal specifically with scaling issues, e.g. use of memcached, > proxy servers, sharding, etc. > > > -- realm3 web applications realm3.com/ twitter.com/brian_dailey/ p: 917-512-3594 f: 440-744-3559 From oorza2k5 at gmail.com Fri Jul 24 17:50:33 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Fri, 24 Jul 2009 17:50:33 -0400 Subject: [nycphp-talk] Caching, proxies, sharding and other scaling questions In-Reply-To: <4A6A20F8.1080400@realm3.com> References: <4A6A20F8.1080400@realm3.com> Message-ID: <68de37340907241450h34442589tb1be0a3f35dcb15b@mail.gmail.com> Beat me to it! There's also: www.mysqlperformanceblog.com On Fri, Jul 24, 2009 at 5:00 PM, Brian Dailey wrote: > http://highscalability.com/ > > Ajai Khattri wrote: >> >> Can anyone recommend good online resources for (mailing lists, web sites, >> etc) which deal specifically with scaling issues, e.g. use of memcached, >> proxy servers, sharding, etc. >> >> >> > > -- > realm3 web applications > realm3.com/ > twitter.com/brian_dailey/ > p: 917-512-3594 > f: 440-744-3559 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ajai at bitblit.net Fri Jul 24 17:58:04 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 24 Jul 2009 17:58:04 -0400 (EDT) Subject: [nycphp-talk] Caching, proxies, sharding and other scaling questions In-Reply-To: <4A6A20F8.1080400@realm3.com> Message-ID: On Fri, 24 Jul 2009, Brian Dailey wrote: > http://highscalability.com/ Yes, I forgot about that great site. We're toying with using memcache but the $M question is: how many memcache servers will we need? Is it just a case of testing-tweaking-testing or are there some ballpark figures I can a least use as a starting point? -- Aj. From lists at zaunere.com Fri Jul 24 18:24:05 2009 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 24 Jul 2009 18:24:05 -0400 Subject: [nycphp-talk] Caching, proxies, sharding and other scaling questions In-Reply-To: References: <4A6A20F8.1080400@realm3.com> Message-ID: <04e901ca0cad$74824390$5d86cab0$@com> > > http://highscalability.com/ > > Yes, I forgot about that great site. And I'm sure many on this list have experience in this field too... > We're toying with using memcache but the $M question is: how many memcache > servers will we need? Is it just a case of testing-tweaking-testing or are > there some ballpark figures I can a least use as a starting point? Well Facebook has TBs up in memcache. In fact, much of their architecture depends on it. If you need to deal with scaling, there's no answer to questions like "how many..." or "how much..." If those were known numbers, it wouldn't be scaling. Rather, start thinking in terms of "where is" and "how do I" - for example, "where are the expected pressure points in my application" and "how do I let that scale." It's an architectural question, rather than a quantitative one, which is specifically complex to what your application does. H From jmcgraw1 at gmail.com Fri Jul 24 18:25:21 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Fri, 24 Jul 2009 18:25:21 -0400 Subject: [nycphp-talk] Caching, proxies, sharding and other scaling questions In-Reply-To: References: <4A6A20F8.1080400@realm3.com> Message-ID: Whats your data size like? How many requests per second do you plan on handling? The easiest route for switching some of your data store routines from a relational database to a key/value store (memcache is nice, personally, I'm becoming a big fan of Redis) is to set up a single instance and see how it handles the load. For example, with modern hardware, value look up from a single, untaxed instance of memcache should take around 1ms. At a certain point, based almost entirely on traffic, that'll go up. When it gets to an undesirable level, throw in another memcache instance and hash the keys to spread the load (or allow your memcached client to hash the keys for you). Continue this until some other bottleneck rears its head. - jake On Fri, Jul 24, 2009 at 5:58 PM, Ajai Khattri wrote: > On Fri, 24 Jul 2009, Brian Dailey wrote: > >> http://highscalability.com/ > > Yes, I forgot about that great site. > > We're toying with using memcache but the $M question is: how many memcache > servers will we need? Is it just a case of testing-tweaking-testing or are > there some ballpark figures I can a least use as a starting point? > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ajai at bitblit.net Fri Jul 24 18:45:48 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 24 Jul 2009 18:45:48 -0400 (EDT) Subject: [nycphp-talk] Caching, proxies, sharding and other scaling questions In-Reply-To: Message-ID: On Fri, 24 Jul 2009, Jake McGraw wrote: > Whats your data size like? How many requests per second do you plan on > handling? Its a very big site. Last year, we handled a total of 945 million page views. And we expect those numbers to go up of course :-) > a relational database to a key/value store (memcache is nice, > personally, I'm becoming a big fan of Redis) is to set up a single > instance and see how it handles the load. Yes, my thoughts exactly. (BTW, I also looked at Redis earlier today, but I have yet to see a comparison with memcache). Any thoughts? > For example, with modern > hardware, value look up from a single, untaxed instance of memcache > should take around 1ms. At a certain point, based almost entirely on > traffic, that'll go up. When it gets to an undesirable level, throw in > another memcache instance and hash the keys to spread the load (or > allow your memcached client to hash the keys for you). Continue this > until some other bottleneck rears its head. We know where the bottle necks are, so right now its a case of selecting some solutions to test with. -- Aj. From jmcgraw1 at gmail.com Fri Jul 24 19:29:29 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Fri, 24 Jul 2009 19:29:29 -0400 Subject: [nycphp-talk] Caching, proxies, sharding and other scaling questions In-Reply-To: References: Message-ID: On Fri, Jul 24, 2009 at 6:45 PM, Ajai Khattri wrote: > On Fri, 24 Jul 2009, Jake McGraw wrote: > >> Whats your data size like? How many requests per second do you plan on >> handling? > > Its a very big site. Last year, we handled a total of 945 million page > views. And we expect those numbers to go up of course :-) > >> a relational database to a key/value store (memcache is nice, >> personally, I'm becoming a big fan of Redis) is to set up a single >> instance and see how it handles the load. > > Yes, my thoughts exactly. (BTW, I also looked at Redis earlier today, but > I have yet to see a comparison with memcache). Any thoughts? > Memcache is a proven product with a long (in web terms) history. Redis is brand knew, RC for version 1.0 was just put out fairly recently. The things I like about Redis are: Data Persistence (not just in memory) * Very easy to take a snapshot of your entire data store, just backup the data dump dir. * Very easy to prime a new data store. Let's say part of scaling strategy includes mirroring your data, that is, you'll have multiple cache servers with the same data. Simply take a snapshot of your data dir, move the files to a new server and start redis. * If your server goes down you can still recover information from the last active state. Lists Redis is not just a key/value store, it also provides lists of values under a single key. You can push, pop, get the length, get an arbitrary value within a list and a bunch of other features. Doing all of this computation within the provides two benefits: 1. No round trip and (de)serialization, 2. Atomic transactions. KEYS command for wildcards in key support. http://code.google.com/p/redis/wiki/KeysCommand Sets Though I haven't played around with sets yet, they look pretty powerful. In general, I think the KEYS and List commands makes the whole key/value thing a lot easier to use when coming from an RDBMS background. For performance information, check out this post: http://groups.google.com/group/redis-db/browse_thread/thread/0c706a43bc78b0e5/455dd41883d90101#455dd41883d90101 - jake >> For example, with modern >> hardware, value look up from a single, untaxed instance of memcache >> should take around 1ms. At a certain point, based almost entirely on >> traffic, that'll go up. When it gets to an undesirable level, throw in >> another memcache instance and hash the keys to spread the load (or >> allow your memcached client to hash the keys for you). Continue this >> until some other bottleneck rears its head. > > We know where the bottle necks are, so right now its a case of selecting > some solutions to test with. > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From petros.ziogas at gmail.com Sat Jul 25 06:39:50 2009 From: petros.ziogas at gmail.com (Petros Ziogas) Date: Sat, 25 Jul 2009 13:39:50 +0300 Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: References: Message-ID: <236c3b210907250339p660c2368wdb5e7dcbe7b4e707@mail.gmail.com> I have the exact same problem. I find it a little immature to change the way a framework is deployed and the setup after 6 months. I created a nice CMS based on Zend 1.6 and now I see that 1.8.4 is completely different and nothing works. I am one step from going back to my own framework where I kept everything under control. Petros Ziogas http://www.royalblue.gr On Fri, Jul 24, 2009 at 9:12 PM, Ajai Khattri wrote: > On Fri, 24 Jul 2009, Brian D. wrote: > > > This causes an issue with applications that have a long life-span. > > They age very poorly. You basically have two choices: > > 1. Upgrade your application to fit new framework API changes. This > > leads to an inordinate amount of time upgrading, which means less time > > you can devote to actually improving the application itself. You're > > stuck upgrading existing functionality broken by new upgrades. In my > > experience, frameworks tend to be brittle. > > 2. Don't upgrade. You may miss out on security fixes or new > > functionality. You may even have to patch the framework code to fix > > security issues without breaking other functionality, which means now > > you have undocumented changes. Documentation for past frameworks may > > even be difficult to find (assuming it's even online). > > > > How do you guys handle this? > > I think it depends on the framework. symfony for example released 1.0 > in 2007 and announced they would support it until 2010. Even after 1.1 and > 1.2 were released, they introduced a compatibility option which required > no porting of code even when running on the latest 1.2 code base. > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From SyAD at aol.com Sat Jul 25 10:06:26 2009 From: SyAD at aol.com (SyAD at aol.com) Date: Sat, 25 Jul 2009 10:06:26 EDT Subject: [nycphp-talk] Frameworks & Fast Iterations Message-ID: Ouch! I was thinking of going to a framework from my own setup, but hearing this worries me. I'm wondering if there are other frameworks that pay more attention to backward compatibility? In a message dated 7/25/2009 6:40:29 AM Eastern Standard Time, petros.ziogas at gmail.com writes: I have the exact same problem. I find it a little immature to change the way a framework is deployed and the setup after 6 months. I created a nice CMS based on Zend 1.6 and now I see that 1.8.4 is completely different and nothing works. I am one step from going back to my own framework where I kept everything under control. Petros Ziogas _http://www.royalblue.gr/_ (http://www.royalblue.gr/) On Fri, Jul 24, 2009 at 9:12 PM, Ajai Khattri <_ajai at bitblit.net_ (mailto:ajai at bitblit.net) > wrote: On Fri, 24 Jul 2009, Brian D. wrote: > This causes an issue with applications that have a long life-span. > They age very poorly. You basically have two choices: > 1. Upgrade your application to fit new framework API changes. This > leads to an inordinate amount of time upgrading, which means less time > you can devote to actually improving the application itself. You're > stuck upgrading existing functionality broken by new upgrades. In my > experience, frameworks tend to be brittle. > 2. Don't upgrade. You may miss out on security fixes or new > functionality. You may even have to patch the framework code to fix > security issues without breaking other functionality, which means now > you have undocumented changes. Documentation for past frameworks may > even be difficult to find (assuming it's even online). > > How do you guys handle this? I think it depends on the framework. symfony for example released 1.0 in 2007 and announced they would support it until 2010. Even after 1.1 and 1.2 were released, they introduced a compatibility option which required no porting of code even when running on the latest 1.2 code base. -- Aj. _______________________________________________ New York PHP User Group Community Talk Mailing List _http://lists.nyphp.org/mailman/listinfo/talk_ (http://lists.nyphp.org/mailman/listinfo/talk) _http://www.nyphp.org/show_participation.php_ (http://www.nyphp.org/show_participation.php) _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php **************An Excellent Credit Score is 750. See Yours in Just 2 Easy Steps! (http://pr.atwola.com/promoclk/100126575x1222585106x1201462830/aol?redir=http://www.freecreditreport.com/pm/default.aspx?sc=668072&hmpgID=62&bcd=Jul yExcfooterNO62) -------------- next part -------------- An HTML attachment was scrubbed... URL: From anoland at indigente.net Sat Jul 25 12:12:30 2009 From: anoland at indigente.net (Adrian Noland) Date: Sat, 25 Jul 2009 11:12:30 -0500 Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: References: Message-ID: <1d8a0e930907250912g744a3ee7ia23880d0e9732a69@mail.gmail.com> I work with the assumption that the site will *need* to be rewritten in 18-24 months. If you can live with the current version of the framework, keep it on hand. The idea being, you can leap-frog several versions of the framework, and refactor/rewrite with large changes on both the site and the framework. The definition of "need" being a subjective one. If the client hasn't yet realized a rework is in order, you will have to do some education and nudging in that direction. Does anybody still work on any pre-"web 2.0" anymore? I don't think so. I believe this is a healthy mindset to have. Just because it is C doesn't mean it is safe either. At a previous job, they had some legacy CGI that ran some custom C module written years and years ago. Nobody would touch it because it "just worked". When RedHat stopped shipping the only GCC that would compile the module, we had to hastily abandon it and hack together a workaround. Caused everybody a headache for a couple weeks. On Fri, Jul 24, 2009 at 11:46 AM, Brian D. wrote: > - How do you deal with quickly-morphing PHP frameworks when some > applications tend to stay in production for years at a time? > - Do any of you have a good experience with a framework that ages well? > > > How do you guys handle this? > > - Brian > -- > realm3 web applications > realm3.com/ > twitter.com/brian_dailey/ > p: 917-512-3594 > f: 440-744-3559 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From leam at reuel.net Sat Jul 25 13:10:19 2009 From: leam at reuel.net (Leam Hall) Date: Sat, 25 Jul 2009 13:10:19 -0400 Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: <1d8a0e930907250912g744a3ee7ia23880d0e9732a69@mail.gmail.com> References: <1d8a0e930907250912g744a3ee7ia23880d0e9732a69@mail.gmail.com> Message-ID: <4A6B3C7B.3080401@reuel.net> If you're coming out with site-breaking changes every 6 months and not supporting older versions, why would anyone use the product? Frameworks should be a tool, not a master. They should save time. Or so I thought. Saves me the trouble of learning one. Leam From mitch.pirtle at gmail.com Sat Jul 25 14:18:22 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Sat, 25 Jul 2009 14:18:22 -0400 Subject: [nycphp-talk] Caching, proxies, sharding and other scaling questions In-Reply-To: References: Message-ID: <330532b60907251118h65c5286eh2beee449a7b27bdf@mail.gmail.com> Memcache is your safest option for an in-memory solution, for sure. Realistically, does memcache even have a competitor in that regard? For persistent storage, you should look at MongoDB and Project Voldemort. Voldemort is insanely fast as a key/value store, and coupled with BerkeleyDB storage is unbeatable for scale, shard and speed needs. MongoDB provides a persistent datastore that also goes direct to disk, and is wikkid fast - MongDB tries to bridge the gap between key/value stores (scale, shard, speed) and relational databases (lists, finds). I have a site that will probably break 1B page views in 6 months, running on three physical webservers, each of which having memcache as well. It certainly can be done, but depends greatly on the quality of your developers, how much time you give them to do their thing, and the overall performance characteristics and requirements of your site. Making massive scale websites isn't actually hard, it just takes time. Not giving your engineers time to think things through takes their efficiency and sets it on fire outside in the street. :-) -- Mitch On Fri, Jul 24, 2009 at 7:29 PM, Jake McGraw wrote: > On Fri, Jul 24, 2009 at 6:45 PM, Ajai Khattri wrote: >> On Fri, 24 Jul 2009, Jake McGraw wrote: >> >>> Whats your data size like? How many requests per second do you plan on >>> handling? >> >> Its a very big site. Last year, we handled a total of 945 million page >> views. And we expect those numbers to go up of course :-) >> >>> a relational database to a key/value store (memcache is nice, >>> personally, I'm becoming a big fan of Redis) is to set up a single >>> instance and see how it handles the load. >> >> Yes, my thoughts exactly. (BTW, I also looked at Redis earlier today, but >> I have yet to see a comparison with memcache). Any thoughts? >> > > Memcache is a proven product with a long (in web terms) history. Redis > is brand knew, RC for version 1.0 was just put out fairly recently. > The things I like about Redis are: > > Data Persistence (not just in memory) > * Very easy to take a snapshot of your entire data store, just backup > the data dump dir. > * Very easy to prime a new data store. Let's say part of scaling > strategy includes mirroring your data, that is, you'll have multiple > cache servers with the same data. Simply take a snapshot of your data > dir, move the files to a new server and start redis. > * If your server goes down you can still recover information from the > last active state. > > Lists > Redis is not just a key/value store, it also provides lists of values > under a single key. You can push, pop, get the length, get an > arbitrary value within a list and a bunch of other features. Doing all > of this computation within the provides two benefits: 1. No round trip > and (de)serialization, 2. Atomic transactions. > > KEYS command for wildcards in key support. > http://code.google.com/p/redis/wiki/KeysCommand > > Sets > Though I haven't played around with sets yet, they look pretty powerful. > > In general, I think the KEYS and List commands makes the whole > key/value thing a lot easier to use when coming from an RDBMS > background. For performance information, check out this post: > > http://groups.google.com/group/redis-db/browse_thread/thread/0c706a43bc78b0e5/455dd41883d90101#455dd41883d90101 > > - jake > >>> For example, with modern >>> hardware, value look up from a single, untaxed instance of memcache >>> should take around 1ms. At a certain point, based almost entirely on >>> traffic, that'll go up. When it gets to an undesirable level, throw in >>> another memcache instance and hash the keys to spread the load (or >>> allow your memcached client to hash the keys for you). Continue this >>> until some other bottleneck rears its head. >> >> We know where the bottle necks are, so right now its a case of selecting >> some solutions to test with. >> >> >> -- >> Aj. >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From chsnyder at gmail.com Sat Jul 25 16:20:48 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Sat, 25 Jul 2009 16:20:48 -0400 Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: <4A6B3C7B.3080401@reuel.net> References: <1d8a0e930907250912g744a3ee7ia23880d0e9732a69@mail.gmail.com> <4A6B3C7B.3080401@reuel.net> Message-ID: On Sat, Jul 25, 2009 at 1:10 PM, Leam Hall wrote: > If you're coming out with site-breaking changes every 6 months and not > supporting older versions, why would anyone use the product? Frameworks > should be a tool, not a master. They should save time. > > Or so I thought. Saves me the trouble of learning one. > > Leam Oh no, that's exactly right. But at the same time, if you don't release a new version of your framework every six months developers get antsy about whether the project is abandoned. Can't win. This is a pretty run-of-the-mill problem in programming. When you write code, you depend on the behavior and quirks of whatever languages and libraries you are developing against. If you made good (or lucky!) decisions about what to depend on, the languages and libraries will evolve without breaking your code. If not, you'll spend time refactoring after an upgrade. Frameworks, especially stable, well-documented frameworks, save time. Unquestionably. And when new versions break compatibility, at least you're not alone in having to find workarounds. Some tips, I guess: Don't customize the framework. As changes you make to framework code will likely need to be made each time you upgrade the framework, and may break other things over time. Write compatibility functions or override methods or something instead. Don't be afraid to upgrade. The sooner you get it over with, the less pain you'll face on the next release. Release notes for version n.0 of a product will often include detailed lists of gotchas and ways in which compatibility is broken. Notes for version n.1 and beyond will not. Lurk on developer mailing lists or blog so that you know about big changes in advance. Branch your project so that you can work on supporting next release of the framework even as you support previous release in production. Finally, maybe this is too obvious, but I use symbolic links to point to specific versions of third-party packages: somelib-2.1.3 somelib-3.0.1 somelib -> somelib-2.1.3 When the time comes to upgrade, you just remove the link and relink to the newer version. This makes it easy to roll back quickly if necessary. From ramons at gmx.net Sat Jul 25 18:49:00 2009 From: ramons at gmx.net (David Krings) Date: Sat, 25 Jul 2009 18:49:00 -0400 Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: References: <1d8a0e930907250912g744a3ee7ia23880d0e9732a69@mail.gmail.com> <4A6B3C7B.3080401@reuel.net> Message-ID: <4A6B8BDC.3080507@gmx.net> Chris Snyder wrote: > On Sat, Jul 25, 2009 at 1:10 PM, Leam Hall wrote: >> If you're coming out with site-breaking changes every 6 months and not >> supporting older versions, why would anyone use the product? Frameworks >> should be a tool, not a master. They should save time. >> >> Or so I thought. Saves me the trouble of learning one. >> >> Leam > > Oh no, that's exactly right. But at the same time, if you don't > release a new version of your framework every six months developers > get antsy about whether the project is abandoned. Can't win. You can if you continue to support the old version or, what might be difficult to do and not accepted by some, provide a tool that upgrades exsting scripts to work with the new framework. We do that with databases, why not with code as well? The question is if one really needs an off the shelf framework. While I do see the benefit in doing so (why reinvent the wheel?) if it is really only for some basic tasks then rolling your own might be better. Says someone who does neither.... David From jmcgraw1 at gmail.com Sat Jul 25 20:43:07 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Sat, 25 Jul 2009 20:43:07 -0400 Subject: [nycphp-talk] Caching, proxies, sharding and other scaling questions In-Reply-To: <330532b60907251118h65c5286eh2beee449a7b27bdf@mail.gmail.com> References: <330532b60907251118h65c5286eh2beee449a7b27bdf@mail.gmail.com> Message-ID: Very ontopic image for our discussion: http://highscalability.com/nsfw-hilarious-fault-tolerance-cartoon On Sat, Jul 25, 2009 at 2:18 PM, Mitch Pirtle wrote: > Memcache is your safest option for an in-memory solution, for sure. > Realistically, does memcache even have a competitor in that regard? > > For persistent storage, you should look at MongoDB and Project > Voldemort. Voldemort is insanely fast as a key/value store, and > coupled with BerkeleyDB storage is unbeatable for scale, shard and > speed needs. > > MongoDB provides a persistent datastore that also goes direct to disk, > and is wikkid fast - MongDB tries to bridge the gap between key/value > stores (scale, shard, speed) and relational databases (lists, finds). > > I have a site that will probably break 1B page views in 6 months, > running on three physical webservers, each of which having memcache as > well. It certainly can be done, but depends greatly on the quality of > your developers, how much time you give them to do their thing, and > the overall performance characteristics and requirements of your site. > > Making massive scale websites isn't actually hard, it just takes time. > Not giving your engineers time to think things through takes their > efficiency and sets it on fire outside in the street. :-) > > -- Mitch > > On Fri, Jul 24, 2009 at 7:29 PM, Jake McGraw wrote: >> On Fri, Jul 24, 2009 at 6:45 PM, Ajai Khattri wrote: >>> On Fri, 24 Jul 2009, Jake McGraw wrote: >>> >>>> Whats your data size like? How many requests per second do you plan on >>>> handling? >>> >>> Its a very big site. Last year, we handled a total of 945 million page >>> views. And we expect those numbers to go up of course :-) >>> >>>> a relational database to a key/value store (memcache is nice, >>>> personally, I'm becoming a big fan of Redis) is to set up a single >>>> instance and see how it handles the load. >>> >>> Yes, my thoughts exactly. (BTW, I also looked at Redis earlier today, but >>> I have yet to see a comparison with memcache). Any thoughts? >>> >> >> Memcache is a proven product with a long (in web terms) history. Redis >> is brand knew, RC for version 1.0 was just put out fairly recently. >> The things I like about Redis are: >> >> Data Persistence (not just in memory) >> * Very easy to take a snapshot of your entire data store, just backup >> the data dump dir. >> * Very easy to prime a new data store. Let's say part of scaling >> strategy includes mirroring your data, that is, you'll have multiple >> cache servers with the same data. Simply take a snapshot of your data >> dir, move the files to a new server and start redis. >> * If your server goes down you can still recover information from the >> last active state. >> >> Lists >> Redis is not just a key/value store, it also provides lists of values >> under a single key. You can push, pop, get the length, get an >> arbitrary value within a list and a bunch of other features. Doing all >> of this computation within the provides two benefits: 1. No round trip >> and (de)serialization, 2. Atomic transactions. >> >> KEYS command for wildcards in key support. >> http://code.google.com/p/redis/wiki/KeysCommand >> >> Sets >> Though I haven't played around with sets yet, they look pretty powerful. >> >> In general, I think the KEYS and List commands makes the whole >> key/value thing a lot easier to use when coming from an RDBMS >> background. For performance information, check out this post: >> >> http://groups.google.com/group/redis-db/browse_thread/thread/0c706a43bc78b0e5/455dd41883d90101#455dd41883d90101 >> >> - jake >> >>>> For example, with modern >>>> hardware, value look up from a single, untaxed instance of memcache >>>> should take around 1ms. At a certain point, based almost entirely on >>>> traffic, that'll go up. When it gets to an undesirable level, throw in >>>> another memcache instance and hash the keys to spread the load (or >>>> allow your memcached client to hash the keys for you). Continue this >>>> until some other bottleneck rears its head. >>> >>> We know where the bottle necks are, so right now its a case of selecting >>> some solutions to test with. >>> >>> >>> -- >>> Aj. >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >>> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From jmcgraw1 at gmail.com Sat Jul 25 20:48:15 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Sat, 25 Jul 2009 20:48:15 -0400 Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: <236c3b210907250339p660c2368wdb5e7dcbe7b4e707@mail.gmail.com> References: <236c3b210907250339p660c2368wdb5e7dcbe7b4e707@mail.gmail.com> Message-ID: On Sat, Jul 25, 2009 at 6:39 AM, Petros Ziogas wrote: > I have the exact same problem. > I find it a little immature to change the way a framework is deployed and > the setup after 6 months. > I created a nice CMS based on Zend 1.6 and now I see that 1.8.4 is > completely different and nothing works. > I am one step from going back to my own framework where I kept everything > under control. What do you mean nothing works? I'd be interested to hear what your issue is since I've been developing apps in using Zend Framework MVC since 1.5 and the only changes I've had to make are associated with Zend_Loader and adding support for Zend_Application_Bootstrap. I use the unofficial/official PEAR channel (http://pear.zfcampus.org/) to keep up to date. - jake > Petros Ziogas > http://www.royalblue.gr > > > > On Fri, Jul 24, 2009 at 9:12 PM, Ajai Khattri wrote: >> >> On Fri, 24 Jul 2009, Brian D. wrote: >> >> > This causes an issue with applications that have a long life-span. >> > They age very poorly. You basically have two choices: >> > 1. Upgrade your application to fit new framework API changes. This >> > leads to an inordinate amount of time upgrading, which means less time >> > you can devote to actually improving the application itself. You're >> > stuck upgrading existing functionality broken by new upgrades. In my >> > experience, frameworks tend to be brittle. >> > 2. Don't upgrade. You may miss out on security fixes or new >> > functionality. You may even have to patch the framework code to fix >> > security issues without breaking other functionality, which means now >> > you have undocumented changes. Documentation for past frameworks may >> > even be difficult to find (assuming it's even online). >> > >> > How do you guys handle this? >> >> I think it depends on the framework. symfony for example released 1.0 >> in 2007 and announced they would support it until 2010. Even after 1.1 and >> 1.2 were released, they introduced a compatibility option which required >> no porting of code even when running on the latest 1.2 code base. >> >> >> -- >> Aj. >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From bonsaime at gmail.com Sat Jul 25 21:23:37 2009 From: bonsaime at gmail.com (Jesse Callaway) Date: Sat, 25 Jul 2009 21:23:37 -0400 Subject: [nycphp-talk] best way to run script? In-Reply-To: <865a7acf0907192113p49f085f5h2841572a636bf1ea@mail.gmail.com> References: <865a7acf0907192113p49f085f5h2841572a636bf1ea@mail.gmail.com> Message-ID: On Mon, Jul 20, 2009 at 12:13 AM, Konstantin Rozinov wrote: > Hey guys, > > I'm trying to run the same php script via the command line interface > on several remote servers. > I'd like to do it securely preferably over ssh. ?Right now, I'm using > the ssh2 class from php, but getting very inconsistent results > (sometimes the script runs, sometimes it doesn't via ssh2_exec) > > What do people use to run scripts on production machines? > > Thanks, > Konstantin > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > Dunno if this thread is dead or not, but see what you make of fabric. It's supposed to be pretty handy for running the same command on multiple machines. You edit and execute the fabric script locally. It then goes out and does your bidding on the remotes. From nate at cakephp.org Sun Jul 26 01:49:39 2009 From: nate at cakephp.org (Nate Abele) Date: Sun, 26 Jul 2009 01:49:39 -0400 Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: References: Message-ID: <733C6502-7BB8-40FA-AC1B-068ECBCDEA05@cakephp.org> > Date: Fri, 24 Jul 2009 11:46:32 -0500 > From: "Brian D." > To: NYPHP Talk > Subject: [nycphp-talk] Frameworks & Fast Iterations > > - How do you deal with quickly-morphing PHP frameworks when some > applications tend to stay in production for years at a time? > - Do any of you have a good experience with a framework that ages > well? Hey Brian, interesting thoughts. Certainly, this is something you deal with any time you're integrating 3rd-party libraries into your application, but especially so when dealing with a full-stack framework, since every part of the application is in question. The idea that things change 'quickly' is somewhat curious though, since the speed of change is a relative metric. Languages evolve very slowly, over a period of years, but technology, especially in our specific industry, can change almost monthly. It seems appropriate then, that frameworks, which touch both ends of that spectrum, evolve at a rate somewhere between the two. > As others have pointed out, the more abstracted a given foundation is, > the faster it changes. C code pretty much works the same way it did 10 > years ago. PHP 5.3 is quite a bit different than the PHP3 code I wrote > years ago. Frameworks (I've used Zend and CakePHP) change even faster > - the code I wrote last year for Cake or Zend is quite a bit different > than the code I write today. I can only speak to the projects I've worked (i.e. CakePHP), but in my experience, the upgrade processes we've provided have, for most people, been fairly smooth. So far in the history of the project, the biggest changes occurred between the 1.1 and 1.2 releases, where a significant portion of the helper API changed, many other methods were moved around, and a lot of new features were added. While we didn't have the foresight at the time to develop a migration guide as we went along, but resources and tutorials quickly sprang up by people documenting their experiences with their own applications. Interestingly, one recurring item of feedback we received was that people spent the bulk of their migration time removing code that was no longer needed because of new framework features. Spending migration time on removing maintainable SLOC seems like a fair trade, IMO. As far as the changes to helpers, which were the most extensive, many of them were simply moved/renamed methods, with slightly modified parameters in some cases. In the 7 releases and roughly two years between the 1.1 and 1.2 stable releases, we incrementally implemented these method changes by throwing deprecation warnings in the old methods for several release cycles before finally removing the old method. Of course, the people who had the easiest time migrating were those with effective unit test coverage. Between this and deprecation warnings, most migration issues between any CakePHP versions in the same branch should be immediately identifiable. Given tests, and the ease with which you can move between CakePHP versions (i.e. usually just by replacing the "cake" directory), my suggestion on migrating across several releases would be to update to each release between your current one and the latest, one at a time. Run your tests, update your code, rinse and repeat. Again, I can't speak for other frameworks or projects, but for CakePHP, this process is a lot simpler than you think. Oh, also, we have a migration guide now: http://book.cakephp.org/view/411/Migrating-from-CakePHP-1-1-to-1-2 ? and we'll have one for the upcoming 1.3 release as well (only a few very minor BC breaks in that one anyway, won't affect most apps at all). - Nate Abele Lead Developer, CakePHP From zippy1981 at gmail.com Sun Jul 26 07:01:26 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Sun, 26 Jul 2009 07:01:26 -0400 Subject: [nycphp-talk] Do any URL Shortening services have an https accessiable url? In-Reply-To: References: <5458db3c0907212245x49dc4ee5kdb3da280ecb77091@mail.gmail.com> Message-ID: <5458db3c0907260401w4f457943sc66b9cd097d13fde@mail.gmail.com> Jake, I checked out the service last night. You can hook it up to your own domain, and its run locally by a bunch of programmers from Brooklyn. The bad part is that it seems you can only track urls from your own custom domain. However, the whole point of url shortening for a service like this is to obfuscate the url. So I would have to buy yet another domain besiges http://www.lmsotfy.com ,http://www.lmsftfy.com , or http://www.lmsutfy.com Regards, Justin Dearing On Fri, Jul 24, 2009 at 3:34 PM, Jake McGraw wrote: > I answered this on Stack Overflow, but I thought the NYPHP may want to > take advantage of the new service I had a small part in developing: > > http://woo.ly supports https URLs and has an API and support for custom domains. > > - jake > > On Wed, Jul 22, 2009 at 1:45 AM, Justin Dearing wrote: >> Before I fall victim to my own practical joke twice on this list in >> one day, I already asked on stackoverflow. >> >> http://stackoverflow.com/questions/1163226/do-any-url-shortening-services-with-link-tracking-have-a-https-accessiable-url >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ajai at bitblit.net Sun Jul 26 11:57:09 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sun, 26 Jul 2009 11:57:09 -0400 (EDT) Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: <4A6B8BDC.3080507@gmx.net> Message-ID: On Sat, 25 Jul 2009, David Krings wrote: > You can if you continue to support the old version or, what might be difficult > to do and not accepted by some, provide a tool that upgrades exsting scripts > to work with the new framework. We do that with databases, why not with code > as well? The symfony developers provided just such a tool for 1.0->1.1 and later for 1.1->1.2. I imagine it will be the same when 1.3 appears. -- Aj. From petros.ziogas at gmail.com Mon Jul 27 06:25:04 2009 From: petros.ziogas at gmail.com (Petros Ziogas) Date: Mon, 27 Jul 2009 13:25:04 +0300 Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: References: <236c3b210907250339p660c2368wdb5e7dcbe7b4e707@mail.gmail.com> Message-ID: <236c3b210907270325x119bae0fl2ba68cc450ba3cbb@mail.gmail.com> Actually I am referring to those exact features. Zend decided to change the way a project is deployed using Zend Bootstrap, Loader and Zend Tool. So suddenly all documentation refers to code that looks completely different than the code I wrote 6 months ago. Zend has done a great job documenting all their classes but simply leaves out the proccess of gluing those parts together. As I was developing a site in 1.6 I managed to read my way through it and finally get the framework to start and my classes to communicate and autoload. After that it was just PHP as usual and I loved it. So I get back to develop something completely different and I realise that on 1.8 there is Bootstrap and Loader that completely change the way a project should start. Also I must use a command line tool to add actions. And the documentation just fails to mention what I can do if I don't want to use Zend Tool. So now I have to read again to find out what Zend wants me to do to get the application of the ground.Thank God there are people bloging about it. In my opinion changing the fundamental details that makes a framework difficult to use, is a very bad move, and to be honest I thought that Zend would do better than that. Most challenging thing on Zend is to find out how to start (Bootstrap) and get a simple page up showing (View) a database record (Db) to people that have access to it (Auth and Acl). If you change a great part of that every 6 months what's the point? note: I think there is great potential in using frameworks that is why I used Zend framework and will use it again. I am just a little frustrated these days with Zend_Tool and Bootstraping. Petros Ziogas http://www.royalblue.gr On Sun, Jul 26, 2009 at 3:48 AM, Jake McGraw wrote: > On Sat, Jul 25, 2009 at 6:39 AM, Petros Ziogas > wrote: > > I have the exact same problem. > > I find it a little immature to change the way a framework is deployed and > > the setup after 6 months. > > I created a nice CMS based on Zend 1.6 and now I see that 1.8.4 is > > completely different and nothing works. > > I am one step from going back to my own framework where I kept everything > > under control. > > What do you mean nothing works? I'd be interested to hear what your > issue is since I've been developing apps in using Zend Framework MVC > since 1.5 and the only changes I've had to make are associated with > Zend_Loader and adding support for Zend_Application_Bootstrap. I use > the unofficial/official PEAR channel (http://pear.zfcampus.org/) to > keep up to date. > > - jake > > > Petros Ziogas > > http://www.royalblue.gr > > > > > > > > On Fri, Jul 24, 2009 at 9:12 PM, Ajai Khattri wrote: > >> > >> On Fri, 24 Jul 2009, Brian D. wrote: > >> > >> > This causes an issue with applications that have a long life-span. > >> > They age very poorly. You basically have two choices: > >> > 1. Upgrade your application to fit new framework API changes. This > >> > leads to an inordinate amount of time upgrading, which means less time > >> > you can devote to actually improving the application itself. You're > >> > stuck upgrading existing functionality broken by new upgrades. In my > >> > experience, frameworks tend to be brittle. > >> > 2. Don't upgrade. You may miss out on security fixes or new > >> > functionality. You may even have to patch the framework code to fix > >> > security issues without breaking other functionality, which means now > >> > you have undocumented changes. Documentation for past frameworks may > >> > even be difficult to find (assuming it's even online). > >> > > >> > How do you guys handle this? > >> > >> I think it depends on the framework. symfony for example released 1.0 > >> in 2007 and announced they would support it until 2010. Even after 1.1 > and > >> 1.2 were released, they introduced a compatibility option which required > >> no porting of code even when running on the latest 1.2 code base. > >> > >> > >> -- > >> Aj. > >> > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > > > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vtbludgeon at gmail.com Mon Jul 27 09:49:16 2009 From: vtbludgeon at gmail.com (David Mintz) Date: Mon, 27 Jul 2009 09:49:16 -0400 Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: References: <236c3b210907250339p660c2368wdb5e7dcbe7b4e707@mail.gmail.com> Message-ID: <721f1cc50907270649m764673c9u2b5c1671765ac11@mail.gmail.com> On Sat, Jul 25, 2009 at 8:48 PM, Jake McGraw wrote: > On Sat, Jul 25, 2009 at 6:39 AM, Petros Ziogas > wrote: > > I have the exact same problem. > > I find it a little immature to change the way a framework is deployed and > > the setup after 6 months. > > I created a nice CMS based on Zend 1.6 and now I see that 1.8.4 is > > completely different and nothing works. > > I am one step from going back to my own framework where I kept everything > > under control. > > What do you mean nothing works? I'd be interested to hear what your > issue is since I've been developing apps in using Zend Framework MVC > since 1.5 and the only changes I've had to make are associated with > Zend_Loader and adding support for Zend_Application_Bootstrap. I use > the unofficial/official PEAR channel (http://pear.zfcampus.org/) to > keep up to date. Well, going from the general to the specific, I can jump in with an example of an irritating BC breakage between ZF 1.7.8 and 1.8.x. The behavior of Zend_Filter_Input has changed in several ways such that the examples in their own docs no longer work as advertized. Issues have been filed but AFAIK no one seems to care enough to fix. Makes me want to take another hard look at Cake, which I turned away from when I first tried it a couple years ago because things that I thought should be fairly simple -- e.g., writing custom input validation -- were painful, and the docs were well-meaning but wanting. Looks both of the above have been addressed since then. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From vtbludgeon at gmail.com Mon Jul 27 09:51:59 2009 From: vtbludgeon at gmail.com (David Mintz) Date: Mon, 27 Jul 2009 09:51:59 -0400 Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: <236c3b210907270325x119bae0fl2ba68cc450ba3cbb@mail.gmail.com> References: <236c3b210907250339p660c2368wdb5e7dcbe7b4e707@mail.gmail.com> <236c3b210907270325x119bae0fl2ba68cc450ba3cbb@mail.gmail.com> Message-ID: <721f1cc50907270651x17f48ce3xeda3fd514164d216@mail.gmail.com> On Mon, Jul 27, 2009 at 6:25 AM, Petros Ziogas wrote: > Actually I am referring to those exact features. > Zend decided to change the way a project is deployed using Zend Bootstrap, > Loader and Zend Tool. > > So suddenly all documentation refers to code that looks completely > different than the code I wrote 6 months ago. > > Zend has done a great job documenting all their classes but simply leaves > out the proccess of gluing those parts together. As I was developing a site > in 1.6 I managed to read my way through it and finally get the framework to > start and my classes to communicate and autoload. After that it was just PHP > as usual and I loved it. > > So I get back to develop something completely different and I realise that > on 1.8 there is Bootstrap and Loader that completely change the way a > project should start. Also I must use a command line tool to add actions. > And the documentation just fails to mention what I can do if I don't want to > use Zend Tool. So now I have to read again to find out what Zend wants me to > do to get the application of the ground.Thank God there are people bloging > about it. > > In my opinion changing the fundamental details that makes a framework > difficult to use, is a very bad move, and to be honest I thought that Zend > would do better than that. > > Most challenging thing on Zend is to find out how to start (Bootstrap) and > get a simple page up showing (View) a database record (Db) to people that > have access to it (Auth and Acl). If you change a great part of that every 6 > months what's the point? > > note: I think there is great potential in using frameworks that is why I > used Zend framework and will use it again. I am just a little frustrated > these days with Zend_Tool and Bootstraping. > > Petros Ziogas > http://www.royalblue.gr > > I too am pissed about the BC breakage and general bloat and complexity, but in fairness I think a ZF black belt would tell you, you are not obligated to use Zend_Tool or the (hideously complicated) bootstrapping and classloading stuff if you don't care to. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmcgraw1 at gmail.com Mon Jul 27 15:01:15 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Mon, 27 Jul 2009 15:01:15 -0400 Subject: [nycphp-talk] Frameworks & Fast Iterations In-Reply-To: <721f1cc50907270651x17f48ce3xeda3fd514164d216@mail.gmail.com> References: <236c3b210907250339p660c2368wdb5e7dcbe7b4e707@mail.gmail.com> <236c3b210907270325x119bae0fl2ba68cc450ba3cbb@mail.gmail.com> <721f1cc50907270651x17f48ce3xeda3fd514164d216@mail.gmail.com> Message-ID: On Mon, Jul 27, 2009 at 9:51 AM, David Mintz wrote: > > > On Mon, Jul 27, 2009 at 6:25 AM, Petros Ziogas > wrote: >> >> Actually I am referring to those exact features. >> Zend decided to change the way a project is deployed using Zend Bootstrap, >> Loader and Zend Tool. >> So suddenly all documentation refers to code that looks completely >> different than the code I wrote 6 months ago. >> Zend has done a great job documenting all?their classes but simply leaves >> out the proccess of gluing those parts together. As I was developing a site >> in 1.6 I managed to read my way through it and finally get the framework to >> start and my classes to communicate and autoload. After that it was just PHP >> as usual and I loved it. >> So I get back to develop something completely different and I realise that >> on 1.8 there is?Bootstrap and Loader that completely change the way a >> project should start. Also I must use a command line tool to add actions. >> And the documentation just fails to mention what I can do if I don't want to >> use Zend Tool. So now I have to read again to find out what Zend wants me to >> do to get the application of the ground.Thank God there are people bloging >> about it. >> In my opinion changing the fundamental details that makes a framework >> difficult to use, is a very bad move, and to be honest I thought that Zend >> would do better than that. >> Most challenging thing on Zend is to find out how to start (Bootstrap) and >> get a simple page up showing (View) a database record (Db) to people that >> have access to it (Auth and Acl). If you change a great part of that every 6 >> months what's the point? >> note: I think there is great potential in using frameworks that is why I >> used Zend framework and will use it again. I am just a little frustrated >> these days with Zend_Tool and Bootstraping. >> Petros Ziogas >> http://www.royalblue.gr > > I too am pissed about the BC breakage and general bloat and complexity, but > in fairness I think a ZF black belt would tell you, you are not obligated to > use Zend_Tool or the (hideously complicated) bootstrapping and classloading > stuff if you don't care to. Zend_Tool/Application_Bootstrap were developed to address features lacking from the pre-1.8 Zend Framework. They standardized the method for creating a new project and introduced a new set of classes representing the bootstrapping process. Going from the project creation, bootstrapping process of pre-1.8, I can understand how there may have been some confusion. When you rely on a third party library to drive core components of your infrastructure, part of your day to day development process should include keeping abreast with changes to that library. There are a myriad of benefits from utilizing free open source software, one of the most important benefits is the fact that you can participate in the development process. If you don't have the time or the resources to give back to the code base, run betas or nightly releases, provide feedback on architecture changes and log bugs in the public bug tracker. None of the changes introduced in ZF 1.8+ happened overnight or in the dark. Announcements were made on the listserv: http://framework.zend.com/community/resources Through core developers blogs: http://weierophinney.net/matthew/ http://ralphschindler.com/ They even made videos on how to use the new features! http://www.zend.com/en/resources/webinars/framework Hope that helps, - jake > > -- > David Mintz > http://davidmintz.org/ > > The subtle source is clear and bright > The tributary streams flow through the darkness > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ant92083 at gmail.com Mon Jul 27 16:06:11 2009 From: ant92083 at gmail.com (Anthony Wlodarski) Date: Mon, 27 Jul 2009 16:06:11 -0400 Subject: [nycphp-talk] Learned one CMS and want to move on. Message-ID: <43bc541c0907271306o1a05e822xe8b95fa4a53ad264@mail.gmail.com> I have been lucky/unfortunate to have acquired quite a lot of knowledge about a certain CMS (Drupal). Now although I built a pretty cool website and have tackled a lot of the scalability issues I believe I have learned all that I can from the software and would like to move on. Currently I am in a situation where our company keeps pulling in clients that are stuck on Drupal as a buzzword but don't think about the future of their website and the scalability of the CMS itself. What are some recommended tactics when it comes to dealing with superiors and the displeasure of your current projects? Also how do you keep yourself from being pigeonholed into a project because you have a vast repository of knowledge on the matter? I feel that no matter how many times I discuss with my manager how much I want to move on and learn new technology I am going to be stuck in the same situation forever, I see new projects roll in and hope they get assigned to me but then I just see them float along and then I see a whole bunch of To-Do's with Drupal filling in my inbox. Is it time to find a new job? -- Anthony W. ant92083 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From brenttech at gmail.com Mon Jul 27 16:19:52 2009 From: brenttech at gmail.com (Brent Baisley) Date: Mon, 27 Jul 2009 16:19:52 -0400 Subject: [nycphp-talk] Learned one CMS and want to move on. In-Reply-To: <43bc541c0907271306o1a05e822xe8b95fa4a53ad264@mail.gmail.com> References: <43bc541c0907271306o1a05e822xe8b95fa4a53ad264@mail.gmail.com> Message-ID: <5d515c620907271319r21827acfn17e509436b0d1210@mail.gmail.com> Congrats, you have job security! One rarely learns all there is to know about a piece of software. Drupal is written in PHP, why not learn PHP? Write some plugins or even submit code for inclusion into Drupal. Knowing Drupal isn't going to qualify you for other projects, only Drupal projects. Knowing PHP will qualify you for much more. I'm actually in the opposite role you are, I know PHP and am getting pushed in Wordpress, Drupal and Joomla. Brent Baisley On Mon, Jul 27, 2009 at 4:06 PM, Anthony Wlodarski wrote: > I have been lucky/unfortunate to have acquired quite a lot of knowledge > about a certain CMS (Drupal).? Now although I built a pretty cool website > and have tackled a lot of the scalability issues I believe I have learned > all that I can from the software and would like to move on.? Currently I am > in a situation where our company keeps pulling in clients that are stuck on > Drupal as a buzzword but don't think about the future of their website and > the scalability of the CMS itself.? What are some recommended tactics when > it comes to dealing with superiors and the displeasure of your current > projects?? Also how do you keep yourself from being pigeonholed into a > project because you have a vast repository of knowledge on the matter? > > I feel that no matter how many times I discuss with my manager how much I > want to move on and learn new technology I am going to be stuck in the same > situation forever, I see new projects roll in and hope they get assigned to > me but then I just see them float along and then I see a whole bunch of > To-Do's with Drupal filling in my inbox.? Is it time to find a new job? > -- > Anthony W. > ant92083 at gmail.com > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ant92083 at gmail.com Mon Jul 27 16:35:02 2009 From: ant92083 at gmail.com (Anthony Wlodarski) Date: Mon, 27 Jul 2009 16:35:02 -0400 Subject: [nycphp-talk] Learned one CMS and want to move on. In-Reply-To: <5d515c620907271319r21827acfn17e509436b0d1210@mail.gmail.com> References: <43bc541c0907271306o1a05e822xe8b95fa4a53ad264@mail.gmail.com> <5d515c620907271319r21827acfn17e509436b0d1210@mail.gmail.com> Message-ID: <43bc541c0907271335g248c8bfbh874ca6d32e59a802@mail.gmail.com> Oh I hope it didn't seem like I was incompetent in PHP, far from it. Just that every project I get is Drupal based and I want to branch out. All I can put on my resume is Drupal, Drupal, and more Drupal! I worked with it for 1.5 years. Built about twenty custom modules. Installed memcache a dozen or so times. Wrote different nodes from scratch and have figured out the Views/Panels/Taxonomy CF. Just that I don't want to do it anymore, it is tiring and there are better ways to do it. I was graced with the ability to work with CakePHP for two weeks and was the happiest developer in the world cause it was OOP based and made building a functioning site from scratch easy, the the clients with Drupal all reared their ugly head and that was the end of CakePHP for me. -Anthony On Mon, Jul 27, 2009 at 4:19 PM, Brent Baisley wrote: > Congrats, you have job security! > > One rarely learns all there is to know about a piece of software. > Drupal is written in PHP, why not learn PHP? Write some plugins or > even submit code for inclusion into Drupal. > > Knowing Drupal isn't going to qualify you for other projects, only > Drupal projects. Knowing PHP will qualify you for much more. > > I'm actually in the opposite role you are, I know PHP and am getting > pushed in Wordpress, Drupal and Joomla. > > Brent Baisley > > On Mon, Jul 27, 2009 at 4:06 PM, Anthony Wlodarski > wrote: > > I have been lucky/unfortunate to have acquired quite a lot of knowledge > > about a certain CMS (Drupal). Now although I built a pretty cool website > > and have tackled a lot of the scalability issues I believe I have learned > > all that I can from the software and would like to move on. Currently I > am > > in a situation where our company keeps pulling in clients that are stuck > on > > Drupal as a buzzword but don't think about the future of their website > and > > the scalability of the CMS itself. What are some recommended tactics > when > > it comes to dealing with superiors and the displeasure of your current > > projects? Also how do you keep yourself from being pigeonholed into a > > project because you have a vast repository of knowledge on the matter? > > > > I feel that no matter how many times I discuss with my manager how much I > > want to move on and learn new technology I am going to be stuck in the > same > > situation forever, I see new projects roll in and hope they get assigned > to > > me but then I just see them float along and then I see a whole bunch of > > To-Do's with Drupal filling in my inbox. Is it time to find a new job? > > -- > > Anthony W. > > ant92083 at gmail.com > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Anthony W. ant92083 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From glenn310b at mac.com Mon Jul 27 17:33:16 2009 From: glenn310b at mac.com (Glenn Powell) Date: Mon, 27 Jul 2009 17:33:16 -0400 Subject: [nycphp-talk] Learned one CMS and want to move on. In-Reply-To: <43bc541c0907271335g248c8bfbh874ca6d32e59a802@mail.gmail.com> References: <43bc541c0907271306o1a05e822xe8b95fa4a53ad264@mail.gmail.com> <5d515c620907271319r21827acfn17e509436b0d1210@mail.gmail.com> <43bc541c0907271335g248c8bfbh874ca6d32e59a802@mail.gmail.com> Message-ID: <6FCE358C-1ED9-4331-B739-DD928B5A5FE2@mac.com> My jaded 2 cents... It's cheaper for your employer to use the most experienced Drupal developer for Drupal work. You can probably get Drupal things done very quickly compared to others at your workplace... quick=profit (or getting the job in the first place.) I would guess that your career development is not at the top of the priority list for your employer. Maybe there is a compromise? Better for everyone if you don't have to leave... On Jul 27, 2009, at 4:35 PM, Anthony Wlodarski wrote: > Oh I hope it didn't seem like I was incompetent in PHP, far from > it. Just that every project I get is Drupal based and I want to > branch out. All I can put on my resume is Drupal, Drupal, and more > Drupal! I worked with it for 1.5 years. Built about twenty custom > modules. Installed memcache a dozen or so times. Wrote different > nodes from scratch and have figured out the Views/Panels/Taxonomy > CF. Just that I don't want to do it anymore, it is tiring and there > are better ways to do it. I was graced with the ability to work > with CakePHP for two weeks and was the happiest developer in the > world cause it was OOP based and made building a functioning site > from scratch easy, the the clients with Drupal all reared their ugly > head and that was the end of CakePHP for me. > > -Anthony > > On Mon, Jul 27, 2009 at 4:19 PM, Brent Baisley > wrote: > Congrats, you have job security! > > One rarely learns all there is to know about a piece of software. > Drupal is written in PHP, why not learn PHP? Write some plugins or > even submit code for inclusion into Drupal. > > Knowing Drupal isn't going to qualify you for other projects, only > Drupal projects. Knowing PHP will qualify you for much more. > > I'm actually in the opposite role you are, I know PHP and am getting > pushed in Wordpress, Drupal and Joomla. > > Brent Baisley > > On Mon, Jul 27, 2009 at 4:06 PM, Anthony > Wlodarski wrote: > > I have been lucky/unfortunate to have acquired quite a lot of > knowledge > > about a certain CMS (Drupal). Now although I built a pretty cool > website > > and have tackled a lot of the scalability issues I believe I have > learned > > all that I can from the software and would like to move on. > Currently I am > > in a situation where our company keeps pulling in clients that are > stuck on > > Drupal as a buzzword but don't think about the future of their > website and > > the scalability of the CMS itself. What are some recommended > tactics when > > it comes to dealing with superiors and the displeasure of your > current > > projects? Also how do you keep yourself from being pigeonholed > into a > > project because you have a vast repository of knowledge on the > matter? > > > > I feel that no matter how many times I discuss with my manager how > much I > > want to move on and learn new technology I am going to be stuck in > the same > > situation forever, I see new projects roll in and hope they get > assigned to > > me but then I just see them float along and then I see a whole > bunch of > > To-Do's with Drupal filling in my inbox. Is it time to find a new > job? > > -- > > Anthony W. > > ant92083 at gmail.com > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > > -- > Anthony W. > ant92083 at gmail.com > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Mon Jul 27 17:38:43 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 27 Jul 2009 17:38:43 -0400 (EDT) Subject: [nycphp-talk] Learned one CMS and want to move on. In-Reply-To: <6FCE358C-1ED9-4331-B739-DD928B5A5FE2@mac.com> Message-ID: On Mon, 27 Jul 2009, Glenn Powell wrote: > You can probably get Drupal things done very quickly compared to > others at your workplace... quick=profit (or getting the job in the > first place.) > > I would guess that your career development is not at the top of the > priority list for your employer. > > Maybe there is a compromise? A few ideas: 1. Maybe offer to mentor someone else to become proficient in Drupal too - allowing you to work on non-Drupal stuff? 2. Learn some other technology in your own time and use it in a project. (Or use it in a personal project). 3. Explain how bad it would be for the company if you had to leave, so have them let you work on some non-Drupal projects for part of your time. 4. Ask if they can pay for training for you - explain how much more projects they can bid on and get if they have a more diversified work force. -- Aj. From ka at kacomputerconsulting.com Mon Jul 27 19:07:58 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Mon, 27 Jul 2009 16:07:58 -0700 Subject: [nycphp-talk] Learned one CMS and want to move on. Message-ID: <1248736078.14435@coral.he.net> > 4. Ask if they can pay for training for you - explain how much more > projects they can bid on and get if they have a more diversified work > force. > I like Ajai's idea #4. The only way management will agree to let you diversify your job duties is if it will put $$$$ in their pocket somehow. Although I think these days it's more like, learn the stuff on your own time and your own dime, and then beg management to let you work on it. And this could have some drawbacks, most notably more work in the aggregate, since the ol' Drupal stuff isn't going anywhere... Kristina From leam at reuel.net Mon Jul 27 19:18:45 2009 From: leam at reuel.net (Leam Hall) Date: Mon, 27 Jul 2009 19:18:45 -0400 Subject: [nycphp-talk] Learned one CMS and want to move on. In-Reply-To: <1248736078.14435@coral.he.net> References: <1248736078.14435@coral.he.net> Message-ID: <4A6E35D5.6060108@reuel.net> Kristina D. H. Anderson wrote: >> 4. Ask if they can pay for training for you - explain how much more >> projects they can bid on and get if they have a more diversified work >> force. >> > > I like Ajai's idea #4. The only way management will agree to let you > diversify your job duties is if it will put $$$$ in their pocket > somehow. > Or find a technology you really like, figure out how to sell it as profitable to management, and smack any of your co-workers that tries to take the projects that come in. Not that I've ever done this, mind you... Leam From ajai at bitblit.net Mon Jul 27 22:12:05 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 27 Jul 2009 22:12:05 -0400 (EDT) Subject: [nycphp-talk] Learned one CMS and want to move on. In-Reply-To: <1248736078.14435@coral.he.net> Message-ID: On Mon, 27 Jul 2009, Kristina D. H. Anderson wrote: > Although I think these days it's more like, learn the stuff on your own > time and your own dime, and then beg management to let you work on it. > And this could have some drawbacks, most notably more work in the > aggregate, since the ol' Drupal stuff isn't going anywhere... Sad but true, it often ends up as training on your own time. But developers that are unhappy for a long time usually end up leaving - its amazing that management never sees that. Give developers a great environment and they will bend over backwards and give their all. -- Aj. From ps at blu-studio.com Tue Jul 28 05:24:58 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Tue, 28 Jul 2009 05:24:58 -0400 Subject: [nycphp-talk] So You Got a New PHP5 Job Message-ID: <005401ca0f65$473d8c90$d5b8a5b0$@com> Now what? Guidelines, must-dos, things to avoid, generic new job advice, websites/blogs to review daily, other good advice websites, book(s) to checkout, feedback, thoughts... 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 ramons at gmx.net Tue Jul 28 07:05:12 2009 From: ramons at gmx.net (David Krings) Date: Tue, 28 Jul 2009 07:05:12 -0400 Subject: [nycphp-talk] Learned one CMS and want to move on. In-Reply-To: References: Message-ID: <4A6EDB68.6060206@gmx.net> Ajai Khattri wrote: > On Mon, 27 Jul 2009, Kristina D. H. Anderson wrote: > >> Although I think these days it's more like, learn the stuff on your own >> time and your own dime, and then beg management to let you work on it. >> And this could have some drawbacks, most notably more work in the >> aggregate, since the ol' Drupal stuff isn't going anywhere... > > Sad but true, it often ends up as training on your own time. But > developers that are unhappy for a long time usually end up leaving - its > amazing that management never sees that. Give developers a great > environment and they will bend over backwards and give their all. True, same applies for QA professionals who get paid half of what developers get and support gets often just half of that - besides being as skilled, but differently skilled as developers. And that just doesn't apply only to software companies. Any place where employees are considered nothing more than "human capital" folks end up leaving....assuming they have a place to go. David From zippy1981 at gmail.com Tue Jul 28 09:31:58 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Tue, 28 Jul 2009 09:31:58 -0400 Subject: [nycphp-talk] So You Got a New PHP5 Job In-Reply-To: <005401ca0f65$473d8c90$d5b8a5b0$@com> References: <005401ca0f65$473d8c90$d5b8a5b0$@com> Message-ID: <5458db3c0907280631k43f89026sb1b676682f0dfed2@mail.gmail.com> If their not using PHPDocumentor, setup a cron job to generate the documentation every hour, even if runs locally on your laptop for now. Start documenting the code as you make changes. Even if there are no javadoc like comments in the code, You'll have a list of functions, classes, files, etc. Oh yeah, go down to some user group meetings, talk about your experiences at your new job. Make sure people don't tell you to run away. Regards, Justin Dearing 2009/7/28 Peter Sawczynec > Now what? Guidelines, must-dos, things to avoid, generic new job advice, > websites/blogs to review daily, other good advice websites, book(s) to > checkout, feedback, thoughts... > > > > Warmest regards, > > > > Peter Sawczynec > > Technology Dir. > > bl?studio > > 941.893.0396 > > ps at blu-studio.com > > www.blu-studio.com > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From y2rob at aol.com Tue Jul 28 10:33:10 2009 From: y2rob at aol.com (y2rob at aol.com) Date: Tue, 28 Jul 2009 10:33:10 -0400 Subject: [nycphp-talk] Learned one CMS and want to move on. In-Reply-To: Message-ID: <8CBDDA77714D933-BEC-908@WEBMAIL-MY35.sysops.aol.com> hello anthony, sorry to hear your troubles, yeah unfortunately these are strange times for progammers. ?the demand is less and people want programmed miracles in days, opposed to weeks and it's safer to use test driven platforms like drupal or joomla, which has a ton of user support as well as multiple modules to solve every client's question, than to build your own. the only thing i can suggest is this, you know drupal and you know it's problems, take what you know of drupal, pick up a framework, which you feel is the best for your needs and construct a cms from that. ?it will be the most fun for you and it's not drupal, while it's still a platform your employer might be interested in using as an alternative if you choose to share it with him/her. ?i mean protect what's yours and see if you can make money of it as well, imo :) just my 2 cents, ~rob -----Original Message----- From: Ajai Khattri To: NYPHP Talk Sent: Mon, Jul 27, 2009 5:38 pm Subject: Re: [nycphp-talk] Learned one CMS and want to move on. On Mon, 27 Jul 2009, Glenn Powell wrote: > You can probably get Drupal things done very quickly compared to > others at your workplace... quick=profit (or getting the job in the > first place.) > > I would guess that your career development is not at the top of the > priority list for your employer. > > Maybe there is a compromise? A few ideas: 1. Maybe offer to mentor someone else to become proficient in Drupal too - allowing you to work on non-Drupal stuff? 2. Learn some other technology in your own time and use it in a project. (Or use it in a personal project). 3. Explain how bad it would be for the company if you had to leave, so have them let you work on some non-Drupal projects for part of your time. 4. Ask if they can pay for training for you - explain how much more projects they can bid on and get if they have a more diversified work force. -- Aj. _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ps at blu-studio.com Tue Jul 28 11:16:13 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Tue, 28 Jul 2009 11:16:13 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer Message-ID: <003101ca0f96$58e1bb20$0aa53160$@com> T-Mobile HTC "myTouch" w/ google Android OS (brand new, Aug 5 09) Sprint Palm Pre (new, mid-Jun 09) AT&T iPhone 3G S T-Mobile RIM Blackberry Curve 8900 T-Mobile Samsung Comeback SGH-T559 Verizon LG enV3 Anyone have any thoughts on any of these above phone/plan/carrier/OS or do you have a different phone that you feel is a real adjunct. 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 jmcgraw1 at gmail.com Tue Jul 28 11:20:09 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Tue, 28 Jul 2009 11:20:09 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: <003101ca0f96$58e1bb20$0aa53160$@com> References: <003101ca0f96$58e1bb20$0aa53160$@com> Message-ID: As a PHP developer I'm assuming you make web applications? That is, apps that will see the light of day in the form of a public web application? Perhaps for a bunch of clients? Those clients will most likely have an iPhone and they'll be none too pleased to see your web application rendering incorrectly in mobile Safari. Go for the iPhone. - jake 2009/7/28 Peter Sawczynec : > T-Mobile HTC "myTouch" w/ google Android OS (brand new, Aug 5 09) > > > > Sprint Palm Pre (new, mid-Jun 09) > > > > AT&T iPhone 3G S > > > > T-Mobile RIM Blackberry Curve 8900 > > > > T-Mobile Samsung Comeback SGH-T559 > > > > Verizon LG enV3 > > > > Anyone have any thoughts on any of these above phone/plan/carrier/OS > > or do you have a different phone that you feel is a real adjunct. > > > > Warmest regards, > > > > Peter Sawczynec > > Technology Dir. > > bl?studio > > 941.893.0396 > > ps at blu-studio.com > > www.blu-studio.com > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From jmcgraw1 at gmail.com Tue Jul 28 11:46:23 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Tue, 28 Jul 2009 11:46:23 -0400 Subject: [nycphp-talk] So You Got a New PHP5 Job In-Reply-To: <5458db3c0907280631k43f89026sb1b676682f0dfed2@mail.gmail.com> References: <005401ca0f65$473d8c90$d5b8a5b0$@com> <5458db3c0907280631k43f89026sb1b676682f0dfed2@mail.gmail.com> Message-ID: On Tue, Jul 28, 2009 at 9:31 AM, Justin Dearing wrote: > If their not using PHPDocumentor, setup a cron job to generate the > documentation every hour, even if runs locally on your laptop for now. Start > documenting the code as you make changes. > Even if there are no javadoc like comments in the code, You'll have a list > of functions, classes, files, etc. > Oh yeah, go down to some user group meetings, talk about your experiences at > your new job. Make sure people don't tell you to run away. > Regards, > Justin Dearing > 2009/7/28 Peter Sawczynec >> >> Now what? Guidelines, must-dos, things to avoid, generic new job advice, >> websites/blogs to review daily, other good advice websites, book(s) to >> checkout, feedback, thoughts... Using the vernacular "I have a PHP5 job" is pass?. PHP5 is now over five years old, any PHP job should be a PHP5 job :-P. Couple of must-dos: * Use special function "__construct" NOT class name for constructor. * Use visibility: public, protected, don't just make everything public * Define the special function "__toString" with something useful, makes debugging much simpler * Read, and I mean read, don't skim, through every single page here: http://php.net/oop - jake >> >> >> >> Warmest regards, >> >> >> >> Peter Sawczynec >> >> Technology Dir. >> >> bl?studio >> >> 941.893.0396 >> >> ps at blu-studio.com >> >> www.blu-studio.com >> >> >> >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From chsnyder at gmail.com Tue Jul 28 11:57:42 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Tue, 28 Jul 2009 11:57:42 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: <003101ca0f96$58e1bb20$0aa53160$@com> References: <003101ca0f96$58e1bb20$0aa53160$@com> Message-ID: 2009/7/28 Peter Sawczynec : > T-Mobile HTC "myTouch" w/ google Android OS (brand new, Aug 5 09) > Sprint Palm Pre (new, mid-Jun 09) > AT&T iPhone 3G S > T-Mobile RIM Blackberry Curve 8900 > T-Mobile Samsung Comeback SGH-T559 > Verizon LG enV3 > > Anyone have any thoughts on any of these above phone/plan/carrier/OS > or do you have a different phone that you feel is a real adjunct. > Hey Peter, is this a sly attempt to get pagerank? LOL. iPhone is dominating mobile app development right now, both native apps in Objective-C and mobile-friendly web applications in HTML, CSS, and JavaScript. The later, of course, are portable to *any* smart phone with a WebKit or Gecko browser, or to a lesser extent an Opera browser. The Nokia N810 internet tablet should also be on your list, and works with any sim-capable carrier. Chris Snyder http://chxor.chxo.com/ From php.tutor at yahoo.com Tue Jul 28 11:58:52 2009 From: php.tutor at yahoo.com (PHP Tutor) Date: Tue, 28 Jul 2009 08:58:52 -0700 (PDT) Subject: [nycphp-talk] About the site structure article Message-ID: <455033.95011.qm@web44713.mail.sp1.yahoo.com> Hello everyone. First of I wanna say hi, since it's my first contribution here. Also I'm not from NY, but Norway. Found your site trough google Now, back on topic: It's a very nice, short and direct article. Easy to understand. What I was thinking tho was about using .php. Wouldn't it add a bit more security if you do something like this? Just asking, cause I'm fairly new to all this so :) Article: http://www.nyphp.org/phundamentals/sitestructure.php - Ole -------------- next part -------------- An HTML attachment was scrubbed... URL: From ps at blu-studio.com Tue Jul 28 12:01:32 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Tue, 28 Jul 2009 12:01:32 -0400 Subject: [nycphp-talk] So You Got a New PHP5 Job In-Reply-To: References: <005401ca0f65$473d8c90$d5b8a5b0$@com> <5458db3c0907280631k43f89026sb1b676682f0dfed2@mail.gmail.com> Message-ID: <008901ca0f9c$ada7ca90$08f75fb0$@com> Thank you for the info. The PHP5 thing sounds like a public relations issue with PHP though. Because a lot of the major media available on PHP (books and online info) still very much present PHP 5 as seemingly brand new Warmest regards, Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Jake McGraw Sent: Tuesday, July 28, 2009 11:46 AM To: NYPHP Talk Subject: Re: [nycphp-talk] So You Got a New PHP5 Job On Tue, Jul 28, 2009 at 9:31 AM, Justin Dearing wrote: > If their not using PHPDocumentor, setup a cron job to generate the > documentation every hour, even if runs locally on your laptop for now. Start > documenting the code as you make changes. > Even if there are no javadoc like comments in the code, You'll have a list > of functions, classes, files, etc. > Oh yeah, go down to some user group meetings, talk about your experiences at > your new job. Make sure people don't tell you to run away. > Regards, > Justin Dearing > 2009/7/28 Peter Sawczynec >> >> Now what? Guidelines, must-dos, things to avoid, generic new job advice, >> websites/blogs to review daily, other good advice websites, book(s) to >> checkout, feedback, thoughts... Using the vernacular "I have a PHP5 job" is pass?. PHP5 is now over five years old, any PHP job should be a PHP5 job :-P. Couple of must-dos: * Use special function "__construct" NOT class name for constructor. * Use visibility: public, protected, don't just make everything public * Define the special function "__toString" with something useful, makes debugging much simpler * Read, and I mean read, don't skim, through every single page here: http://php.net/oop - jake >> >> >> >> Warmest regards, >> >> >> >> Peter Sawczynec >> >> Technology Dir. >> >> blustudio >> >> 941.893.0396 >> >> ps at blu-studio.com >> >> www.blu-studio.com >> >> >> >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From ant92083 at gmail.com Tue Jul 28 12:04:37 2009 From: ant92083 at gmail.com (Anthony Wlodarski) Date: Tue, 28 Jul 2009 12:04:37 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: References: <003101ca0f96$58e1bb20$0aa53160$@com> Message-ID: <43bc541c0907280904v33fbe216g3d5aa474d68624e@mail.gmail.com> Yes but your chances of getting an app published are slim to none with an iPhone. I find this to be true as the big G was denied this morning. http://www.engadget.com/2009/07/28/google-voice-iphone-app-rejected-current-gv-apps-lose-connectio/ I own a Touch Pro. When making web apps I tailor the standards to the minimum that that phone has (runs Opera too). -Anthony On Tue, Jul 28, 2009 at 11:57 AM, Chris Snyder wrote: > 2009/7/28 Peter Sawczynec : > > T-Mobile HTC "myTouch" w/ google Android OS (brand new, Aug 5 09) > > Sprint Palm Pre (new, mid-Jun 09) > > AT&T iPhone 3G S > > T-Mobile RIM Blackberry Curve 8900 > > T-Mobile Samsung Comeback SGH-T559 > > Verizon LG enV3 > > > > Anyone have any thoughts on any of these above phone/plan/carrier/OS > > or do you have a different phone that you feel is a real adjunct. > > > > Hey Peter, is this a sly attempt to get pagerank? LOL. > > iPhone is dominating mobile app development right now, both native > apps in Objective-C and mobile-friendly web applications in HTML, CSS, > and JavaScript. > > The later, of course, are portable to *any* smart phone with a WebKit > or Gecko browser, or to a lesser extent an Opera browser. > > The Nokia N810 internet tablet should also be on your list, and works > with any sim-capable carrier. > > Chris Snyder > http://chxor.chxo.com/ > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Anthony W. ant92083 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Tue Jul 28 12:17:02 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Jul 2009 12:17:02 -0400 (EDT) Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: Message-ID: On Tue, 28 Jul 2009, Chris Snyder wrote: > The Nokia N810 internet tablet should also be on your list, and works > with any sim-capable carrier. The N810 does *not* include any cellular data modem. -- Aj. From ps at blu-studio.com Tue Jul 28 12:27:02 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Tue, 28 Jul 2009 12:27:02 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: <43bc541c0907280904v33fbe216g3d5aa474d68624e@mail.gmail.com> References: <003101ca0f96$58e1bb20$0aa53160$@com> <43bc541c0907280904v33fbe216g3d5aa474d68624e@mail.gmail.com> Message-ID: <00a301ca0fa0$3db11580$b9134080$@com> The HTC Touch Pro is a great looking phone, but I want small form factor and don?t mind onscreen keyboard. Samsung Omnia. Blackberry Storm? Also, meanwhile, Sprint buys Virigin this morning. Warmest regards, Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Anthony Wlodarski Sent: Tuesday, July 28, 2009 12:05 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Best Cell Phone for a PHP Programmer Yes but your chances of getting an app published are slim to none with an iPhone. I find this to be true as the big G was denied this morning. http://www.engadget.com/2009/07/28/google-voice-iphone-app-rejected-current-gv-apps-lose-connectio/ I own a Touch Pro. When making web apps I tailor the standards to the minimum that that phone has (runs Opera too). -Anthony On Tue, Jul 28, 2009 at 11:57 AM, Chris Snyder wrote: 2009/7/28 Peter Sawczynec : > T-Mobile HTC "myTouch" w/ google Android OS (brand new, Aug 5 09) > Sprint Palm Pre (new, mid-Jun 09) > AT&T iPhone 3G S > T-Mobile RIM Blackberry Curve 8900 > T-Mobile Samsung Comeback SGH-T559 > Verizon LG enV3 > > Anyone have any thoughts on any of these above phone/plan/carrier/OS > or do you have a different phone that you feel is a real adjunct. > Hey Peter, is this a sly attempt to get pagerank? LOL. iPhone is dominating mobile app development right now, both native apps in Objective-C and mobile-friendly web applications in HTML, CSS, and JavaScript. The later, of course, are portable to *any* smart phone with a WebKit or Gecko browser, or to a lesser extent an Opera browser. The Nokia N810 internet tablet should also be on your list, and works with any sim-capable carrier. Chris Snyder http://chxor.chxo.com/ _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -- Anthony W. ant92083 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Tue Jul 28 12:28:17 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Tue, 28 Jul 2009 12:28:17 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: <43bc541c0907280904v33fbe216g3d5aa474d68624e@mail.gmail.com> References: <003101ca0f96$58e1bb20$0aa53160$@com> <43bc541c0907280904v33fbe216g3d5aa474d68624e@mail.gmail.com> Message-ID: On Tue, Jul 28, 2009 at 12:04 PM, Anthony Wlodarski wrote: > Yes but your chances of getting an app published are slim to none with an > iPhone.? I find this to be true as the big G was denied this morning. > http://www.engadget.com/2009/07/28/google-voice-iphone-app-rejected-current-gv-apps-lose-connectio/ > > I own a Touch Pro.? When making web apps I tailor the standards to the > minimum that that phone has (runs Opera too). > > -Anthony > You don't need to get approved by Apple if you're making web apps. Of course, you won't be listed in the App Store, but as a silver lining anyone with a browser and an internet connection will be able to use your app. I wonder how many App Store "native" apps are really HTML+JS "web" apps and use Objective-C to display a WebKit view of local files? Like Dashboard widgets, but for the phone. I know there is at least one framework that makes this easy to do. From chsnyder at gmail.com Tue Jul 28 12:29:32 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Tue, 28 Jul 2009 12:29:32 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: References: Message-ID: On Tue, Jul 28, 2009 at 12:17 PM, Ajai Khattri wrote: > On Tue, 28 Jul 2009, Chris Snyder wrote: > >> The Nokia N810 internet tablet should also be on your list, and works >> with any sim-capable carrier. > > The N810 does *not* include any cellular data modem. > Ah right, forgot it's only wi-fi, not a phone. I have a friend who makes calls on his, but he must be using Skype or something. From ps at blu-studio.com Tue Jul 28 12:29:39 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Tue, 28 Jul 2009 12:29:39 -0400 Subject: [nycphp-talk] Google Apps Message-ID: <00a801ca0fa0$9b68ef90$d23aceb0$@com> Anyone using this as serious complete office suite? Using as personal mobile office? Any thoughts, heard on the street? 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 jcampbell1 at gmail.com Tue Jul 28 12:43:08 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Tue, 28 Jul 2009 12:43:08 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: <43bc541c0907280904v33fbe216g3d5aa474d68624e@mail.gmail.com> References: <003101ca0f96$58e1bb20$0aa53160$@com> <43bc541c0907280904v33fbe216g3d5aa474d68624e@mail.gmail.com> Message-ID: <8f0676b40907280943s15afb2b9k20ccad7ea7d99b8f@mail.gmail.com> On Tue, Jul 28, 2009 at 12:04 PM, Anthony Wlodarski wrote: > Yes but your chances of getting an app published are slim to none with an > iPhone. The review period can last a few months, but there is nothing stopping people from getting apps in the store. Google was rejected because they created an app that materially hurts the carriers revenue. From ajai at bitblit.net Tue Jul 28 12:45:36 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Jul 2009 12:45:36 -0400 (EDT) Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: <003101ca0f96$58e1bb20$0aa53160$@com> Message-ID: Ive spent years following developments in the mobile space (Im a refugee from the Psion / Symbian world :-) On Tue, 28 Jul 2009, Peter Sawczynec wrote: > T-Mobile HTC "myTouch" w/ google Android OS (brand new, Aug 5 09) I just pulled the trigger and ordered this last week. Ill explain why a bit later. > Sprint Palm Pre (new, mid-Jun 09) Pre is great if you dont mind being on Sprint's US-only network (or maybe you dont mind paying the exorbitant amount to acquire the UK GSM version unlocked! Has gotten greta reviews and I like the whole embrace-the-cloud concept and universal search concept. >From a development standpoint, Pre is nice. Any web developer can write Pre apps (Basically, you've got a Javascript engine embedded in the frontend running on top of a Linux kernel, so unlike the iPhone you can access acclerometer, GPS and app data from JavaScript). You use HTML and CSS to build the GUI. If I had the choice I would probably buy a Pre, but I hate Sprint so Im waiting for a GSM version to come to the US, but that might not happen until late 2010... > AT&T iPhone 3G S Very nice and pretty good value at $199. Im not a big fan of Obfuscated-C :-) so as a developer its got a steeper learning curve. There are a bazillion apps for it and its hard sorting the wheat from the chaff. But being locked on AT&T's network is a drag for me. That said, it is a nice phone. > T-Mobile RIM Blackberry Curve 8900 I like the haptic feedback of the Storm more than the Curve. Development environment is (like Android) Java-based. More business-oriented, so I never think of them as 'sexy'. > T-Mobile Samsung Comeback SGH-T559 Did not (along with the envy) make my smartphone "A" list :-) So why did I order the Ion / Magic / G2 / myTouch ? Pre was actually my top choice but Im never going back to Sprint. While Im waiting (hoping?) for a GSM Pre (or some other webOS device like the Eos) I decided I needed a smartphone now even if I only get a year of usage out of it. Im a T-Mobile customer and I didn't want to switch carrier and T-Mobile have plenty of roaming coverage in Europe which was important to me. Also when deciding between Android and iPhone, the fact that Android is open source was a major factor in my decision to look at the myTouch over the iPhone. The G2 is quad-band and has gotten good reviews. T-Mobile are running a pre-sale for existing customers so we get it first for $199. I should get mine the first week of August. (You might also consider the HTC Hero which runs Android and has a stunning UI, BUT the reviews I read said the hardware was not quite up to the task. The last I heard, the FCC had approved a version that looks like it could run on Sprint's network. Finally, a T-Mobile exec mentioned they had no plan to offer the Hero on their network, so that was that). -- Aj. From ajai at bitblit.net Tue Jul 28 12:48:09 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Jul 2009 12:48:09 -0400 (EDT) Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: Message-ID: On Tue, 28 Jul 2009, Chris Snyder wrote: > I wonder how many App Store "native" apps are really HTML+JS "web" > apps and use Objective-C to display a WebKit view of local files? Like > Dashboard widgets, but for the phone. I know there is at least one > framework that makes this easy to do. Phonegap? -- Aj. From ajai at bitblit.net Tue Jul 28 12:50:39 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Jul 2009 12:50:39 -0400 (EDT) Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: Message-ID: On Tue, 28 Jul 2009, Chris Snyder wrote: > Ah right, forgot it's only wi-fi, not a phone. I have a friend who > makes calls on his, but he must be using Skype or something. Yeah, they can run Skype or Gizmo. I used it when I was in Barcelona to make calls back to the US. BTW, the screen is very nice (800 x 480 pixels) so I use mine as an armchair / bedroom sufing device. -- Aj. (who has owned all the Nokia web tablets at some point :-) From sukritd at sevenacross.com Tue Jul 28 13:03:23 2009 From: sukritd at sevenacross.com (Sukrit D) Date: Tue, 28 Jul 2009 22:33:23 +0530 Subject: [nycphp-talk] Google Apps In-Reply-To: <00a801ca0fa0$9b68ef90$d23aceb0$@com> References: <00a801ca0fa0$9b68ef90$d23aceb0$@com> Message-ID: It's good. I use it, mostly for email though. Do check out zimbra.com while you're at it. That's a more complete web based office suite. - S On 28-Jul-09, at 9:59 PM, Peter Sawczynec wrote: > Anyone using this as serious complete office suite? > Using as personal mobile office? > > Any thoughts, heard on the street? > > Warmest regards, > > Peter Sawczynec > Technology Dir. > bl?studio > 941.893.0396 > ps at blu-studio.com > www.blu-studio.com > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From zippy1981 at gmail.com Tue Jul 28 13:05:55 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Tue, 28 Jul 2009 13:05:55 -0400 Subject: [nycphp-talk] Google Apps In-Reply-To: <00a801ca0fa0$9b68ef90$d23aceb0$@com> References: <00a801ca0fa0$9b68ef90$d23aceb0$@com> Message-ID: <5458db3c0907281005o13c31e90n5f6d65bb4378cdd@mail.gmail.com> Peter, Zoho has a more advanced online free office suite if you really need a mobile office. I use google apps for some spreadsheets.It works well if everyone is a geek. Many non programmer/IT people I know that are avid facebook users don't like google spreadsheets. So your mileage may vary depending on who you collabare with. On a side note, are you the one starting a new job, or are you looking to hire/recently hired someone? 2009/7/28 Peter Sawczynec > Anyone using this as serious complete office suite? > > Using as personal mobile office? > > > > Any thoughts, heard on the street? > > > > Warmest regards, > > > > Peter Sawczynec > > Technology Dir. > > bl?studio > > 941.893.0396 > > ps at blu-studio.com > > www.blu-studio.com > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at devonianfarm.com Tue Jul 28 13:07:21 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Tue, 28 Jul 2009 13:07:21 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: <43bc541c0907280904v33fbe216g3d5aa474d68624e@mail.gmail.com> References: <003101ca0f96$58e1bb20$0aa53160$@com> <43bc541c0907280904v33fbe216g3d5aa474d68624e@mail.gmail.com> Message-ID: <4A6F3049.8080503@devonianfarm.com> Anthony Wlodarski wrote: > Yes but your chances of getting an app published are slim to none with > an iPhone. I find this to be true as the big G was denied this > morning. > http://www.engadget.com/2009/07/28/google-voice-iphone-app-rejected-current-gv-apps-lose-connectio/ > > I own a Touch Pro. When making web apps I tailor the standards to the > minimum that that phone has (runs Opera too). > The rejection of Google Voice could be the end of the iPhone, or at least an opportunity for a competitor to get in. From the viewpoint of telephone carriers, Google Voice is a disruptive technology. Allow people to route calls to VoIP or landline could cut seriously into the the "selling minutes" racket that is the main business of the carriers. Google Voice gives you (practical) number portability without filling out paperwork, waiting or dealing with complex legal requirements. In the long term, the carriers can't make a profit from both selling minutes and selling data services: a minute of cell phone service is (at most) 18kb of data, and more like 9kb when you consider TASI. Pages at big internet properties (Yahoo and Facebook) are typically around 40kb, and that's the equivalent of 4 minutes right there... If you sell data service at a price people can accept, VoIP will undercut minutes, so carriers are pressured to control what people can do with the data service. From ps at blu-studio.com Tue Jul 28 13:11:30 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Tue, 28 Jul 2009 13:11:30 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: References: <003101ca0f96$58e1bb20$0aa53160$@com> Message-ID: <000c01ca0fa6$74be3250$5e3a96f0$@com> So, as I see it -- natively Android will only sync with Outlook Contacts. So can one get full Outlook Contacts/Email/Tasks sync to myTouch. Does one ad hoc this by first, setup a google Calendar. Sync Outlook to Calendar. Calendar to myTouch. Also, Netflix may be up for sale to MSFT or AMZN. Hmmm. Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Ajai Khattri Sent: Tuesday, July 28, 2009 12:46 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Best Cell Phone for a PHP Programmer Ive spent years following developments in the mobile space (Im a refugee from the Psion / Symbian world :-) On Tue, 28 Jul 2009, Peter Sawczynec wrote: > T-Mobile HTC "myTouch" w/ google Android OS (brand new, Aug 5 09) I just pulled the trigger and ordered this last week. Ill explain why a bit later. > Sprint Palm Pre (new, mid-Jun 09) Pre is great if you dont mind being on Sprint's US-only network (or maybe you dont mind paying the exorbitant amount to acquire the UK GSM version unlocked! Has gotten greta reviews and I like the whole embrace-the-cloud concept and universal search concept. >From a development standpoint, Pre is nice. Any web developer can write Pre apps (Basically, you've got a Javascript engine embedded in the frontend running on top of a Linux kernel, so unlike the iPhone you can access acclerometer, GPS and app data from JavaScript). You use HTML and CSS to build the GUI. If I had the choice I would probably buy a Pre, but I hate Sprint so Im waiting for a GSM version to come to the US, but that might not happen until late 2010... > AT&T iPhone 3G S Very nice and pretty good value at $199. Im not a big fan of Obfuscated-C :-) so as a developer its got a steeper learning curve. There are a bazillion apps for it and its hard sorting the wheat from the chaff. But being locked on AT&T's network is a drag for me. That said, it is a nice phone. > T-Mobile RIM Blackberry Curve 8900 I like the haptic feedback of the Storm more than the Curve. Development environment is (like Android) Java-based. More business-oriented, so I never think of them as 'sexy'. > T-Mobile Samsung Comeback SGH-T559 Did not (along with the envy) make my smartphone "A" list :-) So why did I order the Ion / Magic / G2 / myTouch ? Pre was actually my top choice but Im never going back to Sprint. While Im waiting (hoping?) for a GSM Pre (or some other webOS device like the Eos) I decided I needed a smartphone now even if I only get a year of usage out of it. Im a T-Mobile customer and I didn't want to switch carrier and T-Mobile have plenty of roaming coverage in Europe which was important to me. Also when deciding between Android and iPhone, the fact that Android is open source was a major factor in my decision to look at the myTouch over the iPhone. The G2 is quad-band and has gotten good reviews. T-Mobile are running a pre-sale for existing customers so we get it first for $199. I should get mine the first week of August. (You might also consider the HTC Hero which runs Android and has a stunning UI, BUT the reviews I read said the hardware was not quite up to the task. The last I heard, the FCC had approved a version that looks like it could run on Sprint's network. Finally, a T-Mobile exec mentioned they had no plan to offer the Hero on their network, so that was that). -- Aj. _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From ps at blu-studio.com Tue Jul 28 13:15:00 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Tue, 28 Jul 2009 13:15:00 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: References: Message-ID: <000d01ca0fa6$f11910e0$d34b32a0$@com> Apple tablet. 10" on the diag. End of 09. http://gizmodo.com/5323446/financial-times-confirms-apple-tablet-feature s-september-launch http://www.techcrunch.com/2009/05/21/what-we-know-about-the-apple-tablet -so-far/ Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Ajai Khattri Sent: Tuesday, July 28, 2009 12:51 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Best Cell Phone for a PHP Programmer On Tue, 28 Jul 2009, Chris Snyder wrote: > Ah right, forgot it's only wi-fi, not a phone. I have a friend who > makes calls on his, but he must be using Skype or something. Yeah, they can run Skype or Gizmo. I used it when I was in Barcelona to make calls back to the US. BTW, the screen is very nice (800 x 480 pixels) so I use mine as an armchair / bedroom sufing device. -- Aj. (who has owned all the Nokia web tablets at some point :-) _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From chehodgins at gmail.com Tue Jul 28 13:18:57 2009 From: chehodgins at gmail.com (Che Hodgins) Date: Tue, 28 Jul 2009 13:18:57 -0400 Subject: [nycphp-talk] Google Apps In-Reply-To: <00a801ca0fa0$9b68ef90$d23aceb0$@com> References: <00a801ca0fa0$9b68ef90$d23aceb0$@com> Message-ID: Hey Peter, Twitter uses Google Apps, although that hasn't worked out great, since this was the entry point for all those leaked documents a few weeks ago. Personally, I find I lose a lot of formatting when I upload a docx to google docs... but its still usable. I think it should definitely be considered, but I'm not ready to use google apps as my primary office suite. Che 2009/7/28 Peter Sawczynec : > Anyone using this as serious complete office suite? > > Using as personal mobile office? > > > > Any thoughts, heard on the street? > > > > Warmest regards, > > > > Peter Sawczynec > > Technology Dir. > > bl?studio > > 941.893.0396 > > ps at blu-studio.com > > www.blu-studio.com > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From chsnyder at gmail.com Tue Jul 28 13:25:53 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Tue, 28 Jul 2009 13:25:53 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: References: Message-ID: On Tue, Jul 28, 2009 at 12:48 PM, Ajai Khattri wrote: > On Tue, 28 Jul 2009, Chris Snyder wrote: > >> I wonder how many App Store "native" apps are really HTML+JS "web" >> apps and use Objective-C to display a WebKit view of local files? Like >> Dashboard widgets, but for the phone. I know there is at least one >> framework that makes this easy to do. > > > Phonegap? That's one (http://phonegap.com/) and it builds cross-platform apps, too. Very nice, have you used it? Of all the latest phone OSes, Android seems the most capable as far as having the freedom to get the phone to do exactly what you want. If you don't like the music player it ships with, you can build a better one without sacrificing the ability to play tracks in the background. The only caveat is that you'll be building it in Java. The Pre sounds like it's the easiest in which to build rich apps. Has anyone here actually tried the SDK yet? From guilhermeblanco at gmail.com Tue Jul 28 14:33:48 2009 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Tue, 28 Jul 2009 15:33:48 -0300 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: References: Message-ID: Hi guys, I own an unlocked iPhone 3G. With it, you can install terminal, apache, gcc and compile PHP. By doing it, you can even create a PHP-GTK application. Also, it seems there's a port from mono to be incorporated by iPhone soon, which means all .NET applications can run on it too. With that, just install Phalanger on your Visual Studio and be nice coding in PHP and running it on your iPhone. BUT... if you are open mind... I already heard good things about Linux mobile phones... OpenMoko. Cheers, On Tue, Jul 28, 2009 at 2:25 PM, Chris Snyder wrote: > On Tue, Jul 28, 2009 at 12:48 PM, Ajai Khattri wrote: >> On Tue, 28 Jul 2009, Chris Snyder wrote: >> >>> I wonder how many App Store "native" apps are really HTML+JS "web" >>> apps and use Objective-C to display a WebKit view of local files? Like >>> Dashboard widgets, but for the phone. I know there is at least one >>> framework that makes this easy to do. >> >> >> Phonegap? > > That's one (http://phonegap.com/) and it builds cross-platform apps, > too. Very nice, have you used it? > > Of all the latest phone OSes, Android seems the most capable as far as > having the freedom to get the phone to do exactly what you want. If > you don't like the music player it ships with, you can build a better > one without sacrificing the ability to play tracks in the background. > The only caveat is that you'll be building it in Java. > > The Pre sounds like it's the easiest in which to build rich apps. Has > anyone here actually tried the SDK yet? > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Paulo - SP/Brazil From krook at us.ibm.com Tue Jul 28 14:43:04 2009 From: krook at us.ibm.com (Daniel Krook) Date: Tue, 28 Jul 2009 14:43:04 -0400 Subject: [nycphp-talk] Meeting tonight: Can anyone record audio/video? Message-ID: Hi folks, Sorry for the last minute request, but is there anyone who can volunteer to bring along some sort of A/V device so we can record tonight's presentation? Thanks in advance, -Dan Daniel Krook Senior IT Specialist - Tools Team Lead, Global Solutions, ibm.com IBM Certified IT Specialist, SCSA, SCJP, SCWCD, ZCE, ICDAssoc., ICAD From chsnyder at gmail.com Tue Jul 28 15:00:58 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Tue, 28 Jul 2009 15:00:58 -0400 Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: References: Message-ID: On Tue, Jul 28, 2009 at 2:33 PM, Guilherme Blanco wrote: > I own an unlocked iPhone 3G. > With it, you can install terminal, apache, gcc and compile PHP. By > doing it, you can even create a PHP-GTK application. Heh. A great thing about all of these linux/darwin phones is support for "server" software. Pre does it too: http://www.weboshelp.net/all-webos-news-articles/497-palm-pre-hacked-to-enable-webserver If anything, the Android phones and the Pre are probably better suited to this kind of thing because at the end of the day, the phone OS is just another Linux distro. From lists at zaunere.com Tue Jul 28 14:51:48 2009 From: lists at zaunere.com (Hans Zaunere) Date: Tue, 28 Jul 2009 14:51:48 -0400 Subject: [nycphp-talk] Meeting tonight: Can anyone record audio/video? In-Reply-To: References: Message-ID: <118a01ca0fb4$76130b90$623922b0$@com> > Sorry for the last minute request, but is there anyone who can volunteer > to bring along some sort of A/V device so we can record tonight's > presentation? It'd be great to get someone with a good camera, but we do have justin.tv setup for next week's meetup. If worse comes to worse, we can use the web came we've been testing with, but if anyone had a camera (or a better way to this) that'd be sweet... H From anoland at indigente.net Tue Jul 28 15:51:09 2009 From: anoland at indigente.net (Adrian Noland) Date: Tue, 28 Jul 2009 14:51:09 -0500 Subject: [nycphp-talk] Google Apps In-Reply-To: <00a801ca0fa0$9b68ef90$d23aceb0$@com> References: <00a801ca0fa0$9b68ef90$d23aceb0$@com> Message-ID: <1d8a0e930907281251v6f7f9027i2e5f3d4523731942@mail.gmail.com> 2009/7/28 Peter Sawczynec > Anyone using this as serious complete office suite? > > Using as personal mobile office? > > > > Any thoughts, heard on the street? > > Warmest regards, > Last year I tried to use gCalendar to manage my interviews when I was job hunting. It fell far short of the mark. It was to cumbersome to add new appointments and I couldn't easily keep track of who I had talked to. I went back to using the calendar on my phone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Tue Jul 28 20:15:06 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Jul 2009 20:15:06 -0400 (EDT) Subject: [nycphp-talk] Google Apps In-Reply-To: <1d8a0e930907281251v6f7f9027i2e5f3d4523731942@mail.gmail.com> Message-ID: On Tue, 28 Jul 2009, Adrian Noland wrote: > Last year I tried to use gCalendar to manage my interviews when I was job > hunting. It fell far short of the mark. It was to cumbersome to add new > appointments and I couldn't easily keep track of who I had talked to. I went > back to using the calendar on my phone. Mind you, a lot of phone calendars can talk to Google Calendar. -- Aj. From ajai at bitblit.net Tue Jul 28 20:21:29 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Jul 2009 20:21:29 -0400 (EDT) Subject: [nycphp-talk] Google Apps In-Reply-To: Message-ID: On Tue, 28 Jul 2009, Che Hodgins wrote: > Personally, I find I lose a lot of formatting when I upload a docx to google docs... but its still usable. If you're uploading docs into it, then its not your primary office suite? I dont have any problem using Google Docs, it has 90% of the features that most people use. You dont have to be a programmer to click on a toolbar that uses the same icons as Word or Excel. The biggest stumbling block to get past is the idea that your documents live in the cloud. I would also have a look at ZoHo apps too though - they have a bunch of additional apps not covered by Google. They also have a framework and app 'store' where you can build your own apps. I also like the idea of using wikis to document stuff, so Ive also been playing with PBWorks (formerly PBWiki). -- Aj. From ajai at bitblit.net Tue Jul 28 20:22:45 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Jul 2009 20:22:45 -0400 (EDT) Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: <000d01ca0fa6$f11910e0$d34b32a0$@com> Message-ID: On Tue, 28 Jul 2009, Peter Sawczynec wrote: > Apple tablet. 10" on the diag. End of 09. http://gizmodo.com/5323446/financial-times-confirms-apple-tablet-feature s-september-launch http://www.techcrunch.com/2009/05/21/what-we-know-about-the-apple-tablet -so-far/ Maybe. -- Aj. From ajai at bitblit.net Tue Jul 28 20:31:00 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Jul 2009 20:31:00 -0400 (EDT) Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: Message-ID: On Tue, 28 Jul 2009, Chris Snyder wrote: > That's one (http://phonegap.com/) and it builds cross-platform apps, > too. Very nice, have you used it? Ive been playing with it for a couple months. Anyone built a real app with it? > Of all the latest phone OSes, Android seems the most capable as far as > having the freedom to get the phone to do exactly what you want. If > you don't like the music player it ships with, you can build a better > one without sacrificing the ability to play tracks in the background. > The only caveat is that you'll be building it in Java. Yes, it seems to have the most freedom. With the release of the NDK, porting C code becomes much easier too. I expect to see more langauages and scripting tools to appear eventually on Android. It also seems to be moving pretty fast - Cupcake is out and Donut is just round the corner. > The Pre sounds like it's the easiest in which to build rich apps. Has > anyone here actually tried the SDK yet? Unfortunately it requires Leopard (I have Tiger) and my Linux box disk died. But I have the 'official' book from O'Reilly which Im working through. App structure resembles Rails. The OS gives you a lot of built-in functionality with very little coding. It supports HTML 5 so you can use databases client-side. -- Aj. From ajai at bitblit.net Tue Jul 28 20:34:56 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Jul 2009 20:34:56 -0400 (EDT) Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: Message-ID: On Tue, 28 Jul 2009, Guilherme Blanco wrote: > I own an unlocked iPhone 3G. Is unlocking a problem when it comes time to update? -- Aj. From ajai at bitblit.net Tue Jul 28 20:49:43 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Tue, 28 Jul 2009 20:49:43 -0400 (EDT) Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: Message-ID: On Tue, 28 Jul 2009, Guilherme Blanco wrote: > With it, you can install terminal, apache, gcc and compile PHP. Same on the Nokia N810 - I use it as a mobile ssh terminal to connect to my screen session at the office :-) -- Aj. From ramons at gmx.net Tue Jul 28 21:08:25 2009 From: ramons at gmx.net (David Krings) Date: Tue, 28 Jul 2009 21:08:25 -0400 Subject: [nycphp-talk] Google Apps In-Reply-To: References: Message-ID: <4A6FA109.1080707@gmx.net> Ajai Khattri wrote: > I dont have any problem using Google Docs, it has 90% of the features that > most people use. You dont have to be a programmer to click on a toolbar > that uses the same icons as Word or Excel. The biggest stumbling block to > get past is the idea that your documents live in the cloud. Cloud? The cloud is Google's servers and who knows what they do with that data. "Do no harm" - what a bunch of Augenwischerei. And given that their clouds are often enough unaccessible I would consider it as a backup for casual use, but for nothing serious. If you want to stay mobile get OOo as mobile app on a USB drive or just take a pen and paper, like people did it for centuries. David From chehodgins at gmail.com Wed Jul 29 00:33:29 2009 From: chehodgins at gmail.com (Che Hodgins) Date: Wed, 29 Jul 2009 00:33:29 -0400 Subject: [nycphp-talk] Google Apps In-Reply-To: References: Message-ID: On Tue, Jul 28, 2009 at 8:21 PM, Ajai Khattri wrote: > On Tue, 28 Jul 2009, Che Hodgins wrote: > >> Personally, I find I lose a lot of formatting when I upload a docx to > google docs... but its still usable. > > > If you're uploading docs into it, then its not your primary office suite? It's likely you will have to deal with external documents, which you will have to upload to view. Che > > I dont have any problem using Google Docs, it has 90% of the features that > most people use. You dont have to be a programmer to click on a toolbar > that uses the same icons as Word or Excel. The biggest stumbling block to > get past is the idea that your documents live in the cloud. > > I would also have a look at ZoHo apps too though - they have a bunch of > additional apps not covered by Google. They also have a framework and app > 'store' where you can build your own apps. > > I also like the idea of using wikis to document stuff, so Ive also been > playing with PBWorks (formerly PBWiki). > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From gatzby3jr at gmail.com Thu Jul 30 12:25:10 2009 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Thu, 30 Jul 2009 12:25:10 -0400 Subject: [nycphp-talk] About the site structure article In-Reply-To: <455033.95011.qm@web44713.mail.sp1.yahoo.com> References: <455033.95011.qm@web44713.mail.sp1.yahoo.com> Message-ID: <29da5d150907300925o1fe1f76ahf1b1773be44b9b64@mail.gmail.com> That's the strategy I use ... I sure hope that's not unsafe On Tue, Jul 28, 2009 at 11:58 AM, PHP Tutor wrote: > Hello everyone. > First of I wanna say hi, since it's my first contribution here. > Also I'm not from NY, but Norway. Found your site trough google > > Now, back on topic: > It's a very nice, short and direct article. Easy to understand. > What I was thinking tho was about using .php. Wouldn't it add a bit more > security if you do something like this? > > .... Code here .... > > ?> > > Just asking, cause I'm fairly new to all this so :) > > Article: http://www.nyphp.org/phundamentals/sitestructure.php > > - Ole > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From gatzby3jr at gmail.com Thu Jul 30 12:25:10 2009 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Thu, 30 Jul 2009 12:25:10 -0400 Subject: [nycphp-talk] About the site structure article In-Reply-To: <455033.95011.qm@web44713.mail.sp1.yahoo.com> References: <455033.95011.qm@web44713.mail.sp1.yahoo.com> Message-ID: <29da5d150907300925o1fe1f76ahf1b1773be44b9b64@mail.gmail.com> That's the strategy I use ... I sure hope that's not unsafe On Tue, Jul 28, 2009 at 11:58 AM, PHP Tutor wrote: > Hello everyone. > First of I wanna say hi, since it's my first contribution here. > Also I'm not from NY, but Norway. Found your site trough google > > Now, back on topic: > It's a very nice, short and direct article. Easy to understand. > What I was thinking tho was about using .php. Wouldn't it add a bit more > security if you do something like this? > > .... Code here .... > > ?> > > Just asking, cause I'm fairly new to all this so :) > > Article: http://www.nyphp.org/phundamentals/sitestructure.php > > - Ole > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Thu Jul 30 12:35:38 2009 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 30 Jul 2009 12:35:38 -0400 Subject: [nycphp-talk] About the site structure article In-Reply-To: <29da5d150907300925o1fe1f76ahf1b1773be44b9b64@mail.gmail.com> References: <455033.95011.qm@web44713.mail.sp1.yahoo.com> <29da5d150907300925o1fe1f76ahf1b1773be44b9b64@mail.gmail.com> Message-ID: <03a401ca1133$c595e5e0$50c1b1a0$@com> > That's the strategy I use ... I sure hope that's not unsafe > > Hello everyone. > First of I wanna say hi, since it's my first contribution here. > Also I'm not from NY, but Norway. Found your site trough google > > Now, back on topic: > It's a very nice, short and direct article. Easy to understand. > What I was thinking tho was about using .php. Wouldn't it add a > bit more security if you do something like this? > } > > .... Code here .... > > ?> > > Just asking, cause I'm fairly new to all this so :) > > Article: http://www.nyphp.org/phundamentals/sitestructure.php I think both methods work, but the doInclude stuff is always a bit tedious and superfluous in my opinion. And what happens if you forget to do this defines? This type of thing certainly doesn't hurt, but especially when you can put stuff outside of the document root, I'd just do that. H From gatzby3jr at gmail.com Thu Jul 30 12:25:10 2009 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Thu, 30 Jul 2009 12:25:10 -0400 Subject: [nycphp-talk] About the site structure article In-Reply-To: <455033.95011.qm@web44713.mail.sp1.yahoo.com> References: <455033.95011.qm@web44713.mail.sp1.yahoo.com> Message-ID: <29da5d150907300925o1fe1f76ahf1b1773be44b9b64@mail.gmail.com> That's the strategy I use ... I sure hope that's not unsafe On Tue, Jul 28, 2009 at 11:58 AM, PHP Tutor wrote: > Hello everyone. > First of I wanna say hi, since it's my first contribution here. > Also I'm not from NY, but Norway. Found your site trough google > > Now, back on topic: > It's a very nice, short and direct article. Easy to understand. > What I was thinking tho was about using .php. Wouldn't it add a bit more > security if you do something like this? > > .... Code here .... > > ?> > > Just asking, cause I'm fairly new to all this so :) > > Article: http://www.nyphp.org/phundamentals/sitestructure.php > > - Ole > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Thu Jul 30 13:07:52 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Thu, 30 Jul 2009 13:07:52 -0400 Subject: [nycphp-talk] SSH2_CONNECT Message-ID: <20090730170915380.CMZH17500@hrndva-omta04.mail.rr.com> Does anyone know if you need a library for SSH2_CONNECT? If so, which one? Margaret Michele Waldman Sovereign Sites L.L.C. Website Development 646-861-3375 Rule your domain ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Thu Jul 30 13:20:18 2009 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 30 Jul 2009 13:20:18 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090730170915380.CMZH17500@hrndva-omta04.mail.rr.com> References: <20090730170915380.CMZH17500@hrndva-omta04.mail.rr.com> Message-ID: <03df01ca113a$0323be90$096b3bb0$@com> > Does anyone know if you need a library for SSH2_CONNECT? > > If so, which one? http://us2.php.net/manual/en/ssh2.installation.php Most (all?) unix systems should have the required libs already. H From mmwaldman at nyc.rr.com Thu Jul 30 13:56:45 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Thu, 30 Jul 2009 13:56:45 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <03df01ca113a$0323be90$096b3bb0$@com> Message-ID: <20090730175807958.ENWX17500@hrndva-omta04.mail.rr.com> If I'm on a server already what function can I use to connect as another user? Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Hans Zaunere > Sent: Thursday, July 30, 2009 1:20 PM > To: 'NYPHP Talk' > Subject: Re: [nycphp-talk] SSH2_CONNECT > > > Does anyone know if you need a library for SSH2_CONNECT? > > > > If so, which one? > > http://us2.php.net/manual/en/ssh2.installation.php > > Most (all?) unix systems should have the required libs already. > > H > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From davidalanroth at gmail.com Thu Jul 30 14:05:53 2009 From: davidalanroth at gmail.com (David A. Roth) Date: Thu, 30 Jul 2009 14:05:53 -0400 Subject: [nycphp-talk] Best open source package for doing charts and graphs in PHP? Any updates? Message-ID: <642abf2e0907301105m72c2cea7n6b25ae22bc0062e9@mail.gmail.com> I asked this question two years ago and wanted to know if anyone has updates to these suggestions? (By the way, http://pear.veggerby.dk/samples/ is still in Alpha) http://pear.veggerby.dk/samples/ JpGraph http://www.aditus.nu/jpgraph/ PHP/SWF Charts http://www.maani.us/charts/index.php Javascript library Plotr: http://code.google.com/p/plotr/ Thanks in advance, David Roth davidalanroth at gmail.com From gatzby3jr at gmail.com Thu Jul 30 14:11:39 2009 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Thu, 30 Jul 2009 14:11:39 -0400 Subject: [nycphp-talk] Best open source package for doing charts and graphs in PHP? Any updates? In-Reply-To: <642abf2e0907301105m72c2cea7n6b25ae22bc0062e9@mail.gmail.com> References: <642abf2e0907301105m72c2cea7n6b25ae22bc0062e9@mail.gmail.com> Message-ID: <29da5d150907301111p62d99a03p8c8b837a060324a3@mail.gmail.com> Another JS library, but I've heard good things about Flot. http://code.google.com/p/flot/ On Thu, Jul 30, 2009 at 2:05 PM, David A. Roth wrote: > I asked this question two years ago and wanted to know if anyone has > updates to these suggestions? (By the way, > http://pear.veggerby.dk/samples/ is still in Alpha) > > http://pear.veggerby.dk/samples/ > > JpGraph http://www.aditus.nu/jpgraph/ > > PHP/SWF Charts http://www.maani.us/charts/index.php > > Javascript library Plotr: > http://code.google.com/p/plotr/ > > > Thanks in advance, > > David Roth > davidalanroth at gmail.com > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From brenttech at gmail.com Thu Jul 30 14:11:58 2009 From: brenttech at gmail.com (Brent Baisley) Date: Thu, 30 Jul 2009 14:11:58 -0400 Subject: [nycphp-talk] Best open source package for doing charts and graphs in PHP? Any updates? In-Reply-To: <642abf2e0907301105m72c2cea7n6b25ae22bc0062e9@mail.gmail.com> References: <642abf2e0907301105m72c2cea7n6b25ae22bc0062e9@mail.gmail.com> Message-ID: <5d515c620907301111r8d96902ua15c095f93aedfc9@mail.gmail.com> I was looking into this a few weeks ago and discovered Google charts. It's not PHP, but you just pass them some data in a URL and they will render a chart for you. The chart is actually a graphic image, so you can incorporate it any way you want. http://code.google.com/apis/chart/ Of course, you are limited by the maximum length of a URL. Brent Baisley On Thu, Jul 30, 2009 at 2:05 PM, David A. Roth wrote: > I asked this question two years ago and wanted to know if anyone has > updates to these suggestions? (By the way, > http://pear.veggerby.dk/samples/ is still in Alpha) > > http://pear.veggerby.dk/samples/ > > JpGraph http://www.aditus.nu/jpgraph/ > > PHP/SWF Charts http://www.maani.us/charts/index.php > > Javascript library Plotr: > http://code.google.com/p/plotr/ > > > Thanks in advance, > > David Roth > davidalanroth at gmail.com > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From zippy1981 at gmail.com Thu Jul 30 14:21:51 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Thu, 30 Jul 2009 14:21:51 -0400 Subject: [nycphp-talk] Best open source package for doing charts and graphs in PHP? Any updates? In-Reply-To: <5d515c620907301111r8d96902ua15c095f93aedfc9@mail.gmail.com> References: <642abf2e0907301105m72c2cea7n6b25ae22bc0062e9@mail.gmail.com> <5d515c620907301111r8d96902ua15c095f93aedfc9@mail.gmail.com> Message-ID: <5458db3c0907301121t309aff31s4124405080cba402@mail.gmail.com> http://www.lmsotfy.com/index.php?q=open%20source%20PHP%20chart%20and%20graph%20library And more seriously: http://stackoverflow.com/questions/395541/graphs-charts-in-php On Thu, Jul 30, 2009 at 2:11 PM, Brent Baisley wrote: > I was looking into this a few weeks ago and discovered Google charts. > It's not PHP, but you just pass them some data in a URL and they will > render a chart for you. The chart is actually a graphic image, so you > can incorporate it any way you want. > http://code.google.com/apis/chart/ > > Of course, you are limited by the maximum length of a URL. > > Brent Baisley > > On Thu, Jul 30, 2009 at 2:05 PM, David A. Roth > wrote: > > I asked this question two years ago and wanted to know if anyone has > > updates to these suggestions? (By the way, > > http://pear.veggerby.dk/samples/ is still in Alpha) > > > > http://pear.veggerby.dk/samples/ > > > > JpGraph http://www.aditus.nu/jpgraph/ > > > > PHP/SWF Charts http://www.maani.us/charts/index.php > > > > Javascript library Plotr: > > http://code.google.com/p/plotr/ > > > > > > Thanks in advance, > > > > David Roth > > davidalanroth at gmail.com > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Thu Jul 30 14:37:59 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 30 Jul 2009 14:37:59 -0400 (EDT) Subject: [nycphp-talk] Best open source package for doing charts and graphs in PHP? Any updates? In-Reply-To: <642abf2e0907301105m72c2cea7n6b25ae22bc0062e9@mail.gmail.com> Message-ID: On Thu, 30 Jul 2009, David A. Roth wrote: > I asked this question two years ago and wanted to know if anyone has > updates to these suggestions? Protovis - http://vis.stanford.edu/protovis/ (JS) GoogChart - http://luddep.se/notebook/2008/04/13/charts-php-and-google-charts-api/ FusionCharts Free (Flash) - http://www.fusioncharts.com/free/ JSXGraph - http://jsxgraph.uni-bayreuth.de/wp/index.php JS Charts (JS) - http://www.jscharts.com/ EZ Components has some chart components - http://ezcomponents.org/introduction/overview Axiss (Flex 3) - http://www.axiis.org/ jqPlot (JS) - http://www.jqplot.com/ infoVia (JS) - http://thejit.org/ Visualize (JS) - http://www.filamentgroup.com/lab/jquery_visualize_plugin_accessible_charts_graphs_from_tables_html5_canvas -- Aj. From lists at zaunere.com Thu Jul 30 14:58:03 2009 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 30 Jul 2009 14:58:03 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090730175807958.ENWX17500@hrndva-omta04.mail.rr.com> References: <03df01ca113a$0323be90$096b3bb0$@com> <20090730175807958.ENWX17500@hrndva-omta04.mail.rr.com> Message-ID: <045901ca1147$aaf28090$00d781b0$@com> > If I'm on a server already what function can I use to connect as > another user? Seems like a reasonable choice: http://us2.php.net/manual/en/function.ssh2-connect.php Then you'll probably want: http://us2.php.net/manual/en/function.ssh2-auth-password.php H From mmwaldman at nyc.rr.com Thu Jul 30 15:30:26 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Thu, 30 Jul 2009 15:30:26 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <045901ca1147$aaf28090$00d781b0$@com> Message-ID: <20090730193148870.IRKO17500@hrndva-omta04.mail.rr.com> Are you sure? The scenario is I'm running a php script but I want to switch linix users? Do I have to use ssh2? I would have to go off the server and come back in just to switch users? Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Hans Zaunere > Sent: Thursday, July 30, 2009 2:58 PM > To: 'NYPHP Talk' > Subject: Re: [nycphp-talk] SSH2_CONNECT > > > If I'm on a server already what function can I use to connect as > > another user? > > Seems like a reasonable choice: > > http://us2.php.net/manual/en/function.ssh2-connect.php > > Then you'll probably want: > > http://us2.php.net/manual/en/function.ssh2-auth-password.php > > H > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From ajai at bitblit.net Thu Jul 30 15:35:45 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 30 Jul 2009 15:35:45 -0400 (EDT) Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090730193148870.IRKO17500@hrndva-omta04.mail.rr.com> Message-ID: On Thu, 30 Jul 2009, Michele Waldman wrote: > The scenario is I'm running a php script but I want to switch linix users? > > Do I have to use ssh2? I would have to go off the server and come back in > just to switch users? Only root can change user and I doubt your script will be running as root (otherwise any PHP scrpt could become any user and wreak havoc on a server!). This begs the question: why do you need to change user? -- Aj. From zippy1981 at gmail.com Thu Jul 30 15:41:36 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Thu, 30 Jul 2009 15:41:36 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: References: <20090730193148870.IRKO17500@hrndva-omta04.mail.rr.com> Message-ID: <5458db3c0907301241p1293adaai8c3673545b13c02@mail.gmail.com> Why not use sudo? or run a damon as the other user that performs the task you need. What exactly does the other user need to do? On Thu, Jul 30, 2009 at 3:35 PM, Ajai Khattri wrote: > On Thu, 30 Jul 2009, Michele Waldman wrote: > > > The scenario is I'm running a php script but I want to switch linix > users? > > > > Do I have to use ssh2? I would have to go off the server and come back > in > > just to switch users? > > Only root can change user and I doubt your script will be running as root > (otherwise any PHP scrpt could become any user and wreak havoc on a > server!). > > > This begs the question: why do you need to change user? > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Thu Jul 30 15:44:28 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Thu, 30 Jul 2009 15:44:28 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <5458db3c0907301241p1293adaai8c3673545b13c02@mail.gmail.com> Message-ID: <20090730194550985.FZQQ28534@hrndva-omta02.mail.rr.com> Will sudo work from the php script? That would work for me. Basically, I'm looking through domain names gotten from mysql and copying files from a template directory in one domain to the other domains. Sudo has been setup for the user, but I didn't know if it would work or how it works or what function to use from php? Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Justin Dearing Sent: Thursday, July 30, 2009 3:42 PM To: NYPHP Talk Subject: Re: [nycphp-talk] SSH2_CONNECT Why not use sudo? or run a damon as the other user that performs the task you need. What exactly does the other user need to do? On Thu, Jul 30, 2009 at 3:35 PM, Ajai Khattri wrote: On Thu, 30 Jul 2009, Michele Waldman wrote: > The scenario is I'm running a php script but I want to switch linix users? > > Do I have to use ssh2? I would have to go off the server and come back in > just to switch users? Only root can change user and I doubt your script will be running as root (otherwise any PHP scrpt could become any user and wreak havoc on a server!). This begs the question: why do you need to change user? -- Aj. _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at realm3.com Thu Jul 30 15:53:01 2009 From: brian at realm3.com (Brian D.) Date: Thu, 30 Jul 2009 14:53:01 -0500 Subject: [nycphp-talk] Best open source package for doing charts and graphs in PHP? Any updates? In-Reply-To: References: <642abf2e0907301105m72c2cea7n6b25ae22bc0062e9@mail.gmail.com> Message-ID: There's a number of them out there, but if your needs are humble the Google Chart API is absolutely fantastic if only for it's sheer simplicity. - Brian realm3 web applications [realm3.com] Information architecture, application development. phone: (917) 512-3594 fax: (440) 744-3559 On Thu, Jul 30, 2009 at 1:37 PM, Ajai Khattri wrote: > On Thu, 30 Jul 2009, David A. Roth wrote: > >> I asked this question two years ago and wanted to know if anyone has >> updates to these suggestions? > > Protovis - http://vis.stanford.edu/protovis/ ?(JS) > > GoogChart - > http://luddep.se/notebook/2008/04/13/charts-php-and-google-charts-api/ > > FusionCharts Free (Flash) - http://www.fusioncharts.com/free/ > > JSXGraph - http://jsxgraph.uni-bayreuth.de/wp/index.php > > JS Charts (JS) - http://www.jscharts.com/ > > EZ Components has some chart components - > http://ezcomponents.org/introduction/overview > > Axiss (Flex 3) - http://www.axiis.org/ > > jqPlot (JS) - http://www.jqplot.com/ > > infoVia (JS) - http://thejit.org/ > > Visualize (JS) - > http://www.filamentgroup.com/lab/jquery_visualize_plugin_accessible_charts_graphs_from_tables_html5_canvas > > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From jcampbell1 at gmail.com Thu Jul 30 15:59:46 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 30 Jul 2009 15:59:46 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090730194550985.FZQQ28534@hrndva-omta02.mail.rr.com> References: <5458db3c0907301241p1293adaai8c3673545b13c02@mail.gmail.com> <20090730194550985.FZQQ28534@hrndva-omta02.mail.rr.com> Message-ID: <8f0676b40907301259sbfd1560qff065d9491894b21@mail.gmail.com> On Thu, Jul 30, 2009 at 3:44 PM, Michele Waldman wrote: > Will sudo work from the php script?? That would work for me. Unfortunately it won't work. I am not sure what the problem you are having is, but my instinct tells me the correct solution has something to do with groups and permissions. Regards, John Campbell From ashaw at polymerdb.org Thu Jul 30 16:02:00 2009 From: ashaw at polymerdb.org (Allen Shaw) Date: Thu, 30 Jul 2009 15:02:00 -0500 Subject: [nycphp-talk] table structure for "friend" relationships Message-ID: <4A71FC38.7050604@polymerdb.org> Hi Gang, To support "friend" relationships in a contacts management database, I'm expecting to use a simple table like this one (plus a few columns for unique id, etc.): CREATE TABLE `tcontactrelationships` ( `contact1` int(11), `contact2` int(11) ); My concern is that when I'm looking for friends of contact #100, I'll have to search for '100' in both columns, because there's no reason that the value should be in only one column or the other. For example: +-----------+-----------+ | contact1 | contact2 | +-----------+-----------+ | 100 | 200 | | 300 | 100 | +-----------+-----------+ Alternatively, I could create two rows for each relationship, so that I can always search only one column to find all relationships, e.g., +-----------+-----------+ | contact1 | contact2 | +-----------+-----------+ | 100 | 200 | | 200 | 100 | | 300 | 100 | | 100 | 300 | +-----------+-----------+ The second method seems better, smoother, less complicated when it comes time to pull out data from this table with joins to multiple other tables. Of course I should only be adding/removing relationships within a transaction. Can anyone suggest drawbacks or caveats I may be missing, or maybe suggest a better way? Thanks, Allen -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From mmwaldman at nyc.rr.com Thu Jul 30 16:06:44 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Thu, 30 Jul 2009 16:06:44 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <8f0676b40907301259sbfd1560qff065d9491894b21@mail.gmail.com> Message-ID: <20090730200806967.HAJW28534@hrndva-omta02.mail.rr.com> That's what I was originally thinking. I was hoping for a way around. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of John Campbell > Sent: Thursday, July 30, 2009 4:00 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] SSH2_CONNECT > > On Thu, Jul 30, 2009 at 3:44 PM, Michele Waldman > wrote: > > Will sudo work from the php script?? That would work for me. > > Unfortunately it won't work. > > I am not sure what the problem you are having is, but my instinct > tells me the correct solution has something to do with groups and > permissions. > > Regards, > John Campbell > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From lists at zaunere.com Thu Jul 30 16:13:45 2009 From: lists at zaunere.com (Hans Zaunere) Date: Thu, 30 Jul 2009 16:13:45 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090730193148870.IRKO17500@hrndva-omta04.mail.rr.com> References: <045901ca1147$aaf28090$00d781b0$@com> <20090730193148870.IRKO17500@hrndva-omta04.mail.rr.com> Message-ID: <04c601ca1152$3e08b930$ba1a2b90$@com> > Are you sure? yah, pretty much - if you want to connect to a server using ssh, then this is the way to go... > The scenario is I'm running a php script but I want to switch linix > users? > > Do I have to use ssh2? I would have to go off the server and come back > in just to switch users? While I'm sure there's a better solution for what you're trying to do, since we went down the ssh route - why not just reconnect back to the server using SSH/SFTP and then you'll have the rights of the new user and can place the file as that user? You can use streams to push whatever you want over the loopback'd ssh tunnel you just created. Crazy yes, better way, probably. H From gatzby3jr at gmail.com Thu Jul 30 16:18:58 2009 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Thu, 30 Jul 2009 16:18:58 -0400 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: <4A71FC38.7050604@polymerdb.org> References: <4A71FC38.7050604@polymerdb.org> Message-ID: <29da5d150907301318y6d8bc747l9218acd392dd1a0d@mail.gmail.com> I did this a few years ago and I believe I went with option 1 (disclaimer: most what I did back then would be shunned by even the most beginner of programmers). #2 definitely has its advantages but goes against database normalization theory (in my opinion), especially since there is inherently no "direction" to friendship. #1 can easily be sorted out using a few lines of php but is definitely uglier. Of course, if you really wanted to go table-happy you could make even the notion of friendship based on joins :) On Thu, Jul 30, 2009 at 4:02 PM, Allen Shaw wrote: > Hi Gang, > > To support "friend" relationships in a contacts management database, I'm > expecting to use a simple table like this one (plus a few columns for unique > id, etc.): > > CREATE TABLE `tcontactrelationships` ( > `contact1` int(11), > `contact2` int(11) > ); > > My concern is that when I'm looking for friends of contact #100, I'll have > to search for '100' in both columns, because there's no reason that the > value should be in only one column or the other. For example: > > +-----------+-----------+ > | contact1 | contact2 | > +-----------+-----------+ > | 100 | 200 | > | 300 | 100 | > +-----------+-----------+ > > Alternatively, I could create two rows for each relationship, so that I can > always search only one column to find all relationships, e.g., > > +-----------+-----------+ > | contact1 | contact2 | > +-----------+-----------+ > | 100 | 200 | > | 200 | 100 | > | 300 | 100 | > | 100 | 300 | > +-----------+-----------+ > > The second method seems better, smoother, less complicated when it comes > time to pull out data from this table with joins to multiple other tables. > Of course I should only be adding/removing relationships within a > transaction. Can anyone suggest drawbacks or caveats I may be missing, or > maybe suggest a better way? > > Thanks, > Allen > > -- > Allen Shaw > slidePresenter (http://slides.sourceforge.net) > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From oorza2k5 at gmail.com Thu Jul 30 16:23:45 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Thu, 30 Jul 2009 16:23:45 -0400 Subject: [nycphp-talk] Best open source package for doing charts and graphs in PHP? Any updates? In-Reply-To: References: <642abf2e0907301105m72c2cea7n6b25ae22bc0062e9@mail.gmail.com> Message-ID: <68de37340907301323g70dc5ad3gb6f2a85abaf894a5@mail.gmail.com> I've had a lot of success with jQuery Flot: http://code.google.com/p/flot/ On Thu, Jul 30, 2009 at 3:53 PM, Brian D. wrote: > There's a number of them out there, but if your needs are humble the > Google Chart API is absolutely fantastic if only for it's sheer > simplicity. > > - Brian > > realm3 web applications [realm3.com] > Information architecture, application development. > phone: (917) 512-3594 > fax: (440) 744-3559 > > > > On Thu, Jul 30, 2009 at 1:37 PM, Ajai Khattri wrote: >> On Thu, 30 Jul 2009, David A. Roth wrote: >> >>> I asked this question two years ago and wanted to know if anyone has >>> updates to these suggestions? >> >> Protovis - http://vis.stanford.edu/protovis/ ?(JS) >> >> GoogChart - >> http://luddep.se/notebook/2008/04/13/charts-php-and-google-charts-api/ >> >> FusionCharts Free (Flash) - http://www.fusioncharts.com/free/ >> >> JSXGraph - http://jsxgraph.uni-bayreuth.de/wp/index.php >> >> JS Charts (JS) - http://www.jscharts.com/ >> >> EZ Components has some chart components - >> http://ezcomponents.org/introduction/overview >> >> Axiss (Flex 3) - http://www.axiis.org/ >> >> jqPlot (JS) - http://www.jqplot.com/ >> >> infoVia (JS) - http://thejit.org/ >> >> Visualize (JS) - >> http://www.filamentgroup.com/lab/jquery_visualize_plugin_accessible_charts_graphs_from_tables_html5_canvas >> >> >> >> >> -- >> Aj. >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From oorza2k5 at gmail.com Thu Jul 30 16:36:01 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Thu, 30 Jul 2009 16:36:01 -0400 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: <29da5d150907301318y6d8bc747l9218acd392dd1a0d@mail.gmail.com> References: <4A71FC38.7050604@polymerdb.org> <29da5d150907301318y6d8bc747l9218acd392dd1a0d@mail.gmail.com> Message-ID: <68de37340907301336p791bdf1es7542e728eb1a87c1@mail.gmail.com> I'd go with option #2, because it allows a "two-way" friendship, similar to how LiveJournal does it. Or, you could run a logic hook and check that both relationships exists, or the friendship is "pending." Option #1 means that you'd have to query the table twice (or the RDBMS would) to get a friends list (whether you ran a single query with an "OR" statement or two queries, the table is going to have to be opened twice) and is less flexible. And assuming that you had a table called people with a column names, just to get "your" friends out, with option 1: SELECT name FROM people,friends WHERE ( people.ID = friends.ID1 AND friends.ID2 = $yourID ) OR ( people.ID = friends.ID2 AND friends.ID1 = $yourID ) As opposed to option #2: SELECT name FROM people, friends WHERE people.ID = friends.ID2 AND friends.ID1 = $yourID Now, expand this to a query with more than two tables and your looking at a lot more work. On the other hand, Option #2 is inherently twice as much data, so I guess it really depends on what you're looking for. I'd definitely err on the side of option #2 because (IMO) it's more flexible and would almost definitely be faster to query against, at least until you had a mountain of data. On Thu, Jul 30, 2009 at 4:18 PM, Brian O'Connor wrote: > I did this a few years ago and I believe I went with option 1 (disclaimer: > most what I did back then would be shunned by even the most beginner of > programmers). > > #2 definitely has its advantages but goes against database normalization > theory (in my opinion), especially since there is inherently no "direction" > to friendship. > > #1 can easily be sorted out using a few lines of php but is definitely > uglier. > > Of course, if you really wanted to go table-happy you could make even the > notion of friendship based on joins :) > On Thu, Jul 30, 2009 at 4:02 PM, Allen Shaw wrote: >> >> Hi Gang, >> >> To support "friend" relationships in a contacts management database, I'm >> expecting to use a simple table like this one (plus a few columns for unique >> id, etc.): >> >> CREATE TABLE `tcontactrelationships` ( >> ?`contact1` int(11), >> ?`contact2` int(11) >> ); >> >> My concern is that when I'm looking for friends of contact #100, I'll have >> to search for '100' in both columns, because there's no reason that the >> value should be in only one column or the other. For example: >> >> +-----------+-----------+ >> | contact1 | contact2 | >> +-----------+-----------+ >> | ? ? ?100 ? ?| ? ? ?200 ? | >> | ? ? ?300 ? ?| ? ? ?100 ? | >> +-----------+-----------+ >> >> Alternatively, I could create two rows for each relationship, so that I >> can always search only one column to find all relationships, e.g., >> >> +-----------+-----------+ >> | contact1 | contact2 | >> +-----------+-----------+ >> | ? ? ?100 ? ?| ? ? ?200 ? | >> | ? ? ?200 ? ?| ? ? ?100 ? | >> | ? ? ?300 ? ?| ? ? ?100 ? | >> | ? ? ?100 ? ?| ? ? ?300 ? | >> +-----------+-----------+ >> >> The second method seems better, smoother, less complicated when it comes >> time to pull out data from this table with joins to multiple other tables. >> ?Of course I should only be adding/removing relationships within a >> transaction. ?Can anyone suggest drawbacks or caveats I may be missing, or >> maybe suggest a better way? >> >> Thanks, >> Allen >> >> -- >> Allen Shaw >> slidePresenter (http://slides.sourceforge.net) >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > > > -- > Brian O'Connor > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From glenn310b at mac.com Thu Jul 30 16:45:33 2009 From: glenn310b at mac.com (Glenn Powell) Date: Thu, 30 Jul 2009 16:45:33 -0400 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: <4A71FC38.7050604@polymerdb.org> References: <4A71FC38.7050604@polymerdb.org> Message-ID: imho, For option 1, if looking for friends of 100, maybe you only have to look in col 1. if 100 considers 300 a friend, that does not mean that 300 considers 100 a friend. It could be maddening for a user to see that they are a friend of 300, when in fact they have not done anything in the system to create that relationship. Looking for friends of 100 should probably mean looking for friends that 100 listed as friends? best, glenn On Jul 30, 2009, at 4:02 PM, Allen Shaw wrote: > Hi Gang, > > To support "friend" relationships in a contacts management database, > I'm expecting to use a simple table like this one (plus a few > columns for unique id, etc.): > > CREATE TABLE `tcontactrelationships` ( > `contact1` int(11), > `contact2` int(11) > ); > > My concern is that when I'm looking for friends of contact #100, > I'll have to search for '100' in both columns, because there's no > reason that the value should be in only one column or the other. For > example: > > +-----------+-----------+ > | contact1 | contact2 | > +-----------+-----------+ > | 100 | 200 | > | 300 | 100 | > +-----------+-----------+ > > Alternatively, I could create two rows for each relationship, so > that I can always search only one column to find all relationships, > e.g., > > +-----------+-----------+ > | contact1 | contact2 | > +-----------+-----------+ > | 100 | 200 | > | 200 | 100 | > | 300 | 100 | > | 100 | 300 | > +-----------+-----------+ > > The second method seems better, smoother, less complicated when it > comes time to pull out data from this table with joins to multiple > other tables. Of course I should only be adding/removing > relationships within a transaction. Can anyone suggest drawbacks or > caveats I may be missing, or maybe suggest a better way? > > Thanks, > Allen > > -- > Allen Shaw > slidePresenter (http://slides.sourceforge.net) > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From ajai at bitblit.net Thu Jul 30 17:05:00 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 30 Jul 2009 17:05:00 -0400 (EDT) Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090730194550985.FZQQ28534@hrndva-omta02.mail.rr.com> Message-ID: On Thu, 30 Jul 2009, Michele Waldman wrote: > Will sudo work from the php script? That would work for me. > > Basically, I'm looking through domain names gotten from mysql and copying > files from a template directory in one domain to the other domains. > > Sudo has been setup for the user, but I didn't know if it would work or how > it works or what function to use from php? Basic Unix Permissions 101: Most probably your PHP script will be running under the same username as Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you wouldn't want to give www or nobody sudo privilege anyway!). Another solution is to create a group that both the web server user and the destination folder belong to and give the group write permissions. But there are downsides to this too (basically if your script is hacked it would allow anyone to write to any folder that has group write permissions). This is probably why the Joomla installer switched to using FTP back to the same host to install files - it gets round all the problems since you just login as a regular user and don't have to mess with sudo or groups. So, it sounds like using FTP or SSH back to the same host with the other username is a good strategy. -- Aj. From tmpvar at gmail.com Thu Jul 30 17:07:18 2009 From: tmpvar at gmail.com (Elijah Insua) Date: Thu, 30 Jul 2009 17:07:18 -0400 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: References: <4A71FC38.7050604@polymerdb.org> Message-ID: <2b4feca10907301407g2d72c4c6jff550d2110da777f@mail.gmail.com> This is how I would approach the problem (simplified/pseudocode) CREATE TABLE user ( id INT, username VARCHAR ); CREATE TABLE friend ( id INT, user_id INT, friend_id INT ); -- Get all of user #1's friends usernames SELECT u.username FROM users u, friends f WHERE f.user_id = 1 AND u.id = f.friend_id; -- Get all users who think #1 is their friend SELECT u.username FROM users u, friends f WHERE f.user_id = u.id AND f.friend_id = 1; with a clean/consistent naming scheme and _not_ duplicating data you will be set for faster development, and not to mention the benefits down the road when you may have to actually debug this (possibly many months later). If speed becomes a problem there are some measures you can take: 1) make sure you create proper indexes 2) caching -- Elijah On Thu, Jul 30, 2009 at 4:45 PM, Glenn Powell wrote: > imho, > > For option 1, if looking for friends of 100, maybe you only have to look in > col 1. > > if 100 considers 300 a friend, that does not mean that 300 considers 100 a > friend. > > It could be maddening for a user to see that they are a friend of 300, when > in fact they have not done anything in the system > to create that relationship. > > Looking for friends of 100 should probably mean looking for friends that > 100 listed as friends? > > best, > > glenn > > > On Jul 30, 2009, at 4:02 PM, Allen Shaw wrote: > > Hi Gang, >> >> To support "friend" relationships in a contacts management database, I'm >> expecting to use a simple table like this one (plus a few columns for unique >> id, etc.): >> >> CREATE TABLE `tcontactrelationships` ( >> `contact1` int(11), >> `contact2` int(11) >> ); >> >> My concern is that when I'm looking for friends of contact #100, I'll have >> to search for '100' in both columns, because there's no reason that the >> value should be in only one column or the other. For example: >> >> +-----------+-----------+ >> | contact1 | contact2 | >> +-----------+-----------+ >> | 100 | 200 | >> | 300 | 100 | >> +-----------+-----------+ >> >> Alternatively, I could create two rows for each relationship, so that I >> can always search only one column to find all relationships, e.g., >> >> +-----------+-----------+ >> | contact1 | contact2 | >> +-----------+-----------+ >> | 100 | 200 | >> | 200 | 100 | >> | 300 | 100 | >> | 100 | 300 | >> +-----------+-----------+ >> >> The second method seems better, smoother, less complicated when it comes >> time to pull out data from this table with joins to multiple other tables. >> Of course I should only be adding/removing relationships within a >> transaction. Can anyone suggest drawbacks or caveats I may be missing, or >> maybe suggest a better way? >> >> Thanks, >> Allen >> >> -- >> Allen Shaw >> slidePresenter (http://slides.sourceforge.net) >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashaw at polymerdb.org Thu Jul 30 17:07:50 2009 From: ashaw at polymerdb.org (Allen Shaw) Date: Thu, 30 Jul 2009 16:07:50 -0500 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: References: <4A71FC38.7050604@polymerdb.org> Message-ID: <4A720BA6.5080809@polymerdb.org> Glenn Powell wrote: > ... if 100 considers 300 a friend, that does not mean that 300 > considers 100 a friend. > > It could be maddening for a user to see that they are a friend of 300, > when in fact they have not done anything in the system > to create that relationship. Hi Glenn, For a social networking app, I think you'd be right about that. What I have here is more of a CRM application. The user manages his own contacts and can record relationships between them for his own information, so reciprocation is not an issue, whereas it would be in a social networking app like friendster or facebook. In this app, the design spec indicates that if a user records that 100 and 300 are friends (or spouses, or co-workers, etc.), then the system should be able to find 100 connected to 300 and vice-verse. - A. -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From glenn310b at mac.com Thu Jul 30 17:26:54 2009 From: glenn310b at mac.com (Glenn Powell) Date: Thu, 30 Jul 2009 17:26:54 -0400 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: <4A720BA6.5080809@polymerdb.org> References: <4A71FC38.7050604@polymerdb.org> <4A720BA6.5080809@polymerdb.org> Message-ID: Thanks for clarifying. glenn On Jul 30, 2009, at 5:07 PM, Allen Shaw wrote: > Glenn Powell wrote: >> ... if 100 considers 300 a friend, that does not mean that 300 >> considers 100 a friend. >> >> It could be maddening for a user to see that they are a friend of >> 300, when in fact they have not done anything in the system >> to create that relationship. > Hi Glenn, > > For a social networking app, I think you'd be right about that. What > I have here is more of a CRM application. The user manages his own > contacts and can record relationships between them for his own > information, so reciprocation is not an issue, whereas it would be > in a social networking app like friendster or facebook. In this app, > the design spec indicates that if a user records that 100 and 300 > are friends (or spouses, or co-workers, etc.), then the system > should be able to find 100 connected to 300 and vice-verse. > > - A. > > -- > Allen Shaw > slidePresenter (http://slides.sourceforge.net) > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From mitch.pirtle at gmail.com Thu Jul 30 18:14:14 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Thu, 30 Jul 2009 18:14:14 -0400 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: <2b4feca10907301407g2d72c4c6jff550d2110da777f@mail.gmail.com> References: <4A71FC38.7050604@polymerdb.org> <2b4feca10907301407g2d72c4c6jff550d2110da777f@mail.gmail.com> Message-ID: <330532b60907301514x76cd8f59r651736af4ba838d2@mail.gmail.com> ++ on this approach, took a similar route on a very high traffic site and that was a major bonus. -- Mitch On Thu, Jul 30, 2009 at 5:07 PM, Elijah Insua wrote: > This is how I would approach the problem (simplified/pseudocode) > > CREATE TABLE user ( > ??? id INT, > ??? username VARCHAR > ); > > CREATE TABLE friend ( > ??? id INT, > ??? user_id INT, > ??? friend_id INT > ); > > -- Get all of user #1's friends usernames > SELECT u.username FROM users u, friends f WHERE f.user_id = 1 AND u.id = > f.friend_id; > > -- Get all users who think #1 is their friend > SELECT u.username FROM users u, friends f WHERE f.user_id = u.id AND > f.friend_id = 1; > > with a clean/consistent naming scheme and? _not_ duplicating data you will > be set for faster > development, and not to mention the benefits down the road when you may have > to actually debug > this (possibly many months later). > > If speed becomes a problem there are some measures you can take: > 1) make sure you create proper indexes > 2) caching > > -- Elijah > > > On Thu, Jul 30, 2009 at 4:45 PM, Glenn Powell wrote: >> >> imho, >> >> For option 1, if looking for friends of 100, maybe you only have to look >> in col 1. >> >> if 100 considers 300 a friend, that does not mean that 300 considers 100 a >> friend. >> >> It could be maddening for a user to see that they are a friend of 300, >> when in fact they have not done anything in the system >> to create that relationship. >> >> Looking for friends of 100 should probably mean looking for friends that >> 100 listed as friends? >> >> best, >> >> glenn >> >> On Jul 30, 2009, at 4:02 PM, Allen Shaw wrote: >> >>> Hi Gang, >>> >>> To support "friend" relationships in a contacts management database, I'm >>> expecting to use a simple table like this one (plus a few columns for unique >>> id, etc.): >>> >>> CREATE TABLE `tcontactrelationships` ( >>> `contact1` int(11), >>> `contact2` int(11) >>> ); >>> >>> My concern is that when I'm looking for friends of contact #100, I'll >>> have to search for '100' in both columns, because there's no reason that the >>> value should be in only one column or the other. For example: >>> >>> +-----------+-----------+ >>> | contact1 | contact2 | >>> +-----------+-----------+ >>> | ? ? ?100 ? ?| ? ? ?200 ? | >>> | ? ? ?300 ? ?| ? ? ?100 ? | >>> +-----------+-----------+ >>> >>> Alternatively, I could create two rows for each relationship, so that I >>> can always search only one column to find all relationships, e.g., >>> >>> +-----------+-----------+ >>> | contact1 | contact2 | >>> +-----------+-----------+ >>> | ? ? ?100 ? ?| ? ? ?200 ? | >>> | ? ? ?200 ? ?| ? ? ?100 ? | >>> | ? ? ?300 ? ?| ? ? ?100 ? | >>> | ? ? ?100 ? ?| ? ? ?300 ? | >>> +-----------+-----------+ >>> >>> The second method seems better, smoother, less complicated when it comes >>> time to pull out data from this table with joins to multiple other tables. >>> ?Of course I should only be adding/removing relationships within a >>> transaction. ?Can anyone suggest drawbacks or caveats I may be missing, or >>> maybe suggest a better way? >>> >>> Thanks, >>> Allen >>> >>> -- >>> Allen Shaw >>> slidePresenter (http://slides.sourceforge.net) >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ashaw at polymerdb.org Thu Jul 30 18:33:35 2009 From: ashaw at polymerdb.org (Allen Shaw) Date: Thu, 30 Jul 2009 17:33:35 -0500 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: <330532b60907301514x76cd8f59r651736af4ba838d2@mail.gmail.com> References: <4A71FC38.7050604@polymerdb.org> <2b4feca10907301407g2d72c4c6jff550d2110da777f@mail.gmail.com> <330532b60907301514x76cd8f59r651736af4ba838d2@mail.gmail.com> Message-ID: <4A721FBF.2070509@polymerdb.org> [reformatted] Mitch Pirtle wrote: > On Thu, Jul 30, 2009 at 5:07 PM, Elijah Insua wrote: > >> This is how I would approach the problem (simplified/pseudocode) >> >> CREATE TABLE user ( >> id INT, >> username VARCHAR >> ); >> >> CREATE TABLE friend ( >> id INT, >> user_id INT, >> friend_id INT >> ); >> >> -- Get all of user #1's friends usernames >> SELECT u.username FROM users u, friends f WHERE f.user_id = 1 AND u.id = >> f.friend_id; >> >> -- Get all users who think #1 is their friend >> SELECT u.username FROM users u, friends f WHERE f.user_id = u.id AND >> f.friend_id = 1; >> >> with a clean/consistent naming scheme and _not_ duplicating data you will >> be set for faster >> development, and not to mention the benefits down the road when you may have >> to actually debug >> this (possibly many months later). >> >> If speed becomes a problem there are some measures you can take: >> 1) make sure you create proper indexes >> 2) caching >> >> -- Elijah >> >> > ++ on this approach, took a similar route on a very high traffic site > and that was a major bonus. > > -- Mitch > To be more clear, in this app, friend relationships are reciprocal by definition -- the CRM user is managing his own business contacts and marking them as connected to each other for his own reference, which is different from a social networking user marking his own friends among other users. These two comments from Elijah's example highlight the difference: > -- Get all of user #1's friends usernames > ... > -- Get all users who think #1 is their friend To say "user #1" and "users" here is incorrect. The "friends" in this app are not users -- they're business contacts of the user who themselves have no access to the app. In this app, if the user says they're friends, then by definition they're both friends to each other. Since friend relationships are always reciprocal in this app, if we use Elijah's suggestion, we have to perform a union query (or two separate queries) every time we want to find friends of contact #1. I'm thinking the multi-table joins performed twice for each search will make more of a hit in performance (and maintenance) than writing two rows for each relationship and then always being able to search only once. - Allen -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From rmarscher at beaffinitive.com Thu Jul 30 21:10:12 2009 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 30 Jul 2009 21:10:12 -0400 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: <4A721FBF.2070509@polymerdb.org> References: <4A71FC38.7050604@polymerdb.org> <2b4feca10907301407g2d72c4c6jff550d2110da777f@mail.gmail.com> <330532b60907301514x76cd8f59r651736af4ba838d2@mail.gmail.com> <4A721FBF.2070509@polymerdb.org> Message-ID: <2F6FFCCB-5198-4081-8033-90E18BA7F04C@beaffinitive.com> On Jul 30, 2009, at 6:33 PM, Allen Shaw wrote: > I'm thinking the multi-table joins performed twice for each search > will make more of a hit in performance (and maintenance) than > writing two rows for each relationship and then always being able to > search only once. I've used code like that successfully for 4 years. I'm not sure if that's even technically denormalization, but the savings in read time definitely outweigh the extra writes and storage. From rmarscher at beaffinitive.com Fri Jul 31 00:42:57 2009 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 31 Jul 2009 00:42:57 -0400 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: <2F6FFCCB-5198-4081-8033-90E18BA7F04C@beaffinitive.com> References: <4A71FC38.7050604@polymerdb.org> <2b4feca10907301407g2d72c4c6jff550d2110da777f@mail.gmail.com> <330532b60907301514x76cd8f59r651736af4ba838d2@mail.gmail.com> <4A721FBF.2070509@polymerdb.org> <2F6FFCCB-5198-4081-8033-90E18BA7F04C@beaffinitive.com> Message-ID: <2C26E94A-1EB8-46F6-B16D-E315B999CC19@beaffinitive.com> On Jul 30, 2009, at 9:10 PM, Rob Marscher wrote: > On Jul 30, 2009, at 6:33 PM, Allen Shaw wrote: >> I'm thinking the multi-table joins performed twice for each search >> will make more of a hit in performance (and maintenance) than >> writing two rows for each relationship and then always being able >> to search only once. > > I've used code like that successfully for 4 years. I'm not sure if > that's even technically denormalization, but the savings in read > time definitely outweigh the extra writes and storage. Just noticed that my snip didn't make it totally clear but I'm talking about two rows per friend relationship. Cheers, Rob From kenneth at ylayali.net Fri Jul 31 07:32:56 2009 From: kenneth at ylayali.net (Kenneth Dombrowski) Date: Fri, 31 Jul 2009 07:32:56 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: References: <20090730194550985.FZQQ28534@hrndva-omta02.mail.rr.com> Message-ID: <20090731113256.GB31515@ylayali.net> On 09-07-30 17:05 -0400, Ajai Khattri wrote: > Most probably your PHP script will be running under the same username as > Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you > wouldn't want to give www or nobody sudo privilege anyway!). All this talk about sudo not working made me curious -- why shouldn't it work? It will, and a well configured sudo offers a very fine level of control -- though whether one wants to do it is another question # visudo Defaults:www-data !lecture Defaults:www-data !authenticate www-data ALL = (kenneth) /usr/bin/touch /tmp/sudoer.apache The first two lines get rid of sudo's usual prompts, since it will never run interactively, & the last specifies a single command + argument www-data is allowed to run as kenneth (you can use shell-style globs) # sudo.php References: <4A71FC38.7050604@polymerdb.org> Message-ID: At 3:02 PM -0500 7/30/09, Allen Shaw wrote: >Hi Gang, > >To support "friend" relationships in a contacts management database, >I'm expecting to use a simple table like this one (plus a few >columns for unique id, etc.): > >CREATE TABLE `tcontactrelationships` ( > `contact1` int(11), > `contact2` int(11) >); > >My concern is that when I'm looking for friends of contact #100, >I'll have to search for '100' in both columns, because there's no >reason that the value should be in only one column or the other. For >example: > >+-----------+-----------+ >| contact1 | contact2 | >+-----------+-----------+ >| 100 | 200 | >| 300 | 100 | >+-----------+-----------+ > Allen: All the above tells you is that 100 has a 200 for a friend, which is exactly what I would want. I would solve the problem by simply creating an unique record when anyone is identified as a friend of another, but only in a one-way relationship. In the above example, you can see that 100 has 200 as a friend and 300 has 100 as a friend, but you cannot conclude that 100 has 300 as a friend. If 100 agreed that 300 is a friend, then your table would look like this: +-----------+-----------+ | contact1 | contact2 | +-----------+-----------+ | 100 | 200 | | 300 | 100 | | 100 | 300 | +-----------+-----------+ So, I would make it one record per one-way relationship to solve this problem. That way you don't have to search two columns to find one-way relationships and you keep your records short and neat. Plus, this makes it easy if a relationship is not shared or later dissolved -- a single record is either not created or deleted, respectfully. Additionally, I might change the column titles to "person" and "friend" to be more semantic (and add an index). Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From php.tutor at yahoo.com Fri Jul 31 09:59:16 2009 From: php.tutor at yahoo.com (Ole Aass) Date: Fri, 31 Jul 2009 06:59:16 -0700 (PDT) Subject: [nycphp-talk] About the site structure article In-Reply-To: <03a401ca1133$c595e5e0$50c1b1a0$@com> References: <455033.95011.qm@web44713.mail.sp1.yahoo.com> <29da5d150907300925o1fe1f76ahf1b1773be44b9b64@mail.gmail.com> <03a401ca1133$c595e5e0$50c1b1a0$@com> Message-ID: <875848.68125.qm@web44716.mail.sp1.yahoo.com> yeah ofc the best way is to put it outside the root, but like the article sais, not all hosts provide with that, and not all can use *.inc either.. So from the little i know about php, checking if the constant is defined, then give/deny access would make it abit more secure.. ________________________________ From: Hans Zaunere To: NYPHP Talk Sent: Thursday, July 30, 2009 6:35:38 PM Subject: Re: [nycphp-talk] About the site structure article > That's the strategy I use ... I sure hope that's not unsafe > > Hello everyone. > First of I wanna say hi, since it's my first contribution here. > Also I'm not from NY, but Norway. Found your site trough google > > Now, back on topic: > It's a very nice, short and direct article. Easy to understand. > What I was thinking tho was about using .php. Wouldn't it add a > bit more security if you do something like this? > } > > .... Code here .... > > ?> > > Just asking, cause I'm fairly new to all this so :) > > Article: http://www.nyphp.org/phundamentals/sitestructure.php I think both methods work, but the doInclude stuff is always a bit tedious and superfluous in my opinion. And what happens if you forget to do this defines? This type of thing certainly doesn't hurt, but especially when you can put stuff outside of the document root, I'd just do that. H _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Fri Jul 31 10:20:53 2009 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 31 Jul 2009 10:20:53 -0400 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: <2F6FFCCB-5198-4081-8033-90E18BA7F04C@beaffinitive.com> References: <4A71FC38.7050604@polymerdb.org> <2b4feca10907301407g2d72c4c6jff550d2110da777f@mail.gmail.com> <330532b60907301514x76cd8f59r651736af4ba838d2@mail.gmail.com> <4A721FBF.2070509@polymerdb.org> <2F6FFCCB-5198-4081-8033-90E18BA7F04C@beaffinitive.com> Message-ID: <07a201ca11ea$1cc93bd0$565bb370$@com> All, > > I'm thinking the multi-table joins performed twice for each search > > will make more of a hit in performance (and maintenance) than > > writing two rows for each relationship and then always being able to > > search only once. > > I've used code like that successfully for 4 years. I'm not sure if > that's even technically denormalization, but the savings in read time > definitely outweigh the extra writes and storage. In many modern web application, relational pedantic have been fading. Denormalization is often a good thing, and very large sites are in fact highly denormalized. This is due to the type of data they need to store (friend relationships is a classic one), and the level of throughput they need to achieve. The importance of transactions faded when MySQL become the dominant database on the web, and now even relationships are fading (sounds like a soap opera, I know). Instead, things like document based DBs and memcached is where it's at. The goal really is key/value pairs with insane performance because there's no overhead to manage that "old clunky SQL" - in fact, these are often considered schemaless databases. We have a couple of presentations coming up about this in the fall - check out the calendar on www.nyphp.org Some useful links: http://en.wikipedia.org/wiki/Document-oriented_database http://labs.google.com/papers/bigtable.html http://aws.amazon.com/simpledb/ "The times they are a changing..." (yet somehow that phrase always hangs on :) H From paul at devonianfarm.com Fri Jul 31 11:14:41 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Fri, 31 Jul 2009 11:14:41 -0400 Subject: [nycphp-talk] table structure for "friend" relationships In-Reply-To: <07a201ca11ea$1cc93bd0$565bb370$@com> References: <4A71FC38.7050604@polymerdb.org> <2b4feca10907301407g2d72c4c6jff550d2110da777f@mail.gmail.com> <330532b60907301514x76cd8f59r651736af4ba838d2@mail.gmail.com> <4A721FBF.2070509@polymerdb.org> <2F6FFCCB-5198-4081-8033-90E18BA7F04C@beaffinitive.com> <07a201ca11ea$1cc93bd0$565bb370$@com> Message-ID: <4A730A61.7000307@devonianfarm.com> Hans Zaunere wrote: > In many modern web application, relational pedantic have been fading. > Denormalization is often a good thing, and very large sites are in fact > highly denormalized. This is due to the type of data they need to store > (friend relationships is a classic one), and the level of throughput they > need to achieve. > I think about 90% of people who scream "down with normalization" are the same people who were creating Microsoft Access databases 10 years ago with three phone number columns rather than creating a separate table for phone numbers. (I spent about 6 months fixing those kind of apps, and that's enough for me...) In the "social media" sorts of applications, I think it's wise to pursue an 'eventually consistent' strategy. If you don't think about consistency at all, you're going to have a day that your database wrecks and you find it's a pile of spaghetti that doesn't make any sense. One strategy is to have a normalized 'core' and then denormalize the data to make views that are very fast. I'm doing a lot of semantic web stuff these days and I'm finding that I need to create materialized views all the time. Myself I'm feeling torn between wanting schema flexibility and wanting to have richer schemas: I want more data types and data dictionaries that record more about what data in the database means: with a rich schema, many parts of your apps can "write themselves." I've also got a lot of fear that "schemaless" systems are going to be "futureless" systems. Look at the sad story of Java serialization and object databases: once an object gets persisted into a database, you can't make changes to it as easily as you can make changes to an ordinary object that lives in RAM. Object database vendors haven't come up with a decent story for how to migrate databases over the long term. On the other hand, I've seen relational databases in business applications that have survived 5, 10, even 25 years of changing business requirements. Relational databases seem to have hit about the right balance between being easy and hard to change the schema. ---------- My dream database is something like the CycL system created for the Cyc project, though I'd add full RDF capability and dump most of the Cyc ontology on the floor. Add SPARQL and relational-mapped views... From ajai at bitblit.net Fri Jul 31 12:05:58 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 31 Jul 2009 12:05:58 -0400 (EDT) Subject: [nycphp-talk] Best Cell Phone for a PHP Programmer In-Reply-To: <000c01ca0fa6$74be3250$5e3a96f0$@com> Message-ID: On Tue, 28 Jul 2009, Peter Sawczynec wrote: > So, as I see it -- natively Android will only sync with Outlook > Contacts. > > So can one get full Outlook Contacts/Email/Tasks sync to myTouch. > > Does one ad hoc this by first, setup a google Calendar. > Sync Outlook to Calendar. Calendar to myTouch. Yes, that's sounds right. BTW, I recieved my myToouch yesterday. Its smaller and lighter than I thought (slightly smaller than an iPhone). Feels nice in your hand. The screen is gorgeous. I added data service online (by logging into my account on t-mobile.com) and I was online in a few minutes. This means I kept my current cheap voice plan as is and just slotted by old SIM card into the new phone (iPhones are sealed, so you get a new SIM card built-in). The interface is very snappy (faster than my dumbphone which was suprising). Basically, I love it and Im very happy with my choice. -- Aj. From mmwaldman at nyc.rr.com Fri Jul 31 19:33:12 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Fri, 31 Jul 2009 19:33:12 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090731113256.GB31515@ylayali.net> Message-ID: <20090731233432931.EXWI8759@hrndva-omta01.mail.rr.com> So I rewrote the code in bash due to my client's concern about bandwidth. Here's my new problem: $msg = exec("echo $password | sudo /home/user/site_util/copy_sites $id 2> /dev/null"); The script isn't running. Since it's running from http, I modified the user nobody to have /bin/bash in /etc/passwd and gave the user a password. I can login to the server as nobody and run this code on the command line. Works fine. Does anyone know why this execute isn't working in php? Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Kenneth Dombrowski > Sent: Friday, July 31, 2009 7:33 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] SSH2_CONNECT > > On 09-07-30 17:05 -0400, Ajai Khattri wrote: > > Most probably your PHP script will be running under the same username as > > Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you > > wouldn't want to give www or nobody sudo privilege anyway!). > > All this talk about sudo not working made me curious -- why shouldn't it > work? It will, and a well configured sudo offers a very fine level of > control -- though whether one wants to do it is another question > > # visudo > Defaults:www-data !lecture > Defaults:www-data !authenticate > www-data ALL = (kenneth) /usr/bin/touch /tmp/sudoer.apache > > The first two lines get rid of sudo's usual prompts, since it will never > run interactively, & the last specifies a single command + argument > www-data is allowed to run as kenneth (you can use shell-style globs) > > # sudo.php > header('Content-type: text/plain'); > $f = '/tmp/sudoer.apache'; > system("sudo -u kenneth /usr/bin/touch $f"); > print "\n$f exists? " . (bool) file_exists($f); > > kenneth at gilgamesh:~$ elinks --dump http://localhost/tmp/sudo.php > /tmp/sudoer.apache exists? 1 > kenneth at gilgamesh:~$ ls -l /tmp/sudoer.apache > -rw-r--r-- 1 kenneth kenneth 0 2009-07-30 19:52 /tmp/sudoer.apache > > So on debian, www-data successfully created a file as kenneth. On FreeBSD > I think www/nobody/whatever has a /bin/false shell, so there it won't > work. Of course, you shouldn't do it on shared hosts, and I'm sure > somebody will tell me you shouldn't do it at all, but its not due to a > technical limitation > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From leam at reuel.net Fri Jul 31 19:57:36 2009 From: leam at reuel.net (Leam Hall) Date: Fri, 31 Jul 2009 19:57:36 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090731233432931.EXWI8759@hrndva-omta01.mail.rr.com> References: <20090731233432931.EXWI8759@hrndva-omta01.mail.rr.com> Message-ID: <4A7384F0.2050901@reuel.net> Hey Michele. Can you edit /etc/sudoers? You might be able to give it the NOPASSWD option, to at least shorten it a bit. Can you read /var/log/messages and the web server log to see if they say anything? Leam Michele Waldman wrote: > So I rewrote the code in bash due to my client's concern about bandwidth. > > Here's my new problem: > $msg = exec("echo $password | sudo /home/user/site_util/copy_sites $id 2> > /dev/null"); > > The script isn't running. > > Since it's running from http, I modified the user nobody to have /bin/bash > in /etc/passwd and gave the user a password. > > I can login to the server as nobody and run this code on the command line. > Works fine. > > Does anyone know why this execute isn't working in php? > > Michele > >> -----Original Message----- >> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >> On Behalf Of Kenneth Dombrowski >> Sent: Friday, July 31, 2009 7:33 AM >> To: NYPHP Talk >> Subject: Re: [nycphp-talk] SSH2_CONNECT >> >> On 09-07-30 17:05 -0400, Ajai Khattri wrote: >>> Most probably your PHP script will be running under the same username as >>> Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you >>> wouldn't want to give www or nobody sudo privilege anyway!). >> All this talk about sudo not working made me curious -- why shouldn't it >> work? It will, and a well configured sudo offers a very fine level of >> control -- though whether one wants to do it is another question >> >> # visudo >> Defaults:www-data !lecture >> Defaults:www-data !authenticate >> www-data ALL = (kenneth) /usr/bin/touch /tmp/sudoer.apache >> >> The first two lines get rid of sudo's usual prompts, since it will never >> run interactively, & the last specifies a single command + argument >> www-data is allowed to run as kenneth (you can use shell-style globs) >> >> # sudo.php >> > header('Content-type: text/plain'); >> $f = '/tmp/sudoer.apache'; >> system("sudo -u kenneth /usr/bin/touch $f"); >> print "\n$f exists? " . (bool) file_exists($f); >> >> kenneth at gilgamesh:~$ elinks --dump http://localhost/tmp/sudo.php >> /tmp/sudoer.apache exists? 1 >> kenneth at gilgamesh:~$ ls -l /tmp/sudoer.apache >> -rw-r--r-- 1 kenneth kenneth 0 2009-07-30 19:52 /tmp/sudoer.apache >> >> So on debian, www-data successfully created a file as kenneth. On FreeBSD >> I think www/nobody/whatever has a /bin/false shell, so there it won't >> work. Of course, you shouldn't do it on shared hosts, and I'm sure >> somebody will tell me you shouldn't do it at all, but its not due to a >> technical limitation >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From mmwaldman at nyc.rr.com Fri Jul 31 20:15:35 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Fri, 31 Jul 2009 20:15:35 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <4A7384F0.2050901@reuel.net> Message-ID: <20090801001655456.FYYS8759@hrndva-omta01.mail.rr.com> I didn't see anything in /var/log/messages. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Leam Hall > Sent: Friday, July 31, 2009 7:58 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] SSH2_CONNECT > > Hey Michele. > > Can you edit /etc/sudoers? You might be able to give it the NOPASSWD > option, to at least shorten it a bit. > > Can you read /var/log/messages and the web server log to see if they say > anything? > > Leam > > Michele Waldman wrote: > > So I rewrote the code in bash due to my client's concern about > bandwidth. > > > > Here's my new problem: > > $msg = exec("echo $password | sudo /home/user/site_util/copy_sites $id > 2> > > /dev/null"); > > > > The script isn't running. > > > > Since it's running from http, I modified the user nobody to have > /bin/bash > > in /etc/passwd and gave the user a password. > > > > I can login to the server as nobody and run this code on the command > line. > > Works fine. > > > > Does anyone know why this execute isn't working in php? > > > > Michele > > > >> -----Original Message----- > >> From: talk-bounces at lists.nyphp.org [mailto:talk- > bounces at lists.nyphp.org] > >> On Behalf Of Kenneth Dombrowski > >> Sent: Friday, July 31, 2009 7:33 AM > >> To: NYPHP Talk > >> Subject: Re: [nycphp-talk] SSH2_CONNECT > >> > >> On 09-07-30 17:05 -0400, Ajai Khattri wrote: > >>> Most probably your PHP script will be running under the same username > as > >>> Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you > >>> wouldn't want to give www or nobody sudo privilege anyway!). > >> All this talk about sudo not working made me curious -- why shouldn't > it > >> work? It will, and a well configured sudo offers a very fine level of > >> control -- though whether one wants to do it is another question > >> > >> # visudo > >> Defaults:www-data !lecture > >> Defaults:www-data !authenticate > >> www-data ALL = (kenneth) /usr/bin/touch /tmp/sudoer.apache > >> > >> The first two lines get rid of sudo's usual prompts, since it will > never > >> run interactively, & the last specifies a single command + argument > >> www-data is allowed to run as kenneth (you can use shell-style globs) > >> > >> # sudo.php > >> >> header('Content-type: text/plain'); > >> $f = '/tmp/sudoer.apache'; > >> system("sudo -u kenneth /usr/bin/touch $f"); > >> print "\n$f exists? " . (bool) file_exists($f); > >> > >> kenneth at gilgamesh:~$ elinks --dump http://localhost/tmp/sudo.php > >> /tmp/sudoer.apache exists? 1 > >> kenneth at gilgamesh:~$ ls -l /tmp/sudoer.apache > >> -rw-r--r-- 1 kenneth kenneth 0 2009-07-30 19:52 /tmp/sudoer.apache > >> > >> So on debian, www-data successfully created a file as kenneth. On > FreeBSD > >> I think www/nobody/whatever has a /bin/false shell, so there it won't > >> work. Of course, you shouldn't do it on shared hosts, and I'm sure > >> somebody will tell me you shouldn't do it at all, but its not due to a > >> technical limitation > >> > >> > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From leam at reuel.net Fri Jul 31 20:16:57 2009 From: leam at reuel.net (Leam Hall) Date: Fri, 31 Jul 2009 20:16:57 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <4A7384F0.2050901@reuel.net> References: <20090731233432931.EXWI8759@hrndva-omta01.mail.rr.com> <4A7384F0.2050901@reuel.net> Message-ID: <4A738979.8000904@reuel.net> Also, maybe change "2> /dev/null" to 2>/tmp/error.log to see what it says. Leam Leam Hall wrote: > Hey Michele. > > Can you edit /etc/sudoers? You might be able to give it the NOPASSWD > option, to at least shorten it a bit. > > Can you read /var/log/messages and the web server log to see if they say > anything? > > Leam > > Michele Waldman wrote: >> So I rewrote the code in bash due to my client's concern about bandwidth. >> >> Here's my new problem: >> $msg = exec("echo $password | sudo /home/user/site_util/copy_sites $id 2> >> /dev/null"); >> >> The script isn't running. >> >> Since it's running from http, I modified the user nobody to have >> /bin/bash >> in /etc/passwd and gave the user a password. >> >> I can login to the server as nobody and run this code on the command >> line. >> Works fine. >> >> Does anyone know why this execute isn't working in php? >> >> Michele >> >>> -----Original Message----- >>> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >>> On Behalf Of Kenneth Dombrowski >>> Sent: Friday, July 31, 2009 7:33 AM >>> To: NYPHP Talk >>> Subject: Re: [nycphp-talk] SSH2_CONNECT >>> >>> On 09-07-30 17:05 -0400, Ajai Khattri wrote: >>>> Most probably your PHP script will be running under the same >>>> username as >>>> Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you >>>> wouldn't want to give www or nobody sudo privilege anyway!). >>> All this talk about sudo not working made me curious -- why shouldn't it >>> work? It will, and a well configured sudo offers a very fine level of >>> control -- though whether one wants to do it is another question >>> >>> # visudo >>> Defaults:www-data !lecture >>> Defaults:www-data !authenticate >>> www-data ALL = (kenneth) /usr/bin/touch /tmp/sudoer.apache >>> >>> The first two lines get rid of sudo's usual prompts, since it will never >>> run interactively, & the last specifies a single command + argument >>> www-data is allowed to run as kenneth (you can use shell-style globs) >>> >>> # sudo.php >>> >> header('Content-type: text/plain'); >>> $f = '/tmp/sudoer.apache'; >>> system("sudo -u kenneth /usr/bin/touch $f"); >>> print "\n$f exists? " . (bool) file_exists($f); >>> >>> kenneth at gilgamesh:~$ elinks --dump http://localhost/tmp/sudo.php >>> /tmp/sudoer.apache exists? 1 >>> kenneth at gilgamesh:~$ ls -l /tmp/sudoer.apache >>> -rw-r--r-- 1 kenneth kenneth 0 2009-07-30 19:52 /tmp/sudoer.apache >>> >>> So on debian, www-data successfully created a file as kenneth. On >>> FreeBSD >>> I think www/nobody/whatever has a /bin/false shell, so there it won't >>> work. Of course, you shouldn't do it on shared hosts, and I'm sure >>> somebody will tell me you shouldn't do it at all, but its not due to a >>> technical limitation >>> >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From leam at reuel.net Fri Jul 31 20:22:05 2009 From: leam at reuel.net (Leam Hall) Date: Fri, 31 Jul 2009 20:22:05 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090801001655456.FYYS8759@hrndva-omta01.mail.rr.com> References: <20090801001655456.FYYS8759@hrndva-omta01.mail.rr.com> Message-ID: <4A738AAD.8090209@reuel.net> Drat! That's my favorite reading. :) Couple more ideas, based on an OS perspective. If it's a PHPism, I'm not so good... If the copy_sites program is a script and not a binary, edit it early on to create a temporary file. For example, put in a like "echo guido > /tmp/woo-hoo". See if it writes it. If so, then it's choking on the script. If not, then it's not getting to the script. Also, have it echo $id to a temp file to make sure the variable substitution is happening correctly. Hope that helps. Leam Michele Waldman wrote: > I didn't see anything in /var/log/messages. > > Michele > >> -----Original Message----- >> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >> On Behalf Of Leam Hall >> Sent: Friday, July 31, 2009 7:58 PM >> To: NYPHP Talk >> Subject: Re: [nycphp-talk] SSH2_CONNECT >> >> Hey Michele. >> >> Can you edit /etc/sudoers? You might be able to give it the NOPASSWD >> option, to at least shorten it a bit. >> >> Can you read /var/log/messages and the web server log to see if they say >> anything? >> >> Leam >> >> Michele Waldman wrote: >>> So I rewrote the code in bash due to my client's concern about >> bandwidth. >>> Here's my new problem: >>> $msg = exec("echo $password | sudo /home/user/site_util/copy_sites $id >> 2> >>> /dev/null"); >>> >>> The script isn't running. >>> >>> Since it's running from http, I modified the user nobody to have >> /bin/bash >>> in /etc/passwd and gave the user a password. >>> >>> I can login to the server as nobody and run this code on the command >> line. >>> Works fine. >>> >>> Does anyone know why this execute isn't working in php? >>> >>> Michele >>> >>>> -----Original Message----- >>>> From: talk-bounces at lists.nyphp.org [mailto:talk- >> bounces at lists.nyphp.org] >>>> On Behalf Of Kenneth Dombrowski >>>> Sent: Friday, July 31, 2009 7:33 AM >>>> To: NYPHP Talk >>>> Subject: Re: [nycphp-talk] SSH2_CONNECT >>>> >>>> On 09-07-30 17:05 -0400, Ajai Khattri wrote: >>>>> Most probably your PHP script will be running under the same username >> as >>>>> Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you >>>>> wouldn't want to give www or nobody sudo privilege anyway!). >>>> All this talk about sudo not working made me curious -- why shouldn't >> it >>>> work? It will, and a well configured sudo offers a very fine level of >>>> control -- though whether one wants to do it is another question >>>> >>>> # visudo >>>> Defaults:www-data !lecture >>>> Defaults:www-data !authenticate >>>> www-data ALL = (kenneth) /usr/bin/touch /tmp/sudoer.apache >>>> >>>> The first two lines get rid of sudo's usual prompts, since it will >> never >>>> run interactively, & the last specifies a single command + argument >>>> www-data is allowed to run as kenneth (you can use shell-style globs) >>>> >>>> # sudo.php >>>> >>> header('Content-type: text/plain'); >>>> $f = '/tmp/sudoer.apache'; >>>> system("sudo -u kenneth /usr/bin/touch $f"); >>>> print "\n$f exists? " . (bool) file_exists($f); >>>> >>>> kenneth at gilgamesh:~$ elinks --dump http://localhost/tmp/sudo.php >>>> /tmp/sudoer.apache exists? 1 >>>> kenneth at gilgamesh:~$ ls -l /tmp/sudoer.apache >>>> -rw-r--r-- 1 kenneth kenneth 0 2009-07-30 19:52 /tmp/sudoer.apache >>>> >>>> So on debian, www-data successfully created a file as kenneth. On >> FreeBSD >>>> I think www/nobody/whatever has a /bin/false shell, so there it won't >>>> work. Of course, you shouldn't do it on shared hosts, and I'm sure >>>> somebody will tell me you shouldn't do it at all, but its not due to a >>>> technical limitation >>>> >>>> >>>> _______________________________________________ >>>> New York PHP User Group Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> http://www.nyphp.org/show_participation.php >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >>> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From mmwaldman at nyc.rr.com Fri Jul 31 20:26:32 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Fri, 31 Jul 2009 20:26:32 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <4A738AAD.8090209@reuel.net> Message-ID: <20090801002753284.FJQE17500@hrndva-omta04.mail.rr.com> Thank you. sudo: sorry, you must have a tty to run sudo I don't know how to resolve this. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Leam Hall > Sent: Friday, July 31, 2009 8:22 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] SSH2_CONNECT > > Drat! That's my favorite reading. :) > > Couple more ideas, based on an OS perspective. If it's a PHPism, I'm not > so good... > > If the copy_sites program is a script and not a binary, edit it early on > to create a temporary file. For example, put in a like "echo guido > > /tmp/woo-hoo". See if it writes it. If so, then it's choking on the > script. If not, then it's not getting to the script. > > Also, have it echo $id to a temp file to make sure the variable > substitution is happening correctly. > > Hope that helps. > > Leam > > Michele Waldman wrote: > > I didn't see anything in /var/log/messages. > > > > Michele > > > >> -----Original Message----- > >> From: talk-bounces at lists.nyphp.org [mailto:talk- > bounces at lists.nyphp.org] > >> On Behalf Of Leam Hall > >> Sent: Friday, July 31, 2009 7:58 PM > >> To: NYPHP Talk > >> Subject: Re: [nycphp-talk] SSH2_CONNECT > >> > >> Hey Michele. > >> > >> Can you edit /etc/sudoers? You might be able to give it the NOPASSWD > >> option, to at least shorten it a bit. > >> > >> Can you read /var/log/messages and the web server log to see if they > say > >> anything? > >> > >> Leam > >> > >> Michele Waldman wrote: > >>> So I rewrote the code in bash due to my client's concern about > >> bandwidth. > >>> Here's my new problem: > >>> $msg = exec("echo $password | sudo /home/user/site_util/copy_sites $id > >> 2> > >>> /dev/null"); > >>> > >>> The script isn't running. > >>> > >>> Since it's running from http, I modified the user nobody to have > >> /bin/bash > >>> in /etc/passwd and gave the user a password. > >>> > >>> I can login to the server as nobody and run this code on the command > >> line. > >>> Works fine. > >>> > >>> Does anyone know why this execute isn't working in php? > >>> > >>> Michele > >>> > >>>> -----Original Message----- > >>>> From: talk-bounces at lists.nyphp.org [mailto:talk- > >> bounces at lists.nyphp.org] > >>>> On Behalf Of Kenneth Dombrowski > >>>> Sent: Friday, July 31, 2009 7:33 AM > >>>> To: NYPHP Talk > >>>> Subject: Re: [nycphp-talk] SSH2_CONNECT > >>>> > >>>> On 09-07-30 17:05 -0400, Ajai Khattri wrote: > >>>>> Most probably your PHP script will be running under the same > username > >> as > >>>>> Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you > >>>>> wouldn't want to give www or nobody sudo privilege anyway!). > >>>> All this talk about sudo not working made me curious -- why shouldn't > >> it > >>>> work? It will, and a well configured sudo offers a very fine level > of > >>>> control -- though whether one wants to do it is another question > >>>> > >>>> # visudo > >>>> Defaults:www-data !lecture > >>>> Defaults:www-data !authenticate > >>>> www-data ALL = (kenneth) /usr/bin/touch /tmp/sudoer.apache > >>>> > >>>> The first two lines get rid of sudo's usual prompts, since it will > >> never > >>>> run interactively, & the last specifies a single command + argument > >>>> www-data is allowed to run as kenneth (you can use shell-style globs) > >>>> > >>>> # sudo.php > >>>> >>>> header('Content-type: text/plain'); > >>>> $f = '/tmp/sudoer.apache'; > >>>> system("sudo -u kenneth /usr/bin/touch $f"); > >>>> print "\n$f exists? " . (bool) file_exists($f); > >>>> > >>>> kenneth at gilgamesh:~$ elinks --dump http://localhost/tmp/sudo.php > >>>> /tmp/sudoer.apache exists? 1 > >>>> kenneth at gilgamesh:~$ ls -l /tmp/sudoer.apache > >>>> -rw-r--r-- 1 kenneth kenneth 0 2009-07-30 19:52 /tmp/sudoer.apache > >>>> > >>>> So on debian, www-data successfully created a file as kenneth. On > >> FreeBSD > >>>> I think www/nobody/whatever has a /bin/false shell, so there it won't > >>>> work. Of course, you shouldn't do it on shared hosts, and I'm sure > >>>> somebody will tell me you shouldn't do it at all, but its not due to > a > >>>> technical limitation > >>>> > >>>> > >>>> _______________________________________________ > >>>> New York PHP User Group Community Talk Mailing List > >>>> http://lists.nyphp.org/mailman/listinfo/talk > >>>> > >>>> http://www.nyphp.org/show_participation.php > >>> _______________________________________________ > >>> New York PHP User Group Community Talk Mailing List > >>> http://lists.nyphp.org/mailman/listinfo/talk > >>> > >>> http://www.nyphp.org/show_participation.php > >>> > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From leam at reuel.net Fri Jul 31 20:35:00 2009 From: leam at reuel.net (Leam Hall) Date: Fri, 31 Jul 2009 20:35:00 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090801002753284.FJQE17500@hrndva-omta04.mail.rr.com> References: <20090801002753284.FJQE17500@hrndva-omta04.mail.rr.com> Message-ID: <4A738DB4.2010801@reuel.net> http://forums.fedoraforum.org/showthread.php?t=159677 [root at leam ~]# grep -i tty /etc/sudoers Defaults requiretty That might help. :) Leam Michele Waldman wrote: > Thank you. > > sudo: sorry, you must have a tty to run sudo > > I don't know how to resolve this. > > Michele > >> -----Original Message----- >> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >> On Behalf Of Leam Hall >> Sent: Friday, July 31, 2009 8:22 PM >> To: NYPHP Talk >> Subject: Re: [nycphp-talk] SSH2_CONNECT >> >> Drat! That's my favorite reading. :) >> >> Couple more ideas, based on an OS perspective. If it's a PHPism, I'm not >> so good... >> >> If the copy_sites program is a script and not a binary, edit it early on >> to create a temporary file. For example, put in a like "echo guido > >> /tmp/woo-hoo". See if it writes it. If so, then it's choking on the >> script. If not, then it's not getting to the script. >> >> Also, have it echo $id to a temp file to make sure the variable >> substitution is happening correctly. >> >> Hope that helps. >> >> Leam >> >> Michele Waldman wrote: >>> I didn't see anything in /var/log/messages. >>> >>> Michele >>> >>>> -----Original Message----- >>>> From: talk-bounces at lists.nyphp.org [mailto:talk- >> bounces at lists.nyphp.org] >>>> On Behalf Of Leam Hall >>>> Sent: Friday, July 31, 2009 7:58 PM >>>> To: NYPHP Talk >>>> Subject: Re: [nycphp-talk] SSH2_CONNECT >>>> >>>> Hey Michele. >>>> >>>> Can you edit /etc/sudoers? You might be able to give it the NOPASSWD >>>> option, to at least shorten it a bit. >>>> >>>> Can you read /var/log/messages and the web server log to see if they >> say >>>> anything? >>>> >>>> Leam >>>> >>>> Michele Waldman wrote: >>>>> So I rewrote the code in bash due to my client's concern about >>>> bandwidth. >>>>> Here's my new problem: >>>>> $msg = exec("echo $password | sudo /home/user/site_util/copy_sites $id >>>> 2> >>>>> /dev/null"); >>>>> >>>>> The script isn't running. >>>>> >>>>> Since it's running from http, I modified the user nobody to have >>>> /bin/bash >>>>> in /etc/passwd and gave the user a password. >>>>> >>>>> I can login to the server as nobody and run this code on the command >>>> line. >>>>> Works fine. >>>>> >>>>> Does anyone know why this execute isn't working in php? >>>>> >>>>> Michele >>>>> >>>>>> -----Original Message----- >>>>>> From: talk-bounces at lists.nyphp.org [mailto:talk- >>>> bounces at lists.nyphp.org] >>>>>> On Behalf Of Kenneth Dombrowski >>>>>> Sent: Friday, July 31, 2009 7:33 AM >>>>>> To: NYPHP Talk >>>>>> Subject: Re: [nycphp-talk] SSH2_CONNECT >>>>>> >>>>>> On 09-07-30 17:05 -0400, Ajai Khattri wrote: >>>>>>> Most probably your PHP script will be running under the same >> username >>>> as >>>>>>> Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you >>>>>>> wouldn't want to give www or nobody sudo privilege anyway!). >>>>>> All this talk about sudo not working made me curious -- why shouldn't >>>> it >>>>>> work? It will, and a well configured sudo offers a very fine level >> of >>>>>> control -- though whether one wants to do it is another question >>>>>> >>>>>> # visudo >>>>>> Defaults:www-data !lecture >>>>>> Defaults:www-data !authenticate >>>>>> www-data ALL = (kenneth) /usr/bin/touch /tmp/sudoer.apache >>>>>> >>>>>> The first two lines get rid of sudo's usual prompts, since it will >>>> never >>>>>> run interactively, & the last specifies a single command + argument >>>>>> www-data is allowed to run as kenneth (you can use shell-style globs) >>>>>> >>>>>> # sudo.php >>>>>> >>>>> header('Content-type: text/plain'); >>>>>> $f = '/tmp/sudoer.apache'; >>>>>> system("sudo -u kenneth /usr/bin/touch $f"); >>>>>> print "\n$f exists? " . (bool) file_exists($f); >>>>>> >>>>>> kenneth at gilgamesh:~$ elinks --dump http://localhost/tmp/sudo.php >>>>>> /tmp/sudoer.apache exists? 1 >>>>>> kenneth at gilgamesh:~$ ls -l /tmp/sudoer.apache >>>>>> -rw-r--r-- 1 kenneth kenneth 0 2009-07-30 19:52 /tmp/sudoer.apache >>>>>> >>>>>> So on debian, www-data successfully created a file as kenneth. On >>>> FreeBSD >>>>>> I think www/nobody/whatever has a /bin/false shell, so there it won't >>>>>> work. Of course, you shouldn't do it on shared hosts, and I'm sure >>>>>> somebody will tell me you shouldn't do it at all, but its not due to >> a >>>>>> technical limitation >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> New York PHP User Group Community Talk Mailing List >>>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>>> >>>>>> http://www.nyphp.org/show_participation.php >>>>> _______________________________________________ >>>>> New York PHP User Group Community Talk Mailing List >>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>> >>>>> http://www.nyphp.org/show_participation.php >>>>> >>>> _______________________________________________ >>>> New York PHP User Group Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> http://www.nyphp.org/show_participation.php >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >>> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From consult at covenantedesign.com Fri Jul 31 20:39:12 2009 From: consult at covenantedesign.com (CED) Date: Fri, 31 Jul 2009 20:39:12 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090731113256.GB31515@ylayali.net> References: <20090730194550985.FZQQ28534@hrndva-omta02.mail.rr.com> <20090731113256.GB31515@ylayali.net> Message-ID: <4A738EB0.6020201@covenantedesign.com> I'll take the bait... No, you most certainly shouldn't do this at all. Adjusting the defaults to sudoers is a big no no. Whatever it is you are doing, the need to become root is far different than Ken's example of becoming Ken. The reason that you can't make this work properly has everything to do with 'REAL' tty sessions, which you aren't going to have. Root cannot be allowed to be running around without a properly bound TTY; for various Auditing reasons. However, in the spirit of this list: Defaults:root !requiretty Defaults:nobody !requiretty Play VERY carefully. -Ed Kenneth Dombrowski wrote: > On 09-07-30 17:05 -0400, Ajai Khattri wrote: > >> Most probably your PHP script will be running under the same username as >> Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you >> wouldn't want to give www or nobody sudo privilege anyway!). >> > > All this talk about sudo not working made me curious -- why shouldn't it > work? It will, and a well configured sudo offers a very fine level of > control -- though whether one wants to do it is another question > > # visudo > Defaults:www-data !lecture > Defaults:www-data !authenticate > www-data ALL = (kenneth) /usr/bin/touch /tmp/sudoer.apache > > The first two lines get rid of sudo's usual prompts, since it will never > run interactively, & the last specifies a single command + argument > www-data is allowed to run as kenneth (you can use shell-style globs) > > # sudo.php > header('Content-type: text/plain'); > $f = '/tmp/sudoer.apache'; > system("sudo -u kenneth /usr/bin/touch $f"); > print "\n$f exists? " . (bool) file_exists($f); > > kenneth at gilgamesh:~$ elinks --dump http://localhost/tmp/sudo.php > /tmp/sudoer.apache exists? 1 > kenneth at gilgamesh:~$ ls -l /tmp/sudoer.apache > -rw-r--r-- 1 kenneth kenneth 0 2009-07-30 19:52 /tmp/sudoer.apache > > So on debian, www-data successfully created a file as kenneth. On FreeBSD > I think www/nobody/whatever has a /bin/false shell, so there it won't > work. Of course, you shouldn't do it on shared hosts, and I'm sure > somebody will tell me you shouldn't do it at all, but its not due to a > technical limitation > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > > -- 995 Maple Hill Road Castleton, New York 12033 518-331-5061 Consult at CovenanteDesign.com From consult at covenantedesign.com Fri Jul 31 20:42:16 2009 From: consult at covenantedesign.com (CED) Date: Fri, 31 Jul 2009 20:42:16 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <4A738DB4.2010801@reuel.net> References: <20090801002753284.FJQE17500@hrndva-omta04.mail.rr.com> <4A738DB4.2010801@reuel.net> Message-ID: <4A738F68.8020705@covenantedesign.com> Leam Hall wrote: > > > http://forums.fedoraforum.org/showthread.php?t=159677 > > [root at leam ~]# grep -i tty /etc/sudoers > Defaults requiretty > > That might help. :) > > Leam > > Michele Waldman wrote: >> Thank you. >> >> sudo: sorry, you must have a tty to run sudo >> >> I don't know how to resolve this. >> >> Michele >> >>> -----Original Message----- >>> From: talk-bounces at lists.nyphp.org >>> [mailto:talk-bounces at lists.nyphp.org] >>> On Behalf Of Leam Hall >>> Sent: Friday, July 31, 2009 8:22 PM >>> To: NYPHP Talk >>> Subject: Re: [nycphp-talk] SSH2_CONNECT >>> >>> Drat! That's my favorite reading. :) >>> >>> Couple more ideas, based on an OS perspective. If it's a PHPism, I'm >>> not >>> so good... >>> >>> If the copy_sites program is a script and not a binary, edit it >>> early on >>> to create a temporary file. For example, put in a like "echo guido > >>> /tmp/woo-hoo". See if it writes it. If so, then it's choking on the >>> script. If not, then it's not getting to the script. >>> >>> Also, have it echo $id to a temp file to make sure the variable >>> substitution is happening correctly. >>> >>> Hope that helps. >>> >>> Leam >>> >>> Michele Waldman wrote: >>>> I didn't see anything in /var/log/messages. >>>> >>>> Michele >>>> >>>>> -----Original Message----- >>>>> From: talk-bounces at lists.nyphp.org [mailto:talk- >>> bounces at lists.nyphp.org] >>>>> On Behalf Of Leam Hall >>>>> Sent: Friday, July 31, 2009 7:58 PM >>>>> To: NYPHP Talk >>>>> Subject: Re: [nycphp-talk] SSH2_CONNECT >>>>> >>>>> Hey Michele. >>>>> >>>>> Can you edit /etc/sudoers? You might be able to give it the NOPASSWD >>>>> option, to at least shorten it a bit. >>>>> >>>>> Can you read /var/log/messages and the web server log to see if they >>> say >>>>> anything? >>>>> >>>>> Leam >>>>> >>>>> Michele Waldman wrote: >>>>>> So I rewrote the code in bash due to my client's concern about >>>>> bandwidth. >>>>>> Here's my new problem: >>>>>> $msg = exec("echo $password | sudo >>>>>> /home/user/site_util/copy_sites $id >>>>> 2> >>>>>> /dev/null"); >>>>>> >>>>>> The script isn't running. >>>>>> >>>>>> Since it's running from http, I modified the user nobody to have >>>>> /bin/bash >>>>>> in /etc/passwd and gave the user a password. >>>>>> >>>>>> I can login to the server as nobody and run this code on the command >>>>> line. >>>>>> Works fine. >>>>>> >>>>>> Does anyone know why this execute isn't working in php? >>>>>> >>>>>> Michele >>>>>> >>>>>>> -----Original Message----- >>>>>>> From: talk-bounces at lists.nyphp.org [mailto:talk- >>>>> bounces at lists.nyphp.org] >>>>>>> On Behalf Of Kenneth Dombrowski >>>>>>> Sent: Friday, July 31, 2009 7:33 AM >>>>>>> To: NYPHP Talk >>>>>>> Subject: Re: [nycphp-talk] SSH2_CONNECT >>>>>>> >>>>>>> On 09-07-30 17:05 -0400, Ajai Khattri wrote: >>>>>>>> Most probably your PHP script will be running under the same >>> username >>>>> as >>>>>>>> Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you >>>>>>>> wouldn't want to give www or nobody sudo privilege anyway!). >>>>>>> All this talk about sudo not working made me curious -- why >>>>>>> shouldn't >>>>> it >>>>>>> work? It will, and a well configured sudo offers a very fine level >>> of >>>>>>> control -- though whether one wants to do it is another question >>>>>>> >>>>>>> # visudo >>>>>>> Defaults:www-data !lecture >>>>>>> Defaults:www-data !authenticate >>>>>>> www-data ALL = (kenneth) /usr/bin/touch /tmp/sudoer.apache >>>>>>> >>>>>>> The first two lines get rid of sudo's usual prompts, since it will >>>>> never >>>>>>> run interactively, & the last specifies a single command + argument >>>>>>> www-data is allowed to run as kenneth (you can use shell-style >>>>>>> globs) >>>>>>> >>>>>>> # sudo.php >>>>>>> >>>>>> header('Content-type: text/plain'); >>>>>>> $f = '/tmp/sudoer.apache'; >>>>>>> system("sudo -u kenneth /usr/bin/touch $f"); >>>>>>> print "\n$f exists? " . (bool) file_exists($f); >>>>>>> >>>>>>> kenneth at gilgamesh:~$ elinks --dump http://localhost/tmp/sudo.php >>>>>>> /tmp/sudoer.apache exists? 1 >>>>>>> kenneth at gilgamesh:~$ ls -l /tmp/sudoer.apache >>>>>>> -rw-r--r-- 1 kenneth kenneth 0 2009-07-30 19:52 /tmp/sudoer.apache >>>>>>> >>>>>>> So on debian, www-data successfully created a file as kenneth. On >>>>> FreeBSD >>>>>>> I think www/nobody/whatever has a /bin/false shell, so there it >>>>>>> won't >>>>>>> work. Of course, you shouldn't do it on shared hosts, and I'm sure >>>>>>> somebody will tell me you shouldn't do it at all, but its not >>>>>>> due to >>> a >>>>>>> technical limitation >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> New York PHP User Group Community Talk Mailing List >>>>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>>>> >>>>>>> http://www.nyphp.org/show_participation.php >>>>>> _______________________________________________ >>>>>> New York PHP User Group Community Talk Mailing List >>>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>>> >>>>>> http://www.nyphp.org/show_participation.php >>>>>> >>>>> _______________________________________________ >>>>> New York PHP User Group Community Talk Mailing List >>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>> >>>>> http://www.nyphp.org/show_participation.php >>>> _______________________________________________ >>>> New York PHP User Group Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> http://www.nyphp.org/show_participation.php >>>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > Please DO NOT use Leam's example... "Defaults requiretty" is a global sudoers security default, change the default at the user level... or, again; Don't do it at all. -- 995 Maple Hill Road Castleton, New York 12033 518-331-5061 Consult at CovenanteDesign.com From leam at reuel.net Fri Jul 31 20:44:34 2009 From: leam at reuel.net (Leam Hall) Date: Fri, 31 Jul 2009 20:44:34 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <4A738F68.8020705@covenantedesign.com> References: <20090801002753284.FJQE17500@hrndva-omta04.mail.rr.com> <4A738DB4.2010801@reuel.net> <4A738F68.8020705@covenantedesign.com> Message-ID: <4A738FF2.3050400@reuel.net> CED wrote: > Leam Hall wrote: >> >> >> http://forums.fedoraforum.org/showthread.php?t=159677 >> >> [root at leam ~]# grep -i tty /etc/sudoers >> Defaults requiretty >> >> That might help. :) >> >> Leam >> > Please DO NOT use Leam's example... > > "Defaults requiretty" is a global sudoers security default, change the > default at the user level... or, again; Don't do it at all. > Depends on the nature of the server. Changing sudoers is less problematic unless you have a lot of sudo'ing going on. What do you see as the issue? Leam From mmwaldman at nyc.rr.com Fri Jul 31 20:49:37 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Fri, 31 Jul 2009 20:49:37 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <4A738EB0.6020201@covenantedesign.com> Message-ID: <20090801005058065.GTTX8759@hrndva-omta01.mail.rr.com> Thank you. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of CED > Sent: Friday, July 31, 2009 8:39 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] SSH2_CONNECT > > > I'll take the bait... > > No, you most certainly shouldn't do this at all. Adjusting the defaults > to sudoers is a big no no. > > Whatever it is you are doing, the need to become root is far different > than Ken's example of becoming Ken. > > The reason that you can't make this work properly has everything to do > with 'REAL' tty sessions, which you aren't going to have. > > Root cannot be allowed to be running around without a properly bound > TTY; for various Auditing reasons. > > However, in the spirit of this list: > > Defaults:root !requiretty > Defaults:nobody !requiretty > > Play VERY carefully. > > -Ed > > > Kenneth Dombrowski wrote: > > On 09-07-30 17:05 -0400, Ajai Khattri wrote: > > > >> Most probably your PHP script will be running under the same username > as > >> Apache (i.e. www or nobody) so sudo wouldn't work anyway. (And you > >> wouldn't want to give www or nobody sudo privilege anyway!). > >> > > > > All this talk about sudo not working made me curious -- why shouldn't it > > work? It will, and a well configured sudo offers a very fine level of > > control -- though whether one wants to do it is another question > > > > # visudo > > Defaults:www-data !lecture > > Defaults:www-data !authenticate > > www-data ALL = (kenneth) /usr/bin/touch /tmp/sudoer.apache > > > > The first two lines get rid of sudo's usual prompts, since it will never > > run interactively, & the last specifies a single command + argument > > www-data is allowed to run as kenneth (you can use shell-style globs) > > > > # sudo.php > > > header('Content-type: text/plain'); > > $f = '/tmp/sudoer.apache'; > > system("sudo -u kenneth /usr/bin/touch $f"); > > print "\n$f exists? " . (bool) file_exists($f); > > > > kenneth at gilgamesh:~$ elinks --dump http://localhost/tmp/sudo.php > > /tmp/sudoer.apache exists? 1 > > kenneth at gilgamesh:~$ ls -l /tmp/sudoer.apache > > -rw-r--r-- 1 kenneth kenneth 0 2009-07-30 19:52 /tmp/sudoer.apache > > > > So on debian, www-data successfully created a file as kenneth. On > FreeBSD > > I think www/nobody/whatever has a /bin/false shell, so there it won't > > work. Of course, you shouldn't do it on shared hosts, and I'm sure > > somebody will tell me you shouldn't do it at all, but its not due to a > > technical limitation > > > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > > > > > > > > > -- > > 995 Maple Hill Road > Castleton, New York 12033 > 518-331-5061 > Consult at CovenanteDesign.com > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From consult at covenantedesign.com Fri Jul 31 20:58:29 2009 From: consult at covenantedesign.com (CED) Date: Fri, 31 Jul 2009 20:58:29 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <4A738FF2.3050400@reuel.net> References: <20090801002753284.FJQE17500@hrndva-omta04.mail.rr.com> <4A738DB4.2010801@reuel.net> <4A738F68.8020705@covenantedesign.com> <4A738FF2.3050400@reuel.net> Message-ID: <4A739335.2060604@covenantedesign.com> Leam Hall wrote: > CED wrote: >> Leam Hall wrote: >>> >>> >>> http://forums.fedoraforum.org/showthread.php?t=159677 >>> >>> [root at leam ~]# grep -i tty /etc/sudoers >>> Defaults requiretty >>> >>> That might help. :) >>> >>> Leam >>> > >> Please DO NOT use Leam's example... >> >> "Defaults requiretty" is a global sudoers security default, change >> the default at the user level... or, again; Don't do it at all. >> > > Depends on the nature of the server. Changing sudoers is less > problematic unless you have a lot of sudo'ing going on. > > What do you see as the issue? > > Leam > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > I thought it was somewhat clear from my previous post... The entire point of sudoers is to manage and audit those running commands in escalation. Whether the list is large or small, the entire point it to satisfy secuirty needs for auditing and accountability, globally adjusting the defaults to the sudoers file begins to slight against it's very reason for sudoers existing. Particularly the session level limits (requiring a REAL tty), in the simplist way it prevents scary things like "rlogin -l iamleam Leamspc 'cd /; rm -rf'" from firing. I would suggest reading the sudoers man page and the 2.6 kernel notes. -Ed -- 995 Maple Hill Road Castleton, New York 12033 518-331-5061 Consult at CovenanteDesign.com From ajai at bitblit.net Fri Jul 31 23:56:52 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 31 Jul 2009 23:56:52 -0400 (EDT) Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <4A738EB0.6020201@covenantedesign.com> Message-ID: On Fri, 31 Jul 2009, CED wrote: > Play VERY carefully. Or just use FTP/SCP and dont mess with any security settings. -- Aj.