Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Up and Running with the Fastest PHP Framework on PHP7 in 5 Mins
Aug 24, 2016 @ 11:22:46

On the SitePoint PHP blog editor Bruno Skvorc has posted a tutorial helping you get up and running with PHP 7 and Phalcon in five minutes on a Homestead Improved virtual machine.

You may remember our past infatuation with Phalcon, the fastest PHP framework.

In this post, we’ll go through the process of getting it up and running in 5 minutes on one of our <a href="http://www.sitepoint.com/quick-tip-get-homestead-vagrant-vm-running/>Homestead Improved instances. If you’re not interested in why or what Phalcon is, just skip ahead to “Setting it up”.

He starts with a brief recap of what the Phalcon framework is (including Zephir), some history behind it and the latest advancement around the framework: LTS support for v3.0. The tutorial then gets into the setup and configuration of the VM along with PHP 7 and the latest stable version of Phalcon. He then uses the sample application provided by Phalcon and getting it boostrapped and running.

tagged: phalcon php7 tutorial demo homesteadimproved vm setup configure extension

Link: https://www.sitepoint.com/up-and-running-with-the-fastest-php-framework-on-php7-in-5-mins/

Laravel News:
Learn about Grant Types in Laravel Passport
Aug 24, 2016 @ 10:46:49

On the Laravel News site today they've posted a tutorial helping you learn more about the grant types in the OAuth2 functionality provided by Laravel Passport.

OAuth2 is a security framework that controls access to protected areas of an application, and it’s mainly used to control how different clients consume an API ensuring they have the proper permissions to access the requested resources.

Laravel Passport is a full OAuth2 server implementation; it was built to make it easy to apply authentication over an API for laravel-based web applications.

For those not familiar with some of the terms around OAuth and its handling, they start with a few brief definitions (those that are familiar can skip them). Following this the post gets into the creation of a two kinds of grant handling with Passport: third-party authorizations and first-party applications (your own apps authenticating against the OAuth server). The post ends with a brief mention of creating access tokens manually, but points out that thing functionality should probably only be used during testing.

tagged: laravel passport oauth2 grant types password thirdparty server

Link: https://laravel-news.com/2016/08/passport-grant-types/

Matt Trask:
Looking at Ramsey UUID
Aug 24, 2016 @ 09:16:56

Matt Trask has put together a new post spotlighting a handy library that's widely used across the PHP ecosystem for generating UUIDs: ramsey/uuid.

Welcome to the first installment in my 2113918230981 part series, "Better know a Package!". Tonight's package: the famous/infamous Uuid package that that taught us all what Ramsey is in Scottish, Rhumsaa. Created to give PHP a library to generate Universal Unique Identifiers, this library has been a stallwort in the community. Ben Ramsey created it first under the Rhumsaa namesapce before moving it to the Ramsey namespace, saving us all from learning more Scottish then we needed to ever learn.

[...] A UUID, or Universally Unique Identifier, will generate a 128 bite unique key in different series based on the version you asked for. RFC-4122 dictates how Uuids should be generated, and recommends 4 types.

Matt then goes on to describe each of the different UUID types and provides some code examples as illustration:

  • Version 1: Time and MAC addressed based Uuid
  • Version 2: DCE-based
  • Version 3: UUIDs based on a namespace and then it is MD5 hashed
  • Version 4: Random generation (based on the output of random_bytes

He also includes examples of the UUIDs output by each method (not much difference there as the structure of the resulting UUID is all the same).

tagged: uuid ramsey library introduction types namespace random mac time tutorial

Link: http://matthewtrask.net/blog/Looking-At-Ramsey-Uuid/

Community News:
Recent posts from PHP Quickfix (08.24.2016)
Aug 24, 2016 @ 08:05:02

Recent posts from the PHP Quickfix site:

tagged:

Link:

SitePoint PHP Blog:
Framework-Agnostic PHP Cronjobs Made Easy with Crunz!
Aug 23, 2016 @ 13:36:59

The SitePoint PHP Blog has a new tutorial posted from author Reza Lavaryan showing you how to use the Crunz package to make cronjobs a bit simpler in a more framework-agnostic way.

In this article, we’re going to learn about a relatively new job scheduling library named Crunz. Crunz is a framework-agnostic library inspired by Laravel’s Task Scheduler, but improved in many ways. [...] Before getting started, you should have a firm grasp of cronjobs, so please read our in-depth walkthrough if you’re unfamiliar with how they work.

The tutorial then starts in on the code, getting the library installed and setting up a basic task example. The "task" files are sets of cron-formatted commands that are read and executed much like the cron daemon would on a Unix-based system. Example code for a task and command are included. They also talk about the "frequency" settings allowed by the library and the helper methods to make creating them simpler. The post also includes details about task lifetime, running conditions, configuration and parallelism (among other topics).

tagged: crunz library cronjob cron helper tutorial introduction

Link: https://www.sitepoint.com/framework-agnostic-php-cronjobs-made-easy-with-crunz/

Zend Developer Zone:
Testing your project with PHP 7.1
Aug 23, 2016 @ 12:20:12

On the Zend Developer Zone author Cal Evans has written up a post showing you how to test your application with PHP 7.1, the upcoming minor release version for the PHP 7.x series.

Both PHP 7.0 and the upcoming PHP 7.1 release are fairly benign releases. They do not break backwards compatibility except in a few edge cases. If you’ve not yet moved to PHP 7.0, check out our posts tagged php7 for details on what might trip you up there.

Regardless of what version you are moving to, 7.0 or 7.1, you are going to want to test your application before you make the move in production. Sometimes that is difficult though you need a server properly configured, you need someone to manage it, most importantly, you need unit tests. While I can’t help you with that last one – other than point you to @grmpyprogrammer who will publicly abuse you until you write them – I can help you with the “where to test” problem.

Cal shows how to make use of Docker containers to easily test your application in a more self-contained environment and make it simpler to swap out the PHP versions in your platform. He walks you through the steps you'll need to follow to get the environment set up, pull down required components, install and compile PHP and, finally, install Composer globally. Once set up, he shows how to log in, clone your project and execute its test suite. He finishes the post with a few comments about this being a "sandbox", not a CI environment and how it is "future proof" for later versions of PHP too (as it doesn't lock it down to just PHP 7.1.x).

tagged: testing project php71 docker container tutorial

Link: https://devzone.zend.com/7262/testing-project-php-7-1/

Symfony Finland:
Symfony Bundle Spotlight: EasyLogHandler, eZ Migration Bundle, Netgen Layouts & Syl
Aug 23, 2016 @ 11:06:04

On the Symfony Finland blog they've posted a "spotlight" article highlighting several useful Symfony packages to help make your development life easier.

With the summer coming to an end there is increasing activity in the Symfony community in the form of bundles. Recently four interesting Symfony bundles have had interesting status updates: EasyLogHandler, eZ Migration Bundle, Netgen Layouts and Sylius.

The packages mentioned (some relatively new) are:

Each item on the list comes with a brief description of either the features of the library or a brief overview of what's changing in the package's updates.

tagged: symfony bundle spotlight easyloghandler ezmigration netgenlayouts sylius

Link: https://www.symfony.fi/entry/symfony-bundle-spotlight-easyloghandler-ez-migration-bundle-netgen-layouts-and-sylius

Laravel News:
Laravel 5.3 is now released
Aug 23, 2016 @ 10:52:24

As is mentioned in this new post on the Laravel News site, the latest version of the Laravel framework (v5.3) has officially been released:

The Laravel team is proud to announce the release of Laravel 5.3 and it’s now available for everyone. The new features in 5.3 are focused on improving developer speed by adding additional out of the box improvements for common tasks.

This is a general release and comes with six months of bug fixes and security fixes are provided for one year. Laravel 5.1 is the latest LTS release which includes bug fixes for two years and security fixes for three years.

The post also lists some of the major updates that come with the v5.3 release including:

  • New Home Page (for the project)
  • New packages like Laravel Passport, Laravel Scout and Laravel Echo
  • Updated migration handling
  • Queued job improvements

You can read the full list of changes in the rest of the post including a link to an upgrade guide for those migrating from previous versions.

tagged: laravel version release v53 framework update feature project

Link: https://laravel-news.com/2016/08/laravel-5-3-is-now-released/

Voices of the ElePHPant:
Interview with Adam Harvey
Aug 23, 2016 @ 09:41:24

The Voices of the ElePHPant podcast has posted another interview with a member of the PHP community. In this latest episode host Cal Evans talks with Adam Harvey, a core developer on the PHP project. This episode is a video recorded at the php[tek] 2016 conference in St. Louis, Missouri.

Cal and Adam talk about the pre-RFC "wild west" days of work on the PHP language, what he sees as better and what he sees as worse since the RFC process has been introduced. They talk about some of the "differences of opinion" that have happened on the php.internals mailing list, citing the strict type hinting conversations as an example. They also talk about the migration guides and Adam's contributions to them.

You can watch and listen to this latest episode either through the in-page video player or audio player. If you enjoy the show, be sure to subscribe to their feed and follow them on Twitter for updates when new shows are released.

tagged: voicesoftheelephpant community interview adamharvey podcast

Link: https://voicesoftheelephpant.com/2016/08/23/interview-adam-harvey/

Community News:
Latest PECL Releases (08.23.2016)
Aug 23, 2016 @ 08:05:02

Latest PECL Releases:

  • swoole 1.8.10
    - Fixed SwooleHttpClient crash when do close connection in the callback function

    • Fixed SwooleHttpServer cannot support more than 1024 concurrent
  • pecl_http 2.6.0beta1
    + Added httpClientCurlUser interface for userland event loops + Added httpUrl::IGNORE_ERRORS, httpUrl::SILENT_ERRORS and httpUrl::STDFLAGS + Added httpClient::setDebug(callable $debug) + Added httpClientCurlFEATURES constants and namespace + Added httpClientCurlVERSIONS constants and namespace + Added share_cookies and share_ssl (libcurl >= 7.23.0) options to httpClient::configure() + httpClient uses curl_share handles to properly share cookies and SSL/TLS sessions between requests + Improved configure checks for default CA bundles + Improved negotiation precision * Fixed regression introduced by httpParams::PARSE_RFC5987: negotiation using the params parser would receive param keys without the trailing asterisk, stripped by httpParams::PARSE_RFC5987. * Fix gh-issue #50: httpClient::dequeue() within httpClient::setDebug() causes segfault (Mike, Maik Wagner) * Fix gh-issue #47: httpUrl: Null pointer deref in sanitize_value() (Mike, @rc0r) * Fix gh-issue #45: HTTP/2 response message parsing broken with libcurl >= 7.49.1 (Mike) * Fix gh-issue #43: Joining query with empty original variable in query (Mike, Sander Backus) * Fix gh-issue #42: fatal error when using punycode in URLs (Mike, Sebastian Thielen) * Fix gh-issue #41: Use curl_version_info_data.features when initializing options (Mike) * Fix gh-issue #40: determinde the SSL backend used by curl at runtime (Mike, @rcanavan) * Fix gh-issue #39: Notice: httpClient::enqueue(): Could not set option proxy_service_name (Mike, @rcanavan) * Fix gh-issue #38: Persistent curl handles: error code not properly reset (Mike, @afflerbach) * Fix gh-issue #36: Unexpected cookies sent if persistent_handle_id is used (Mike, @rcanavan, @afflerbach) * Fix gh-issue #34: allow setting multiple headers with the same name (Mike, @rcanavan) * Fix gh-issue #33: allow setting prodyhost request option to NULL (Mike, @rcanavan) * Fix gh-issue #31: add/improve configure checks for default CA bundle/path (Mike, @rcanavan)
  • pecl_http 3.1.0beta1
    + Added httpClientCurlUser interface for userland event loops + Added httpUrl::IGNORE_ERRORS, httpUrl::SILENT_ERRORS and httpUrl::STDFLAGS + Added httpClient::setDebug(callable $debug) + Added httpClientCurlFEATURES constants and namespace + Added httpClientCurlVERSIONS constants and namespace + Added share_cookies and share_ssl (libcurl >= 7.23.0) options to httpClient::configure() + httpClient uses curl_share handles to properly share cookies and SSL/TLS sessions between requests + Improved configure checks for default CA bundles + Improved negotiation precision * Fixed regression introduced by httpParams::PARSE_RFC5987: negotiation using the params parser would receive param keys without the trailing asterisk, stripped by httpParams::PARSE_RFC5987. * Fix gh-issue #50: httpClient::dequeue() within httpClient::setDebug() causes segfault (Mike, Maik Wagner) * Fix gh-issue #47: httpUrl: Null pointer deref in sanitize_value() (Mike, @rc0r) * Fix gh-issue #45: HTTP/2 response message parsing broken with libcurl >= 7.49.1 (Mike) * Fix gh-issue #43: Joining query with empty original variable in query (Mike, Sander Backus) * Fix gh-issue #42: fatal error when using punycode in URLs (Mike, Sebastian Thielen) * Fix gh-issue #41: Use curl_version_info_data.features when initializing options (Mike) * Fix gh-issue #40: determinde the SSL backend used by curl at runtime (Mike, @rcanavan) * Fix gh-issue #39: Notice: httpClient::enqueue(): Could not set option proxy_service_name (Mike, @rcanavan) * Fix gh-issue #38: Persistent curl handles: error code not properly reset (Mike, @afflerbach) * Fix gh-issue #36: Unexpected cookies sent if persistent_handle_id is used (Mike, @rcanavan, @afflerbach) * Fix gh-issue #34: allow setting multiple headers with the same name (Mike, @rcanavan) * Fix gh-issue #33: allow setting prodyhost request option to NULL (Mike, @rcanavan) * Fix gh-issue #31: add/improve configure checks for default CA bundle/path (Mike, @rcanavan)
  • geoip 1.1.1
    * Add IPv6 support (geoip_country_code_by_*_v6) * PHP7 support (thanks to Adam and Dan Ackroyd)
  • gRPC 1.0.0
    - gRPC 1.0.0 release
  • oci8 2.1.2
    This version is for PHP 7 only. Fixed invalid handle error with Implicit Result Sets Fixed bug #72524 (Binding null values triggers ORA-24816 error)
  • oci8 2.0.12
    Fixed invalid handle error with Implicit Result Sets
  • swoole 1.8.9
    - Added namespace class alias - Added SwooleHttpClient->addFile interface, support upload file - Added SwooleEvent namespace and class styles - Added SwooleHttpClient no ContentLength response - Added --with-openssl compiler option, can specify the path of the OpenSSL Library - Fixed SwooleMySQL memory leak on PHP7 - Fixed SwooleRedis memory leak on PHP7 - Fixed SwooleHttpClient memory leak on PHP7 - Fixed SwooleHttpServer crash when uploading files on PHP7
  • yaf 3.0.4
    - Fixed bug wrong variables scope in tpl - Minor optimizations
  • hdr_histogram 0.3.0
    - Improve serialized array size by introducing skip counter - Validate inputs into hdr_import are in their range
tagged:

Link: