Skip to content

A pre-built mashup of ZF2 / Vagrant / VirtualBox that can get you setup to run and develop on ZF2 with partial zero configuration!

License

Notifications You must be signed in to change notification settings

gwagner/ZF2VagrantBase

Repository files navigation

ZF2VagrantBase

Introduction

This is specifically designed to give you a fully working ZF2 Skeleton Application in a vagrant environment. I have gone through and painstakingly put together a setup that once cloned will require X steps to completely have a working LAMP stack in a virtual machine. If you are looking for a guide on how to work with ZendFramekwork, VirtualBox, or Vagrant go to their website's and RTM.

Installation

  1. Clone ZF2VagrantBase https://github.com/gwagner/ZF2VagrantBase.git
  2. Install Vagrant http://downloads.vagrantup.com/
  3. Install VirtualBox https://www.virtualbox.org/wiki/Downloads
  4. Inside of your clone of ZF2VagrantBase, navigate to the vagrant directory
  5. Type vagrant up
  6. Once the machine is up and running, navigate to http://192.168.1.12
  7. Profit!!!

Note: On your first vagrant up you will download a ~400MB CentOS image. This will take some time. Every subsequent run of vagrant up will not re-download the image.

Configuration Files

Since the version bump to 1.1+ for Vagrant, there is a divergence from previous configuration files to the new configuration files. I have supplied a Vagrantfile_1 and a Vagrantfile_2 for use with this project. By default the contents of Vagrantfile are a direct copy of the contents from Vagrantfile_2. I have commented the proper configuration changes that need to be made in the Vagrantfile_1 if you are using Vagrant < 1.1.

Note: The version change has made things a little confusing. Try and default to using the default setup with Vagrant 1.1+ If that is not an option and you can not get things working on your computer, feel free to contact @gwagner85 on twitter.

There is also a configuration file located in the /vagrant/modules folder named Puppetfile. This file holds the configuration file to determine what puppet modules need to be downloaded to install your fully working LAMP stack with ZF2.

Unit Testing

Testing is pretty simple. Follow these steps if you plan on developing in the application module. If you are going creating your own module from scratch, use the application module as a template.

  • Run tests without code coverage
    1. In your terminal, navigate to your vagrant directory
    2. Run the following command vagrant ssh -c "sudo php /var/www/zf2/vendor/phpunit/phpunit/phpunit.php -c /var/www/zf2/test/phpunit-fast.xml"
  • Run tests with code coverage
    1. In your terminal, navigate to your vagrant directory
    2. Run the following command vagrant ssh -c "sudo php /var/www/zf2/vendor/phpunit/phpunit/phpunit.php -c /var/www/zf2/test/phpunit.xml"

Your testing log files will end up in PROJECT_ROOT/data/log

But, I wana use this with my project!!

You can take the vagrant directory right out of this project directly into your project and use it. Once it is on your project (and you have installed VirtualBox / Vagrant), navigate to your vagrant directory and run vagrant up from your terminal. It is very VERY portable that way. That will give you a VM running on YOUR existing project 👍

Note: You may need to disable the composer module from the zf2 module if you are not using composer in your project

Contributors

These contributors are in no particular order

Contributor Provided
Zend ZendFramekwork && ZendSkeletonApplication
HashiCorp Vagrant GitHub / Vagrant Website
VagrantBox CentOS 6.4 x86_64 Minimal (VirtualBox Guest Additions 4.2.8, Chef 11.4.0, Puppet 3.1.0)
Rodjek (Tim Sharpe) librarian-puppet
Jmather (Jacob Mather) Pointed me to librarian-puppet
Oracle VirtualBox
Puppet Labs Puppet
PHP PHP
Geoffrey Wagner ZF2VagrantBase

About

A pre-built mashup of ZF2 / Vagrant / VirtualBox that can get you setup to run and develop on ZF2 with partial zero configuration!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published