Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen:
Using Phing to SSH into a Vagrant box
Nov 25, 2014 @ 16:22:55

In a quick new post to his site Rob Allen shows you how to have Phing SSH into a Vagrant box as a part of the VM creation process. In his case, he uses it to run database migrations.

Now that I've started using migrations, I've discovered a minor irritant. I run this project on a Vagrant VM and have discovered that I keep forgetting to ssh into the vagrant box before running the migrations script. The obvious solution is to automate this and I decided to use Phing to do so.

He walks through the installation of the libssh2 software (if you don't already have it) and the ssh2 PHP extensionSshTask to make the connection as the "vagrant" user and execute the given PHP command.

tagged: vagrant ssh phing migrations automate tutorial vm virtualmachine

Link: http://akrabat.com/php/using-phing-to-ssh-into-a-vagrant-box/

FuelPHP:
Oil Migrations, Tasks and Console (Screencast)
Mar 15, 2011 @ 16:31:39

Phil Sturgeon has put together a screencast showing off a few of the features of the Fuel PHP framework like migrations, tasks and the console the Oil tool provides.

In this video I'm going to be demonstrating migrations which I touched on in the last video but I felt I should go into them in more depth. Migrations [...] are essentially a way to stage changes for your database in a way that means the changes can be independent from the schema as a whole.

He walks you through the creation of a migration with the help of the Oil command line tool. The generated classes include "up" and "down" methods for the creation and rollback of your changes. He shows the process to create a simple task and how to use the built-in console to interactively work with the framework. You can find out more about Fuel on the Fuel documentation section of the project's site.

tagged: fuelphp framework oil console commandline tasks migrations

Link:


Trending Topics: