Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ an active article offline or deleting it entirely:

## Requirements

- phpBB 3.3.0 or later (also tested on phpBB 4.0)
- phpBB 3.3.19 or later (also tested on phpBB 4.0)
- PHP 7.4 or later

Tested versions and compatibility notes: [docs/compatibility.md](docs/compatibility.md).
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"extra": {
"display-name": "phpBB Modders Wiki",
"soft-require": {
"phpbb/phpbb": ">=3.3.0,<4.1@dev"
"phpbb/phpbb": ">=3.3.19,<4.1@dev"
}
}
}
32 changes: 31 additions & 1 deletion ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,23 @@ class ext extends \phpbb\extension\base
const NEW_REPARSER_NAME = 'phpbbmodders.wiki.text_reparser.article_text';

/**
* Refuse to enable below the minimum phpBB and PHP versions.
*
* Refuse to enable while the old copy is still enabled; both would run
* at once and the old one's data can't be moved while it's in use.
*
* @return bool|array True if enableable, otherwise an array of reasons
* @return bool|string|array True if enableable, otherwise a reason string or array of reasons
*/
public function is_enableable()
{
if (!$this->check_phpbb_version() || !$this->check_php_version())
{
$language = $this->container->get('language');
$language->add_lang('install_wiki', 'phpbbmodders/wiki');

return $language->lang('WIKI_NOT_ENABLEABLE');
}

if ($this->container->get('ext.manager')->is_enabled(self::OLD_EXT_NAME))
{
return ['Disable the old "' . self::OLD_EXT_NAME . '" extension first (keep its data, do not delete it).'];
Expand All @@ -66,6 +76,26 @@ public function is_enableable()
return true;
}

/**
* Require phpBB 3.3.19
*
* @return bool
*/
public function check_phpbb_version()
{
return phpbb_version_compare(PHPBB_VERSION, '3.3.19', '>=');
}

/**
* Require PHP 7.4
*
* @return bool
*/
public function check_php_version()
{
return PHP_VERSION_ID >= 70400;
}

/**
* Move an old install's data to the new name, then enable as usual.
*
Expand Down
46 changes: 46 additions & 0 deletions language/en/install_wiki.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
*
* Wiki extension for the phpBB Forum Software package
*
* @copyright (c) 2015 tas2580 (https://tas2580.net)
* @copyright (c) Christian Schnegelberger (Crizz0), phpBB.de - 3.2.x fork
* @copyright (c) 2026, phpBB Modders, https://www.phpbbmodders.com/
* @license GNU General Public License, version 2 (GPL-2.0)
*
* See README.md for full acknowledgments and this fork's changes.
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = [];
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, [
'WIKI_NOT_ENABLEABLE' => 'phpBB Modders Wiki could not be enabled. The minimum requirements of phpBB 3.3.19 and/or PHP 7.4.0 were not satisfied.',
]);
Loading