Who am I? ● Werner M. Krauß ● Living in Bad Ischl, Austria ● wmk on slack ● PHP since 1998 ● Freelancer since 2006 (netwerkstatt) ● Silverstripe since 2009 (V 2.3) ● Creator of www.silverstrip.es
What’s this talk about? ● My development setup ○ PHPStorm ○ Vagrant ○ Derk’s TwistedBytes Vagrant box ● Cool settings to ease the daily development tasks ● Tips and tricks
Pros and Cons + easy set up virtual machine for local development + same development environment for the whole team + many ways to configure it + preconfigured boxes with huge functionalities - slow shared folder on windows - upgrading the box destroys it’s database
What do we need? ● PHPStorm / Intellij Idea ● VirtualBox and Vagrant ● Hostmanager plugin for nice local URLs ● TwistedBytes’ webserver box aka DerkBox(box templates)
PHPStorm Vagrant tools ● The IDE can control and communicate with the VM ● Shortcuts for starting, stopping, suspending, resuming, reloading and destroying the VM ● can easily connect to the VM and configure paths, PHP interpreter, composer, PHPUnit etc...
Box Configuration ● a bunch of config files in different directories ● configure webserver root and https ● install additional packages ● Switch PHP versions on the fly ● Switch xdebug on and off ● import/export databases ● folder for PHPMyAdmin’s database imports
Built in DB import & export ● can be triggered from vagrant/private/ mysqldump-trigger.conf and mysqlload-trigger.conf ● saves and loads dumps in own folder
Composer ● manage packages on the box ● Installs via remote interpreter on the box ● no need to match the local PHP version ● caveat: github token for composer might be needed
Xdebug ● Cannot live without it ● Easy mapping with PHPStorm ● Slows down PHP Interpreter ● Can be switched off in the box if not needed (e.g. for frontend work)
remote tools run commands on the vagrant box with one click ● flush caches ○ use “silverstripe-cache” folder in project root ● vendor expose ● dev/build ● sake