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

Dutch Web Alliance:
Capifony, Continuous Deployment and Symfony's parameter.yml
December 15, 2014 @ 12:10:50

On the Dutch Web Alliance site today they've posted a tutorial about their use of Capifony for Symfony application deployment and how it relates to updating the "parameter.yml" file. They describe their current deployment process, how it works with the different environments and how they solved the one manually problem they had.

The actual deployment is thus dealt with by capifony. This is a plugin for capistrano written for deploying Symfony applications. [...] Capifony automatically deals with cloning the correct branch on the servers, installing dependencies through composer, migrating database versions etc etc. Basically we don't have to care about anything else. However, there is one single thing that still keeps on bugging us: when we want to upgrade to a new parameters.yml, we must do this manually. This means that our builds will break when we deploy a version that requires an updated parameters.yml until we manually solve the issue.

To get around this manual issue, they decided on creating a new Capifony task that does an upload/download of the parameters file, depending on the environment.The continuous deployment can then push or pull the file as needed in a more automatic way.

0 comments voice your opinion now!
continuous deployment paramatersyml configuration capifony capistrano task

Link: https://dutchweballiance.nl/techblog/capifony-continuous-deployment-symfonys-parameter-yml/

SitePoint PHP Blog:
PHP Job Interview Task Day of Week Calculation
January 09, 2014 @ 12:14:56

Sometimes during an interview it's difficult to determine the skill set of the person on the other side of the table. One solution to this that's become popular is asking the developer to perform a task of your choosing and watching how they work out the problem. In this new post to the SitePoint PHP blog Bruno Skvorc shares one suggestion for this kind of test - a day of week calculation.

Not so long ago, I was given a job interview task. I was to write a function which deduces the day of the standard 7-day week of ANY calendar (even an imaginary one), provided I know how often leap years happen, if at all, how many months their year has, and how many days each month has. This is a fairly common introductory job-interview task, and in this article I'll be solving and explaining the math behind it.

His task was, given any kind of calendar definition (not necessarily the Gregorian), figure out what day of the week a certain month/day/year combination would fall on. He walks through the entire code to solve the problem, including a bit to output the resulting calendar to an HTML table for each month.

0 comments voice your opinion now!
interview task dayofweek calculation tutorial

Link: http://www.sitepoint.com/php-job-interview-task-day-week-calculation

SitePoint PHP Blog:
Introduction to Gearman - Multitasking in PHP
November 04, 2013 @ 13:23:11

The SitePoint PHP blog has posted an introductory tutorial showing you how to use Gearman in PHP to handle multitasking outside of the normal script execution. Gearman is an external job server that lets you schedule scripts and tasks for execution.

How many times have you developed a web application that had some functionality which would benefit from running an external program or even forking a separate process? This is not something you generally like to do from your web app because you want to make it run as fast and efficient as possible, while keeping the site functional for end users. So how do we get a fast but full-featured application that can process more than the average app we're used to?

They start by introducing you to Gearman - the server side - and how it works to handle a large amount of jobs quickly (50 thousand per second according to the article). They give the example of resizing images uploaded by users to illustrate. Next up is the installation - first Gearman then on to the PHP side, installing the PECL extension and adding it to the php.ini configuration. An example script is also provided showing how to create a new connection to Gearman and configure the callbacks for handling status changes. They also include adding two kinds of tasks - a normal one and a low priority one.

0 comments voice your opinion now!
tutorial gearman introduction install configure process task

Link: http://www.sitepoint.com/introduction-gearman-multi-tasking-php/

SitePoint PHP Blog:
Running Tasks in the Cloud with IronWorker
September 13, 2013 @ 10:37:09

On the SitePoint PHP blog today there's a new tutorial showing you how to run tasks "in the cloud" using PHP and the Iron Worker service.

In this article I'm going to show you how we can use IronWorker to run code in the Cloud, just as if it were being run inside our PHP application's code. There are a number of advantages to running tasks in the cloud, for example: processor-intensive tasks can be offloaded from your web server, better fault tolerance and the execution of your code isn't blocked waiting for long-running tasks

The tutorial uses a Ruby-based CLI tool and this PHP Package to setup and execute the tasks. They walk you through the creation of a first task script and help you create the ".worker" file it needs to execute. With the IronWorker PHP package, you can quickly create these workers and configure things like schedule, data to send or - as their last example shows - send emails directly from the worker.

0 comments voice your opinion now!
ironworker cloud task execution ironio

Link: http://www.sitepoint.com/running-tasks-in-the-cloud-with-ironworker/

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


PHPMaster.com:
Zend Job Queue
January 13, 2012 @ 08:37:31

In this most recent post to PHPMaster.com Alex Stetsenko takes a look at the Zend Job Queue functionality, a part of the Zend Server installation. He talks about some basic usage to make HTTP requests and a more extended example showing report generation.

Web applications usually follow a synchronous communication model. However, non-interactive and long-running tasks (such as report generation) are better suited for asynchronous execution. One way to off-load tasks to run at a later time, or even on a different server, is use the Job Queue module available as a part of Zend Server 5 (though not as part of the Community Edition). Job Queue allows job scheduling based on time, priority, and even dependencies

In his two examples, he shows the code involved to create a new Queue object and define a HttpJob in it. The first just calls a "sample.php" script that's exposed as a part of your external-facing site and shows how you can get the current status of the job. The more advanced example shows a call to a "report.php" script with a set of options defining things like "type", "length" and "priority". He also points out some other options that can do similar things like Gearman, NodeJs and RabbitMQ.

0 comments voice your opinion now!
zend job queue zendeserver tutorial task status


Tom Schlick's Blog:
Wrench for FuelPHP
November 30, 2011 @ 12:40:57

Tom Schlick has a new post to his blog talking about a tool he's written for FuelPHP-based applications called Wrench. It's a command-line tool to make taking your site "offline" simpler.

If you have been following what I've been up to lately you would see that many of my recent projects are based on FuelPHP. Since Fuel is so awesome and allows you to create "packages" that can be dropped into your application, I have created a few that help me quickly piece together apps. The first package I'm "releasing" is called Wrench.

The tool works with the oil command-line tool already included in the framework to swap out the default action with a "Down for Maintenance" message. It will look at the current state of the app and switch it to the opposite when run, but you can also define "start" and "finish" manually if you'd like. You can find the source for the package on Tom's github account.

0 comments voice your opinion now!
wrench site maintenance message tool task fuelphp framework


Josh Adell's Blog:
Phar Flung Phing
September 26, 2011 @ 10:05:37

Josh Adell has posted about a bit of automation he set up with Phing and PHP's phar packaging to create an archive as a part of his build system. It's a simple five step process mad even easier by the fact that Phing already has a PharPackage task.

One of the cooler features of PHP 5.3 is the ability to package up a set of PHP class files and scripts into a single archive, known as a PHAR ("PHp ARchive"). [...] I decided to see how easy it would be to wrap up Neo4jPHP in a PHAR for distribution. [...] Since I also started playing with Phing recently, I decided to see if I could incorporate packaging a project as a PHAR into my build system. It turns out, it's pretty easy, given that Phing has a built-in PharPackage task.

He points you towards Phing's PEAR channel to get the tool installed and includes a command-line call to update your php.ini to allow PHP to generate phar files. Code is included to create the phar-generation stub as well as the XML for the Phing build file. You can find his end result here.

0 comments voice your opinion now!
phar package archive neo4jphp tutorial build task phing


Sander Marechal's Blog:
A YuiCompressorFilter for Phing
August 02, 2011 @ 09:16:37

Sander Marechal has been working with Phing in some of his recent development and has created something useful for compressing Javascript and CSS files on the deployment of your application - a YuiCompressor task.

I am going to write several useful extensions, the first of which is a YuiCompressorFilter. Phing already has support for a JavaScrip minifier in the form of the JsMinTask, but the yui-compressor is more useful. Not only does it usually compress better than JsMin, it can also compress CSS files. Also, because my YuiCompressor extension is implemented as a filter instead of a task you can do fancy things like minifying and concatenating files in a single step.

He includes both a sample of the task and it's configuration (the XML) in the post as well as a link to its source over on github.

0 comments voice your opinion now!
javascript compress phing task css


PHP and Me Blog:
Use Phing to Update your SVN-Version-Controlled Website Automatically, Through FTP
June 20, 2011 @ 11:57:15

On the "PHP and Me" blog there's a new entry from Pinpin Bysma showing how to use the PHP-based deployment tool Phing to update your production website via an FTP connection, automated by a Phing build.

If you're working on a PHP project, like with any other project, probably comes a time when you need to "build a new release," e.g. update the production web site with the latest version of the code. And doing the whole thing manually isn't the most efficient way to get things done, especially if you're lazy, or have to do that every once in a while, over a long period of time. [...] Obviously if updating the site itself could be done without FTP but through a simple svn switch, things would be easier. Still, Phing would allow to make things easier just as nicely. It could for example still be used to create the new tag, trigger the switch, etc

He introduces the process by showing a basic Phing build file that uses the PEAR VersionControl_SVN component to get the latest from the repository and push it to another directory. There was one thing that he wanted to do that the default SVN task couldn't - export the difference between two tags. To make this happen, he had to extend Phing and make a new task - SvnExportDiff. He includes the code for this new task and an updated build file to show it all in use - complete with the FtpDeploy to push the code live.

0 comments voice your opinion now!
phing tutorial svn website deploy ftp custom task



Community Events





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


release framework composer podcast security introduction interview opinion artisanfiles conference voicesoftheelephpant language version laravel community symfony library tool list series

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