C.63 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.83: Attributes

NameTypeDescriptionDefaultRequired
basedirStringBase directory, which will be deleted from each included file (from path). Paths with deleted basedir part are local paths in package.n/aYes
destfileStringDestination (output) file. Will be recreated, if exists!n/aYes
compressionStringCompression type (gzip, bzip2, none) to apply to the packed files.noneNo
webstubStringRelative path within the phar package to run, if accessed through a web browser.n/aNo
clistubStringRelative path within the phar package to run, if accessed on the command line.n/aNo
stubStringA path to a php file that contains a custom stubn/aNo
aliasStringAn alias to assign to the phar packagen/aNo
signatureStringSignature algorithm (md5, sha1, sha256, sha512), used for this package.sha1No
keyStringThe private key to sign the phar package with (PEM or PKCS#12 encoded)n/aNo
keyPasswordStringThe password to use for the private keyn/aNo

C.63.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="[email protected]" />
      </element>
    </element>
  </metadata>
</pharpackage>

C.63.2 Supported Nested Tags