Extensions and version-check (w/ github)

Discussion forum for Extension Writers regarding Extension Development.
User avatar
3Di
Registered User
Posts: 12893
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Extensions and version-check (w/ github)

Post by 3Di » Mon Sep 26, 2016 12:02 am

Thanks for the head-up kasimi.

So in order to be safe we can say:

a) use the ext.php file to set the minimum requirement of phpBB 3.1.8-RC1 as mandatory.

b) Modify your composer.json (version-check object) file to look like this:

Code: Select all

		"version-check":
		{
			"host": "3d-i.github.io",
			"directory": "/site/vchecks",
			"filename": "ipcf-vcheck.json",
			"ssl": true"
		}
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
MarkDHamill
Registered User
Posts: 3431
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Extensions and version-check (w/ github)

Post by MarkDHamill » Mon Oct 03, 2016 1:51 pm

Standby. I need to create the ext.php program.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
MarkDHamill
Registered User
Posts: 3431
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Extensions and version-check (w/ github)

Post by MarkDHamill » Mon Oct 03, 2016 8:00 pm

I created the ext.php program which looks valid:

Code: Select all

<?php
/**
 *
 * @package phpBB Extension - Digests
 * @copyright (c) 2016 Mark D. Hamill (mark@phpbbservices.com)
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
 *
 */

namespace phpbbservices\smartfeed;

/**
 * @ignore
 */

class ext extends \phpbb\extension\base
{

	public function is_enableable()
	{
		global $config;
		return (version_compare($config['version'], '3.1.8-RC1') >= 0) ? true : false;
	}

}
(This shouldn't be a problem anyhow because composer.json specifies phpBB 3.1.9 or greater is required.)

The composer.json looks like:

Code: Select all

{
	"name": "phpbbservices/digests",
	"type": "phpbb-extension",
	"description": "Sends daily, weekly or monthly digests of posts to subscribers via email.",
	"homepage": "https://phpbbservices.com/digests_wp",
	"version": "3.0.6-RC5",
	"license": "GPL-2.0",
	"authors": [
		{
			"name": "Mark D. Hamill",
			"email": "mark@phpbbservices.com",
			"homepage": "https://phpbbservices.com/",
			"role": "Developer"
		}
	],
	"require": {
		"php": ">=5.3.3",
		"composer/installers": "~1.0"
	},
	"extra": {
		"display-name": "Digests",
		"soft-require": {
			"phpbb/phpbb": ">=3.1.9,<3.2.0@dev"
		},
		"version-check": {
			"host": "phpbbservices.com",
			"directory": "/digests/updatecheck/",
			"filename": "3.1.json",
			"ssl": "true"
		}
	}
}
But it doesn't work. (I also tried not putting "true" in quotes, same result.) It is valid JSON, however.
Failed to obtain latest version information.

The operation could not be completed because the fsockopen function has been disabled or the server being queried could not be found.
I verified fsockopen is installed in my test instance.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3097
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Extensions and version-check (w/ github)

Post by kasimi » Mon Oct 03, 2016 8:14 pm

No trailing path delimiter: "directory": "/digests/updatecheck",. The ext.php file is unrelated to checking for updates.

User avatar
MarkDHamill
Registered User
Posts: 3431
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Extensions and version-check (w/ github)

Post by MarkDHamill » Mon Oct 03, 2016 9:20 pm

kasimi, thanks for the suggestion. Unfortunately it didn't work. The trailing delimiter has worked in the past.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3097
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Extensions and version-check (w/ github)

Post by kasimi » Mon Oct 03, 2016 9:49 pm

fsockopen failed to validate your SSL certificate: unable to get local issuer certificate

User avatar
MarkDHamill
Registered User
Posts: 3431
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Extensions and version-check (w/ github)

Post by MarkDHamill » Mon Oct 03, 2016 9:50 pm

Hmm, that's odd. Worth a call to tech support.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
3Di
Registered User
Posts: 12893
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Extensions and version-check (w/ github)

Post by 3Di » Tue Oct 04, 2016 2:34 am

MarkDHamill wrote:I created the ext.php program which looks valid:

Code: Select all

<?php
/**
 *
 * @package phpBB Extension - Digests
 * @copyright (c) 2016 Mark D. Hamill (mark@phpbbservices.com)
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
 *
 */

namespace phpbbservices\smartfeed;

/**
 * @ignore
 */

class ext extends \phpbb\extension\base
{

	public function is_enableable()
	{
		global $config;
		return (version_compare($config['version'], '3.1.8-RC1') >= 0) ? true : false;
	}

}
(This shouldn't be a problem anyhow because composer.json specifies phpBB 3.1.9 or greater is required.)
Again, the ext.php file it's often used (can be) to perform a check based on your wishes prior that the extension will be installed, if the check you coded there has not been satisfied then the extension will not install (an error message is throwed to the end user telling him to check the requirements) and the migration/s will not run.. too.

A true check-point Charlie, so to speak.

Look at this, more elegant and functional (phpbb_version_compare) is a wrapper of version_compare (upper/lowercases insensitive too), I like it. Further-more there is no need to globalise $config.

Code: Select all

    public function is_enableable()
    {
        $config = $this->container->get('config');
        return phpbb_version_compare($config['version'], '3.1.8-rc1', '>=');
    } 
Look, you can write into the composer.json that your extension will work only under phpBB 4.0.0, it will install also in 3.1.x.. I mean, the json file is not YET used for this kind of checking (as kasimi said).
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
MarkDHamill
Registered User
Posts: 3431
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Extensions and version-check (w/ github)

Post by MarkDHamill » Tue Oct 04, 2016 2:05 pm

Thanks 3Di. It's better to use phpBB's version compare function. So I guess what is placed in composer.json is for information and is not enforced.
Get the latest versions of my Digests and Smartfeed mods and extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
david63
Jr. Extension Validator
Posts: 14644
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Extensions and version-check (w/ github)

Post by david63 » Tue Oct 04, 2016 2:16 pm

MarkDHamill wrote:I guess what is placed in composer.json is for information and is not enforced.
Currently yes, but it is planned that at some point in the future that data will be used to validate the install requirements.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
3Di
Registered User
Posts: 12893
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Extensions and version-check (w/ github)

Post by 3Di » Wed Oct 05, 2016 4:03 am

david63 wrote:
MarkDHamill wrote:I guess what is placed in composer.json is for information and is not enforced.
Currently yes, but it is planned that at some point in the future that data will be used to validate the install requirements.
Is planned for 3.3.x but just for languages and/or styles actually. AFAIK.
https://github.com/phpbb/phpbb/pull/4129
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
3Di
Registered User
Posts: 12893
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Extensions and version-check (w/ github)

Post by 3Di » Sat Oct 15, 2016 4:32 am

And yes, for to install extensions through composer. https://github.com/phpbb/phpbb/pull/3909
david63 wrote:
MarkDHamill wrote:I guess what is placed in composer.json is for information and is not enforced.
Currently yes, but it is planned that at some point in the future that data will be used to validate the install requirements.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3097
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Extensions and version-check (w/ github)

Post by kasimi » Fri Feb 09, 2018 5:17 pm

I noticed my GitHub version checks stopped working. When clicking on Details of an affected extension in the ACP Customize tab, I'm seeing this message:

Code: Select all

Failed to obtain latest version information.

The operation could not be completed because the fsockopen function has been disabled or the server being queried could not be found.
This is what's in the Apache error logs:

Code: Select all

PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1409442E:SSL routines:SSL3_READ_BYTES:tlsv1 alert protocol version
PHP Warning: fsockopen(): Failed to enable crypto
PHP Warning: fsockopen(): unable to connect to tls://kasimi.github.io:443 (Unknown error)
In this line, I changed tls:// to ssl:// and it worked again. Does anyone have the same issue?

User avatar
Crizzo
Translations & International Support Teams Manager
Translations & International Support Teams Manager
Posts: 761
Joined: Thu Apr 23, 2009 1:20 pm
Location: Germany
Name: Christian
Contact:

Re: Extensions and version-check (w/ github)

Post by Crizzo » Fri Feb 09, 2018 5:19 pm

Github deactivated tls 1.1. Maybe that is the problem.
My extensions for phpBB: crizzo.de
German phpBB Support at www.phpbb.de

User avatar
3Di
Registered User
Posts: 12893
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Extensions and version-check (w/ github)

Post by 3Di » Fri Feb 09, 2018 5:32 pm

kasimi wrote:
Fri Feb 09, 2018 5:17 pm
Does anyone have the same issue?
Everything's all right here.

I use github's gh-pages FWIW
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 10 guests