Xdebug Update: December 2020 – Derick Rethans

Xdebug Update: December 2020

Another monthly update where I explain what happened with Xdebug development in this past month. These will be published on the first Tuesday after the 5th of each month.

Patreon and GitHub supporters will get it earlier, on the first of each month.

You can become a patron or support me through GitHub Sponsors. I am currently 82% towards my $1,000 per month goal. If you’re already supporting Xdebug’s development, could you do me a favour and tweet this out?

Using @xdebug? Help its developer @derickr to get to 100% on his GitHub sponsors goal: https://github.com/sponsors/derickr #Xdebug3

If you are leading a team or company, then it is also possible to support Xdebug through a subscription.

In December, I worked on Xdebug for about 46 hours, with funding being around 30 hours. I worked mostly on the following things:

Releases

A few bugs were found in Xdebug 3.0.0, which should not come as a surprise, as with any big .0 release, users always find things that go wrong. December saw the 3.0.1 release, and the 3.0.2 released followed in the new year.

Xdebug 3.0.1 fixed several crashes and other bugs that are present in Xdebug 3.0.0. The crash when removing a breakpoint (or run-to-cursor) was the most notable fix in this release.

You’ll have to wait for the January 2021 wrap up to find out about the 3.0.2 release, or you can have a look at the release announcement.

There are also new release of PhpStorm and the VS Code Plugin to address a few Xdebug related issues from their sides. On top of that, the GitHub repository of the VS Code Plugin has been moved to the Xdebug organisation. There is a back log of pull requests and issues that need looking at.

Videos

I have started making videos to introduce Xdebug 3 and how to use it. The first one on Xdebug 3’s modes can be watched on YouTube.

I am currently working on a video to explain all the new features in Xdebug that help you find problems with running Xdebug itself.

Xdebug Cloud

I have been continuing to test Xdebug Cloud, and I am working with a few private alpha testers. They’re putting the hosted Cloud service through its paces.

At the same time I am working with a designer to make the https://cloud.xdebug.com look pretty too.

If you want to be kept up to date with Xdebug Cloud, please sign up to the mailinglist, which I will use to send out an update not more than once a month.

Truncated by Planet PHP, read more at the original (another 629 bytes)

Object properties, part 2: Examples – larry@garfieldtech.com

Object properties, part 2: Examples

In my last post, I went over some of the pros and cons of various proposals for making PHP objects more immutable-ish, and the contexts in which they would be useful. I also posted the link to the PHP Internals list, where it generated some interesting if meandering discussion (as is par for the course on Internals).

One of the requests was for sample code to demonstrate why I felt particular feature proposals were better than others. Fair enough! This post is in response to that request, and I think it will help illuminate the challenges better.

For this exercise, I chose to experiment with a junior version of the PSR-7 request object as a concrete example. The code below is not exactly PSR-7; it’s a representative sample of portions of a naive, slightly reduced scope version of PSR-7 requests only, and using all PHP 8.0 features available. The goal is not a complete working object, but sufficient real-world representative examples of situations that an immutability plan would need to address.

Continue reading this post on PeakD.

Larry
9 January 2021 – 6:33pm

Free ticket to The Online PHP Conference! – Rob Allen

I’m very happy to be speaking at The Online PHP Conference this year. As you can guess from the title, this is an online event so is easily accessible right from your desk.

Sebastian, Arne, and Stefan are acknowledged experts in PHP development and so an opportunity to hear their thoughts is always welcome. In this case, they have also invited a number of us to share our thoughts as well, expanding on the topics covered. It should be a good event and I encourage to buy a ticket and attend.

One area where I’ve found in-person events have the edge on virtual ones is the so-called hallway track where speakers and attendees can interact in ad-hoc conversations. I’ve always had really good conversations where I can ask and answer interesting questions and we learn things in a more informal setting. So, I was excited to discover that thePHPCC have thought about this.

From A Happy New Year 2021:

In addition to presenting much more (and more diverse) content than last time, we have made our already famous Hallway Track even better, allowing for more informal exchange between attendees and speakers. This is definitely something to look forward to. After our first edition of The Online PHP Conference, many attendees said that taking part in the Hallway Track almost felt like attending a conference in person.

I’m intrigued!

Free tickets!

thePHP.cc have very kindly made available a couple of tickets to me that I can give to you! All you need to do is email me with your first name and last name. On Monday 11th January, I’ll pick the winners at random. I’ll delete your email afterwards and of course I’ll only email you if you win.

If you don’t win, get your company to buy a ticket anyway!

Object properties and immutability – larry@garfieldtech.com

Object properties and immutability

There has been much discussion in recent weeks in PHP circles about how to make objects more immutable. There have been a number of proposals made either formally or informally that relate to object property access, all aimed at making objects safer through restricting write access in some way.

Since my last mega post on PHP object ergonomics was so well-received and successful (it resulted in both constructor promotion and named arguments being added to PHP 8.0, thanks Nikita!), I figure I’ll offer another summary of the problem space in the hopes of a deeper analysis suggesting a unified way forward.

Continue reading on PeakD

Larry
28 December 2020 – 5:30pm

Xdebug Update: November 2020 – Derick Rethans

Xdebug Update: November 2020

Another monthly update where I explain what happened with Xdebug development in this past month. These will be published on the first Tuesday after the 5th of each month.

Patreon and GitHub supporters will get it earlier, on the first of each month.

I am currently looking for more funding, especially now some companies have dropped out, and that GitHub sponsors is no longer matching supporters.

You can become a patron or support me through GitHub Sponsors. I am currently 73% towards my $1,000 per month goal.

If you are leading a team or company, then it is also possible to support Xdebug through a subscription.

In November, I worked on Xdebug for about 72 hours, with funding being around 30 hours. I worked mostly on the following things:

Xdebug 3

The biggest thing this month is the release of Xdebug 3!

After about a year and a half after starting with this massive undertaking, it is finally ready. I released it the day before PHP 8 came out. Of course Xdebug 3 also supports PHP 8. It however drops support for PHP 7.1 as per the support policy.

As is custom with a x.0.0 release, a few bugs did occur. I am currently working at addressing then. I plan to release bug release versions weekly throughout December, as long as it makes sense to do so.

Xdebug 3 should be a lot faster, as it is a lot more clever on when it hooks into things it needs to do. That does come with changes as to how Xdebug needs to be configured. Xdebug 3’s upgrade guide lists all the changes.

The https://xdebug.org web site now only contains Xdebug 3 documentation, with the old site archived at https://2.xdebug.org until the end of 2021.

I will be recording some videos about the ideas behind the changes, and how to use Xdebug 3. I am also playing with the idea of hosting “Office Hours” for an hour a week where users can drop-in with questions and problems. If that is something that you’re interested in, please let me know.

Xdebug Cloud

I have been continuing to test Xdebug Cloud, and I am working with a few private alpha testers. They’re putting the hosted Cloud service to its paces with the latest PhpStorm 2020.3 release candidate. As I suspected, the alpha testers found some minor issues which I will be addressing during December.

The web site for Xdebug Cloud does not have a design yet, but this is coming this month as well.

If you want to be kept up to date with Xdebug Cloud, please sign up to the mailinglist, which I will use to send out an update not more than once a month.

Business Supporter Scheme and Funding

In November, two new supporters signed up.

Thank you Find My Electric and Edmonds Commerce!

If you, or your company, would also like to support Xdebug, head over to the support page!

Besides business support, I also maintain a Patreon page and a profile on GitHub sponsors.

Development-Mode Modules for Mezzio – Matthew Weier O’Phinney

I fielded a question in the Laminas Slack yesterday that I realized should likely be a blog post.
The question was:

Is there a way to register development-mode-only modules in Mezzio?

There’s actually multiple ways to do it, though one that is probably more preferable to others.

Conditional ConfigProviders

We already provide one pattern for doing this in the Mezzio skeleton application, by conditionally including the mezzio-swoole ConfigProvider if the class is present:

class_exists(\Some\ConfigProvider::class) ? \Some\ConfigProvider::class : function (): array { return []; },

Alternately, you could express this as an anonymous function:

function (): array { if (class_exists(\Some\ConfigProvider::class)) { return (new \Some\ConfigProvider())(); } return [];
},

(The values provided to the ConfigAggregator constructor can be either string class names of config providers, or functions returning arrays, which is why either of these will work.)

This approach is primarily useful if the config provider will only be installed as a require-dev dependency.
But what if you are defining the config provider in your own code, and it’s always present?

Development-Mode Configuration Aggregation

Another possibility is to do some “hacking” around how laminas-development-mode works with Mezzio.
laminas-development-mode in Mezzio works with the config/autoload/development.local.php.dist file; enabling development mode symlinks config/autoload/development.local.php to that file.
That file just needs to return an array.
As such, you could totally write it to aggregate other config providers, as well as some default development configuration, using the same tools you do in your primary configuration file:

// in config/autoload/development.local.php.dist: declare(strict_types=1); use Laminas\ConfigAggregator\ArrayProvider;
use Laminas\ConfigAggregator\ConfigAggregator; $developmentConfig = [ // app-level development config you want to define
]; $aggregator = new ConfigAggregator([ // any ConfigProviders you want to list, then: new ArrayProvider($developmentConfig),
]); return $aggregator->getMergedConfig();

This approach is likely the best to use, as it makes it more clear in your main config what the default modules are, and any dev-only ones are now listed in this file.

mwop Development-Mode Modules for Mezzio was originally published on https://mwop.net by .

Install PHP 8.0 on CentOS, RHEL or Fedora – Remi Collet

Here is a quick howto upgrade default PHP version provided on Fedora, RHEL or CentOS with latest version 8.0.

You can also follow the Wizard instructions.

 

Repositories configuration:

On Fedora, standards repositories are enough, on Enterprise Linux (RHEL, CentOS) the Extra Packages for Enterprise Linux (EPEL) repository must be configured, and on RHEL the optional channel must be enabled.

Fedora 33

dnf install https://rpms.remirepo.net/fedora/remi-release-33.rpm

Fedora 32

dnf install https://rpms.remirepo.net/fedora/remi-release-32.rpm

RHEL version 8.3

dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

RHEL version 7.9

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
subscription-manager repos --enable=rhel-7-server-optional-rpms

CentOS version 8

dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

CentOS version 7

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm

 

php module usage

With Fedora modular and RHEL / CentOS 8, you can simply use the remi-8.0 stream of the php module

dnf module reset php
dnf module install php:remi-8.0

 

remi-php80 repository activation

Needed packages are in the remi-safe (enabled by default) and remi-php80 repositories, the latest is not enabled by default (administrator choice according to the desired PHP version).

RHEL or CentOS 7

yum install yum-utils
yum-config-manager --enable remi-php80

Fedora

dnf config-manager --set-enabled remi-php80

 

PHP upgrade

By choice, the packages have the same name than in the distribution, so a simple update is enough:

yum update

That’s all 🙂

$ php -v
PHP 8.0.0 (cli) (built: Nov 24 2020 17:04:03) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies with Zend OPcache v8.0.0, Copyright (c), by Zend Technologies

 

Known issues

The upgrade can fail (by design) when some installed extensions are not yet compatible with  PHP 8.0.

See the compatibility tracking list: PECL extensions RPM status

If these extensions are not mandatory, you can remove them before the upgrade, else, you will have to be patient.

Warning: some extensions are still under development, but it seems useful to provide them to allow upgrade to more people, and to allow user to give feedback to the authors.

 

More d’information

If you prefer to install PHP 8.0 beside the default PHP version, this can be achieved using the php80 prefixed packages, see the PHP 8.0 as Software Collection post.

You can also try the configuration wizard.

The packages available in the repository will be used as sources for Fedora 35 (if self contained change proposal is accepted).

By providing a full feature PHP stack, with about 130 available extensions, 7 PHP versions, as base and SCL packages, for Fedora and Enterprise Linux, and with 300 000 download per day, remi repository became in the last 15 years a reference for PHP users on RPM based distributions, maintained by an active contributor to the projects (Fedora, PHP,

Truncated by Planet PHP, read more at the original (another 888 bytes)