Development BlogVersion checks for extensions

Post Reply
User avatar
Topic Starter
Restless Rancor
Great Britain

Site Admin
New Member
Posts: 48
Joined: October 15th, 2018, 3:14 pm
Age: 25
Location: Hampshire, England
Contact:

Version checks for extensions

#1

Post by Restless Rancor » October 20th, 2018, 11:38 am

When an extension is validated at phpBB.com a version checker is automatically added, so admins may see a new version is available, without leaving their ACP.

I wanted to learn the process so that my development extensions could have this feature. I'm a long way off validation, but it'd be nice for people to know an update is available without having to constantly check the development topic.

The guide I followed was very straight forward, but I ran into a problem with placing the version_check.json file under a domain with SSL and more specifically, under https://www.restlessrancor.com which has a temporary redirect to this forum. (I plan on eventually adding a homepage there).

To be absolutely sure it was an SSL related issue I changed the json file location to a non-SSL domain and the version check was successful; I started to think the redirect in the .htaccess at https://www.restlessrancor.com was the culprit, so started to mess with it.

Another topic at phpBB.com had a similar issue, so I tried what was successful for them:

Code: Select all

Redirect 302 / https://forum.restlessrancor.com
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
Nope. In fact that broke everything.

A while later I remembered reading that using tab for indentations could cause issues and to use 4 spaces instead. The formatting improved, but the version check still failed. (That's actually just for the config/services.yml file).

Comparing with other extensions I saw that I needed to add the SSL status to the composer:

Code: Select all

"version-check": {
            "host": "restlessrancor.com",
            "directory": "/versions",
            "filename": "postcountonindex.json",
            "ssl": "true"
            }
    }
Broadening my search, I looked to replace the entire .htaccess file to redirect all but a specified folder:

Code: Select all

RewriteCond $1 !^versions
RewriteRule (.*) https://forum.restlessrancor.com/$1 [R=301,L]
A short while later I added a missing , in the composer and had a successful version check!


These aren't the droids you're looking for.

Post Reply

Topic Subscribers

1 user subscribed to this topic: Restless Rancor