Work with the Zend Tool in multiple development environments

In any Zend Framework project, I can work in 2 or 3 places - my work PC, home PC or my MacBook. My source code is always in SVN, and I usually work on the development server before pushing the completed work to the production server. In such an environment, I was never sure where exactly I should work with Zend_Tool.

As I see, there are 2 options:

  • Setting up work locally with Zend_Tool on each dev environment, and then click on the dev server from there, checking the manifest, etc. with every use of Zend_Tool.
  • Use Zend_Tool directly on the dev server, then upload each add / change, and then embed SVN.

I would be inclined to say that the most reliable way would be a lot of Zend_Tool settings, but I would be interested to hear if people can think of any potential problems with this or the reasons why I should make a different choice.

Thanks.

+4
source share
3 answers

Zend_Tool actually intends to be used in development environments. Actually, your feeling about using it in several places is absolutely correct, the only problem is the synchronization between XML, which Zend_Tool uses to know a different configuration in the project, and yet this will happen only if the main changes are made during the same revision on different working copies (general restriction on version control / problem / independently).

Other than that, you should not have any problems.

+2
source

Zend_Tool hardcodes APPLICATION_ENV to 'development' in Tool/Project/Context/Zf/BootstrapFile.php

You can get all the recklessness and change the source code (not a good idea, but it will work). Applying this patch will allow you to use an environment variable to tell Zend_Tool that you are.

  --- BootstrapFile.php (saved version) +++ (current document) @@ -106,9 +106,11 @@ define('APPLICATION_PATH', $this->_applicationDirectory->getPath()); $applicationOptions = array(); $applicationOptions['config'] = $this->_applicationConfigFile->getPath(); + + $env = getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'; $this->_applicationInstance = new Zend_Application( - 'development', + $env, $applicationOptions ); } , 

Remember to set the environment variable APPLICATION_ENV .

Needless to say, this is quite dangerous and could explode if you have the wrong set of environment variables, but for those of us who use ZFDoctrine, which combines Doctrine commands in the Zend Tool, we don't have many other options when it comes to the migration of doctrine.

See this link http://framework.zend.com/issues/browse/ZF-9898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel

+2
source

What we do in my work is to create an instance configuration. By doing this, we have 3 configurations depending on the environment in which the application runs.

  • Local computer (debugging during programming).
  • Development (used to test our code before clicking on production).
  • Production (Live Environment).

Then we configure the configuration class to load the configuration, which has paths and data for our tools, depending on which environment we specify in our configuration file.

Basically, we have the Chooser.txt file, which will have the name of the configuration file in the file to start the environment. When we want to run it locally, we edit the Chooser.txt file on local_config.txt (we use .txt so that we can define certain configs, and then we .htaccess in the configuration directory so that no one can view it). When we click on the dev server, we then edit Chooser.txt to say dev_config.txt and so on. Then in dev_config.txt or local_config.txt we will have configuration variables for tools and php settings, etc ...

Now we install the tool in each environment, so we will have our tools and libraries in our local environment, dev and production. With our tools in a localized environment, it is much easier to perform testing when updating / putting so that you do not just fix the tools on the production server when you first tested them on the dev server.

+1
source

All Articles