Code: Select all
public function is_enableable()
{
/* @return bool */
$bb3110 = ( phpbb_version_compare(PHPBB_VERSION, '3.1.10', '>=') && phpbb_version_compare(PHPBB_VERSION, '3.2.0@dev', '<') );
/* @return bool */
$bb320 = ( phpbb_version_compare(PHPBB_VERSION, '3.2.0', '>=') );
/**
* We rely on constants.php
*/
if ( ( ($bb320) || ($bb3110) ) && (function_exists('curl_version')) )
{
return true;
}
else
{
SELF::verbose_it();
}
}
/**
* Let's tell the user what exactly is going on and provide a back-link.
* Using the User Object for BC.
*/
function verbose_it()
{
$this->container->get('user')->add_lang_ext('threedi/ipcf', 'ext_require');
trigger_error($this->container->get('user')->lang['EXTENSION_REQUIREMENTS_NOTICE'] . adm_back_link(append_sid('index.' . $this->container->getParameter('core.php_ext'), 'i=acp_extensions&mode=main')), E_USER_WARNING);
}
Code: Select all
$lang = array_merge($lang, array(
'EXTENSION_REQUIREMENTS_NOTICE' => 'Your phpBB installation doesn\'t meet the requirements of <strong>IP Country Flag</strong> extension.<br />You need at least phpBB 3.1.10 or phpBB 3.2.0.<br />The presence of cURL is mandatory as well.',
));
"phpbb/phpbb": "~3.1.10|~3.2.0"
or "phpbb/phpbb": ">=3.1.10|>=3.2.0"
Way more elegant indeed.
Thanks.
Sorry, one more question: if I read it right, what you are saying is that phpbb/phpbb must be either greater than 3.1.10, or greater than 3.2.0. This is exactly the same as saying it must be greater than 3.1.10, right?.
"phpbb/phpbb": ">=3.1.10,<3.2.0|>=3.2.0,<3.3.0"
Not sure if I got the syntax right, but you get the idea. Probably, it would be more obvious with future versions: "phpbb/phpbb": ">=3.1.11,<3.2.0|>=3.2.1,<3.3.0"
|
but here's what the ~
does: https://getcomposer.org/doc/articles/versions.md#tilde"phpbb/phpbb": "~3.1.10|~3.2.0"
is the best one (not sure about "phpbb/phpbb": ">=3.1.11,<3.2.0|>=3.2.1,<3.3.0"
, it should work I think, but...)For completeness, I think that according to the documentation, these should be all equivalent:kasimi wrote: ↑Sun Jan 22, 2017 1:37 pm I'm not sure about the second example with the|
but here's what the~
does: https://getcomposer.org/doc/articles/versions.md#tilde
"phpbb/phpbb": "~3.1.11||~3.2.1"
- double pipe"phpbb/phpbb": ">=3.1.11,<3.2.0||>=3.2.1,<3.3.0"
- double pipe"phpbb/phpbb": ">=3.1.11 <3.2.0 || >=3.2.1 <3.3.0"
- space for and, same as ,
I wouldn't bother. phpBB 3.2.x usually has everything from 3.1.x in it. So if your 3.1/3.2 compat ext works in 3.2 it should work in 3.1. The main diffs between them with b.c. issues are really down to notifications.
Code: Select all
- php: 5.4
env: DB=mysqli
- php: 5.4
env: DB=mysqli;PHPBB_BRANCH=3.1.x