Re: [PHP] Question about using JSON_ENCODE()

2010-01-08 Thread Anthony Papillion
Thank you Ruan! This is just what I was looking for! Anthony "Ryan Sun" wrote in message news:f7f19ac21001081308r4b202d45vedaf3561536ad...@mail.gmail.com... Yup, you put result in an array $result = array('status' => 'good'); and return encoded string return Json_Encode($result); your clie

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread Per Jessen
tedd wrote: > At 12:24 PM -0800 1/8/10, Daevid Vincent wrote: >>What do you guys all do? > > I always close my code. > > I have never had a problem in doing so. > > I shall continue to close my code until it trips me up. At such time, > I'll figure out what the problem is and fix it. Then I'll

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread Robert Cummings
Mattias Thorslund wrote: Hadn't paid much attention to the issue until reading a previous discussion on the topic, here on this list. After that, I decided to be consistent and leave the closing ?> out in all include files. To my eyes, ?> means "look there is more content coming", which seems

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread German Geek
I would leave this to personal preference, whether there is a closing ?> or not wouldn't bother me. I could argue both ways: Pro: You should put a final ?> for neatness and XML compatibility. Con: It makes the script fractionally slower because 2 more characters have to be processed and there migh

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread Mattias Thorslund
Hadn't paid much attention to the issue until reading a previous discussion on the topic, here on this list. After that, I decided to be consistent and leave the closing ?> out in all include files. To my eyes, ?> means "look there is more content coming", which seems kind of silly when there

[PHP] Clean PHP 5.2.12 Build Core Dumping

2010-01-08 Thread Don O'Neil
Ok... more info on the problem... I started with a clean untarred archive, ad just ran ./configure, make, make test I get a core dump. After running gdb on the core dump I noticed it was the sqlite stuff that was dumping, so I re-ran configure with --without-sqlite --without-pdo-sqlite --with

[PHP] Clean PHP 5.2.12 Build Core Dumping

2010-01-08 Thread Don O'Neil
I'm trying to build a clean version of php 5.2.12 on my FreeBSD 6.1 box and even with NO OPTIONS, php core dumps during the make test phase. How do I go about tracking down what is causing this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread tedd
At 12:24 PM -0800 1/8/10, Daevid Vincent wrote: What do you guys all do? I always close my code. I have never had a problem in doing so. I shall continue to close my code until it trips me up. At such time, I'll figure out what the problem is and fix it. Then I'll probably still close my co

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread Stuart Dallas
On 8 Jan 2010, at 21:38, Ashley Sheridan wrote: > On Fri, 2010-01-08 at 21:30 +, Stuart Dallas wrote: >> On 8 Jan 2010, at 20:49, LinuxManMikeC wrote: >> >> > >> http://framework.zend.com/manual/en/coding-standard.html#coding-standard.overview.scope >> >> > "This document provides guidelines

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread Ashley Sheridan
On Fri, 2010-01-08 at 21:30 +, Stuart Dallas wrote: > On 8 Jan 2010, at 20:49, LinuxManMikeC wrote: > > > http://framework.zend.com/manual/en/coding-standard.html#coding-standard.overview.scope > > "This document provides guidelines for code formatting and > > documentation to individuals and

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread Stuart Dallas
On 8 Jan 2010, at 20:49, LinuxManMikeC wrote: > http://framework.zend.com/manual/en/coding-standard.html#coding-standard.overview.scope > "This document provides guidelines for code formatting and > documentation to individuals and teams contributing to Zend > Framework." > > So as far as anythin

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread Ryan Sun
if you use the newest PDT, you will find that a new php file has no final ?> I vote for your co-worker [?] On Fri, Jan 8, 2010 at 3:49 PM, LinuxManMikeC wrote: > > http://framework.zend.com/manual/en/coding-standard.html#coding-standard.overview.scope > "This document provides guidelines for code

Re: [PHP] Question about using JSON_ENCODE()

2010-01-08 Thread Ryan Sun
Yup, you put result in an array $result = array('status' => 'good'); and return encoded string return Json_Encode($result); your client will get a string '{"status": "good"}' and you use your client tech(eg. javascrpt) to decode this string and finall get an object On Fri, Jan 8, 2010 at 3:43 PM

[PHP] Question about using JSON_ENCODE()

2010-01-08 Thread Anthony Papillion
I'm developing a basic webservice to compliment a mobile application I'm developing or iPhone. While I know how to encode simple variables and arrays, I'm not sure how to do what I'm needing to do. Basically, I want to encode a status message to return to the mobile client. Something like "sta

Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread Phpster
On Jan 8, 2010, at 10:44 AM, Andrew Ballard wrote: On Thu, Jan 7, 2010 at 10:48 PM, Robert Cummings wrote: ... They almost always make your shit run faster. You know they make medicine for that? ;-) Andrew -- Tacos? Bastien Sent from my iPod -- PHP General Mailing List (http:

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread LinuxManMikeC
http://framework.zend.com/manual/en/coding-standard.html#coding-standard.overview.scope "This document provides guidelines for code formatting and documentation to individuals and teams contributing to Zend Framework." So as far as anything other than code being contributed to Zend Framework, its

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread Ashley Sheridan
On Fri, 2010-01-08 at 12:24 -0800, Daevid Vincent wrote: > I'm having a debate with a co-worker about adding the final ?> on a PHP > page... > > To be honest, I am the lead, and I could pull rank and be done with the > discussion, however I don't like to be that way. I would rather do the > right

[PHP] POLL: To add the final ?> or not...

2010-01-08 Thread Daevid Vincent
I'm having a debate with a co-worker about adding the final ?> on a PHP page... To be honest, I am the lead, and I could pull rank and be done with the discussion, however I don't like to be that way. I would rather do the right thing. If my way of thinking is old-school (I've been coding since PH

Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread J Ravi Menon
Sorry forgot to mention that we used APC with apc.stat turned off which will give a little bit more performance gain, but it does mean flushing the cache on every code push (which is trivial). Ravi On Fri, Jan 8, 2010 at 11:30 AM, J Ravi Menon wrote: > Hi, > > A note on bytecode caching and inc

Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread J Ravi Menon
Hi, A note on bytecode caching and include/include_once performance. A while ago when we were profiling our code, we did notice that file includes do take a noticeable percentage of overall overhead (enough for us to look into it more deep). We are using apc cache on a standard LAMP platform (linu

Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread Robert Cummings
clanc...@cybec.com.au wrote: On Thu, 07 Jan 2010 22:48:59 -0500, rob...@interjinn.com (Robert Cummings) wrote: clanc...@cybec.com.au wrote: Thank you all for your comments. I did not know about bytecode caches. They're an interesting concept, but if I am interpreting the paper http://itst.ne

Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread Robert Cummings
Graham Cossey wrote: On Fri, Jan 8, 2010 at 3:48 AM, Robert Cummings wrote: They almost always make your shit run faster. I love your final statement Robert! A reply of good grammar and vocabulary summarised most succinctly. :) -- http://www.interjinn.com Application and Templating Frame

Re: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Jochem Maas
Op 1/8/10 1:41 PM, Rene Veerman schreef: > I'm working on a better var_dump (http://mediabeez.ws/htmlMicroscope/, > LGPL), and want to launch my kate editor when i click in the browser on a > line in my trace-log. > > I'm trying to exec() this line, but it returns 1 (which is i believe a > general

Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread Andrew Ballard
On Thu, Jan 7, 2010 at 10:48 PM, Robert Cummings wrote: > ... > They almost always make your shit run faster. You know they make medicine for that? ;-) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Rene Veerman
hmm. after a nap i'm gonna try to start the editor directly from the browser instead, with ssh:// hopefully to get/write the file on the server.

Fwd: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Rene Veerman
-- Forwarded message -- From: Rene Veerman Date: Fri, Jan 8, 2010 at 2:29 PM Subject: Re: [PHP] trying to launch kate from the browser To: Bob McConnell A: str_replace() ;) maybe a preg_replace() but i dont think thats even necessary. B: the sudo (see my last mails) is succ

Re: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Rene Veerman
$str = ''echo "blah" | sudo -u rene -S /bin/sh -c "export HOME=/home/rene/ && export"''; exec($str,$o,$r); $r === 0. $o = array 0 => 'export HOME='/home/rene/'' .more.

RE: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Bob McConnell
From: Rene Veerman > From: Rene Veerman > > Yep, i also just thought of using ssh/ftp to remotely edit files. > I can probably configure any web-browser to open certain links with any > local program. > > But for now, i'd just like to consider the case where the browser is on the > same machine

Re: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Rene Veerman
oh, echo "blah" | sudo -u rene -S /bin/sh -c "export HOME=/home/rene/" exec($str,$o,$r); $r === 0. so that works. therefore, it must be kate itself that refuses to start up from apache's context. too bad $o === empty array. any ideas are most welcome.

Fwd: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Rene Veerman
-- Forwarded message -- From: Rene Veerman Date: Fri, Jan 8, 2010 at 1:58 PM Subject: Re: [PHP] trying to launch kate from the browser To: a...@ashleysheridan.co.uk Yep, i also just thought of using ssh/ftp to remotely edit files. I can probably configure any web-browser to o

Re: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Stuart Dallas
On 8 Jan 2010, at 12:48, Rene Veerman wrote: > Thanks for the reply.. > > I only need this to work locally on the web-server for now.. > > So i'm calling a script through ajax routines, which would do the exec(). > Since it's on the local webserver, that should work, right? No. When the web ser

Re: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Ashley Sheridan
On Fri, 2010-01-08 at 13:48 +0100, Rene Veerman wrote: > Thanks for the reply.. > > I only need this to work locally on the web-server for now.. > > So i'm calling a script through ajax routines, which would do the > exec(). > Since it's on the local webserver, that should work, right? No, the

Re: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Rene Veerman
Thanks for the reply.. I only need this to work locally on the web-server for now.. So i'm calling a script through ajax routines, which would do the exec(). Since it's on the local webserver, that should work, right?

Re: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Ashley Sheridan
On Fri, 2010-01-08 at 13:41 +0100, Rene Veerman wrote: > I'm working on a better var_dump (http://mediabeez.ws/htmlMicroscope/, > LGPL), and want to launch my kate editor when i click in the browser on a > line in my trace-log. > > I'm trying to exec() this line, but it returns 1 (which is i beli

[PHP] Re: trying to launch kate from the browser....

2010-01-08 Thread Rene Veerman
r...@ekster:~$ uname -a Linux ekster 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 16:20:31 UTC 2009 i686 GNU/Linux r...@ekster:~$ apache2 -v Server version: Apache/2.2.12 (Ubuntu) Server built: Nov 12 2009 22:49:46 r...@ekster:~$ php -v PHP 5.2.10-2ubuntu6.3 with Suhosin-Patch 0.9.7 (cli) (built

[PHP] trying to launch kate from the browser....

2010-01-08 Thread Rene Veerman
I'm working on a better var_dump (http://mediabeez.ws/htmlMicroscope/, LGPL), and want to launch my kate editor when i click in the browser on a line in my trace-log. I'm trying to exec() this line, but it returns 1 (which is i believe a general error) echo "hhh" | sudo -u rene -S /bin/sh -c

Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread Graham Cossey
On Fri, Jan 8, 2010 at 3:48 AM, Robert Cummings wrote: > > They almost always make your shit run faster. I love your final statement Robert! A reply of good grammar and vocabulary summarised most succinctly. -- Graham -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] How to write specification

2010-01-08 Thread David Otton
2010/1/8 Dušan Novaković : > I've been programing for some time, but I never tried to write code > for two different application in same way. How when I work with more > programmers it's even worse. Everyone is forcing it's way of writing > functions inside classes or writing variables, etc. My id

[PHP] How to write specification

2010-01-08 Thread Dušan Novaković
Hi, I've been programing for some time, but I never tried to write code for two different application in same way. How when I work with more programmers it's even worse. Everyone is forcing it's way of writing functions inside classes or writing variables, etc. My idea is to code according to the