New location for Apache PHP config

Under PHP 5, I used to put custom PHP configuration in a file such as /etc/php5/apache2/conf.d/99-foobar.ini and it’d be automatically included by the main php.ini (after most others, thanks to the 99).

Now in PHP 7, it seems to be more normal to add a custom module in /etc/php/7.2/mods-available/foobar.ini and enable it with phpenmod foobar. I guess there’s no priority-setting with this system?

Personal Relationship Manager

Monica allows people to keep track of everything that’s important about their friends and family. Like the activities done with them. When you last called someone. What you talked about. It will help you remember the name and the age of the kids. It can also remind you to call someone you haven’t talked to in a while.

It’s nice to see a new PHP app that (maybe?) still targets shared hosting as a realistic thing.

Will be interested to check it out.

Spaces around dots

One of the first odd things that one finds when starting to work with WordPress code is the excessive use of spaces. Something like:

do_something('Words of '.$widget->noun($attrs['ish']));

becomes the the stretched out:

do_something( 'Words of ' . $widget->noun( $attrs['ish'] ) );

Which is fine, and actually now I’ve been using it for a decade I’m pretty comfortable reading it. But it’s uncommon in the PHP world. (And note the singular place in which spaces aren’t used: the array key, iff it’s a string.)

Not only that, but I just recently realised that the PHP CodeSniffer sniffs for WordPress don’t actually check for the spaces around the concatenation operator. I’ve filed an issue for that.

‘Add node’ link in Drupal Views’ header

Very often one wants to add a link to a View’s header or footer that allows users with permission to quickly jump to the relevant content creation form.

It’s easy to create a Global: Text area with the link, but this would then be seen by all users, regardless of authorization.

A few people have had similar thoughts.

I don’t know if there’s a better way (i.e. probably one that doesn’t involve PHP, not because this is a particularly complicated way of doing things but just that I always figure that Drupal should be usable by non-coders), but here’s how I’ve got it working:—

Required modules: views, views_ui, and php.

Add a Global: Text area header to a view, and select the PHP code text format for it. The code is as follows:


Add new article

Composer repository URLs can’t use UNC paths?

It would seem that when using Composer on Windows, one cannot use UNC paths as repository URLs. That is to say, the following doesn’t work:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "//SERVER/Share/project.git"
    },
  ]
}

Instead, the share must be mapped and the mapped drive letter used:

      "url": "G:/project.git"

This does, of course, have the stupid side effect of forcing everyone who uses the composer.json in question to map the share to the same drive letter! However, this is hardly the most significant of the miseries that one must live through when developing software on Windows…

When Apache invents filename extensions and /index = /index.php

I have now had this problem about every year for the last three or four years, and every time have completely forgotten how I resolved it the previous time. It’s especially annoying, because usually involves searching for such common terms as index.php, apache, directory, etc. which result in almost entirely useless information.

So, here, for my own future reference, is how to stop a stupid Apache from serving /index as /index.php (at, of course, any depth of the path):

Options -MultiViews

So easy. The documentation explains it all.

I’ve just added it to the WebDB .htaccess.

(I have since discovered that this is, of course, already covered on StackOverflow.)

WebDB updated

Yesterday I added a little fix to WebDB for a bug that prevented filtering on column names that occur in both the table being filtered and any of the tables referred to by foreign keys. This most often applied to id columns.

[Update:] And today I’ve (hopefully) fixed the problem with foreign-key fields in edit forms not being able to be emptied. How did that live this long?! Sorry.