ScriptReorganizer
[ class tree: ScriptReorganizer ] [ index: ScriptReorganizer ] [ all elements ]

Class: ScriptReorganizer_Strategy_Pack

Source Location: /ScriptReorganizer-0.3.0/Strategy/Pack.php

Class Overview


Advanced strategy


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005 Stefano F. Rausch <stefano@rausch-e.net>

Methods


Inherited Variables

Inherited Methods


Class Details

[line 65]
Advanced strategy

Reorganizes scripts by applying the Quiet strategy as well as by replacing (1) EOLs according to the pack mode - see below (2) two or more consecutive spaces and/or tabs with a single space char.

Multiple consecutive EOLs are replaced either as defined (1) in the default mode by a single EOL or (2) in the extreme mode by a single space char.

Warning: With ScriptReorganizer optimized source code the tracking of report error messages of the PHP Engine will definitively get cumbersome, when the extreme mode of the Pack strategy is applied. Reason being: all statements are organized on one line only. It is crucial to throughout test again - not only unit test - the code after optimizing it and before building a release to deploy.

If the extreme pack mode strategy is used for packaging, a non-ScriptReorganized source code tree should be shipped together with the optimized one, to enable third parties to track down undiscoverd bugs.



[ Top ]


Method Detail

__construct (Constructor)   [line 76]

ScriptReorganizer_Strategy_Pack __construct( [boolean $oneLiner = false])

Constructor
  • Access: public

Parameters:

boolean   $oneLiner   —  true, if the script's packing should result in only one line of code - extreme pack mode; otherwise false - default pack mode

[ Top ]

reformat   [line 93]

string reformat( string &$content, string $eol)

Performs the main reorganization of the script's content
  • Return: a string representing the reorganized content
  • Access: public

Parameters:

string   &$content   —  a string representing the script's content
string   $eol   —  a string representing the EOL identifier to use

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:10:30 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.