# classes/phing/tasks/ext/jsmin/JsMinTask.php

## \JsMinTask
jump to top

Task to minify javascript files.

Requires JSMin which can be found at http://code.google.com/p/jsmin-php/ but is bundled with Phing so no additional install of JsMin is required.

Extends from
  \Task
author
  Frank Kleine
copyright
  2001,2002 THYRELL. All rights reserved
package
  phing.tasks.ext
since
  2.3.0
version
  $Id: JsMinTask.php 1231 2011-07-25 20:11:53Z mrook $

### Properties

`boolean $failonerror= 'false'`

Whether the build should fail, if errors occured

Default value `false` Details

Type
  boolean

`\FileSet $filesets= 'array'`

the source files

Default value `array` Details

Type
  \FileSet

`boolean $suffix= '-min'`

Define if the target should use or not a suffix -min

Default value`-min` Details

Type
  boolean

`string $targetDir= ''`

directory to put minified javascript files into

Details

Type
  string

### Methods

`createFileSet( ) :`
Nested creator, adds a set of files (nested fileset attribute).
`init( ) :`
The init method: Do init steps.
`main( ) :`
The main entry point method.
`setFailonerror( boolean $value ) :`
Whether the build should fail, if an error occured.
Parameters

Name | Type | Description
--- | --- | ---
$value | boolean |

`setSuffix( string $value ) :`
Define if the task should or not use a suffix (-min is the default)
Parameters

Name | Type | Description
--- | --- | ---
$value | string |

`setTargetDir( string $targetDir ) :`
sets the directory where minified javascript files should be put inot
Parameters

Name | Type | Description
--- | --- | ---
$targetDir | string |

Documentation was generated by DocBlox 0.13.1.