Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A collection of Phing Tasks for a ZF2 app.

tree: 2ca3630f55

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 .gitignore a test task September 11, 2012
Octocat-spinner-32 README.md
Octocat-spinner-32 composer.json
README.md

zf2-phing-task

A collection of Phing Tasks for a ZF2 app.

Note: it will look for config/application.config.yml instead of config/application.config.php on bootstrap. If you use PHP config files, you'll have to change the code in each Task's main() method.

Installation

Composer:

{
    "require": {
        "heartsentwined/zf2-phing-task": "1.*"
    }
}

Phing is not bundled with this package.

You can install it through Composer and use the CLI at vendor/bin/phing:

{
    "require": {
        "phing/phing": "*"
    }
}

or through PEAR and use the CLI at phing:

$ pear channel-discover pear.phing.info
$ pear install [--alldeps] phing/phing

Usage

You must initialize an instance of your Zf2 application through ZfTask before using any of the remaining Tasks.

ZfTask

Bootstrap the ZF2 application using the file foo/bootstrap.php. The bootstrap file must return an instance of Zend\Mvc\Application.

<project>
    <target>
        <includepath classpath="vendor/heartsentwined/zf2-phing-task/src/task" />
        <taskdef name="zf" classname="ZfTask" />
        <zf bootstrap="foo/bootstrap.php" />
    </target>
</project>

foo/bootstrap.php:

/* do some bootstrap */
$application = Zend\Mvc\Application::init(/* config array */);
return $application;

DoctrineEntityTask

Generate entities for the EntityManager doctrine.entitymanager.orm_default, base directory at foo/src, with filter Foo\Entity.

<project>
    <target>
        <includepath classpath="vendor/heartsentwined/zf2-phing-task/src/task" />
        <taskdef name="d-entity" classname="DoctrineEntityTask" />
        <d-proxy em="doctrine.entitymanager.orm_default" filter="Foo\Entity" output="foo/src" />
    </target>
</project>

DoctrineRepoTask

Generate repositories for the EntityManager doctrine.entitymanager.orm_default, base directory at foo/src, with filter Foo\Entity.

<project>
    <target>
        <includepath classpath="vendor/heartsentwined/zf2-phing-task/src/task" />
        <taskdef name="d-repo" classname="DoctrineRepoTask" />
        <d-repo em="doctrine.entitymanager.orm_default" filter="Foo\Entity" output="foo/src" />
    </target>
</project>

DoctrineProxyTask

Generate proxies for the EntityManager doctrine.entitymanager.orm_default, at directory foo/cache/proxy, with filter Foo\Entity.

<project>
    <target>
        <includepath classpath="vendor/heartsentwined/zf2-phing-task/src/task" />
        <taskdef name="d-proxy" classname="DoctrineProxyTask" />
        <d-proxy em="doctrine.entitymanager.orm_default" filter="Foo\Entity" output="foo/cache/proxy" />
    </target>
</project>

DoctrineUpdateTask

Update database schema for the EntityManager doctrine.entitymanager.orm_default.

<project>
    <target>
        <includepath classpath="vendor/heartsentwined/zf2-phing-task/src/task" />
        <taskdef name="d-update" classname="DoctrineUpdateTask" />
        <d-update em="doctrine.entitymanager.orm_default" />
    </target>
</project>

DoctrineDropTask

Drop all database tables from the connection of the EntityManager doctrine.entitymanager.orm_default.

This Task differs from Doctrine CLI's behavior. It drops ALL tables, not just those found in the metadata mapping files.

<project>
    <target>
        <includepath classpath="vendor/heartsentwined/zf2-phing-task/src/task" />
        <taskdef name="d-drop" classname="DoctrineDropTask" />
        <d-drop em="doctrine.entitymanager.orm_default" />
    </target>
</project>

TwigTask

Load the Twig template foo/bar.

<project>
    <target>
        <includepath classpath="vendor/heartsentwined/zf2-phing-task/src/task" />
        <taskdef name="twig" classname="TwigTask" />
        <twig file="foo/bar" />
    </target>
</project>
Something went wrong with that request. Please try again.