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

SitePoint PHP Blog:
Phinx – the Migration Library You Never Knew You Needed
Jun 02, 2016 @ 13:15:36

The SitePoint PHP blog has posted a tutorial about the migration library you never knew you needed for your PHP applications - Phinx (for database migrations).

You’re building an application, and you need to share the database’s structure with your team. After all, you want everyone to be up and running as soon as possible. What do you do? SQL dumps of table structures? You could… but that’s so very primitive – and can be time consuming to import, too! More often than not, database migrations are the answer.

In this tutorial, we’ll go through a framework-agnostic package for building and executing database migrations called Phinx.

He starts by helping you get the tool installed via Composer and initializing your environment for migrations and seeds. He covers the configuration of the tool via a simple YAML file and the creation of first migration files based on an existing table structure. He walks through the code involved to create the tables, add indexes and foreign keys. He shows how to run the migrations, gives an example of the error output and modifying the current database structure.

tagged: migration phinx library tutorial agnostic introduction

Link: https://www.sitepoint.com/phinx-the-migration-library-you-never-knew-you-needed/

Reddit.com:
Any ideas on what "MVC agnostic" PHP code is?
Feb 06, 2014 @ 10:43:59

On Reddit.com there's a recent post that asks for a bit of clarification about the term "MVC agnostic" as said by a potential employer:

A potential employer wanted to see some of my code before an interview. They originally asked for MVC or OO PHP that I'd written in the last 30 days - fair enough. [...] They've come back to me (via the recruitment agent) asking for some "MVC agnostic code" as no one on staff has worked with codeignitor before. Any ideas what they mean by this as I'm slightly stumped.

Most of the responses to the post suggest something that's becoming more and more of a trend in PHP development lately - framework agnostic development. Basically, this is creating functionality (usually in packages) that can be dropped into any application and used independently.

Other comments suggest other possible definitions like:

  • "This is the first time that I have heard someone mention "MVC agnostic" and on the face of it I would question their own understanding of the phrase."
  • "Yeah, the key bit in your question there was 'via a recruitment agency'. Half of the time, they haven't got a clue about the industry and so jargon gets tossed about something awful."
  • "I think it's more accurate to say that what they want to know is that you actually know PHP, and not merely a set of tools on top of PHP that make you productive in the way you prefer."
tagged: mvc agnostic framework opinion package development example

Link: http://www.reddit.com/r/PHP/comments/1x2xea/any_ideas_on_what_mvc_agnostic_php_code_is/

Stuart Herbert's Blog:
Introducing phix
Mar 21, 2011 @ 08:24:05

In a new post to his blog Stuart Herbert has introduced phix, a packaging tools that can be used to manage and install different components in a framework-agnostic sort of way.

phix is a small command-line tool for PHP applications. I created it to fix (pun intended) the problem of how to easily automate the tasks involved in creating and (especially) maintaining components. These tasks aren’t built into phix; they are commands that ship with the phix distribution. You can create your own commands to run inside phix too, and it’s easy to do so

The phix tool (easily installed from PEAR) lets you either use built-in commands or custom ones to manage libraries with a few different kinds of commands - current status, initialize a library, upgrade a library and manage the full web application. As of the time of this post, the current version is phix-0.10.4.

tagged: phix library management commandline cli framework agnostic

Link: