integrate Zend Framework Batchfile

Hello !

I work with the zend framework 1.11.x .
In this framework is a batchfile for creating new controllers, models ... .
Is there an way to integrate this batchfile in PhpStorm.

I have seen in the zend studio the input field for zf.bat commands.

Does anyone have any idea ?

Greetings Stephan

11 comments
Comment actions Permalink

Hello!

Here is blog post about integrating zf.bat command line tool into PhpStorm. It's a bit outdated: now you may choose in Settings the look of command input. It is zend studio-like popup by default, but may be integrated with tool window. You are welcome to ask if you have questions about it.

Develop with pleasure!
Elena

0
Comment actions Permalink

Hello !

and good morning.
I have a little problem with the zf.bat .

I think the path to the php.exe is wrong.

I need an information.

Greetings Stephan



Attachment(s):
view.jpg
0
Comment actions Permalink

Are you sure you've installed zf properly? I suppose zf.bat just fails to find php.exe in system path. Here is installation guide. It says:

You should be able to run php.exe on the command line. If you are not able to, first check the documentation that came with your PHP distribution, or ensure that the path to php.exe is in your Windows  PATH  environment variable.
Please, check that zf works correctly from console.

0
Comment actions Permalink

Hi,
If i want to use CLI first of all i have to create a project. So i did  this. Then i want to use zf tool, but i have already created a new  project and when i type “zf create project test” the zf project is  created inside the first project and because of this i can’t use other  zf tool commands like “zf enable layout”. So how to do that if i create a  project using zf tool it is also a project of phpstorm? Because in the blog post it isn’t said how to do this and in the begininig it even  doesn’t tell that i have to create a project first if i want to use CLI?  What is the best practise for creating project and ZF projects?

0
Comment actions Permalink

Hi!

You were supposed to have new empty PhpStorm project in tutorial. I didn't catch "i can’t use other  zf tool commands like “zf enable layout”". I created new PhpStorm project, created new zend project inside with zf create project. Then invoked zf enable layout, and it worked well. Having problems with working directory for commands, you may change it with cd command.  If your problem persists, please, describe it in more details, maybe create an issue if behavior seems buggy or unfriendly to you.

0
Comment actions Permalink

Thx for the answer. I had created a new project "project1", then i created new zend project "test" inside that phpstorm project with "zf create project". And the problem was that i had not used "cd test" command to switch to zf project dir, so the command "zf enable layout" didn't work for me. Now everything is fine, thx. But i think this project in the project structure is a bit weird, because i am storing my projects in wamp "www" directory, so to access my project i have to go to "www/project1/test".
I found a different solution, outside of the phpstorm IDE i used windows cmd to create zf project and then i opened phpstorm and used "Create new project from existing files". So i got normal project structure "www/test1" and i don't need to use that "cd" command. Or maybe there is a better solution for creating projects? Like i asked before, what would be the best practise for creating projects?

0
Comment actions Permalink

I suppose you've used zf create project test when created your project. Use just zf create project, and project will be created inside your folder. I mean first do File | New Project with location www/<project name>, then execute zf create project, which is equal to zf create project www/<project name>. And project will be generated inside www/<project name>. I suppose this is the best practice.
Also, when you don't need synchronization with server, and files are on local computer, you may create projects with File | Open directory.

0
Comment actions Permalink

Oh thx a lot, shame on me :) i used that "zf create project test". Now everything is ok. I was looking in that blog post and in zend framework tutorial at the same time and i skipped that :) thx again.

0
Comment actions Permalink

But does that mean one has to setup ZF.bat or ZF.sh everytime one starts a new project with Zend Framework, where is the productivity gain here?
that kind of setting should be done once and for all, not everytime i am starting up a projet!

0
Comment actions Permalink

You are right, so long as command line tools configuration is per project and is not available for default project. I suppose it really would be useful to allow to configure in default project, to have that tools in every other project. Feel free to vote for that issue!

0
Comment actions Permalink

in terms of productivity this should be a great gain, now my work around is basically to make sure my ubuntu machine has the zf command alias allowing me to call ZF tool from anywhere on my machine,   in doing so i lose the autocompletion that comes with seting up zf command line tool into a phpstorm project!

0

Please sign in to leave a comment.