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

Three Devs & A Maybe Podcast: The First Q&A Show with Justin DeLucia

The Three Devs & A Maybe podcast has posted their latest episode with guest Justin DeLucia. In this new episode they try out something different – a full, dedicated Q&A episode.

This week we have good friend of the show Justin DeLucia on to help host our first dedicated Q&A episode. Not only that, but Fraser is back! along with some crazy adventures that he discusses since his last time on the show. We have been fortunate to receive many questions throughout the past couple of weeks, and thought it would be good to release the answers as a dedicated show. Topics discussed include, breaking into the industry, the PDO vs. Mysqli debate, bespoke vs. off-the-shelf CMS debate and what to consider when building a Web API.

Other topics mentioned in this latest episode include: the Doctrine project, mutual recursion, Laravel Forge and Phil Sturgeon‘s book Build APIs You Won’t Hate. You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. If you enjoy the show, consider subscribing to their feed too.

Link: http://threedevsandamaybe.com/posts/the-first-qa-show-with-justin-delucia/
PHPDeveloper.org

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

Reddit.com: What constitutes the “PHP community”?

There’s a good conversation happening over on Reddit today about what constitutes the “PHP community” and how it can be defined. JordanLeDoux wonders if those who just write PHP are included in that group as well.

One conversation was with a dev who hates PHP because (mostly) they work with code that was written by some non-PHP dev who was asked to write it. The other was with /u/krakjoe from the PHP internals team, where I was commenting on a sentiment that sometimes finds its way into the internals mailing list: if you want a real programming language, then go use one.
In both cases, I made the assertion that most people who utilize PHP or edit a script aren’t actually part of the PHP community. [...] How can someone that is functionally isolated from any other person working in PHP be part of the PHP community?

Responses to the post are, for the most part, encouraging suggesting that

  • There’s not a single “PHP community” but many smaller ones
  • sub-communitiies can revolve around technology or a product
  • The different definitions of community
  • The broad range of skills that “PHP developers” are known to have

Check out the full post for more opinions and share your own!

Link: http://www.reddit.com/r/PHP/comments/2ayxkg/what_constitutes_the_php_community/
PHPDeveloper.org

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

SitePoint PHP Blog: Social Network Authentication – Setup & Google+

The SitePoint PHP blog has posted the first two parts of a “Social Network Authentication” series looking at connecting your application with social network systems. In these first two posts they help you get things set up to connect to the remote systems and create an actual connection to Google+.

Almost every website which contains a log in option, also contains ways to log in through different social networks. In this series of articles, we will take a look at how we can make sure that our visitor can log in through Google+ and eventually other networks like Twitter and Facebook. In the final article, we will have a close look at how we can make sure users don’t have different accounts due to the fact that they used different social networks. We will create a framework agnostic package which can easily handle users from different social networks. In this part, we will have a look at our basic setup.

The first tutorial helps you get things all set up and takes the first steps in making the “SocialLogin” package. In the second tutorial they use this package structure to create a Google+ specific instance, making the OAuth connection as simple as calling a method, loading a URL and handling the response.

Link: http://www.sitepoint.com/series/using-social-networks-as-a-login-system/
PHPDeveloper.org

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

Symfony Blog: Improving REST in Symfony

On the Symfony blog there’s a recent post about a new effort being started to help improve REST in Symfony-based applications. William Durand talks about some of the current tools and some of the missing features/difficulties each has. This effort wants to help change that.

Building APIs with Symfony is not new. We’ve done that since the early beginning of Symfony: Askeet, Jobeet, it’s been a long time! Nowadays, more and more web applications are made of an API and a client side application. Sharing data across applications using APIs also became an essential feature. [...] For most of us, it is not as clear as it should be, and we can certainly do better than what we have right now! Hence the creation of a working group to gather both people and knowledge for REST in Symfony: https://groups.google.com/forum/#!forum/resting-with-symfony.

The target of the group is just about anyone associated with the development of APIs: developers who build them, developers to contribute to Symfony’s REST functionality, people with questions about REST and, really, anyone else interested. It’s a part of their wider developer experience initiative they’ve recently ramped up.

Link: http://symfony.com/blog/improving-rest-in-symfony
PHPDeveloper.org

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