[Geany-Users] PHP_Beautifier

Colomban Wendling lists.ban at herbesfolles.org
Sun Nov 25 14:42:08 UTC 2012

Le 25/11/2012 11:32, Lex Trotman a écrit :
> On 25 November 2012 21:11, barz040 at yahoo.it <barz040 at yahoo.it> wrote:
>>> Try running it same as the Geany version from the command line, ex:
>>> $ echo "Some PHP Code Here" | php_beautifier -s4 -l "..."
>>> or
>>> $ cat "some-code-file.php" | php_beautifier -s4 -l "..."
>> done. Both the commands work fine in terminal.
>>> What platform are you on? Version of Geany, version of GTK and Glib,
>> >from help->debug messages?  Look for error messages in help->debug
>>> messages.
>> Xubuntu 12.10, Geany 1.22, GTK 2.24.13
>> Those are the error messages in Help>Debug:
>> [...]
>> Those same messages are also shown in terminal but all works however!
> Right, but Geany thinks that since it returned messages on stderr that
> something went wrong with the command, so it doesn't do the
> substitution.  You should have a message along the line "The executed
> custom command returned an error. Your selection was not changed." in
> the status bar.

What's the point about it BTW?  Normally a command exit status should be
the way to check, I don't see why we should make weird guess at a
command not being allowed to output something on stderr?

Anyway, for the OP:  you can simply disable those non-fatal warnings,
e.g. by passing the appropriate flag to PHP (not sure how PHP is called
by your `php_beautifier` command, but it should be easy, e.g. `php -d
... php_beautifier ...`):

	-d error_reporting='E_ALL & ~(E_STRICT|E_DEPRECATED|E_NOTICE)'

It will prevent PHP from whining about those strict standard stuff and
so Geany won't think something went wrong.


More information about the Users mailing list