Skip to content

Instantly share code, notes, and snippets.

@GeeH

GeeH/email.md Secret

Last active February 3, 2016 15:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save GeeH/3d03d3dae3345bcb09f0 to your computer and use it in GitHub Desktop.
Save GeeH/3d03d3dae3345bcb09f0 to your computer and use it in GitHub Desktop.

Hello Tutorial Attendees!

It's nearly time for SunshinePHP, and I hope you're as excitied as I am to get going. This is just a quick note to let you know what you can do to prepare your development environment for the ZF2 Done Properly tutorial.

The absolute minimum you need will be PHP 5.5 and MySQL server. Along with some way of editing PHP files (I'll be using PhpStorm if you want to play along), you'll be good to go. It would be amazing if you could fork and clone the repo we'll be working with from GitHub before Monday, you'll find it here - https://github.com/GeeH/bad-puppy.

An ideal situation would be if all attendees had a working copy of the Wolrd application running locally and ready to refactor before the start of the tutorial. If you can't get that working, don't worry! I'll bring copies of the code with me and providing you have PHP 5.5 or greater, and MySQL installed you'll be fine.

If you want to get the app running before the tutorial follow these steps:

  • git clone https://github.com/GeeH/bad-puppy (or your own fork)
  • edit the database credentials in config/autoload/database.global.php to have the credentials for your database
  • import the data/dump.sql into your database
  • you can run the application from cli - make sure you're in the root of the application directory, and run php -S 0.0.0.0:8080 -t public/ public/index.php
  • you should see the application running with a list of countries when you visit http://0.0.0.0:8080, like this http://c.hock.in/2f7587.png

Good luck, and I'll see you next Monday!

Gary

@adamlundrigan
Copy link

I tried using the bundled Vagrant manifest but it's missing the MySQL server. This diff will fix it:

diff --git a/Vagrantfile b/Vagrantfile
index 38d0bec..c415ceb 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -5,8 +5,12 @@ VAGRANTFILE_API_VERSION = '2'

 @script = <<SCRIPT
 DOCUMENT_ROOT_ZEND="/var/www/zf/public"
+export DEBIAN_FRONTEND=noninteractive
+apt-get install -y debconf-utils
+debconf-set-selections <<< 'mysql-server mysql-server/root_password password '
+debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password '
 apt-get update
-apt-get install -y apache2 git curl php5-cli php5 php5-intl libapache2-mod-php5
+apt-get install -y apache2 git curl php5-cli php5 php5-intl php5-mysqlnd libapache2-mod-php5 mysql-server
 echo "
 <VirtualHost *:80>
     ServerName skeleton-zf.local
@@ -26,6 +30,10 @@ service apache2 restart
 cd /var/www/zf
 curl -Ss https://getcomposer.org/installer | php
 php composer.phar install --no-progress
+
+echo "create database world" | mysql -u root
+mysql -u root world < data/dump.sql
+
 echo "** [ZEND] Visit http://localhost:8085 in your browser for to view the application **"
 SCRIPT

...or I can send a PR to the repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment