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


DeliciousBrains.com:
PHP Encryption Methods for Passwords & Other Sensitive Data
Sep 19, 2018 @ 09:20:39

On the Delicious Brains site, there's a new tutorial posted sharing some of the methods included with PHP to improve protection of sensitive data using encryption.

I recently attended Laracon EU 2018 where Marcus Bointon gave a great talk on Crypto in PHP 7.2. I left the talk having a much greater appreciation for how vastly complicated cryptography is, but also for how PHP is making encryption more accessible thanks to the introduction of Sodium. Data encryption in PHP is something I’ve been working on as part of my work on SpinupWP so I thought it was time I shared a few insights. Buckle up, because this could be a bumpy ride!

The author then spends the remainder of the article covering the different types of encryption that are included with recent versions of the PHP language:

  • one-way hashing (such as the bcrypt password hashing functionality)
  • secret key encryption (symmetric)
  • envelope encryption (such as Google's KMS)

Code examples are provided to show each of the types in action and links are also included for more information on several related topics/resources.

tagged: encryption tutorial hashing symmetric envelope kms google

Link: https://deliciousbrains.com/php-encryption-methods/


Community News:
Latest PECL Releases (09.18.2018)
Sep 18, 2018 @ 08:05:01

Latest PECL Releases:

  • swoole 4.2.0
    + Add new coroutine hooks, tcp, udp, ssl, tls, sleep, usleep, and file read and write, mkdir...etc, be async automatically

    • New ability of the server/client to send the swoole_websocket_frame object directly, support any type of frame construction, send and receive, support __toString
    • Better AIO
    • Add the ProcessPool::getProcess method
    • Support --with-hiredis-dir, --with-nghttp2-dir compiling parameters
    • Enhanced send_yield, automatic retry within the timeout
    • Enhanced timer round detection, repaired millisecond-level ultra-short timer execution error
    • Enable TCP_NODELAY by default, turn off Nagle algorithm, reduce latency
    • More standardized PECL package
    • Re-support the sending of HTTP-header with custom content-length of 0
    • Fixed an issue that can not access the Private/Protect properties in the class after coroutine yield caused by EG(scope) not switched in PHP7.0.x
    • Fixed the error opcode and finish status in websocket_server
    • Fixed the async_dns_lookup bug
    • Completed the code about channel.c overflow space handling
    • Fixed the bug of channel->close
    • Fixed the bug of coroutine socket->recv_package
    • Repair MySQL Statement->execute does not support null parameters
    • Support for identifying form-data encoding with a semicolon-separated boundary
    • Add many high-quality unit tests, greater stability
    • Remove useless time wheel algorithm
  • gRPC 1.15.0
    - gRPC C Core 1.15 uptake
tagged:

Link:

StarTutorial.com:
Modern PHP Developer - Composer
Sep 17, 2018 @ 12:07:01

On the StarTutorial.com site they've posted a tutorial for those that might be newer to the PHP language and ecosystem around it covering the use of Composer. In this latest tutorial they cover some of the basics of using this package manager to pull in and use dependencies in your PHP application.

In general, a block of code forms a method, a group of methods forms a class and a set of classes form a package. A reusable package can be dropped into any project and be used without any need to add functionality to it. A package exposes APIs for clients to achieve a single goal. Packages help our applications achieve DRY (Don't Repeat Yourself), a principle of software development, which reduces repetition of information of all kinds.

[...] In most cases, packages have dependencies. [...] We do need a package manager, a package manager that can solve all of these dependency headaches for us.

The tutorial then goes on to compare two of the main package managers in PHP: Composer and PEAR. It then walks through the installation of Composer and how to use it to pull in a package (in this case the "Faker" package for generating fake user data). It also explains the different commands and configuration files used in working with Composer.

tagged: tutorial introduction composer package manager development

Link: https://www.startutorial.com/articles/view/modern-php-developer-composer

php[architect]:
PHP 7.3 is On Track
Sep 17, 2018 @ 11:19:58

On the php[architect] site they've shared another article from their September 2018 issue. In this new article author Damien Seguy looks forward to PHP 7.3 and covers some of the new features that come with it.

PHP 7.3 successfully passed the “feature freeze” deadline. On Aug. 1st, 2018 all features for PHP 7.3 were identified. This triggered the first PHP 7.3 beta, on the following day, and, from there, we’ll reach RC in September. It is time to review what this new PHP version has available for us, help test PHP 7.3, and get ready.

He goes through several of the changes coming including:

  • Improved Garbage Collector
  • Relaxed Heredoc/Nowdoc
  • Trailing Comma for Calls
  • Deprecated Case-insensitive Constants
  • PCRE 2.0
  • SQLite 3.24
  • Json_encode May Throw Exceptions
  • array_first_key(), array_last_key()
  • list() with References
  • is_countable()
  • net_get_interfaces()
  • Removing image2wbmp()
  • assert() is Now a Reserved Function
  • Continue for Loops, Break for Switch
  • Monotonic Timer: hrtime()
  • compact() Reports Undefined Variables

For each of the items listed, there's a brief explanation of what the feature is and some code to show it in action. The tutorial ends with a listing of some things you can do to prepare your current codebase to work with PHP 7.3 ahead of the December 13th release date.

tagged: language release php73 lookahead preparation features tutorial example

Link: https://www.phparch.com/2018/09/php-7-3-is-on-track/

Community News:
KnpUniversity is now SymfonyCasts
Sep 17, 2018 @ 10:44:36

An announcement has been posted by KnpUniversity today under the group's new name: SymfonyCasts.

If you look around the site today, you'll probably notice something different. KnpUniversity is now SymfonyCasts! And SymfonyCasts is the official online training system for Symfony. This is something we've been planning for awhile and we are beyond excited. Like, jumping-high-fives-someone-order-a-big-cake kind of excited! Woh.

If you're already a KnpU/SymfonyCasts user: we <3 you! And because of that, I want to explain exactly what this change means (and doesn't mean).

They start by answering the first questions most have about changes and if they acquired. They also talk about why they're making the change and how the focus will still remain on high-quality Symfony-related tutorials and videos. With them joining the Symfony family officially, though, it provides them with support to keep the lessons coming and the help they'll provide on the Symfony documentation as a part of the changes.

tagged: knpuniversity symfonycasts announcement symfony

Link: https://symfonycasts.com/blog/symfonycasts

AWS Developer Blog:
Introducing support for Amazon S3 Select in the AWS SDK for PHP
Sep 17, 2018 @ 09:28:17

On the AWS Developer Blog they've posted an announcement about the release of support for Amazon S3 Select in the AWS SDK for PHP. This "select" functionality allows for more powerful queries on the contents currently in your S3 buckets.

We’re excited to announce support for the Amazon Simple Storage Service (Amazon S3) SelectObjectContent API with event streams in the AWS SDK for PHP in version 3.67.11. Using Amazon S3 Select, you can query for a subset of data from an S3 object by using simple SQL expressions.

Amazon S3 streams the responses as a series of events, instead of returning the full API response all at once. This enables your applications to process the parts of the response as the application receives them. To support this new API behavior, the AWS SDK for PHP supports processing these events from the API response.

The post goes on to give a few examples of the use of the "select" functionality, querying the contents of a CSV file using the familiar SQL format. Example code is also included using the SelectObjectContent and EventParsingIterator to select and retrieve the results.

tagged: amazon aws s3 select support release awssdk tutorial

Link: https://aws.amazon.com/blogs/developer/introducing-support-for-amazon-s3-select-in-the-aws-sdk-for-php/

PHP Roundtable Podcast:
Episode 77 - Tech Interviews for Self-Taught PHP Programmers
Sep 14, 2018 @ 12:08:40

The PHP Rountable podcast, hosted by PHP community member Sammy K Powers, has posted their latest episode - Episode #77: Tech Interviews for Self-Taught PHP Programmers. In this episode Sammy is joined by Frank de Jonge, Parker Phinney and Gayle Laakmann McDowell.

Self-taught PHP programmers, even those of us with decades of experience, would likely fail a tech interview in an epic way. If you've ever wanted to work for a big tech company like Google, Amazon or Facebook but have always been too nervous about the tech interview, this episode is for you.

We chat about what we need to do to be fully prepared for a tech interview. And maybe soon you'll be showing your friends how to reverse a binary tree on a whiteboard.

You can catch this latest episode either using the in-page video player or you can watch it directly over on YouTube. 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: phproundtable podcast ep77 technical interview selftaught programmer

Link: https://www.phproundtable.com/episode/tech-interviews-for-self-taught-php-programmers

php[architect]:
2018 Audience Survey
Sep 14, 2018 @ 11:23:14

If you're a reader of php[architect] magazine or even just want to have an influence on what the future of the magazine might look like, you should contribute your thoughts to their 2018 audience survey.

Our 2018 audience survey is online to help gauge how we can provide what you need to be a better developers. Whether you subscribe to the magazine, listen to the podcast, or just visit phparch.com, I want to here from you. I’m no fan of long surveys so I’ve kept it short and to the point. It should take about 10 to 15 minutes at most to complete.

The questions on the survey differ slightly for subscribers versus non-subscribers. There's questions about:

  • why you subscribe/don't subscribe
  • if you know what a subscription comes with
  • preferred distribution method (PDF, print, ePub, etc)
  • their php[podcast]

There's also some questions for general demographics around your job, technologies commonly used and preferred devices. Help php[architect] magazine keep providing the content that PHP developers need and can help them enhance their careers - follow out the survey today!

tagged: phparchitect audience survey magazine

Link: https://www.phparch.com/2018/09/2018-audience-survey/