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

Binary Studio Blog:
Definitive Guide On Creating Custom Providers For Laravel OAuth2 Authorization
May 26, 2015 @ 12:45:12

A new guide has been posted showing you how to create custom OAuth2 providers for your Laravel application. In this case they wanted to hook the application in via Socialite to the VK social network but needed a custom connector to make it happen.

First of all let's say that social authorization is very popular and frankly speaking it's really handy tool. Surfing internet we can see a lot of sites and services which offer login with Facebook, Twitter, Google and other social networks. [...] If you're building your website in PHP using Laravel, probably you've noticed Socialite which provides OAuth / OAuth 2 authentication with Facebook, Twitter, Google, and GitHub. The most famous social network which provides OAuth2 authentication in Russian segment of the internet is vk. But there is a lack of such connector (provider) in Socialite library. Actually it's not a hard problem, so let's build new VkProvider on top of Socialite's components.

He starts with a brief look at the typical OAuth2 authentication flow between the social network and your application. From there it gets more vk.com specific. He shows how to set up the custom application on their side, updating your configuration with the credentials and installing Socialite. He then implements a "VkProvider" defining the required methods based on the interface. He then registers it as a "SocialiteServiceProvider" and uses it in a "login" request route.

0 comments voice your opinion now!
oauth2 guide custom provider laravel socialite tutorial vkcom russian

Link: http://binary-studio.com/2015/05/25/laravel-oauth2/

SitePoint PHP Blog:
Mastering Composer - Tips and Tricks
May 26, 2015 @ 11:02:32

The SitePoint PHP blog has a new tutorial today from editor Bruno Skvorc with some tips and tricks to help you master Composer, the widely popular PHP package management tool.

Composer has revolutionized package management in PHP. It upped the reusability game and helped PHP developers all over the world generate framework agnostic, fully shareable code. But few people ever go beyond the basics, so this post will cover some useful tips and tricks.

Tips in his list include:

  • Installing Composer globally
  • Using "composer require" to install packages
  • Committing your composer.lock file
  • Options to provide profiling information
  • Speeding up Composer installations

...and many more. If you're looking to take your Composer usage and knowledge beyond the basics, definitely check out this article.

0 comments voice your opinion now!
master composer tips tricks advanced list

Link: http://www.sitepoint.com/mastering-composer-tips-tricks/

Kinsta Blog:
HHVM vs PHP 7 - The Competition Gets Closer!
May 26, 2015 @ 10:19:02

In this new post to thier blog Kinsta shares benchmark results comparing PHP 7 to HHVM, both in their own experience and some shared from other companies too.

A few years ago, engineers at Facebook went on a swashbuckling mission to rebuild the foundation of the world's most populated social network struggling to sustain acceptable performance levels. PHP was all the rage a decade ago when Facebook was gaining steam and pursuing a global target audience.

As they put it the "competition is getting closer" and the performance gap between the two is growing smaller and smaller. They talk some about the performance improvements and new features that are being worked into PHP 7 and some speculations around a Just-In-Time engine and asynchronous programming features. Then comes the benchmarks. They provide the specifications of the machine they tested on and the results of tests runs of WordPress and Drupal (based on requests per second). The rest of the article talks about two stories from other companies using HHVM, Etsy and WikiMedia, and some of the lessons that have been learned along the way.

0 comments voice your opinion now!
hhvm php7 performance benchmarks mediawiki etsy wordpress drupal

Link: https://kinsta.com/blog/hhvm-vs-php-7/

Damien Seguy:
Prepare for PHP 7 error messages (Series)
May 26, 2015 @ 09:35:11

For those looking forward to PHP 7, there's a new series of posts from Damien Seguy that can help you with some of the newer error messages and what might be causing them.

The first step to prepare for PHP 7 is to lint it : using the command line instruction 'php -l script.php', one can easily check that every file in a current application compile with PHP 7. The second step is to run the application and the unit tests : in short, execute it with PHP 7. And this is where we'll learn about the new errors that PHP has prepared for us. In order to be one step ahead of the migration, this article will help you prepare here is a panorama on PHP error messages.

In part one he looks at some of the most often raised errors including the incorrect use of "$this" and undefined offsets. Part two gets into a few more complex messages about return type hinting, the constant scalar expression and using temporary expressions in a write context. Finally, part three looks at messaging around redefinition of identical parameters, bit shifting by a negative number, named constructor deprecation and strict typing. Each part of the series covers a few more than just the ones listed here too, so be sure to check each for more helpful error messages and solutions.

0 comments voice your opinion now!
php7 error message help series part1 part2 part3 resolve information

Link: http://www.exakat.io/php-7-error-messages-part-1/


Community News:
Latest PECL Releases for 05.26.2015
May 26, 2015 @ 07:08:04

Latest PECL Releases:
  • selinux 0.4.1 - The "permissive" tag was added to selinux_compute_av - The selinux_deny_unknown() was added - PHP 7 compatibility (Remi) - fix build woth libselinux 2.0 (RHEL-6)

  • ibm_db2 1.9.7 Enhanced: Code refactoring to enhance maintainability of code Removed: IBM i V5R4 is no longer supported Removed: unsupported test cases of V5 removed

  • pecl_http 2.5.0RC1 * Added RFC5988 (Web Linking) support to httpParams * Added httpUrl::SANITIZE_PATH to default flags of httpUrl::mod() * Fixed overly aggressive response chaching to only consider 2xx cachable

  • sphinx 1.3.3 - Added setFilterString() method, available only when built with sphinxclient lib >= 2.2.3. - Fixed bug #67669 (SphinxClient::escapeString() is missing several symbols) - Fixed bug #69675 (crash when accessing properties of subclass)

  • hprose 1.5.4 Fixed a bug of serializing an object of a class which implements IteratorAggregate interface.

0 comments voice your opinion now!



Marc Aube:
Design Pattern Specification
May 25, 2015 @ 12:19:47

Marc Aube has a new post to his site that introduces you to the specification design pattern, a technique that's useful for ensuing the current state of an object is valid.

The specification pattern is a software design pattern used to codify business rules that state something about an object. These simple predicates determine if an object's state satisfies a certain business criteria. They can then be combined to form composite specifications using logical operators. Use a specification to encapsulate a business rule which does not belong inside entities or value objects, but is applied to them.

He suggests a few things the pattern could be useful for like validating the current state or define how an object should be created. He gives a few more "real world" examples and then gets into the code to create a custom specification. In his "CustomerIsPremium" spec he defines a single method on an interface to determine if the Customer given is correct. He then creates a class instance and encapsulates the logic inside its "isSatisfiedBy" method. He also includes a bit more complex example, showing how to create a composite specification for handling grouping like "and", "or" and "not" assertions. Finally he looks at how to build specifications that can be passed in and used as selection criteria. He does point out that this can leak database handling into the specification layer, however, and should really be avoided without a inversion of control method in place.

0 comments voice your opinion now!
specification designpattern pattern example composite select validate

Link: http://marcaube.ca/2015/05/specifications/

NoCapes Podcast:
Interview with Luke Stokes
May 25, 2015 @ 11:52:22

The NoCapes podcast has posted their latest episode, hosted by PHP community member Kayla Daniels. In this new episode she talks with Luke Stokes of FoxyCart.

In this episode of NoCapes, Luke Stokes discusses the journey towards hypermedia APIs, what is it and why hypermedia APIs are important.

You can watch this latest episode either on the NoCapes site or over on YouTube directly. If you enjoy the show you should subscribe to their mailing list and get more information as it's sent.

0 comments voice your opinion now!
nocapes podcast interview lukestokes api hypermedia foxycart

Link: https://www.youtube.com/watch?t=39&v=j43ZYS_wc8g

Mikkel Høgh:
Drupal is still a gated community
May 25, 2015 @ 10:16:42

In a recent post to his site Mikkel Høgh makes the suggestion that Drupal is still a gated community, mostly as it relates to the process around the "Project Applications" process.

One of the things the Drupal community prides itself on, is how open the community is. And that is generally true, but there's one exception. And that is the Kafkaesque horror-show we subject any newcomers that would like to publish their code on Drupal.org to. It goes by the name of "Project Applications". I know several people who've hit this wall when trying to contribute code. It's not uncommon to wait several months to get someone to review your code. And when it does happen, people are often rejected for tiny code style issues, like not ending their comments with a period or similar.

He talks about other factors involving reviews and delays that can also cause authors to abandon their work and feel "unwelcome and unappreciated". He mentions the "review bonus" system and how it's used to encourage participation (or "more hoops" as he puts it) from other authors. He notes that this situation mostly relates to those new to the tool and community and suggests that it just doesn't work (and really is unnecessary). He ends the post with a call to "end the madness" and move to a standardized role that would allow developers to publish without pushing people away and making them feel unwelcome.

0 comments voice your opinion now!
opinion drupal walledgarden project applications review delay contribution

Link: http://mikkel.hoegh.org/2015/05/14/drupal-is-still-a-gated-community/

SitePoint PHP Blog:
CRUD (Create Read Update Delete) in a Laravel App
May 25, 2015 @ 09:49:11

The SitePoint PHP blog continues their series around the creation of a basic CRUD (create, read, update and delete) application with PHP. In this second part of the series they build on the simple application in the first part and enhance it with the remainder of the CRUD handling.

In the previous part, we've bootstrapped our Laravel CRUD application by creating the database, some controllers, basic routes and simple views. In this part, we'll wrap things up and implement proper CRUD.

He jumps right in and creates the controller action and view to take in new "Task" information. This includes the installation of the Illuminate HTML package and setup of the needed provider and facades. He shows how to create the Task model and hook the results of the request into it and make the new record. This includes some basic "required" validation too. He then shows how to read and display the list of current tasks as well as setting up the edit and delete actions for each task.

0 comments voice your opinion now!
tutorial crud application laravel series part2 model form view

Link: http://www.sitepoint.com/crud-create-read-update-delete-laravel-app/


Community Events

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


series opinion composer configure framework podcast performance release introduction api application part2 example voicesoftheelephpant php7 laravel interview community conference symfony2

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