Zend Framework 2 Tools - zend-framework2

I've being looking around for Zend\Tool which appears in version 1 but not in version 2. I did find another SO post where it was mentioned that they've not been added yet but that was over 6 months old.
Does anyone have an update on when they will be added or can point me in the direction of similar utilities?

ZFTool is now available for Zend Framework 2: https://github.com/zendframework/ZFTool

There's no such thing as Zend Tool at the moment. They are still working on it but when it will be released, no one can tell yet. However there are two great Git-Repositories out there, that pretty much cover crucial aspects of Zend Tool - creating a bare application and new modules
zendframework/ZendSkeletonApplication
zendframework/ZendSkeletonModule
Additionally someone posted a shell script to create a new skeleton module on my Blog, you can find the script right there. However i take no responsibility for that script, as i don't use it myself. ZF2 Modules are so simple and the SkeletonModule is all i need:
zf2crmod.sh

Related

ZF2 shared installation for many virtual hosts

I have many projects in the same Centos server and I'd rather like to install ZF2 once in a location like /usr/share/zf2 instead installing it with Skeleton all the time as duplicate libraries with projects and use ZF2_PATH in all my applications. Naturally, I'd like to use composer to update this shared zf2 library as well.
I can make it work in my way but I'd like to know if there is a conventional/preferred way to do this.
What I would do is:
1- Install ZF2 in /usr/share/zf2
2- Set ZF2_PATH environment
3- Remove Zend Framework 2 requirement from composer.json of the projects and update all as necessary.
I am just trying to follow a proven/accepted/easy-to-maintain method instead discovering it.
Thank you very much.
This is unconventional, there is no "proven/accepted" way of doing it and many people will have different opinions.
Downside of your solution is the need of testing all 3 apps when upgrading Zend Framework, I am sure you can imagine multiple scenarios when it could be handy to upgrade it just for one. If anything goes wrong, and things do go wrong, you will end-up breaking all 3 apps, not just one.
The only upside is saving space, but is that really an upside any more? Isn't disk space very cheap. Breaking your code is definitely more expensive (I am talking about cost of your time, potential loss of data or users).
If you still want to proceed you can create a 4th project with its own composer.json file and use it for any shared dependencies.

Making a datagrid in zend framework 2

I am looking for software which creates a DataGrid in ZF2. I've found odiaseo/zf2-datagrid from GitHub but I currently do not understand how to use it. Does anyone have any suggestions on where I can find a tutorial with step-by-step instructions?
Step by step installation and usage guide is already there on git.
https://github.com/odiaseo/zf2-datagrid
I don't know what type of suggestions you need. but you can find good comparison of zf2 with other frameworks. one of them is here
Have you tried using this
There are some other datagrids for zf2 as well. Try one that fits your need
see here: http://modules.zendframework.com/?query=datagrid
e.g. https://github.com/ThaDafinser/ZfcDatagrid

zend framework 2 simple integration

I am planning to build a project using zend framework 2.
But i find it very hard to setup zf2.
It is not easy to setup the framework and start working.
What i am looking is copy required zf2 files, put into the project and start working.
Like in cakephp where you need to make changes in database configurations and start working.
Can anybody help for this issue. this will be useful for many other developers also.
Thanks in advance for any help.
Have you tried the SkeletonApplication? It provides everything you need: Pre-setup bootstrapping, the directory structure, a basic application configuration.
Just clone it into your web directory and make sure that vendor/ZF2 gets cloned as well (--recursive flag).
This is currently the easiest approach to get started with a new ZF2 project.
If you need further assistance, please state your question more specificly.
// Edit: Although it makes sense to use composer or at least git to pull everything directly, you can just download the project (SekeletonApplication and ZF2) from Git. In my opinion, you shouldn't be too lazy here. Using composer etc. will save you a lot of time that you can spend on implementation.
Setting up ZF2 without the use of the command line is MUCH more of a pita than using it. Sure, you can download the SkeletonApplication and then you can Download ZF2 Core Library and put it into your include_path, but that's not too great.
I really suggest learning about the command line. I'm a windows user myself and hated it at first, but after getting around the first problems, i - now - find it really handy.
If you have trouble setting up your stuff or understanding it all, you may find my tutorial helpful which you can find right here: Zend Framework 2 Installation on Xampp for Windows
I had the same issue as you. I found the Skeleton application easy and quick to install, but I didn't need the translations that are included. As a result I created a stripped down, bare bones version which you are welcome to use.
You will find the ZendMinimumApplication on github.

Zend Framework 2 CLI

I realise that the stable release of Zend Framework 2 hasn't been been out for long, but having been through the skeleton tutorial it seems that there's a lot of work that needs to be done in order to get a new module working.
I'm just wondering if there are any tools available such as a CLI that make the creation of new modules/models etc easier.
Many thanks.
You can use the new ZFTool module to create new module and application structures for you via the cli
https://github.com/zendframework/ZFTool
Create a new module
zf.php create module <name> [<path>]
Create a new project
zf.php create project <path>
There probably will be tools to automate the creation of modules later on but probably not yet. Recall that the tools for autocreating projects for ZF1 didn't come out for quite a few releases. I'm not sure exactly which release but I think it wasn't until after 1.8 that the tools became available.
Until then, should DEFINITELY think about creating a 'skeleton' module and maybe putting it up on github or even create a pull request on the skeleton application to have your skeleton module, with the extra setup already done, added to the skeleton application or have it replace Zend's altogether.
A skeleton module already exists on github. It's been there for months and updated regularly as zf2 developed.
https://github.com/zendframework/ZendSkeletonModule

Is there a new version of Zend_Tool for ZF2?

if so, where can it be found?
is it going to have a new handle as to not conflict with zf1's tool?
zf2 create module admin
Zend_Tool documentation can be found here:
http://framework.zend.com/manual/en/zend.tool.usage.cli.html
There is no Zend\Tool component implemented for Zend Framework yet. According to Matthew Weier O'Phinney (Project Lead Zend Framework):
Zend\Console is being worked on for beta4,
which lays the groundwork for new tooling; we may or may not have basic
tooling available for beta4 (depends on when Console hits the master
branch, basically).
Right now, the preferred method for starting with the application is to
use the ZendSkeletonApplication, along with ZendSkeletonModule, as these
give the basic infrastructure you need to start development of an
application and modules, respectively.
Source: http://zend-framework-community.634137.n4.nabble.com/Where-is-the-ZF-tool-in-ZF2-located-td4492524.html
The new Zend Tool for Zend Framework 2 has been released recently and could be found on github: https://github.com/zendframework/ZFTool

Resources