Subscribe: PHPDeveloper.org
http://www.phpdeveloper.org/phpdev.rdf
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
application  cloud  community  error  event  generators  laravel news  laravel  new  news  release  site  symfony  testfest  wordpress 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: PHPDeveloper.org

PHPDeveloper.org



Up-to-the Minute PHP News, views and community



Published: Mon, 25 Sep 2017 19:22:07 -0500

 



Laravel News: Laracon EU 2017 Talk Videos are now on Youtube

Mon, 25 Sep 2017 11:52:23 -0500

On the Laravel News site they've announced the release of the videos from Laracon EU 2017 on YouTube - perfect for those that couldn't make the event this year.

Today, Laracon EU uploaded all of the speaker videos to YouTube and here is the link to the full playlist.

The playlist features 20 videos and is sure to keep you busy for a few days. Also, be sure and join the wait list for the 2018 event.

Sessions presented at this year's event included:

You can check out the full playlist for these and more great sessions.




Freek Van der Herten: A trait to dynamically add methods to a class

Mon, 25 Sep 2017 10:50:51 -0500

Freek Van der Herten has posted about a new package that's essentially a stand-alone version of Laravel's own "macros" functionality available via a package: macroable.

We recently released our newest package called macroable. It contains a trait that, when applied to class, can dynamically add methods to that class. This trait is basically a stand alone version of the macroable trait in Laravel. In this post I’d like to show you how you can use it, how it works behind the scenes and explain why we created it.

He then gives examples of how it can be used to add a new simple method (essentially a "named closure") and using the "mixin" functionality to add multiple at once. He wraps up the post with a look at how it works behind the scenes, adding the items to a "macros" list and then looking them up if they're not defined on the class.




Gonzalo Ayuso: PHP application in SAP Cloud Platform. With PostgreSQL, Redis and Cloud Foundry

Mon, 25 Sep 2017 09:25:01 -0500

Gonzalo Ayuso has a tutorial posted to his site showing you how to create a PHP application on a SAP platform that includes PostgreSQL and Redis via Cloud Foundry.

Keeping on with my study of SAP’s cloud platform (SCP) and Cloud Foundry today I’m going to build a simple PHP application. This application serves a simple Bootstrap landing page. The application uses a HTTP basic authentication. The credentials are validated against a PostgreSQL database. It also has a API to retrieve the localtimestamp from database server (just for play with a database server). I also want to play with Redis in the cloud too, so the API request will have a Time To Live (ttl) of 5 seconds. I will use a Redis service to do it.

He then walks you through the process of setting up both the platform and the application:

  • creating the services in cloud foundry
  • create our application (with either Silex or Lumen)
  • built out the features
  • running the application locally for testing
  • connecting to the cloud servers for PostgreSQL and Redis
  • set up logging
  • set up basic authorization

Full code and configuration is included for each step of the way (with Lumen examples included because Silex is "dead").




Community News: Latest PEAR Releases (09.25.2017)

Mon, 25 Sep 2017 08:05:01 -0500

Latest PEAR Releases:




php[architect]: Community Corner: PHP TestFest Has Returned!

Fri, 22 Sep 2017 13:31:08 -0500

On the php[architect] site they've posted an article from the September 2017 issue - the "Community Corner" from James Titcumb all about the return of PHP TestFest.

There is a new movement in the PHP community! Well, it isn’t exactly new, but an event called PHP TestFest is back. PHP TestFest is a global event organized by the PHP community at large, where an effort is made each time to increase the test coverage of the PHP engine itself. Around eight or nine years ago, user groups around the world coordinated to organize events spanning a few months each year, with some groups continuing events annually for several years after.

The article goes on to talk about some of the reasoning behind the TestFest and how you can help to set up an event for a local group to contribute. It then goes through the format of tests, creating new ones and how to execute them to test the result. You can find out more about PHP TestFest and how you can get involved on the main PHP TestFest site.




WordPress Blog: WordPress 4.8.2 Security and Maintenance Release

Fri, 22 Sep 2017 12:51:20 -0500

The WordPress project has posted a new release that includes some security fixes and general maintenance changes.

WordPress 4.8.2 is now available. This is a security release for all previous versions and we strongly encourage you to update your sites immediately.

WordPress versions 4.8.1 and earlier are affected by [several] security issues.

Issues include problems with prepared statements in SQL statements, XSS issues in several features, path traversal vulnerabilities as well as open redirect flaws. It's recommended that all WordPress users upgrade to this release to prevent exploit of these vulnerabilities either by downloading the latest release or by upgrading via the internal dashboard.




Asmir Mustafic: How to add custom error codes to your Symfony API responses

Fri, 22 Sep 2017 11:10:01 -0500

Asmir Mustafic has posted a guide on his site showing how to create custom error codes in the API responses from your Symfony-based application.

When writing APIs, a proper error handling is fundamental. HTTP status codes are a great start, but often when we deal with user inputs is not enough. If out model has complex validation rules, understanding the reason behind an 400 Bad Request error can be not trivial.

Fortunately when for symfony developers there are many libraries to deal with it. Symfony Validator, FOS REST Bundle and JMS Serializer combined allows you to have nice error messages to be shown to your users.

He walks you through the code required to create the default error handling with an "author" example. This includes the creation of the entity as well as the form and controller to handle the request/response. He then refactors this away from the default to create the custom error handler with handlers for the message and code to be returned. The post ends with the configuration changes to register it with the application and what the result ends up looking like.




Laravel News: Laravel 5.6 Will Remove the Artisan Optimize Command

Fri, 22 Sep 2017 10:23:13 -0500

As this post to Laravel News mentions the upcoming v5.6 release of the framework will remove the artisan optimize functionality from the project's artisan command line tool.

The Artisan optimize command is deprecated as of 5.5, and a commit in master has already removed it from 5.6. Waiting until 5.6 gives you time to update your build scripts and composer.json files ahead of the release.

As of Laravel 5.5, the composer.json no longer references optimize in the post-install-cmd and post-update-cmd scripts. The Optimize command is still defined, but does nothing in 5.5.

The project has provided some reasoning behind the change, mostly having to do with the overall performance improvements in the PHP language itself. Additionally, there was some discussion around the removal before it was finalized.







Niklas Keller: An Introduction to Generators in PHP

Thu, 21 Sep 2017 12:57:15 -0500

In a post to his site Niklas Keller provides an introduction to generators in PHP. Generators provide more "just in time" functionality for looping (iterators) without the need to create a separate class to handle it.

Generators have been added to PHP in version 5.5, yet the have received rather low attention. The PHP 5.5 migration guide introduced them as way to implement simple iterators.

He shows the comparison of generators versus a foreach loop and discusses how the yield statement works and what benefits the generator gives over normal looping. He refactors the example to get a clearer picture into what's happening inside the generator, outputting a few strings when the next value is fetched. He then suggests that generators that are just used as iterators are "boring" and covers some more interesting features and uses (including handling of async operations).