PHP: Hypertext PreprocessorPHP 7.1.11 Released (27.10.2017, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 7.1.11. This is a bugfix release, with several bug fixes included. All PHP 7.1 users are encouraged to upgrade to this version. For source downloads of PHP 7.1.11 please visit our downloads page, Windows source and binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.
Link
PHP: Hypertext PreprocessorPHP 5.6.32 Released (26.10.2017, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 5.6.32. This is a security release. Several security bugs were fixed in this release. All PHP 5.6 users are encouraged to upgrade to this version.For source downloads of PHP 5.6.32 please visit our downloads page, Windows source and binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.
Link
PHP: Hypertext PreprocessorPHP 7.2.0 Release Candidate 5 Released (26.10.2017, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 7.2.0 RC5. This release is the fifth Release Candidate for 7.2.0. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system. THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION! For more information on the new features and other changes, you can read the NEWS file, or the UPGRADING file for a complete list of upgrading notes. These files can also be found in the release archive. For source downloads of PHP 7.2.0 Release Candidate 5 please visit the download page, Windows sources and binaries can be found at windows.php.net/qa/. The next Release Candidate will be announced on the 9th of November. You can also read the full list of planned releases on our wiki. Thank you for helping us make PHP better.
Link
Rob AllenOuputBuffer Middleware for Expressive (25.10.2017, 10:03 UTC)

When developing an Expressive application, if you use var_dump(), echo, print_r(), etc when you get this error:

Fatal error: Uncaught RuntimeException: Output has been emitted previously; cannot emit response
in /www/dev/rka/example-app/vendor/zendframework/zend-diactoros/src/Response/SapiEmitterTrait.php:31

This occurs after your data has been displayed and makes perfect sense as Expressive is unable to send headers as you've already started sending the body.

To solve this, you need some middleware. It looks like this:

<?php
namespace Akrabat\Middleware;

use const Webimpress\HttpMiddlewareCompatibility\HANDLER_METHOD;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Webimpress\HttpMiddlewareCompatibility\HandlerInterface as DelegateInterface;
use Webimpress\HttpMiddlewareCompatibility\MiddlewareInterface;
use Zend\Diactoros\Stream;

class OutputBufferMiddleware implements MiddlewareInterface
{
    const APPEND = 'append';
    const PREPEND = 'prepend';

    protected $style;

    /**
     * Constructor
     *
     * @param string $style Either "append" or "prepend"
     */
    public function __construct(string $style = 'prepend')
    {
        if (!is_string($style) || !in_array($style, [static::APPEND, static::PREPEND])) {
            throw new \InvalidArgumentException('Invalid style. Must be one of: append, prepend');
        }

        $this->style = $style;
    }

    /**
     * Append or Prepend any data in the output buffer to the repsonse
     */
    public function process(ServerRequestInterface $request, DelegateInterface $delegate) : ResponseInterface
    {
        try {
            ob_start();
            $response = $delegate->{HANDLER_METHOD}($request);
            $output = ob_get_clean();
        } catch (\Throwable $e) {
            ob_end_clean();
            throw $e;
        }

        if (!empty($output) && $response->getBody()->isWritable()) {
            if ($this->style === static::PREPEND) {
                $body = new Stream('php://temp', 'wb+');
                $body->write($output . "\n" . $response->getBody());
                $response = $response->withBody($body);
            } elseif ($this->style === static::APPEND) {
                $response->getBody()->write($output);
            }
        }

        return $response;
    }
}

This middleware wraps all subsequent middleware in an output buffer and then either appends or prepends the contents to the response.

To use it, add to your pipline.php:

$app->pipe(Akrabat\Middleware\OutputBufferMiddleware::class);

Now, you can see the output at the same time as your debugging messages!

Link
Qafoo - PHPOOD: Injectables vs.Newables (24.10.2017, 07:40 UTC)
Many projects I join - even those that claim to already do dependency injection - suffer from issues that result from mixing injectable and newable classes. Keeping these two appart seems to be challenging for many developers so that I try to give them a handy guide with Do's and Dont's in this blog post.
Link
larry@garfieldtech.comShort and safe array iteration (22.10.2017, 09:50 UTC)
Short and safe array iteration

One reason to follow development mailing lists is you sometimes pick up on some very neat tricks. Here's one that I spotted on the PHP Internals list recently to simplify array iteration in PHP 7.

Larry 22 October 2017 - 5:50am
Link
larry@garfieldtech.comThe 3 paragraph pitch (20.10.2017, 22:21 UTC)
The 3 paragraph pitch

Earlier this week a fellow PHP public figure tweeted saying that I write great session proposals for conferences. After I finished blushing I reached out to him and we talked a bit about what it was he likes about them. (Whatever I'm doing right, I want to know to keep doing it!)

Based on that, I figured it would be educational to dissect how I go about writing session proposals for conferences and hope that conference organizers don't catch on to my tricks. :-)

Larry 20 October 2017 - 6:21pm
Link
Voices of the ElePHPantInterview with Alan Seiden (20.10.2017, 11:30 UTC) Link
Nomad PHPBuilding a CI System with Free Tools and Duct Tape (20.10.2017, 04:05 UTC)

January 2018 - EU
Presented By

Julian Egelstaff
January 18, 2018
20:00 CET

The post Building a CI System with Free Tools and Duct Tape appeared first on Nomad PHP.

Link
Piotr PasichThe Blockchain fundamentals for developers (19.10.2017, 19:04 UTC)
cryptoDuring my journey with the cryptocurrency, I realized this is a common problem to find a highly qualified programmer who used to work with the cryptocurrency network. This is like finding a big panda in China – they are super rare. So, finally I was called a big panda and because I like to have some […]
Link
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP