Voices of the ElePHPantInterview with Michael Lochemem (20.10.2020, 11:30 UTC) Link
Rob RichardsDigital Identity slides from ZendCon (17.10.2020, 08:02 UTC)
PHP: Hypertext PreprocessorPHP 8.0.0 Release Candidate 2 available for testing (16.10.2020, 00:00 UTC)
The PHP team is pleased to announce the ninth testing release of PHP 8.0.0, Release Candidate 2. At this time, we're not planning to adjust the GA date, however this may change during the course of the RC cycle. The updated release schedule can, as always, be found on the PHP Wiki page about the PHP 8.0. For source downloads of PHP 8.0.0 Release Candidate 2 please visit the download page.Please carefully test this version and report any issues found in the bug reporting system.Please DO NOT use this version in production, it is an early test version. 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. The next release will be the Release Candidate 3, planned for Oct 29 2020.The signatures for the release can be found in the manifest or on the QA site.Thank you for helping us make PHP better.
platform.shPHP 8.0 feature focus: <span>quality of life improvements</span> (14.10.2020, 00:00 UTC)
Our last article looked at a new way to make null values nicer to work with. PHP 8.0 has a lot of such features that make everyday coding more fun, but there are too many of them to give them all their own articles. So today we’ll cover a grab bag of changes and improvements that aren’t web-shattering but should make working with PHP overall more pleasant. New string functions PHP has a huge array of string functions (sorry, too easy), from the very useful to the rather obscure.
Voices of the ElePHPantInterview with Matthew Weier O’Phinney (13.10.2020, 14:36 UTC)
Voices of the ElePHPantInterview with Jaap van Otterdijk (13.10.2020, 11:30 UTC) Link
platform.shPHP 8.0 feature focus: <span>nullsafe methods</span> (8.10.2020, 00:00 UTC)
Last week we used Weak Maps to solve one edge case. Today, we simplify the most common and annoying edge case: That of nothingness. Let’s be honest, null values suck. They’ve been called the billion dollar mistake, but programmers in most languages still have to deal with it. (Except for those working in Rust.) They especially suck when you have a variable that could be an object or null. If it’s an object, presumably you know it’s type and what it can do; if it’s null, you can’t do much of anything with it.
Rob AllenStep-debugging linked composer dependencies with PhpStorm (7.10.2020, 10:00 UTC)

One project I'm working on has multiple separate parts in different git repositories that are brought into the main project using linked composer directories. I needed to get step debugging working in PhpStorm and this is the approach I took.

Directory layout

My project is laid out on disk like this:

├── main-app/
│   ├── public/
│   ├── src/
│   ├── tests/
│   ├── vendor/
│   └── composer.json
└── plugin-one/
    ├── src/
    └── tests/

As you can see I have main-app and plugin-one which are the two sets of source code that I need to work on.

Linked directories in composer

We need to set up ./plugin-one/ as a composer dependency of ./main-app/ such that it appears under ./main-app/vendor/client/plugin-one/, but set-up so that we can edit the original files and have main-app pick up the changes.

This is done by setting up a repository in our composer.json that points to the relevant path using a symlink. These are know as Path repositories and look like this in ./main-app/composer.json:

"repositories": [
      "type": "path",
      "url": "../plugin-one"
      "options": {
        "symlink": true

I can then set my require like this:

"require": {
    "client/plugin-one": "@dev",

The net result is that ./main-app/vendor/client/plugin-one is a symlink to ./plugin-one

Setting up PhpStorm

We create a PhpStorm project for ./main-app and then add plug-one to it as a "content root":

  • Go to Preferences -> Directories
  • Click "+ Add Content Root" add add {full path}/plugin-one
  • Click "Apply" and then "OK" to close the Preferences dialog

We now have the same source code in the project twice (once in ./plugin-one and once in ./main-app/vendor/client/plugin-one), so we need to excluded the vendor directory:

  • In the Project tree view, find the main-app/vendor/client/plugin-one folder and select it
  • Right click -> Mark Directory As -> Excluded

The folder will now be coloured orange, so we know it's excluded.

Set-up for debugging

PhpStorm now knows about our source code, so next we need to map it to the server. I'm using Docker for this project, but it's the for any remote-like project.

  • Go to Preferences -> Languages & Frameworks -> PHP -> Servers
  • Add a new entry:
    • Name: {dev-hostname-for-main-app}
    • Host: {dev-hostname-for-main-app}
    • Port: 8888 (or whatever)
    • Debugger: Xdebug (of course!)
    • [✓] Use path mappings
    • In the File/Directory list set up these mappings:
      • {full path on local disk}/main-app => /var/www/html/main-app
      • {full path on local disk}/plugin-one => /var/www/html/plugin-one

The key bit for this article is that path mapping section. The "/var/www/html" is whatever the correct path is on your Docker/Vagrant/whatever host.

Finally, click the menu item Run -> Start Listening for PHP Debug Connections. Note that if this is already selected, then the menu item does not exist and the menu item Stop Listening for PHP Debug Connections is in its place.

Start debugging

You can now set breakpoints in plugin-one/src/whatever.php and PhpStorm will stop on them.

If you are debugging a website using a browser then get the relevant Xdebug extension for Chrome or Firefox.

If it's an API, then you'll need to set a cookie to enable Xdebug for the request:

curl --cookie 'XDEBUG_SESSION=PHPSTORM; path=/' "http://{dev-hostname-for-main-app}:8888/foo/bar"

Translate to your API client of choice!


This worked for me, hopefully it'll work for you too if you have a similar situation!

Voices of the ElePHPantInterview with Dave Stokes (6.10.2020, 19:33 UTC)
Voices of the ElePHPantInterview with Miriam Schwab and Zeev Suraski (6.10.2020, 11:30 UTC)

Show Notes

This episode is sponsored by
RingCentral Developers

The post Interview with Miriam Schwab and Zeev Suraski appeared first on Voices of the ElePHPant.

LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP