Haben Sie als Zend-Framework-Entwickler nicht schon immer etwas neidisch auf die Konsolenanwendungen der anderen PHP-Frameworks geschielt, mit denen innerhalb kurzer Zeit ein Blog umgesetzt werden konnte? Das Open-Source-Tool ZFrapid schließt diese Lücke und hilft Einsteigern und Profis dabei, im Handumdrehen neue Zend-Framework-Projekte einzurichten, Module zu erstellen und zu konfigurieren und einfache Administrationsoberflächen automatisch zu generieren. Erfahren Sie in dieser Session, wie Sie ZFrapid nutzen können, um die Entwicklungszeit von Prototypen beschleunigen zu können.
9. 9 / 38
$ zf2rapid create-project --help
===========================================================================
Usage:
create-project [--workingPath=]
Arguments:
--workingPath= The path to work in; defaults to current working path
Help:
Create a new ZF2 project within the specified path
===========================================================================
$ cd /home/devhost/
$ zf2rapid create-project --workingPath=myproject
$ cd myproject/
Projekt anlegenProjekt anlegen
12. 12 / 38
$ zf2rapid create-module --help
===========================================================================
Usage:
create-module <module> [--workingPath=] [--configFile=]
[--without-project] [--no-activation]
Arguments:
<module> The name of the module to create; mandatory
--workingPath= The path to work in; defaults to current working path
--configFile= Specify the configuration file to activate or
deactivate a module in; defaults to not bet set
--without-project Ignore if working path does not contain a ZF2 project;
defaults to current working path
--no-activation Prevent the activation of the new module (disabled by
default)
Help:
Create a new module within the specified path
===========================================================================
Modul anlegenModul anlegen
13. 13 / 38
// Modul anlegen
$ zf2rapid create-module Shop
// Modul löschen
$ zf2rapid delete-module Shop
// Modul aktivieren
$ zf2rapid activate-module Shop
// Modul deaktivieren
$ zf2rapid deactivate-module Shop
// Konfigurationsdatei mit angeben
$ zf2rapid create-module Shop --configFile=development.config.php
// Modul unabhängig vom Zend Framework 2 Projekt anlegen
$ zf2rapid create-module Shop --without-project --workingPath=/some/where
Mit Modulen arbeitenMit Modulen arbeiten
16. 16 / 38
$ zf2rapid create-controller --help
===========================================================================
Usage:
create-controller <module> <controller> [--workingPath=]
[--without-project] [--no-factory]
Arguments:
<module> The name of the module to create the controller in;
mandatory
<controller> The name of the controller to create; mandatory
--workingPath= The path to work in; defaults to current working path
--without-project Ignore if working path does not contain a ZF2 project;
defaults to current working path
--no-factory Prevent the creation of a factory for the new
controller
Help:
Create a new controller for module within the specified path
===========================================================================
Controller anlegenController anlegen
17. 17 / 38
$ zf2rapid create-action --help
===========================================================================
Usage:
create-action <module> <controller> <action>
[--workingPath=] [--without-project]
Arguments:
<module> The name of the module to create the controller action
in; mandatory
<controller> The name of the controller to create an action for;
mandatory
<action> The name of the new action to create; mandatory
--workingPath= The path to work in; defaults to current working path
--without-project Ignore if working path does not contain a ZF2 project;
defaults to current working path
Help:
Create a new controller action for module within the specified path
===========================================================================
Action anlegenAction anlegen
18. 18 / 38
$ zf2rapid create-view-helper --help
===========================================================================
Usage:
create-view-helper <module> <viewHelper> [--workingPath=]
[--without-project] [--no-factory]
Arguments:
<module> The name of the module to create the view helper in;
mandatory
<viewHelper> The name of the view helper to create; mandatory
--workingPath= The path to work in; defaults to current working path
--without-project Ignore if working path does not contain a ZF2 project;
defaults to current working path
--no-factory Prevent the creation of a factory for the new view
helper
Help:
Create a new view helper for module within the specified path
===========================================================================
View Helper anlegenView Helper anlegen
28. 28 / 38
$ zf2rapid create-module BlogDomain --configFile=development.config.php
$ zf2rapid crud-create-model BlogDomain article,category,author
$ zf2rapid crud-create-model --help
===========================================================================
Usage:
crud-create-model <module> <tables> [--workingPath=]
Arguments:
<module> The name of the module to create the model classes in;
mandatory
<tables> The names of the database tables to create the model
classes for; mandatory
--workingPath= The path to work in; defaults to current working path
Help:
Create all model classes (entity, hydrator, table gateway, repository) for
a database table
===========================================================================
CRUD Model anlegenCRUD Model anlegen
30. 30 / 38
$ zf2rapid create-module AuthorAdmin --configFile=development.config.php
$ zf2rapid create-module CategoryAdmin --configFile=development.config.php
$ zf2rapid create-module ArticleAdmin --configFile=development.config.php
$ zf2rapid crud-create-application AuthorAdmin BlogDomain/AuthorEntity
$ zf2rapid crud-create-application CategoryAdmin BlogDomain/CategoryEntity
$ zf2rapid crud-create-application ArticleAdmin BlogDomain/ArticleEntity
$ zf2rapid crud-create-application --help
===========================================================================
Usage:
crud-create-application <module> <entity> [--workingPath=]
Arguments:
<module> The name of the module to create the application in;
<entity> The entity to create the application for with the format
ModuleName/EntityClassName; mandatory
--workingPath= The path to work in; defaults to current working path
Help:
Create application (controller, view) for a model entity
===========================================================================
CRUD Application anlegenCRUD Application anlegen
37. 3737 // 3838
DankeDanke
Für Ihre / Eure AufmerksamkeitFür Ihre / Eure Aufmerksamkeit
Repository: https://github.com/RalfEggert/ipc2015-zf2rapidRepository: https://github.com/RalfEggert/ipc2015-zf2rapid
Slides: http://de.slideshare.net/eggertralf/ipc2015-zf2rapidSlides: http://de.slideshare.net/eggertralf/ipc2015-zf2rapid
38. BildnachweisBildnachweis
[B00] Fotos von Ralf Eggert
[B01] Frontiers 2011 - Day 2 https://www.flickr.com/photos/frontiersofinteraction/5866676276/ von Frontiersofinteraction - CC-BY https://creativecommons.org/licenses/by/2.0/
[B02] My nuts https://www.flickr.com/photos/lucasincas/6517703315/ von Lucas Incas - CC-BY https://creativecommons.org/licenses/by/2.0/
[B03] Harbourside Building Site 4 https://www.flickr.com/photos/matt_gibson/420273270/ von Matt Gibson - CC-BY https://creativecommons.org/licenses/by/2.0/
[B04] rainbow cubes with holes https://www.flickr.com/photos/generated/6313491064/ von Jared Tarbell - CC-BY https://creativecommons.org/licenses/by/2.0/
[B05] Monaco-14pt https://www.flickr.com/photos/polarity/3138680190/ von Robert Agthe - CC-BY https://creativecommons.org/licenses/by/2.0/
[B06] Scenic Route 207 Texas Plain Trail https://www.flickr.com/photos/mtsrs/2547608404/ von mtsrs - CC-BY https://creativecommons.org/licenses/by/2.0/
[B07] Molecular Bonds https://www.flickr.com/photos/pasukaru76/6978143982/ von Pascal - CC-BY https://creativecommons.org/licenses/by/2.0/
[B08] Fixing the database https://www.flickr.com/photos/dahlstroms/4140461901 von Håkan Dahlström - CC-BY https://creativecommons.org/licenses/by/2.0/
[B09] Swiss Army Knife https://www.flickr.com/photos/askdavetaylor/4261149346/ von Dave Taylor - CC-BY https://creativecommons.org/licenses/by/2.0/
[B10] Warning https://www.flickr.com/photos/thomasletholsen/9369862678/ von Thomas Leth-Olsen- CC-BY-SA https://creativecommons.org/licenses/by-sa/2.0/
[B11] Help wanted sign https://www.flickr.com/photos/andjohan/5644714850/ von Andreas Klinke Johannsen - CC-BY-SA https://creativecommons.org/licenses/by-sa/2.0/
[B12] Etech05: Audience https://www.flickr.com/photos/oreilly/6648470 von James Duncan Davidson - CC-BY https://creativecommons.org/licenses/by/2.0/
[B13] Jobs https://www.flickr.com/photos/jakerust/16844967041/ von www.gotcredit.com - CC-BY https://creativecommons.org/licenses/by/2.0/
ZFrapid Logo von Moritz Liebeknecht.
Alle weiteren Screenshots wurden von Ralf Eggert erstellt.
38 / 38