News Feed
Sections




News Archive
feed this:

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

Stephan Hochdörfer:
Running PHPUnit via Phing on HHVM
February 26, 2015 @ 09:16:58

Stephan Hochdörfer has a quick post showing how he has PHPunit up and working on an HHVM instance. His problem was that the tests were actually executing using the "php" binary, not the HHVM one.

For quite some time we run the unit tests for our libs and tools against PHP and HHVM, at least that is what I thought up to now. As it turns out I missed a minor detail. [...] What happens now is that Phing is executed via HHVM but PHPUnit will still be executed via the PHP binary because the PHPUnit shell script will look for the php binary in the PATH configuration. Since we run HHVM side-by-side with PHP on our Jenkins build nodes I was not able to point /usr/bin/php to /usr/bin/hhvm - which would be the easiest and cleanest solution. I

He shares the workaround he created, creating a symbolic link between the hhvm and php binaries and then executing the Phing task to run the tests. This is being run via Jenkins and uses it's "WORKSPACE" as a container so the main "php" binary isn't overwritten.

0 comments voice your opinion now!
hhvm phpunit test unittest execute binary path jenkins phing task

Link: https://blog.bitexpert.de/blog/running-phpunit-via-phing-on-hhvm/

Stephan Hochdörfer:
Defining Phing Tasks in PSR-0 style
January 23, 2015 @ 10:42:49

In his latest post Stephan Hochdörfer shows you how to define Phing tasks according to the PSR-0 autoloading format. Phing is a PHP-based automation tool that uses an XML configuration to execute a series of tasks.

Before anybody complains: I know that "as of 2014-10-21 PSR-0 has been marked as deprecated. PSR-4 is now recommended as an alternative." - Anyway I still think this little gem makes sense to be shared because a lot of people are probably not aware of it. I recently found out by accident that it is possible pass a task name in PSR-0 style to the "taskdef" task. In the old days you had to use the Java-like dot-style notation like this and also define the classpath to make sure the class could be loaded correct! This is ok if the task resides in the same project. If the task is located in a dependent package loaded via Composer this can get ugly.

The post is quick but provides two very handy code examples, one showing the old "dot notation" version and the other showing how to make use of the autoloader. The trick is in the classname value and using the full namespace/class name rather than the dot notation.

0 comments voice your opinion now!
phing build task psr0 classname path autoload

Link: http://blog.bitexpert.de/blog/defining-phing-tasks-in-psr-0-style/

Vic Cherubini:
Expert PHP Deployments
December 03, 2014 @ 12:04:22

Vic Cherubini has a recent post on his site sharing for free the contents of a book he'd written previously about "Expert PHP Deployments":

In 2013 I wrote and self-published a book titled "Expert PHP Deployments". While it was not a smashing success, it sold enough copies to pay for itself, and I was happy to have a published book to my name. Unfortunately, I have not had time to market it, update it, or further improve it, so I am giving it away for free. You can read the book in its entirety below or download it as a PDF.

The book covers a wide range of topics related to deploying PHP applications including:

  • Environment configuration (setting up Vagrant for the developers)
  • Working with the Phing automation tool
  • Building deployments with Capistrano
  • Creating and configuring a production server
  • Ensuring the security of the server
  • Making the actual deployment

The post has the full text of the book in one page but you can grab the PDF if you prefer that format.

0 comments voice your opinion now!
expert deployment book free vagrant phing capistrano tutorial

Link: https://leftnode.org/posts/expert-php-deployments.html

Rob Allen:
A few Phing tips
December 02, 2014 @ 10:40:07

Rob Allen has shared a few Phing tips in the latest post to his site today. Phing is a PHP-based automation tools most popularly used for the deployment and configuration of PHP applications.

Following on from my last post, here's a few other Phing things that I've found helps me.

He shares three short but useful tips:

  • Hiding targets from Phing -l
  • Main target vs subtarget
  • List available targets by default

Each tip includes the XML markup you'll need to make it functional. You can find out more about Phing and what it's capable of on its website.

0 comments voice your opinion now!
phing tips hide target subtarget available list

Link: http://akrabat.com/php/a-few-phing-tips/

Rob Allen:
Using Phing to SSH into a Vagrant box
November 25, 2014 @ 10: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.

0 comments voice your opinion now!
vagrant ssh phing migrations automate tutorial vm virtualmachine

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

Lorna Mitchell:
Using Phing with Travis CI
July 18, 2014 @ 11:23:45

Lorna Mitchell has a quick post to her site today showing you how to link up Travis-CI and phing to execute the phing build on the Travis-CI service.

We've started using Travis CI on one of my projects to run some build processes to check that everything looks good before we merge/deploy code. One thing I ran into quite quickly was that I wanted to install phing in order to use the build scripts we already have and use elsewhere, but that it isn't provided by default by Travis CI.

To get it all cooperating, she uses the "before_install" settings/functionality Travis provides to use PEAR to discover and install phing. Then in the "script" section, the build can call the phing executable without problems. She does point out one "magic" kind of thing that rehashes the Travis environment and lets to know phing exists: the...well..."rehash" configuration setting.

0 comments voice your opinion now!
phing travisci beforeinstall tutorial build process

Link: http://www.lornajane.net/posts/2014/using-phing-with-travis-ci

Lukasz Kujawa:
Deploying PHP applications with Phing
April 11, 2013 @ 11:44:43

Lukasz Kujawa has a new post to his site introducing you to deployment of your web-based PHP applications using the Phing build tool.

How many steps are required to deploy your software? Some people say it shouldn't be more than one. I'm little bit more relaxed about it so I would say two steps are still fine. If it takes more than two then most likely you need a build script. [...] Phing is a PHP project build system or build tool based on ​Apache Ant. You can do anything with it that you could do with a traditional build system like GNU make. It use simple XML build files and extensible PHP "task" classes.

He shows how to get it installed via Composer and how to create a simple "build.xml" file with a few targets inside. He shows how to use the "build.properties" configuration file and how to set them from the command line if needed. He also includes details on doing database migrations using the "dbdeploy" tasks.

0 comments voice your opinion now!
deployment phing deployment application introduction

Link: http://systemsarchitect.net/deploying-php-applications-with-phing

Lorna Mitchell:
First Phing Plugin
March 25, 2013 @ 10:49:23

In the latest post to her site, Lorna Mitchell walks you through the creation of a first Phing plugin, an extension to the popular PHP-based build tool.

I'm a huge fan of Phing and use it regularly for build and deployment tasks. Often, I'll ask about a plugin that I wish existed, and get a very courteous "patches welcome" from the nice people in the #phing channel on freenode. This has happened a few times, so I thought I should probably look at how to make a new phing plugin, this article shows you how to make the simplest thing I could think of: a simple "hello world" plugin.

She points you to the location to grab the latest version of the tool (the github repository) and how to define a configuration file for your test runs. Then she includes the sample code showing how to create the "HelloTask" plugin. It takes an input value of "name" and displays a greeting when executed. She shows the syntax for defining this in the XML build file and the sample result when executed.

0 comments voice your opinion now!
phing plugin install build configuration xml helloworld task


Andrew Podner:
Managing PHP Application Builds with Phing
February 04, 2013 @ 09:08:16

Andrew Podner has a new post to his site today introducing you to Phing, a PHP-based build tool (designed after on Apache Ant) that makes automating builds of your applications easy.

One of the things I have been focusing on lately is trying to to a better job of mechanizing and automating the process of building and deploying an application. The reason for this is pretty simple: applications just seem to keep getting more and more complicated and intricate as time goes on. [...] Phing is a "project build system" that helps developers manage repetitive tasks associated with preparation and deployment of applications. Phing uses XML based files to allow you the ability to customize the build process to the individual application.

He walks you through the Phing installation (from PEAR, note that you can install it via Composer now too) and how to set up your first project XML definition. He shows you how to add a "target" or step to the build with the basic example of running your app's PHPUnit tests. He also includes a list of other things Phing can do and work with including CodeSniffer checks, FTP handling, version control interfaces and automated documentation.

0 comments voice your opinion now!
application build phing tool introduction phpunit targer xml


Grzegorz Godlewski's Blog:
Automating software development and deployment
June 21, 2012 @ 11:10:17

Grzegorz Godlewski has a new post to his blog that looks at some of the concepts and practices around automated software deployment and development (specifically with Phing).

Phing is a tool designed for automated project building based on Apache Ant distributed as a PEAR extension. It provides the user with the possibility of building the project / application in the same manner as make does with its Makefiles, making complex process execution (which is commonly human error prone) much easier.

He walks you through the steps for getting Phing set up, the directory structure you'll need for your project and a sample build and property files as well as an example of the output from the build execution. He talks about filters, execution control, extensibility and looks at some of the things that he suggests automating.

0 comments voice your opinion now!
automate deployment development phing tutorial



Community Events

Don't see your event here?
Let us know!


framework programming list yii2 composer php7 language laravel application example symfony api interview series opinion community project introduction part2 podcast

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework