PHP Class Robo\Task\Assets\Minify

php taskMinify( 'web/assets/theme.css' ) ->run() ?> Please install additional dependencies to use: "patchwork/jsqueeze": "~1.0", "natxet/CssMin": "~3.0"
Inheritance: extends Robo\Task\BaseTask
显示文件 Open project: codegyre/robo

Protected Properties

Property Type Description
$dst string
$squeezeOptions array
$text string
$type string
$types array

Public Methods

Method Description
__construct ( string $input ) Constructor. Accepts asset file path or string source.
__toString ( ) : string
keepImportantComments ( boolean $keepImportantComments ) keepImportantComments option for the JS minimisation.
run ( )
singleLine ( boolean $singleLine ) Single line option for the JS minimisation.
specialVarRx ( boolean $specialVarRx ) specialVarRx option for the JS minimisation.
to ( string $dst ) Sets destination. Tries to guess type from it.
type ( string $type ) Sets type with validation.

Protected Methods

Method Description
fromFile ( string $path ) Sets text from asset file path. Tries to guess type and set default destination.
fromText ( string $text ) Sets text from string source.
getExtension ( string $path ) : string Gets file extension from path.
getMinifiedText ( ) : string | boolean Minifies and returns text.

Method Details

__construct() public method

Constructor. Accepts asset file path or string source.
public __construct ( string $input )
$input string

__toString() public method

public __toString ( ) : string
return string

fromFile() protected method

Sets text from asset file path. Tries to guess type and set default destination.
protected fromFile ( string $path )
$path string

fromText() protected method

Sets text from string source.
protected fromText ( string $text )
$text string

getExtension() protected method

Gets file extension from path.
protected getExtension ( string $path ) : string
$path string
return string

getMinifiedText() protected method

Minifies and returns text.
protected getMinifiedText ( ) : string | boolean
return string | boolean

keepImportantComments() public method

keepImportantComments option for the JS minimisation.
public keepImportantComments ( boolean $keepImportantComments )
$keepImportantComments boolean

run() public method

public run ( )

singleLine() public method

Single line option for the JS minimisation.
public singleLine ( boolean $singleLine )
$singleLine boolean

specialVarRx() public method

specialVarRx option for the JS minimisation.
public specialVarRx ( boolean $specialVarRx )
$specialVarRx boolean

to() public method

Sets destination. Tries to guess type from it.
public to ( string $dst )
$dst string

type() public method

Sets type with validation.
public type ( string $type )
$type string css|js

Property Details

$dst protected_oe property

protected string $dst
return string

$squeezeOptions protected_oe property

protected array $squeezeOptions
return array

$text protected_oe property

protected string $text
return string

$type protected_oe property

protected string $type
return string

$types protected_oe property

protected array $types
return array