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

Facebook Code Blog:
Announcing the Hack Transpiler
November 12, 2014 @ 12:11:47

On the Facebook Hack blog there's an announcement about a new tool they've created to "reverse engineer" Hack code and turn it back into normal PHP - the Hack Transpiler. There's also more information in the Facebook announcement:

Today, we're proud to announce a first, experimental release of h2tp, or the "HH (Hack) Transpiler," a tool which allows projects that have converted from PHP to Hack to still make releases that target the PHP language.

Since the launch of Hack, many community members have asked us how to manage forward compatibility. Hack is backwards-compatible with PHP - if you're running PHP on HHVM, Hack code will seamlessly integrate with it. But the inverse is not true.

The announcement talks about the things that make Hack, well, Hack and how it's not just a simple find and replace to convert it back into PHP. Their "h2tp" tool also converts things like collections and short lambda expressions back into structured PHP. To illustrate, they include some before and after code, showing the addition and substitution of PHP for the Hack shorthand operators. The post also covers some of the hurdles they faced during the implementation of the "h2tp" tool, including error handling.

0 comments voice your opinion now!
facebook hack tool covert language h2tp hhvm language

Link: https://code.facebook.com/posts/398235553660954/announcing-the-hack-transpiler/

The ChangeLog Podcast:
#129 Facebook's Sara Golemon and the PHP Language Specification
November 11, 2014 @ 10:06:53

On The Changelog podcast today hosts Adam and Jerod talk with Sara Golemon (of Facebook) about the PHP specification that was released a bit back by a group, largely at Facebook, to help define how the PHP language functions.

Some of the topics mentioned in this episode include:

You can listen to this episode either through their in page audio player or by downloading the mp3. If you enjoy it, be sure to subscribe to their feed and get the latest updates as they're released.

0 comments voice your opinion now!
thechangelog podcast saragolemon facebook specification language

Link: http://thechangelog.com/129/

NetTuts.com:
Design Patterns The Adapter Pattern
November 03, 2014 @ 11:54:20

In the latest post in their series looking at common programming design patterns, NetTuts.com talks about the Adapter pattern. This pattern makes it easier to swap out different connection types via an abstracted interface.

In this article, we will continue our discussion on design patterns by taking a look at the adapter design pattern. This particular pattern can be used when your code is dependent on some external API, or any other class that is prone to change frequently. This pattern falls under the category of "structural patterns" because it teaches us how our code and our classes should be structured in order to manage and/or extend them easily.

He starts off with the problem he's aiming to solve: a change in a "Twitter" class from one method name to another. An "adapter" lets an existing class be used from another interface, requiring no to minimal changes to the original class. He refactors the example to use an example of an adapter, creating a class that defines an object that passes in the original "Twitter" class instance and wraps the "send" call in its own method. With this in place, he also shows how to create a brand new adapter for Facebook, mimicking the "send" method, just with different functionality.

0 comments voice your opinion now!
designpattern adapter pattern socialnetwork twitter facebook wrapper tutorial

Link: http://code.tutsplus.com/tutorials/design-patterns-the-adapter-pattern--cms-22262

Allan MacGregor:
Exploring Hack Building a MicroFramework
August 11, 2014 @ 09:09:13

Allan MacGregor has started a new series of posts to his site where he creates a microframework in Hack, the language created by Facebook to compliment their HHVM (Hip-Hip Virtual Machine) project. He sees it as a "learn by doing" kind of thing and wanted to share his results.

I honestly believe the best way to learn something is to get your hands dirty and make mistakes; so instead of writing dozens of post on the many new features of Hack and why they are awesome (in theory) let's build something useful. So to get started I've decided to build a micro-framework using HACK and HHVM, building a simple microframework should be a challenging enough task to illustrate some of the more interesting features of the language and at the same time it has an achievable goal so we don't end on a never ending development cycle.

His framework, one he calls "Slash", will mostly be about creating RESTful applications but it could, in theory, be for any kind of web application. He also mentions some of the other great microframeworks out there already that are well-developed and have good communities behind them (including Slim and Silex. This is just the first part of the series and introduces some of the "why" around his goal. In the next part of the series he'll get into the structure and routing with some actual framework code.

0 comments voice your opinion now!
hack microframework facebook hhvm language slash

Link: http://coderoncode.com/2014/08/06/exploring-hack-part1.html

Community News:
PHP Specification in Development
July 30, 2014 @ 11:54:25

In a recent message to the PHP internals mailing list Sara Golemon has announced the development of a PHP specification, a document formally defining the interfaces and structure of the functionality of the language. The effort is being spearheaded by a group at Facebook.

We (As in PHP) have been talking about making a spec for the PHP language for a LONG time. With PHPNG around the corner, the need for a formal spec is even more important so that we can reliably ensure that PHP.Next matches PHP 5.6's behavior as much as possible. Meanwhile, other implementations of PHP (like HHVM) should be as spec compliant as possible so that we don't see the language bifurcate. To that end, we (as in Facebook), have been putting together a formal language spec for PHP (using PHP 5.6 as the source of truth) along with an additional conformance test suite (which compliments Zend/tests).

An initial version (a "sneak peek") has already been posted providing a great start to the effort. There's already been a lot of support for the project in the community and some of the concerns around workflow and maintenance are already starting to be addressed.

0 comments voice your opinion now!
language specification facebook earlyrelease

Link: http://grokbase.com/t/php/php-internals/147p423vvz/php-language-specification

SitePoint PHP Blog:
Social Network Authentication Twitter and Facebook
July 21, 2014 @ 11:32:12

The SitePoint PHP blog continues their series of tutorials showing how to authentication your users against various social networks. In the previous post they covered connecting to Google+ and in this latest post they move on to two other popular social networks: Facebook and Twitter.

In the previous parts of this series, we created our initial interfaces, set up our Google+ login functionality and talked about how we can merge our accounts together. In this article, we will integrate Twitter and Facebook within our application. You will see a lot of similarities with the Google+ article, so if you could follow that one easily, you won't have much trouble with this one. If you haven't read that article yet, I suggest you read it first before continuing this article.

He starts off with the Twitter authentication, creating a new "SocialLogin" object type for it and defining the three required properties it needs to connect. Code is included to make the OAuth connection, pass along the callback URL and forward on the user to the Twitter site for approval. Code is also included to store the data about the Twitter user in your application. Next up is Facebook. The connection is very similar to the others with only a slight difference in the data that's required. You can find the full code for the tutorial so far in this Github repository.

0 comments voice your opinion now!
social network authentication tutorial series twitter facebook

Link: http://www.sitepoint.com/social-network-authentication-twitter-facebook/

SitePoint PHP Blog:
Paginating Real-Time Data with Cursor Based Pagination
July 11, 2014 @ 11:52:13

On the SitePoint PHP blog today a new tutorial has been posted introducing you to cursor-based pagination of real-time data, showing the results and allowing for easy click-through functionality.

Pagination is a technique for breaking large record sets into smaller portions called pages. As a developer, you should be familiar with implementing pagination, but implementing pagination for real time data can become tricky even for experienced developers. In this tutorial, we are going to discuss the practical use cases and solutions for real time data pagination and cursor based pagination.

He uses results from the Twitter and Facebook APIs in his examples, grabbing tweets matching the search term "php". He briefly explains some of the issues with real-time pagination and how it compares with standard pagination techniques. He uses the "after" and "before" functionality of each API to only pull the data needed, not the entire list of latest posts. This is added to a list in order and shown when the user view is refreshed. He includes the code for implementing the cursor-based handling and how to echo the results back out to a view.

0 comments voice your opinion now!
cursor pagination twitter facebook api tutorial realtime

Link: http://www.sitepoint.com/paginating-real-time-data-cursor-based-pagination/

Reddit.com:
Hack How to open the black box of Hacklang as a PHP developer
June 25, 2014 @ 11:56:44

In this recent post to Reddit, user JordanLeDoux shares some of the basics behind the Hack language (from Facebook) and making a "first jump" into it and its strong typing handling.

codebase. Having built HHVM, they wanted something that would enforce certain behaviors for developers that didn't rely on IDE's interpreting phpDoc statements. Hack's most interesting and largest function is that it adds optional strong typing to PHP, by examining the tokenized code and ensuring that where declared strong typing is respected.

Example code is included showing the different levels of typing and how to use them in a few example functions. He introduces some of the basic types included in Hack (like int, float and bool) and some of the types unique to Hack (like mixed, tuples, resource and closures). There's a brief look at maps, vectors and sets and a link to more documentation if your interest has been piqued to learn more and make that "first jump".

0 comments voice your opinion now!
hack introduction language facebook tutorial

Link: http://www.reddit.com/r/PHP/comments/28wn7j/hack_how_to_open_the_black_box_of_hacklang_as_a/

HHVM Blog:
Hack Developer Day 2014 Keep Hacking
April 11, 2014 @ 09:40:00

On the Facebook HHVM blog today there's a post about the Hack Developer Day they recently held in Menlo Park. The event brought in developers for a day of presentations from the Hack/HHVM engineers.

150+ Members of the PHP and developer community came to Facebook headquarters and joined over 2000 people online for presentations by the engineers of Hack and HHVM. Afterwards we held a five hour hackathon, where the attendees worked with those engineers to write Hack code, either by converting current codebases or writing new code from scratch.

For those that weren't able to attend or are interested in catching up on what was presented, they've posted videos of all of the sessions in a YouTube playlist as well as PDFs of all the slides. If you want the short version of what was presented, there's a quick list in the post or you can read a recap on the Facebook Engineering blog.

0 comments voice your opinion now!
hack developer day facebook presentation video slides summary

Link: http://hhvm.com/blog/4685/hack-developer-day-2014-keep-hacking

Pádraic Brady:
Is Facebook's HHVM Building PHP's Coffin?
April 01, 2014 @ 09:31:52

In a new post to his site, Pádraic Brady poses a question about the HHVM project from Facebook - is it going to "be the coffin" that will replace the Zend Engine in PHP completely and change the way we know it?

With HHVM 3.0 now released, it's probably time to start talking about HHVM and the new Hack Language. It's becoming hard to ignore some of the fantastical notions spreading on the grapevine about HHVM. There is talk of significant performance improvements, a multitude of new features courtesy of Hack, that PHP Internals is actually now outnumbered by HHVM contributors. There is even treasonous talk of PHP's Zend Engine being put out to pasture.

He talks about how it was inevitable, really, that there'd be another implementation come up through the ranks (much like the variations of Ruby). He also mentions some other, less popular options in replacing the main implementation (Zephir, HippyVM, etc). He then poses an interesting question - "what is PHP?" He talks about language specifications, the PHP internals group and the delay that sometimes happens introducing new language features into the core (some of which HHVM already has).

PHP, as we know it, is starting to smell. It has gone from being the only PHP in town, to being the slowest, with the least number of features, and the one that's subject to dysfunctional governance. The new PHP is called Hack, a new language with only the briefest of documentation since you can learn the other 99.9% of this language over on the PHP manual.
0 comments voice your opinion now!
hhvm hack facebook opinion future language

Link: http://blog.astrumfutura.com/2014/03/is-facebooks-hhvm-building-phps-coffin


Community Events





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


voicesoftheelephpant language security mvc series symfony release introduction podcast composer community interview opinion library framework tool update version package laravel

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