Community News: Packagist Latest Releases for 10.18.2014

Recent releases from the Packagist:

PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

NetTuts.com: Laravel, BDD And You: Let’s Get Started

On NetTuts.com they’ve kicked off a new series of tutorials teaching you about Laravel development but using the principles and testing of behavior-driven development (BDD). In this first part of the series they get you started with the basic environment and a few simple tests.

Welcome to this series about developing Laravel applications using a behavior-driven development (BDD) approach. Full stack BDD can seem complicated and intimidating. There are just as many ways of doing it as there are developers. In this series, I will walk you through my approach of using Behat and PhpSpec to design a Laravel application from scratch. There are many resources on BDD in general, but Laravel specific material is hard to find. Therefore, in this series, we will focus more on the Laravel related aspects and less on the general stuff that you can read about many other places.

He talks about what it means to “describe behavior” versus other kinds of testing and introduces the sample application they’ll be creating to show these principles: a time tracker. Following this, they help you install the needed tools (via Composer) and initialize the directory to be ready for the Behat/Phpspec tests you’ll create. An example of a basic Feature is included, testing the initial Laravel “Welcome” page it defaults to and how to execute it. Finally, following the ideals of BDD, they show how to implement the “Given I am logged in” step first in the test then in the Laravel application.

Link: http://code.tutsplus.com/tutorials/laravel-bdd-and-you-lets-get-started–cms-22155
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , | Hinterlasse einen Kommentar

SitePoint PHP Blog: How to Use PHPbrew and VirtPHP

Phil Sturgeon has written up a new tutorial for the SitePoint PHP blog showing you how to use PHPbrew and VirtPHP to be able to work with more than one PHP version on the same system.

We’ve all been in the situation where we have one version installed. Maybe that version is whatever came installed on our operating system. Maybe it is a version bundled into MAMP/WAMP/XAMPP. How do you go about switching that PHP version? How do you switch to one version, then switch back again? How do you go about switching that version of PHP, but only for one single application on your computer? The Ruby and Python communities have had tools for dealing with this for years. PHP has them now too, but there was nowhere near enough fanfare.

He starts with PHPbrew and walks you through a basic install and configuration of a version of PHP 5.6.0. He shows how to add extension support and switch between the different PHP versions at will. Next comes the look at VirtPHP, a similar system that takes a little bit different approach. It creates “environments” that contain the PHP version to a bit more isolated setup. With an environment created, VirtPHP lets you install PECL extensions without changing anything globally. He ends the post with a comparison to how most developers (developing locally) handle their setup and mentions Vagrant, but notes that it may be a bit much for the solo developer.

Link: http://www.sitepoint.com/use-phpbrew-virtphp/
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , | Hinterlasse einen Kommentar

Community News: Packagist Latest Releases for 09.28.2014

Recent releases from the Packagist:

PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

Evert Pot: Accessing protected properties from objects that share the same ancestry.

In his latest post Evert Pot shows an interesting side effect of working with two objects from the same class: accessing protected properties from one instance to the other.

I realized something odd about accessing protected properties the other day. It’s possible in PHP to access protected properties from other objects, as long as they are from the same class. [...] I always thought that protected strictly allows objects to access things from the current inheritence tree, but didn’t realize that this also extends to other instances of the same object.

He includes a bit of sample code showing two object instances each being able to access the protected “val” property from the other. He also shows an example of how it works in two different objects, both that derive from a common ancestor. He shares a few other code examples showing this relationship and points out a few places where it could come in handy.

Link: http://evertpot.com/properted-properties-from-shared-ancestry/
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , , , , , | Hinterlasse einen Kommentar

Marc Morera: Bye Bye Symfony

In his most recent post Marc Morera says bye bye to Symfony and “hello to PHP”. Confused? His point is that using the Symfony components as a whole in the framework isn’t the only option anymore. You can use them just as effectively as pieces of a larger PHP project, puling them in as needed.

The reason of this post is just to tell you, with a simple example, how to say Bye Bye, Symfony! and say Hi PHP!. This really means uncouple from Symfony Components and still use them as the default implementation, while we can securely remove, from the composer require block, our Symfony dependencies.

He starts off with a simple example showing how to use Symfony’s “UrlGeneratorInterface” to create a URL output class that can be injected to use in the route handling of the application. He then moves on to a more real-life example (a metaphor) using a USB connection and the adapters/cables that could be involved to connect various devices. He then shifts back over to the world of code and describes a specification interface that can be used with the URL generation and remove the Symfony dependency from it. On top of this he builds an adapter object that brings the Symfony component back into the picture and abstracts it out a level to make for more flexibility and testability in the long run.

We win maximum implementation flexibility and minimum coupling. Would be wise to say that a PHP project should tend to this thought, but once again, it depends on many factors. [...] Using ports and adapters is really a great tool for those who want to uncouple from implementations and a great pattern if you develop open source. Open source should satisfy as people as possible, so remember, specify and then implement.

Link: http://mmoreram.com/blog/2014/09/01/bye-bye-symfony/
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , | Hinterlasse einen Kommentar

Community News: Packagist Latest Releases for 08.31.2014

Recent releases from the Packagist:

PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

Engine Yard Blog: Engine Yard Is Sponsoring Composer

According to this new post to the EngineYard blog, they’re announcing their formal sponsorship of a tool that has revolutionized the way PHP libraries and packages are used: Composer.

Open source is a big deal at Engine Yard. Originally founded as a Ruby company, most of our early work was in the Ruby community. Since acquiring Orchestra in 2011, we have been investing in the PHP commmunity and are continually on the look out for ways to give back. So I’m thrilled to be sharing the latest news on this front. [...] We care a lot about PHP and we want to continue our mission of supporting key pieces of infrastructure in the communities we serve.

Their support is coming in the form of a community grant provided over the next twelve months. This fund ($ 15k) will provide support for the continued development of the project and Nils Adermann, one of Composer’s principal developers.

Link: https://blog.engineyard.com/2014/engine-yard-sponsoring-composer
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , | Hinterlasse einen Kommentar

Community News: Packagist Latest Releases for 08.23.2014

Recent releases from the Packagist:

PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

Voices of the ElePHPant: Interview with Beth Tucker Long

The Voices of the ElePHPant podcast has posted their latest episode, another in their series of community interviews. This time it’s with Beth Tucker Long, an organizer of the Madison PHP Conference and former editor of the php[architect] magazine.

They talk some about her plans for the future (post-php[architect]), how she’s trying to get back into coding. She talks about her mentor, Beau Simenson, and the consulting work she has going on. They also talk some about the Madison PHP User Group and Conference and the other organizers.

You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. If you like what you hear, be sure to subscribe to the feed and get the latest episodes as they’re released.

Link: http://voicesoftheelephpant.com/2014/08/12/interview-with-beth-tucker-long/
PHPDeveloper.org

Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , , | Hinterlasse einen Kommentar