php-general Digest 3 Feb 2011 20:10:55 -0000 Issue 7164
Topics (messages 311130 through 311134):
Re: Code formatter
311130 by: Hansen, Mike
311131 by: Ken Guest
Re: nl2br problem
311132 by: Al
311133 by: Donovan Brooke
Memcache problems
311134 by: Jostein Eriksen
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
> Behalf Of Ken Guest
> Sent: Monday, January 31, 2011 3:26 PM
> To: Hansen, Mike
> Cc: [email protected]
> Subject: Re: [PHP] Code formatter
>
>
>
> On Mon, Jan 31, 2011 at 8:27 PM, Hansen, Mike
> <[email protected]> wrote:
>
>
> I've got an application that I'm fixing up and I'd like
> to run it through a code formatter. Is there something like
> Perl Tidy for PHP? If so, what are you experiences with it.
> No prob running it on the command line. It'd be great if it
> followed the PEAR coding standards.
>
>
>
>
> Have you found http://pear.php.net/package/PHP_Beautifier
> yet? ;) <http://www.php.net/unsub.php>
>
>
> Ken
>
It mostly works ok. Unfortunately, there's a bug in it that removes blank
lines.
I found this one that seems to work: http://beta.phpformatter.com/
I'd rather have one I can run on the command line, but this will have to do.
Mike
--- End Message ---
--- Begin Message ---
replies inline...
On Wed, Feb 2, 2011 at 3:23 PM, Hansen, Mike <[email protected]> wrote:
>
>
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]] On
> > Behalf Of Ken Guest
> > Sent: Monday, January 31, 2011 3:26 PM
> > To: Hansen, Mike
> > Cc: [email protected]
> > Subject: Re: [PHP] Code formatter
> >
> >
> >
> > On Mon, Jan 31, 2011 at 8:27 PM, Hansen, Mike
> > <[email protected]> wrote:
> >
> >
> > I've got an application that I'm fixing up and I'd like
> > to run it through a code formatter. Is there something like
> > Perl Tidy for PHP? If so, what are you experiences with it.
> > No prob running it on the command line. It'd be great if it
> > followed the PEAR coding standards.
> >
> >
> >
> >
> > Have you found http://pear.php.net/package/PHP_Beautifier
> > yet? ;) <http://www.php.net/unsub.php>
> >
> >
> > Ken
> >
>
> It mostly works ok. Unfortunately, there's a bug in it that removes blank
> lines.
>
> I found this one that seems to work: http://beta.phpformatter.com/
>
> I'd rather have one I can run on the command line, but this will have to
> do.
>
Just spotted that bug is reported at
http://pear.php.net/package/PHP_Beautifier/bugs - it's a shame it's been
logged since 2007 or so with no sign of it getting fixed. :(
--
http://blogs.linux.ie/kenguest/
--- End Message ---
--- Begin Message ---
On 2/1/2011 2:42 PM, Donovan Brooke wrote:
Hello,
I have CMS form that allows HTML for the body of a site.
To keep the form somewhat WYSIWYG, I am using the
nl2br() function for displaying:
nl2br($t_body)
This works great for normal stuff.. but for pages with tables
etc.. it creates a lot of extra "<br />'s" :-).
I thought about doing an if statement.. if $t_body contains <table> then
don't use nl2br().. but I'm thinking there has got to be a better way... because
pages that use both WYSIWYG returns in the form AND tables would then not
display well.
Any thoughts?
Thanks,
Donovan
You have an example of a page you'd like to control that we can see?
On the surface, it appears you may be able to control the rendering with
advanced CSS2/3 selectors. Thus, the browsers will do the work for you.
Al..........
--- End Message ---
--- Begin Message ---
Al wrote:
[snip]
You have an example of a page you'd like to control that we can see?
On the surface, it appears you may be able to control the rendering with
advanced CSS2/3 selectors. Thus, the browsers will do the work for you.
Al..........
Hello, yes and no.. ;-) Right now browsers receive a google warning of
"malicious site".. which is one of the reasons they are asking me to
redo it. It doesn't actually have any maliciousness ;-) in it, but
I don't want to post the link for that reason. I'm a few days off from
going live though (and fixing that problem).. and could post the
link then if needed. However, I think the solution I came up with
is working fine for the most part.
For Ash, yea, I thought of doing some more sophisticated parsing of
the content as you suggest, but the KISS philosophy has merit as well,
especially when trying to finish a project within a deadline. ;-)
Thanks for comments.
Donovan
--
D Brooke
--- End Message ---
--- Begin Message ---
Hi,
I've been having some problems with memcache lately.
It seems to me that php is dropping connection to the memcache server
mid way through the scripts.
I've sat the failure_callback to log failures. And I'm getting a lot of
them. Several every minute.
I'm quite stuck now and realy dont know where to go from here.
I've tried to telnet into the server. And there is no problem with
either set nor get commands. I've started the memcached daemon with -vvv
to see if I can dig anything interesting from the logs, but I can find
no errors of any kind in them. There is also no errors that I can find
in the php_error log.
I would appreciate some help, if anyone have any ideas of what is going on.
thanks.
--- End Message ---