C.48 PharPackageTask
Prev | Appendix C. Optional tasks | Next

## C.48 PharPackageTask

Phar packages generating with Phing. This task require PECL's Phar extension to be installed on your system. Phar is built-in in PHP from 5.3 version.

Table C.65: Attributes

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`basedir` | `String` | Base directory, which will be deleted from each included file (from path). Paths with deleted `basedir` part are local paths in package. | n/a | Yes
`destfile` | `String` | Destination (output) file. Will be recreated, if exists! | n/a | Yes
`compression` | `String` | Compression type (gzip, bzip2, none) to apply to the packed files. | none | No
`webstub` | `String` | Relative path within the phar package to run, if accessed through a web browser. | n/a | No
`clistub` | `String` | Relative path within the phar package to run, if accessed on the command line. | n/a | No
`stub` | `String` | A path to a php file that contains a custom stub | n/a | No
`alias` | `String` | An alias to assign to the phar package | n/a | No
`signature` | `String` | Signature algorithm (md5, sha1, sha256, sha512), used for this package. | sha1 | No
`key` | `String` | The private key to sign the phar package with (PEM or PKCS#12 encoded) | n/a | No
`keyPassword` | `String` | The password to use for the private key | n/a | No

### C.48.1 Example

Sample build command:

    <pharpackage
      destfile="./build/package.phar"
      basedir="./">
      <fileset dir="./classes">
        <include name="**/**" />
      </fileset>
      <metadata>
        <element name="version" value="1.0" />
        <element name="authors">
          <element name="John Doe">
            <element name="e-mail" value="john@example.com" />
          </element>
        </element>
      </metadata>
    </pharpackage>

### C.48.2 Supported Nested Tags

- `fileset`

- `metadata`

Prev | Up | Next
C.47 PearPackage2Task | Home | C.49 PhkPackageTask