Class PHP_Beautifier_Batch

Description

Adds functionality to handle multiple files.

  • STDIN : As normal
  • STDOUT : Send all the scripts, prepended with the name of the original route
  • One in, one out: as normal
  • Without '/' at the end, same as STDOUT.
  • With '/' at the end, copy the base structure and copy all the scripts
You must define an input file. By default, the output is "./", so the saving of files will be done on the directory of your command prompt.

If the file out end in .tgz, the output will be a tar archive. The same action will be obtained with setCompress() to true Use:

  1.  require "PHP/Beautifier.php";
  2.  require "PHP/Beautifier/Batch.php";
  3.  $oBeautnew PHP_Beautifier();
  4.  $oBatchnew PHP_Beautifier_Batch($oBeaut)// Decorator
  5.  $oBatch->setInputFile(__FILE__);
  6.  $oBatch->setOutputFile(dirname(__FILE__)."/beautified/");
  7.  $oBatch->process();
  8.  $oBatch->save();

Located in /Beautifier/Batch.php (line 70)

PHP_Beautifier_Decorator
   |
   --PHP_Beautifier_Batch
Class Constant Summary
 DIRECTORY = 'Directory'
 FILES = 'Files'
Variable Summary
Method Summary
 mixed callBeautifier (PHP_Beautifier_Batch_Output $oEngine, string $sMethod, [array $aArgs = array()])
 string get ()
 void getInputFiles ()
 void getOutputPath ()
 bool process ()
 bool save ([ $sFile = null])
 void setCompress ([mixed $mCompress = true])
 bool setInputFile (mixed $mFiles)
 true setOutputFile (mixed $sFile)
 void setRecursive ([bool $bRecursive = true])
 void show ()
Variables
bool $bRecursive = false (line 105)

Recursive search on dirs

  • access: public
mixed $mInputFiles (line 93)
  • access: public

Inherited Variables

Inherited from PHP_Beautifier_Decorator

PHP_Beautifier_Decorator::$oBeaut
Methods
callBeautifier (line 296)

Allows subclass of PHP_Beautifier_Batch_Engine call methods of $oBeaut

  • access: public
mixed callBeautifier (PHP_Beautifier_Batch_Output $oEngine, string $sMethod, [array $aArgs = array()])
  • PHP_Beautifier_Batch_Engine $oEngine
  • string $sMethod: method to call
  • array $aArgs: array of args
get (line 280)

Return a string with the content of the file(s)

  • access: public
string get ()
getInputFiles (line 303)
  • access: public
void getInputFiles ()
getOutputPath (line 307)
  • access: public
void getOutputPath ()
process (line 235)

Create the real references to files

  • throws: Exception
  • access: public
bool process ()
save (line 271)

Save the beautified sources to file(s)

  • throws: Exception
  • access: public
bool save ([ $sFile = null])
  • $sFile
setCompress (line 120)

Set compression on/off

  • access: public
void setCompress ([mixed $mCompress = true])
  • mixed $mCompress: bool(false, true for gzip) or string ('gz' or 'gz2')
setInputFile (line 137)

Set the input(s) files

Could be STDIN or a name, with special chars (?,*)

  • access: public
bool setInputFile (mixed $mFiles)
  • mixed $mFiles: STDIN or string(path)
setOutputFile (line 160)

Set the output file

Could be STDOUT or a path to a file or dir (with '/' at the end)

  • access: public
true setOutputFile (mixed $sFile)
  • mixed $sFile: STDOUT or string (path)
setRecursive (line 112)

Set recursive search for files in dirs on

  • access: public
void setRecursive ([bool $bRecursive = true])
  • bool $bRecursive
show (line 285)
  • access: public
void show ()

Inherited Methods

Inherited From PHP_Beautifier_Decorator

 PHP_Beautifier_Decorator::__construct()
 PHP_Beautifier_Decorator::__call()
Class Constants
DIRECTORY = 'Directory' (line 100)
FILES = 'Files' (line 99)

Documentation generated on Mon, 31 May 2010 16:16:04 -0400 by phpDocumentor 1.4.3