NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Help integrating PHP_Beautifier into PHPed


Joined: 07 Mar 2007
Posts: 26
Reply with quote
Hello

I am trying to integrate PHP_Beautifier into PHPed. I dont know what options to add.

Here is the settings i have down:





Here is what PHP_Beautifier site lists:

Command line options and parameters
NOTE: Use the short options. Console_Getopt doesn't works well with long options
Usage
Quote:
# php_beautifier -f input_path -o output_path -c compression_type -t number -s number -l filter_def -d path -r -? input_path... output_path input_path


File name(s) (allowed * and ? for batch processing) or - for STDIN.
# output_path

Path to a dir (with '/' at the end), to a single file (without the '/') or - for STDOUT
# compress_type

Set compression. Modes can be 'gz' (default) and 'bz2'
# filter_def "FilterName (param=value , param=value... FilterName...)"

The name of the filter should be written in StudlyCaps. The settings are inside the parenthesis, separated by commas; the value is preceded by '='. Other Filter could be added, separated by spaces.

The default input/output of the tool are STDIN/STDOUT. So, don't be surprise if nothing happens when you call the tool without any options!
Options
    Command-line optionsshort option long option description
    -f --input input path
    -o --output output path
    -c --compress Compress the output ('tz','bz2')
    -t --indent_tabs Indent with tabs
    -s --indent_spaces Indent with spaces
    -l --filters Add one or more filters
    -d --directory_filters Add a filters directory.
    -r --recursive Turn on recursive mode
    -? --help Display help / usage



Can anyone help in the integration process.
View user's profileFind all posts by Ibn SaeedSend private message
Veteran

Joined: 30 Aug 2006
Posts: 116
Reply with quote
I haven't tried this (I use the free PolyStyle included with PHPEd Pro and just live with its nagware statuses), but isn't PHP_Beatifier an exe? if so you won't need the @PHP5@.
View user's profileFind all posts by rudderSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
AFAIK, PHP_Beautifier is a PHP/PEAR project http://pear.php.net/package/PHP_Beautifier

Regarding PolyStyle, it is not free. It is trial version that will expire in 30 days or about. If it failed to expire for you, it does not change anything from the legal points of view. You can't use it after 30 days.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 Mar 2007
Posts: 26
Reply with quote
BUt atleast can anyone help me to integrate PHP_Beautifier.

dmitri, can you help ?
View user's profileFind all posts by Ibn SaeedSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
I haven't used it yet but I just took a look at the docs and i think the following should work:

The basic syntax for the command is pretty much just:
@php5@ "<path\php beautifier file>" -f @FName@ -o @FName

if you installed in c:\beautifier the commandline pretty much becomes
@php5@ "c:\beautifier\php_beautifier.php" -f @FName@ -o @FName

If you have spaces in your project path you might want to quote the filenames too:
@php5@ "c:\beautifier\php_beautifier.php" -f "@FName@" -o "@FName"

Note that this just runs with the default settings.
If you want to use different settings for tabs or spaces etc you might want to look at the other possible arguments in the documentation
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 07 Mar 2007
Posts: 26
Reply with quote
Blizz wrote:
I haven't used it yet but I just took a look at the docs and i think the following should work:

The basic syntax for the command is pretty much just:
@php5@ "<path\php beautifier file>" -f @FName@ -o @FName

if you installed in c:\beautifier the commandline pretty much becomes
@php5@ "c:\beautifier\php_beautifier.php" -f @FName@ -o @FName

If you have spaces in your project path you might want to quote the filenames too:
@php5@ "c:\beautifier\php_beautifier.php" -f "@FName@" -o "@FName"

Note that this just runs with the default settings.
If you want to use different settings for tabs or spaces etc you might want to look at the other possible arguments in the documentation


Thanks a lot Blizz, Ill try it out and see if it works.

Ill post back an update.
View user's profileFind all posts by Ibn SaeedSend private message


Joined: 07 Mar 2007
Posts: 26
Reply with quote
Hello Blizz

I tried

Quote:
@php5@ "D:\PHP_Beautifier\phped.php" -f @FName@ -o @FName



When i selected an formatted text such as
Code:
function set_number_format($num_decimals, $is_fixed_num_decimals_forced, $is_decimal_separator_comma, $is_thousand_separator_disabled ){$this->num_decimals = $num_decimals;
$this->is_fixed_num_decimals_forced = $is_fixed_num_decimals_forced;$this->is_decimal_separator_comma = $is_decimal_separator_comma;$this->is_thousand_separator_disabled = $is_thousand_separator_disabled;}


It did not perform any changes.

Here is what shows in the Logs:

Code:
Script   D:\Program Files\NuSphere\PhpED\php5\php-cgi.exe "D:\PHP_Beautifier\phped.php" -f D:\xampp\htdocs\chart\ofc_chart_library\open-flash-chart.php -o @FName   5:29:27 PM



Its not working
View user's profileFind all posts by Ibn SaeedSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
I missed the fact that you wanted it to work on a selection.

What you wrote here contains 2 errors:
First is that the script is named "php_beautifier" (that's what read in the docs), you used phped.php. Please verify that D:\PHP_Beautifier\php_beautifier exists to make sure that is correct or locate it.

Secondly: You forgot the @ behind the second FName, but since you want to work on a selection that entire part becomes obsolete.

That makes the entire thing easier, the commandline should be:
@php5@ "D:\PHP_Beautifier\php_beautifier"

Normally that should work

EDIT: Also as Dmitri said above, it is a PEAR project which means it needs the PEAR infrastructure to work.
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
Also as Dmitri said above, it is a PEAR project which means it needs the PEAR infrastructure to work.

yep, something like this should be executed in the command prompt:

if pear.bat is not in %PROGRAMFILES%\NuSphere\PhpED\php5, you have to install pear itself:
cd %PROGRAMFILES%\NuSphere\PhpED\php5
go-pear.bat
<press enter when it asks to install for system>
<press enter when it asks to install all>
<press enter when it asks to quit>

then run it and update channels:
pear.bat channel-update pear.php.net

then upgrade pear's packages to the latest versions
pear.bat upgrade-all

then install the package
pear.bat install php_beautifier

it may print something like
Failed to download pear/php_beautifier within preferred state "stable", latest release is version 0.
1.14, stability "beta", use "channel://pear.php.net/php_beautifier-0.1.14" to install
install failed

which means you have to run:
pear.bat install channel://pear.php.net/php_beautifier-0.1.14

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
solution found


Joined: 20 Jun 2013
Posts: 1
Reply with quote
I am searching for the solution to the similar issues related to PHP integration and most of my searches are almost found. The result from the members are equally important and I would like to thank you for keeping the forum updated with details. Thanks for the good work.
View user's profileFind all posts by jukejumperSend private message
Help integrating PHP_Beautifier into PHPed
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic