Skip to content

Commit

Permalink
2.1.5-b3
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeWCS committed Feb 11, 2023
1 parent 418ef6b commit 3541f2e
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 37 deletions.
7 changes: 7 additions & 0 deletions lf-who-was-here-2_build_changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
### 2.1.5

#### 2.1.5-b3
* EC Fehler behoben.
* Funktionen ohne Rückgabewert als `void` deklariert.
* PHP Mindestversion auf 7.1 erhöht und Maximalversion auf 8.2 erhöht:
* `composer.json` angepasst.
* `ext.php` angepasst.

#### 2.1.5-b2
* ACP-Modul:
* Umgestellt auf Controller.
Expand Down
4 changes: 4 additions & 0 deletions lf-who-was-here-2_changelog_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
* ACP-Template:
* Wurde der Sicherheitsschalter "Erlaube Migrationen" aktiviert, dann wurde durch die modale Javscript Rückfrage `confirm()` verhindert, dass der Browser den aktivierten Zustand des Schalters darstellen konnte, da die Aktualisierung der Render Engine noch gar nicht beendet war. Jetzt wartet die JS Funktion bis diese Aktualisierung abgeschlossen ist.
* Toggle Farben von "Extension Manager Plus" übernommen, also Blau/Grau statt Grün/Rot.
* ACP-Modul:
* Umgestellt auf Controller.
* Code Optimierungen:
* PHP: Unnötige `sprintf()` entfernt.
* PHP: Explizite Typdeklarationen bei Funktionen.
* Twig: Das `spaceless` Tag, welches seit Twig 2.7 als DEPRECATED eingestuft ist, wurde entfernt. Stattdessen wird `spaceless` Filter und Whitespace Modifier eingesetzt.
* PHP Mindestversion auf 7.1 erhöht und Maximalversion auf 8.2 erhöht:

### 2.1.4
GH (2022-12-03) / CDB (2022-12-22)
Expand Down
15 changes: 2 additions & 13 deletions lukewcs/whowashere/acp/acp_who_was_here_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,12 @@ public function main($id, $mode)
{
global $phpbb_container;

/** @var \vendorname\packagename\controller\acp_controller $acp_controller */
$acp_controller = $phpbb_container->get('lukewcs.whowashere.controller.acp');

// Make the $u_action url available in our ACP controller
$acp_controller->set_page_url($this->u_action);

/** @var \phpbb\language\language $language */
$language = $phpbb_container->get('language');

// Load a template from adm/style for our ACP page
$this->tpl_name = 'acp_who_was_here_settings';

// Set the page title for our ACP page
// $this->page_title = $language->lang('LFWWH_NAV_TITLE');
$this->page_title = $language->lang('LFWWH_NAV_TITLE') . ' - ' . $language->lang('LFWWH_NAV_CONFIG');

// Load the display options handle in our ACP controller
$acp_controller = $phpbb_container->get('lukewcs.whowashere.controller.acp');
$acp_controller->set_page_url($this->u_action);
$acp_controller->module_settings();
}
}
6 changes: 3 additions & 3 deletions lukewcs/whowashere/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "phpbb-extension",
"description": "Shows a visitor statistic of the current day or a freely selectable period. It lists both visitors and bots, as well as numbers on visible members, invisible members, bots and guests. In addition, the extension offers a visitor record and is extensively adjustable.",
"homepage": "https://www.phpbb.com/customise/db/extension/lf_who_was_here_2/",
"version": "2.1.5-b2",
"time": "2023-02-09",
"version": "2.1.5-b3",
"time": "2023-02-11",
"license": "GPL-2.0-only",
"authors": [
{
Expand All @@ -24,7 +24,7 @@
}
],
"require": {
"php": ">=7.0.0,<8.2.0",
"php": ">=7.1.0,<8.3.0@dev",
"composer/installers": "~1.0.0"
},
"extra": {
Expand Down
27 changes: 14 additions & 13 deletions lukewcs/whowashere/controller/acp_who_was_here_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ class acp_who_was_here_controller
protected $config;
protected $user;
protected $cache;
protected $ext_manager;
public $u_action;

public function __construct(
\phpbb\language\language $language,
\phpbb\template\template $template,
\phpbb\request\request $request,
\phpbb\config\config $config,
\phpbb\user $user,
\phpbb\cache\driver\driver_interface $cache,
\phpbb\extension\manager $ext_manager,
\phpbb\language\language $language,
\phpbb\template\template $template,
\phpbb\request\request $request,
\phpbb\config\config $config,
\phpbb\user $user,
\phpbb\cache\driver\driver_interface $cache,
\phpbb\extension\manager $ext_manager
)
{
$this->language = $language;
Expand All @@ -43,14 +44,8 @@ public function __construct(

public function module_settings()
{
$md_manager = $this->ext_manager->create_extension_metadata_manager('lukewcs/whowashere');
$this_meta = $md_manager->get_metadata('all');
$notes = [];

$this->language->add_lang(['acp_who_was_here', 'who_was_here'], 'lukewcs/whowashere');

add_form_key('lukewcs_whowashere');

if ($this->request->is_set_post('submit'))
{
if (!check_form_key('lukewcs_whowashere'))
Expand Down Expand Up @@ -106,6 +101,12 @@ public function module_settings()
trigger_error($this->language->lang('LFWWH_MSG_SAVED_SETTINGS') . adm_back_link($this->u_action));
}

add_form_key('lukewcs_whowashere');

$md_manager = $this->ext_manager->create_extension_metadata_manager('lukewcs/whowashere');
$this_meta = $md_manager->get_metadata('all');
$notes = [];

$ext_display_name = $this_meta['extra']['display-name'];
$ext_ver = $this_meta['version'];
$ext_lang_min_ver = $this_meta['extra']['lang-min-ver'];
Expand Down
12 changes: 6 additions & 6 deletions lukewcs/whowashere/core/who_was_here.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function __construct(
*/

// Update the users session in the table.
public function update_session()
public function update_session(): void
{
if ($this->user->data['user_id'] != ANONYMOUS)
{
Expand Down Expand Up @@ -207,7 +207,7 @@ public function update_session()
}

// Fetching the user-list and putting the stuff into the template.
public function display()
public function display(): void
{
$is_index = ($this->user->page['page_name'] == 'index.' . $this->php_ext);
$force_display = false;
Expand Down Expand Up @@ -540,7 +540,7 @@ public function display()
}

// Deletes the users from the list, whose visit is to old.
public function prune()
public function prune(): bool
{
if ($this->config['lfwwh_time_mode'] == self::TIME_MODE_TODAY)
{
Expand Down Expand Up @@ -572,7 +572,7 @@ public function prune()
}

// Cleans up the table and delete the cache when user accounts have been deleted. Inserts also a notification if clean up was necessary. (LukeWCS)
public function clear_up($event)
public function clear_up($event): void
{
if (!$this->config['lfwwh_clear_up'])
{
Expand Down Expand Up @@ -610,7 +610,7 @@ public function clear_up($event)
}

// Adds permissions. (LukeWCS)
public function add_permissions($event)
public function add_permissions($event): void
{
$permissions = $event['permissions'];
$lang_show_users = $this->language->lang('ACL_U_LFWWH_SHOW_USERS'); // needs phpBB >=3.2.10
Expand All @@ -626,7 +626,7 @@ public function add_permissions($event)
}

// Returns the users array
private function view_state()
private function view_state(): array
{
switch ($this->config['lfwwh_sort_by'])
{
Expand Down
4 changes: 2 additions & 2 deletions lukewcs/whowashere/ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class ext extends \phpbb\extension\base
{
public function is_enableable()
{
$valid_phpbb = phpbb_version_compare(PHPBB_VERSION, '3.2.10', '>=') && phpbb_version_compare(PHPBB_VERSION, '3.4.0', '<');
$valid_php = phpbb_version_compare(PHP_VERSION, '7.0.0', '>=') && phpbb_version_compare(PHP_VERSION, '8.2.0', '<');
$valid_phpbb = phpbb_version_compare(PHPBB_VERSION, '3.2.10', '>=') && phpbb_version_compare(PHPBB_VERSION, '3.4.0-dev', '<');
$valid_php = phpbb_version_compare(PHP_VERSION, '7.1.0', '>=') && phpbb_version_compare(PHP_VERSION, '8.3.0-dev', '<');

return $valid_phpbb && $valid_php;
}
Expand Down

0 comments on commit 3541f2e

Please sign in to comment.