PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
PHP_Beautifier and blank lines

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> PHP
View previous topic :: View next topic  
Author Message
leborgne



Joined: 10 Feb 2009
Posts: 1

PostPosted: Tue Feb 10, 2009 12:14 pm    Post subject: PHP_Beautifier and blank lines Reply with quote

hello
i've just try it yesterday, integrating the call into eclipse/aptana.

I got one problem, it remove empty lines in my code.
Is it possible to avoid this ?

here is my config script
i work with wamp 2.0

Code:
@ECHO OFF
SET PHP=D:\wamp\bin\php\php5.2.8\php.exe
SET BEAUTIFY=D:\wamp\bin\php\php5.2.8\php_beautifier
%PHP% -d output_buffering=1 -f %BEAUTIFY% -- --filters "Lowercase()" --input %1 --output %1~ 
%PHP% -d output_buffering=1 -f %BEAUTIFY% -- -l "ListClassFunction() IndentStyles(style=k&r) NewLines(before=if:else:switch:T_CLASS:public:T_FUNCTION)" -t2 --input %1~
del %1~


here is a sample script to beautify

Code:
<?php

# this is a test

phpinfo();




if(true){$var1 = 'test'; $var3 = 'test';} else {echo 'test ici';}
switch (true) {
  case 1:
  echo 'here';   break;

  case 2:   
      echo 'there';   
      break;
}CLASS test  {   PUBLIC $t1;   PUBLIC $t2;   


protected $t3;
    protected $t4;


    private $t5;
    private $t6;   
   
    public function __construct(){
        $this->t1 = 1;
        $this->t2 = 2;
    }
}function foo(){    echo 'bar';}

$a = array(array(1,2,3,4),array(4,5,6),array(7,8,8));
?>


and here is the result
Code:
<?php
/**
* Class and Function List:
* Function list:
* - __construct()
* - foo()
* Classes list:
* - test
*/
# this is a test
phpinfo();

if (true) {
      $var1 = 'test';
      $var3 = 'test';
}
else {
      echo 'test ici';
}

switch (true) {
      case 1:
            echo 'here';
      break;
      case 2:
            echo 'there';
      break;
}

class test {
      public $t1;
      public $t2;
      protected $t3;
      protected $t4;
      private $t5;
      private $t6;
      public
      function __construct() {
            $this->t1 = 1;
            $this->t2 = 2;
      }
}

function foo() {
      echo 'bar';
}
$a = array(array(1, 2, 3, 4), array(4, 5, 6), array(7, 8, 8));
?>


i'de like to keep blank line if possible
and don't put a new line in function if there is public/private ...

does anyone have an experience with this module ?

thx
john
Back to top
View user's profile Send private message
Noahh



Joined: 13 Mar 2010
Posts: 1

PostPosted: Sat Mar 13, 2010 9:14 am    Post subject: Reply with quote

Why no response??ok did you get the solution?
_________________
super affiliate
super affiliate
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> PHP All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement