PHPDeveloper.org

Inhoud syndiceren
Up-to-the Minute PHP News, views and community
Bijgewerkt: 1 uur 39 minuten geleden

php[architect]: April 2014 Issue Released - Major Players

do, 24/04/2014 - 18:56

As is mentioned on the php[architect] site today, they've released their latest issue - the April 2014 edition, Major Players.

It's spring, and (here in the U.S.) the Majors are starting up! In sports, we all have our favorites- the ones we love, and the ones we love to hate. In PHP, we have the similar players- Drupal, WordPress, and Yii Framework (to name a few). Love them or hate them, you can't deny that they're Major Players!

Articles in this latest edition cover topics like:

  • Programmatically Control Drupal
  • Get Started with Joind.in
  • Advanced Authentication in Laravel
  • Fly with Phalcon

You can pick up your copy directly from the php[architect] website or you can always subscribe (with both digital and print options) for a full year.

Link: http://www.phparch.com/2014/04/april-2014-phparchitect-magazine-released-major-players/

PHPMaster.com: PHP News You May Have Missed

do, 24/04/2014 - 17:30

PHPMaster.com has posted some news you might have missed that's happened in the development and open source communities recently. In the post Bruno Skvorc covers updates to projects, resources and various online tools/environments related to PHP.

The last month or two have been chock full of small news and releases not warranting a full story in their own right but still interesting, I've decided to make a small compilation and direct your attention to the interesting developments around us. Just because we don't cover something immediately, doesn't mean we don't notice or care.

Included in the post are updates about:

  • Ubuntu 14.04. LTS
  • Google App Engine 1.9.1 - 1.9.3
  • Hack
  • Phalcon 2 beta 1
  • the Zend Framework 2 Certified Architect certification
  • Zend Framework 3 Progress

...and several more. Check out the full post for more information on these and several other recent happenings around the web.

Link: http://www.sitepoint.com/news-may-missed

Master Zend Framework: Running the ZF2Skeleton with PHP's Built-in Webserver

do, 24/04/2014 - 16:25

The Master Zend Framework site has posted the first in their screencast series with a look at running the ZF2Skeleton with PHP's built-in webserver.

In this screencast we'll go through the creating an application from the ZF2Skeleton project on Github and getting it up and running, using PHP's built-in web server. [It requires] PHP 5.4 or higher and Curl.

The screencast, coming in just over 3 minutes, briefly introduces you to the ZF2Skeleton project and shows you how to run it as a single process though PHP's own web server (useful for debugging). As a part of the installation, he also helps you get Composer installed as that's what Zend Framework 2 uses to install its packages correctly.

Link: http://www.masterzendframework.com/casts/001

Community News: Packagist Latest Releases for 04.24.2014

do, 24/04/2014 - 15:07
Recent releases from the Packagist:

Rob Allen: Injecting dependencies into your ZF2 controllers

wo, 23/04/2014 - 16:06

Rob Allen has a quick new post to his site showing you how to inject dependencies into controllers in a Zend Framework v2 based application.

When starting working with Zend Framework 2, it's common to copy the skeleton and put your controller definitions in module.config.php. The controllers keyword is picked up by the ControllerManager which is an instance of the ServiceManager which means that it creates the controller instance for you when the dispatcher needs it. As it's just a service manager, we configure it to inject the dependencies that the controller needs rather than having to go fishing for them later.

He shows how to write a "getControllerConfig" method to populate two items into the factory call for a "Blog" controller, blog mapper and content mapper classes. He also includes a reminder that ZF2 controllers have no constructor, so dependencies can be more easily injected and used directly in the class.

Link: http://akrabat.com/zend-framework-2/injecting-dependencies-into-your-zf2-controllers/

Community News: Packagist Latest Releases for 04.23.2014

wo, 23/04/2014 - 15:09
Recent releases from the Packagist:

Master Zend Framework: Howto Handle External Form Element Dependencies with FormElementManager

di, 22/04/2014 - 18:58

The Master Zend Framework site has posted a tutorial wanting to help you understand external form element dependencies with help from FormElementManager.

Zend Framework 2, like all great PHP frameworks, provides thorough infrastructure for creating forms in your application. Whether that's form objects, form elements, fieldsets, validation groups or that they interact with so many other components in the Zend Framework 2 default libraries. But how do you handle external dependencies? [...] So what if you need a custom form element in your application, one which will render a list of articles from a database table? [...] In today's post, we're going to look at how to create such a custom element, extending the existing select element.

He walks you through the steps you'll need to make the custom element and hook it into the FormElementManager for correct use:

  • Create a New Form Element
  • Implement the getFormElementConfig Method
  • Create a New Form Object
  • Instantiate the Form Via the FormElementManager

Code is included for each step of the way so you can ensure you end up with a working example.

Link: http://www.masterzendframework.com/zend-form/handle-external-form-element-dependencies-with-formelementmanager

SitePoint PHP Blog: Database Versioning with Ladder Migrations

di, 22/04/2014 - 17:48

The SitePoint PHP blog has posted another tutorial looking at database versioning (see this postfocusing on Ladder migrations. Ladder is a simple PHP-based way to write migrations with rollbacks in a clear, easy to read format.

Version control systems are invaluable for tracking changes in your code, particularly when you're working in a team. However, most applications don't consist solely of application code. Managing changes to the database has always been a little more challenging, particularly when you're adding new features which require changes to the schema. [...] One solution is to move responsibility for creating and modifying the database schema into code, using migrations. That way, changes can be managed along with the rest of your application, and features we take for granted in version control - such as being able to compare versions and keep an audit trail - can be used for database changes.

He introduces the Ladder tool briefly, shows how to get it installed/configured and gets into writing a first simple migration. It creates a "users" table with two columns and comes with both "up" and "down" methods to make rollbacks easier. Ladder also provides functionality for database seeding, pre-populating the database tables with sample data either from hard-coded values or from a CVS file.

Link: http://www.sitepoint.com/database-versioning-ladder-migrations

HipHop VM Blog: Compatibility Update

di, 22/04/2014 - 16:16

The HipHop VM blog has a new post today with some updates around the compatibility work they're doing getting popular PHP projects to work 100% on the platform (and have all unit tests pass).

Earlier this year we set an ambitious goal of passing the PHPUnit test suites of 20 popular frameworks by the end of June; at the time, we were passing on only 6! With a huge amount of help from the community (especially our OpenAcademy students), we're proud to have hit this goal more than 2 months early, and we have more frameworks expected to reach 100% shortly.

Included in their list of projects/frameworks are things like Assetic, Composer, Doctrine2, Guzzle (v3), Laravel, Mockery and Monolog. Now that they've made significant strides to get the HHVM up to a greater level of compatibility, they're going to focus in on the issues list from GitHub to resolve problems there.

Link: http://hhvm.com/blog/4841/compatibility-update

Community News: Packagist Latest Releases for 04.22.2014

di, 22/04/2014 - 15:02
Recent releases from the Packagist:

Community News: Latest PECL Releases for 04.22.2014

di, 22/04/2014 - 14:07
Latest PECL Releases:
  • opengl 0.8.0 - Initial PECL package release.

  • hrtime 0.4.3 - first public release

  • riak 1.1.5 Since 1.1.4 New: Object now allows contentEncoding, contentType, content and vTag to be set to NULL. Fixes issue 72: Riak HTTP stops working after update

  • swoole 1.7.0 - Fixed compile error.

  • protocolbuffers 0.2.6 Bumped up to 0.2.6 * fixed several compile warnings (thanks remi) [fixes] * (ExtensionRegistry) initialize class entry member when reallocating scheme.

ServerGrove Blog: Running Composer with HHVM, not so fast!

ma, 21/04/2014 - 19:46

On the ServerGrove blog today they share some interesting results when it comes to using Composer on a normal PHP install versus using it inside of a HHVM instance.

HHVM is an open-source virtual machine developed by Facebook and designed for executing programs written in Hack and PHP. It offers increased performance for PHP, most of the time. [...] Since Composer needs to perform some heavy computations in order to resolve the dependencies of a project, it makes sense to use HHVM. However, the heavy computations are mainly done when running composer update, or when the composer.lock file has not yet been generated so this is where you will see most of your gains in execution time.

With a bit more testing, this is shown to be true (about a 7 second difference). However, this is only on the "update". The "install" command actually takes longer inside of the HHVM instance, regardless of if the JIT (Just In Time) compiler is disabled or not.

Link: http://blog.servergrove.com/2014/04/17/running-composer-hhvm-fast

SitePoint PHP Blog: Database Versioning with DBV

ma, 21/04/2014 - 18:11

In this new post to the SitePoint PHP blog today Wern Ancheta introduces you to a tool that can help with database versioning, DBV. DBV is a tool developed by Victor Stanciu and made available on GitHub.

It's good practice to always use a version control system in any of your projects. Be it a side-project in which you are the only developer, or a team project where five or more people are working on it together. But the idea of putting your database into version control isn't really that widespread. Often times we take the database for granted. But like the source files in our project, the database is constantly changing too. That's why we also need a way to track the changes that we have made and easily share it to other members of our team. In this article we will take a look at DBV, a database version control system written in PHP for MySQL databases so you need to have PHP and MySQL installed before you can use it, along with a web server like Apache or Nginx.

He steps you through the installation (via an installer and configuration through the "config.php" setup file. The system keeps track of lots of different changes including new tables, updated field descriptions, additional views, stored procedures and functions. He includes some screenshots of the UI and goes through the workflow of adding new tasks and syncing with a remote database server.

Link: http://www.sitepoint.com/database-versioning-dbv/

Allan MacGregor: Flexible PHP Development with PHPFarm

ma, 21/04/2014 - 17:44

Allan MacGregor has a post today talking about a handy tool he uses in his development to have multiple versions of PHP running side-by-side: PHPFarm.

If you have been working with PHP for a while, chances are that you have come across with a project, extension or script that requires to be tested on multiple PHP versions, for simple CLI scripts this seems easy enough but what happens when you are working with complex applications, developing for frameworks or multiple versions of them? [...] This setup can quickly become cumbersome and it is not easily scalable. [...] Getting multiple PHP versions running side by side can be challenging and over the year devs have released multiple solutions like PHPEnv or the new , personally I use PHPFarm.

He walks you through the installation and configuration of the tool. He also shows you how to get a few different versions of PHP installed, including custom configuration files. He also includes a bit at the end of the post about getting it all to work with Apache (via mod_fastcgi and some custom configuration changes).

Link: http://coderoncode.com/2014/04/18/flexible-php-development-phpfarm.html

Community News: PHPUnit Announced End of Life on PEAR Installation Method

ma, 21/04/2014 - 17:29

There's a new addition to the GitHub wiki that's quite important for the PHPUnit users out there. Sebastian Bergmann has officially announced the end of life for the PEAR version of the installer for the popular PHPUnit tool.

Since PHPUnit 3.7, released in the fall of 2012, using the PEAR Installer was no longer the only installation method for PHPUnit. Today most users of PHPUnit prefer to use a PHP Archive (PHAR) of PHPUnit or Composer to download and install PHPUnit. Starting with PHPUnit 4.0 the PEAR package of PHPUnit was merely a distribution mechanism for the PHP Archive (PHAR) and many of PHPUnit's dependencies were no longer released as PEAR packages. Furthermore, the PEAR installation method has been removed from the documentation. We are taking the next step in retiring the PEAR installation method with today's release of PHPUnit 3.7.35 and PHPUnit 4.0.17.

Included in this end of life, they'll also be decommissioning pear.phpunit.de to happen no later than the end of 2014.

Link: https://github.com/sebastianbergmann/phpunit/wiki/End-of-Life-for-PEAR-Installation-Method

PHPClasses.org: Lately in PHP Podcast #46 - "Is the Hack Language Going to Replace PHP?"

ma, 21/04/2014 - 16:12

In the latest episode (#46) of the "Lately in PHP" podcast series Manuel Lemos and Arturs Sosins wonder if Hack will ever replace PHP.

The release of the Facebook Hack language has shaken the PHP community since it implements several frequently requested features that were never implemented, many users are considering to drop PHP in favor of Hack. This was one of the main topics discussed by Manuel Lemos and Arturs Sosins on the episode 46 of the Lately in PHP podcast. They also talked about the OpenSSL Heartbleed security bug may affect PHP sites or not, ideas for the PHP 6 engine, the need for an official PHP specification, and an advanced email validation that can provide suggestions for address typos like Google did you mean feature.

You can catch this latest episode either through the in-page audio player, by downloading the mp3 or by watching the video of the live Google Hangout recording.

Link: http://www.phpclasses.org/blog/post/232-Is-the-Hack-Language-Going-to-Replace-PHP--Lately-in-PHP-podcast-episode-46.html

SitePoint PHP Blog: Getting Started with PHP Underscore

do, 17/04/2014 - 20:50

The SitePoint PHP blog has a new article posted showing you how to get started with Underscore, a PHP library ported over from Javascript's popular Underscore.js library with many of the same methods intact.

If you've ever used the Backbone framework for JavaScript, you'll already be familiar with Underscore. Indeed, it's become incredibly useful for JavaScript developers in general. But did you know that it's been ported to PHP? [...] Underscore describes itself as a "utility belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects. It's the tie to go along with jQuery's tux, and Backbone.js's suspenders."

He starts by showing you how to get it installed and some of the basic syntax of the methods it defines (basically replace the period with the double-colon) for both the procedural and OOP handling. He shows examples of a few of the more handy methods it provides including:

  • Each
  • Pluck
  • Minimum and Maximum
  • Filter and Reject
  • sortBy
  • groupBy

...and many more. There's also a bit of talk about templating and extending the library via "mixins".

Link: http://www.sitepoint.com/getting-started-php-underscore/