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

Community News:
Latest PECL Releases (09.27.2016)
Sep 27, 2016 @ 08:05:02

Latest PECL Releases:

  • pdo_sqlsrv 4.0.4
    This version is for PHP 7 only. This preview contains the PDO_SQLSRV drivers for PHP 7 (64-bit) with limitations (see Limitations below for details). Upcoming release(s) will contain more functionality, bug fixes, and more.

  • protobuf 3.1.0a1
    First alpha release.
  • yaml 1.3.0
    New Features: - Removed IS_UNICODE (PHP6) support - Removed support for PHP <5.3.3 - Timestamps encoded according to https://www.w3.org/TR/NOTE-datetime

    Bugs Fixed:

    • Various missing free calls (remicollet, bd808)
    • Fix parameter parsing for yaml_emit_file
    • Fix callback handling for yaml_emit_file
    • Fix result of tag callback to be copied to aliases (ranvis)
    • #71696 Bad datetime management
  • yaml 2.0.0
    Breaking changes: - #69617 yaml.decode_php ini setting now defaults to false. New Features: - PHP7 compatible - 2.x series will no longer support PHP5 Bugs Fixed: - Premature free in y_write_object (remicollet) - Uninitialized smart_str in convert_to_char (remicollet) - Missing free in convert_to_char (remicollet) - Use zend_* datatypes (weltling) - Fix handling of optional encoding argument to yaml_emit_file (weltling) - Removed PHP6 compat IS_UNICODE support (bd808) - Fixed parameter parsing for yaml_emit_file() - Fixed callback usage for yaml_emit_file() - Use smart_str_free() instead of smart_string_free() (remicollet) - #71045 zend_mm_alloc_small crashes with zend_string_alloc - Fix handling of tag callbacks for aliased values (ranvis) - Quick fix on handle_mapping. arrval should be used instead of retval (jabiinfante) - #71696 Bad datetime management (bocharov) - Fix memory leak in mapping with sequence (bocharov) - Fix anchor in anchor problemo (bocharov) - Fix tests bug_64019.phpt, bug_parsing_alias.phpt (bocharov) - #72204 Crash when try to parse yaml file
  • v8js 1.3.3
    - fix detection of libv8_libbase.a during configuration - fix license URIs in package.xml
  • pdflib 4.0.0
    - add support for PHP7
  • mongodb 1.2.0alpha3
    ** Bug * [PHPC-794] - BulkWrite::update() silently ignores invalid arguments

    ** Improvement * [PHPC-424] - Validate that read preference tag set is an array of documents * [PHPC-705] - Do not unnecessarily wrap filters in $query

    ** New Feature * [PHPC-498] - ReadPreference, ReadConcern, and WriteConcern should serialize to BSON * [PHPC-734] - Support providing collation per operation * [PHPC-752] - Allow users to set a limit on acceptable staleness

    ** Task * [PHPC-783] - Use mongoc_collection_find_with_opts() for Query execution * [PHPC-796] - Use flexible opts for BulkWrite update and delete

  • sqlsrv 4.0.4
    This version is for PHP 7 only. This preview contains the SQLSRV drivers for PHP 7 (64-bit) with limitations (see Limitations below for details). Upcoming release(s) will contain more functionality, bug fixes, and more.


SitePoint PHP Blog:
Mail Logging in Laravel 5.3: Extending the Mail Driver
Sep 26, 2016 @ 11:54:40

On the SitePoint PHP blog there's a new tutorial posted by Younes Rafie looking at logging of mail handling in Laravel by extending the already included driver with your own updates.

One of the many goodies Laravel offers is mailing. You can easily configure and send emails through multiple popular services, and it even includes a logging helper for development.

[...] Laravel also provides a good starting point for sending mails during the development phase using the log driver, and in production using smtp, sparkpost, mailgun, etc. This seems fine in most cases, but it can’t cover all the available services! In this tutorial, we’re going to learn how to extend the existing mail driver system to add our own.

They start by helping you create the service provider used to log the mail information to a database table (the DBMailProvider). The extend the existing mail provider class and set it up to register the Swift Mailer provider if the configuration for the mailer is not set to "db". The the tutorial shows how to update the provider to override the swift.mailer instance in the application dependency injection container and include the code to override the "send" method. A migration is created to hold the mail data and a matching Emails model is used to save the mail results.

tagged: laravel email logging database tutorial driver swiftmailer configuration

Link: https://www.sitepoint.com/mail-logging-in-laravel-5-3-extending-the-mail-driver/

Laravel News:
Troubleshooting Laravel Valet on macOS Sierra
Sep 26, 2016 @ 10:16:22

Eric Barnes has a post to his site for the Laravel Valet users out there that have upgraded to macOS Sierra. In the post he talks about some of the common issues people are seeing when upgrading either Valet or macOS and how to resolve them.

macOS Sierra was released just a few days ago and everybody is starting to upgrade. Some users of Laravel Valet have reported some problems and Adam Wathan has put together a list of common problems and troubleshooting tips to help resolve issues he’s been seeing.

The list in this post covers a few different topics:

  • Interference between Valet and the local Apache install
  • Random Valet deaths
  • Random files being shown on reload
  • 502 Gateway errors
  • "fpm.socket does not exist" error message
  • "php-fpm.conf is missing" message

The post ends with a list of three logs you can look at to try to locate these errors or get more information about them.

tagged: laravelnews valet troubleshoot macos sierra

Link: https://laravel-news.com/2016/09/troubleshooting-laravel-valet-on-macos-sierra/

Michelangelo van Dam:
PHP 7 on macOS Sierra
Sep 26, 2016 @ 09:24:18

Michelangelo van Dam has posted a "follow up" to his previous article about setting up a PHP installation on the recent versions of Mac OSX. In this new tutorial he makes some updates for the latest OS X release: Sierra.

Apple has released the latest version of their OS X operating system to the broad public and many have already upgraded their mac devices. But as it goes with each release, Apple likes to do things a bit different making it quite challenging for PHP developers to stay current with the latest PHP version (or other versions).

This version of mac OS (11.12) comes pre-installed with PHP 5.6.24. [...] Good for Apple, but this version reaches end-of-life support by the end of this year, so it would be great if you could upgrade to PHP 7.0 or even play with the latest PHP 7.1 release candidates.

While he points out that things like XAMPP and Homebrew can be used to set the installation up, he focuses more on compiling and installing it natively. He shares an issue he had with a missing runtime and how to get it installed and working happily so the PHP compile completes without issues.

tagged: mac osx runtime compile php7 sierra issue tutorial

Link: http://www.dragonbe.com/2016/09/php-7-on-macos-sierra.html

How is everyone doing development locally today?
Sep 23, 2016 @ 12:08:17

On the /r/php subreddit from Reddit.com there's a post from Spvrtan asking the community what technologies they're using for local development in their day to day development work.

It's honestly been over 5 years since I last touched PHP on the back-end. At that time, other than "doing it live", XAMPP was the top dog for local environments. Is there a new player in the space or should I go with the same? I've been working primarily as a front-end engineer for the past few years during my full-time employment roles and touched the back-end on projects I've worked on but they've all been Java-based.

They also ask what other developers are using for their deployment tools and pipelines. Answers to the post so far include some of the usual tools and methods including:

  • Docker
  • puphpet (for use with Vagrant)
  • Homestead from Laravel

Other comments also mention the manual creation of virtual machines and even support for local installations rather than virtual ones. What's your development environment like? Head over to the topic and share your own setup too.

tagged: reddit rphp local development virtualmachine opinion deployment

Link: https://www.reddit.com/r/PHP/comments/54487o/how_is_everyone_doing_development_locally_today

Remi Collet:
Microsoft SQL Server from PHP
Sep 23, 2016 @ 11:57:34

In this recent post to his site Remi Collet shows you how to set up your PHP installation to allow it to work with a Microsoft SQL Server as it's data store.

Here is a small comparison of the various solutions to use a [Microsoft SQL Server](https://en.wikipedia.org/wiki/Microsoft_SQL_Server) database from PHP, on Linux. All the tests have be run on Fedora 23 but should work on RHEL or CentOS version 7.

Several different extensions were tested as a part of making the connection to the SQL server:

  • Using PDO, ODBC and FreeTDS
  • Using PDO, mssql and FreeTDS
  • Using PDO, ODBC and Microsoft® ODBC Driver
  • Using the Microsoft® Driver
  • Using PDO and the Microsoft® Driver

Each item comes with a list of the requirements involved (other modules/extensions), examples of the configuration changes you'll need to make and some sample code to create the connection.

tagged: tutorial microsoft sql sqlserver database connection example testing

Link: http://blog.remirepo.net/post/2016/09/20/Microsoft-SQL-Server-from-PHP

Building a Welcome Page for Your WordPress Product: Code Part 1
Sep 23, 2016 @ 10:33:58

TutsPlus.com has started off a new series of posts for the WordPress users out there showing you how to build a "welcome page" for your WordPress site and product.

In the first two articles of this series, I wrote about what welcome pages are and how they are helping products improve user experience by connecting the dots, after which I wrote about the WordPress Transients API that I intend to use while building the welcome page.

Coding a welcome page for your WordPress plugin can be a tricky process. The entire concept revolves around redirecting users to a particular page via setting transients and finally deleting them. Let's start building the welcome page.

They walk you through the creation of a simple plugin that can be used to easily create (and re-create) these "welcome" pages (the final result is here for the impatient). The tutorial the starts off by defining the architecture of the plugin and the workflow that it will follow to generate the page. From there it gets into the code for the plugin itself and related supporting files including the "initializer" that activates the plugin, making it ready for use.

tagged: welcome page wordpress plugin series part1 tutorial

Link: https://code.tutsplus.com/articles/building-a-welcome-page-for-your-wordpress-product-code-part-1--cms-26014

How Much Coding Should Designers Know?
Sep 23, 2016 @ 09:41:35

The Toptal.com site has an interesting post mostly relevant to those out there that straddle the line between design and development. It wonders how much coding should a designer know to get the job done.

Many designers think each discipline should mind their own business, while others see no problem in professionals wearing multiple hats. Many developers see designers who code as a threat, while others see it as a facilitator. This is a hotly debated subject, and although I think some great designers are also superb at coding, I will always defend that the more you focus on a particular area the best you will be at it. But this shouldn’t be a reason for you to miss out on the benefits of having another skill under your belt.

The article then breaks down the benefits of designers learning to code by levels of knowledge:

  • Step 1: Know the basics of HTML and CSS
  • Step 2: Front-end JavaScript and AJAX could make you a unique asset
  • Step 3: Back-end JavaScript might be overkill
  • Step 4: Database Architecture and Software Engineering Won’t Get Designers Anywhere

For each point there's a brief explanation of the level of knowledge it represents and what he sees as a general designers attitude towards it.

tagged: designer coding opinion development

Link: https://www.toptal.com/designers/digital/designers-coding

Building Your Startup With PHP: Simplifying Onramp With OAuth
Sep 22, 2016 @ 12:45:49

The TutsPlus.com site has posted the next part of their "Build Your Startup with PHP" series today. This time they show you how to make it even easier for the users of your site to sign up using OAuth and third-party authentication.

In this tutorial, I'll guide you through implementing OAuth integration with common social networks to make signing up and repeated usage easier and more efficient. I'll explore Facebook, Google, Twitter and LinkedIn, the networks I see as being most appropriate to Meeting Planner's target users.

The tutorial makes use of the Yii framework's own AuthClient functionality to make the actual requests to the 3rd party services. They help you get it installed via Composer and the configuration changes you'll need to make for it to be available and functional.

The tutorial then shows how to create developer applications on a few different services: Twitter, Facebook, Google and LinkedIn. They help you update your configuration with the secret keys for each and create a new database update for storing the 3rd party identifiers when the connection is made. Finally they hook it into the user profile and the login page for use by your users.

tagged: startup series tutorial oauth connection thirdparty service integration authclient

Link: https://code.tutsplus.com/tutorials/building-your-startup-with-php-simplifying-onramp-with-oauth--cms-23512