[ABD] Improved Extension Management

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

[ABD] Improved Extension Management

Post by javiexin » Sun Mar 05, 2017 6:48 pm

Extension Name: Improved Extension Management
Author: javiexin

Extension Description:
This extension replaces the existing Extension Management with these improved services.

Current Version: 1.0.3 DEV
Requires: 3.2.0 or later

Features:
1.0.0 DEV - Initial version
  • Uses service decoration to replace/expand the core extension manager object from phpbb in a 100% compatible way.
  • Uses service inheritance to replace/expand the core extension metadata manager object from phpbb in a 100% compatible way.
  • Uses a combination of launcher module/listener/controller to replace/expand the core ACP extensions page in a 100% compatible way.
  • Encapsulates Metadata mgr y Extension classes into the Extension Mgr, making it unneeded to use them directly. A number of methods allow access to these facilities where needed.
  • Metadata for extensions is only read (at most) once per extension, and cached in the Extension Mgr.
  • Refactors all components for consistency and code reuse.
  • Makes the use of some functions coherent (before, they were misaligned) such as is_available/all_available.
  • Most of the changes available here (but not all) have been submitted for inclusion into the core, but while they are evaluated and discussed, here they are
1.0.1 DEV - Multi actions
  • Refactor ACP extension template files, using a single template file for all extension actions, both on a single extension and on multiple extensions
  • Operate on multiple extensions at the same time (multi-enable, disable, delete-data), allowing to select extensions from the extension list, and executing an action on all of them (sequentially)
  • All metadata validation methods now have the option to throw exceptions or return boolean false on error, selected by a method parameter; the default behaviour is keeping backward compatibility; this is also exposed through the extension manager validation proxy method
1.0.2 DEV - Multi actions with minor fixes
  • Improved Extension Mgr may be disabled within a multi-operation, by doing it last
  • Trying to perform multi-operations on an empty list now triggers an error
  • Other minor fixes and code improvements
1.0.3 DEV - Visual improvements to Multi actions
  • Improve visuals and form behaviours in extension list for actions on multiple extensions
  • Allow selecting all extensions that support an specific action
  • Enable only the multi actions that are relevant for the selected extensions
  • Out of the selected extensions, only those supporting an specific action are taken into consideration when executing multi action
  • Implement methods in extension/manager.php to check if an action may be executed on a given extension
As you can see, this is an extension that makes available improvements in core code, but at this point it does not add any extra functionality to the forum.

With the version 1.0.1, the first visible improvement to the core Extension Manager is now available, with the option to perform actions on multiple extensions with a single operation. Version 1.0.2 fixes some minor issues and improvements with this implementation. Version 1.0.3 adds more visual capabilities to the above.

I have mainly done this as an exercise for myself, trying to learn and understand better how to extend and replace existing services, using several methods. As mentioned before, this is using SERVICE DECORATION, so it is not possible to make it work in 3.1 (an equivalent based on service replacement could be done, but I do not think it is worth the while).

Another reason for this is the need for some of these changes that I myself have suffered when trying to complete some extension(s) without them (mostly due to inconsistencies, and significant extra file accesses). That is why I have proposed these as core improvements, but I wanted to make them available to the community in a relatively safe way while that happens. This is also a way to test these further, and to make use of the functionality in the development of new extensions that might need it before it is released in the core (if it is I should say...).

You may take a look at the documents that I have provided, including the list of CORE changes (updated to 2017-04-01) that this extension implements and a description of the new API methods/parameters and functionality (updated to 1.0.3).

This extension works AS IS in a 3.2.0 (or higher when available) system.

This extension is currently under development, so it might have errors or malfunctions:
DO NOT INSTALL ON LIVE BOARDS.

To do:
  • Solve/mitigate the inconsistency between all_available and all_enabled: an enabled extension might not be available, and yet make your forum crash
  • Perform combined actions in a single extension (reenable=disable+enable, uninstall=disable+delete_data...)
If you find an issue, or have questions, let me know here, or open an issue in GitHub (see link below).

If you have ideas for improvements or new functionality, let me know. I will evaluate them and see if they are feasible to be implemented.

Download:
[DEV] Version 1.0.3: https://github.com/javiexin/extension/r ... tag/v1.0.3
Github Repository: https://github.com/javiexin/extension
Previous versions
[DEV] Version 1.0.2: https://github.com/javiexin/extension/r ... tag/v1.0.2
[DEV] Version 1.0.1: removed, use at least 1.0.2 instead
[DEV] Version 1.0.0: https://github.com/javiexin/extension/r ... tag/v1.0.0

Installation:
  1. Unzip the downloaded file.
  2. Copy the whole contents of the unzipped folder in the ext/javiexin/extension directory of your phpBB board, where you should see the main JSON file at (your forum root)/ext/javiexin/extension/composer.json.
  3. Navigate in the ACP to Customise -> Manage extensions.
  4. Look for Improved Extension Management under the Disabled Extensions list, and click its Enable link. If you are in 3.2.0, you will be asked if you want to be redirected to the new ACP module.
  5. You are done!.
To upgrade from previous versions, you should disable the extension, delete all extension files, replace with new version files, and then reenable the extension. You may delete_data (optional), as this extension does not keep any persistent data (no configuration settings or other data).

Important: Only official release versions validated by phpBB should be installed on a live forum. Pre-release (beta, RC) versions are only to be used for testing on offline/development forums.
Last edited by javiexin on Sun Apr 02, 2017 1:27 am, edited 4 times in total.

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by javiexin » Sun Mar 05, 2017 6:52 pm

Reserved.

User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by spaceace » Sun Mar 05, 2017 7:29 pm

very interesting :D

i'm most interested in "Operate on multiple extensions at the same time (multi-enable, disable, delete-data)"

User avatar
Raul [ThE KuKa]
Style Customisations
Style Customisations
Posts: 6525
Joined: Mon Dec 08, 2003 9:24 pm
Location: Spain
Name: Raul Arroyo
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by Raul [ThE KuKa] » Sun Mar 05, 2017 7:57 pm

spaceace wrote:
Sun Mar 05, 2017 7:29 pm
very interesting :D

i'm most interested in "Operate on multiple extensions at the same time (multi-enable, disable, delete-data)"
Include functionality to operate on multiple extensions at the same time (multi-enable, disable, delete_data)

In the future, read the api.md file ;)

Nice job Javier.
All unsolicited PMs will be ignored.
:warning: Knowledge Base | Documentation | Board rules | phpBB Styles Rules & Policies :warning:


If you like my styles, translations, etc. and want to show some appreciation, then feel free to Donate with Image
:flag_es: phpBB Spain - Online Since 2003 :heart:



User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by spaceace » Sun Mar 05, 2017 8:14 pm

Raul [ThE KuKa] wrote:
Sun Mar 05, 2017 7:57 pm
In the future, read the api.md file ;)
ummmm, i did. but i quoted what was in the To do list from the first post ;)

i quoted it only to show interest in a specific part that i like :D

User avatar
Raul [ThE KuKa]
Style Customisations
Style Customisations
Posts: 6525
Joined: Mon Dec 08, 2003 9:24 pm
Location: Spain
Name: Raul Arroyo
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by Raul [ThE KuKa] » Sun Mar 05, 2017 8:41 pm

Ahhhhhh!!! Ok ;)
All unsolicited PMs will be ignored.
:warning: Knowledge Base | Documentation | Board rules | phpBB Styles Rules & Policies :warning:


If you like my styles, translations, etc. and want to show some appreciation, then feel free to Donate with Image
:flag_es: phpBB Spain - Online Since 2003 :heart:



User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by javiexin » Sun Mar 05, 2017 9:11 pm

And THIS viewtopic.php?p=14677686#p14677686 is an example of something that would be solved by
javiexin wrote:
Sun Mar 05, 2017 6:48 pm
To do:
  • Solve/mitigate the inconsistency between all_available and all_enabled: an enabled extension might not be available, and yet make your forum crash

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by javiexin » Sun Mar 05, 2017 9:13 pm

spaceace wrote:
Sun Mar 05, 2017 7:29 pm
i'm most interested in "Operate on multiple extensions at the same time (multi-enable, disable, delete-data)"
Hope I will have something in a few days... Stay tuned.
-javiexin

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by javiexin » Sun Mar 05, 2017 9:31 pm

javiexin wrote:
Sun Mar 05, 2017 9:11 pm
And THIS viewtopic.php?p=14677686#p14677686 is an example of something that would be solved by
javiexin wrote:
Sun Mar 05, 2017 6:48 pm
To do:
  • Solve/mitigate the inconsistency between all_available and all_enabled: an enabled extension might not be available, and yet make your forum crash
As part of this, I will try to provide mechanisms to automatically "soft disable" invalid extensions (if they are supposed to run an specific disable method in the ext class), automatically/manually "force disable" of invalid extensions (if they pose no issue) and manually "force delete_data" invalid extensions (if no migration is needed).
I might also do version compare of the "enabled" vs "installed" extensions, and offer a manual "reenable".

Not sure if I will offer an option to get notifications for such automatic status transitions to those that have the right permissions. Needed?

Does this sound about right?
-javiexin

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

Re: [3.2][DEV] Improved Extension Management

Post by 3Di » Mon Mar 06, 2017 1:46 am

Intense, well done Javier. And thanks. :)
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by javiexin » Thu Mar 16, 2017 3:15 pm

I have now released the next version 1.0.1, that includes some minor improvements, plus one major functionality addition: the possibility to perform actions on multiple extensions in a single operation.

The first post has been updated, and the new download is available.
Please, report any issues and feature requests here.
-javiexin

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by javiexin » Thu Mar 16, 2017 3:17 pm

spaceace wrote:
Sun Mar 05, 2017 7:29 pm
i'm most interested in "Operate on multiple extensions at the same time (multi-enable, disable, delete-data)"
Done... please test and report back!
-javiexin

User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by spaceace » Thu Mar 16, 2017 4:32 pm

javiexin wrote:
Thu Mar 16, 2017 3:17 pm
spaceace wrote:
Sun Mar 05, 2017 7:29 pm
i'm most interested in "Operate on multiple extensions at the same time (multi-enable, disable, delete-data)"
Done... please test and report back!
-javiexin
works perfectly except if you mistakenly check the box to disable this extension in the list as it throws the following error...
General Error
Module not accessible

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/includes/functions_module.php
LINE: 565
CALL: trigger_error()

FILE: [ROOT]/adm/index.php
LINE: 82
CALL: p_master->load_active()
i don't know if it's possible to be able to exclude this extension from the list of check boxes or possibly just have it skip it and leave it for normal disabling. other than that, it works awesome :D

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by javiexin » Thu Mar 16, 2017 4:40 pm

You are perfectly right!

In fact, I even documented this, but forgot to code it!

Give me a short time, and I will fix it.

EDIT: From the API.md file:
Limitation: the Improved Extension Mgr cannot be disabled together with any other.
REEDIT: Now fixed, please, redownload package (although the change is a one liner)

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [3.2][DEV] Improved Extension Management

Post by javiexin » Thu Mar 16, 2017 5:40 pm

Hold it for now, I have found a bug, and I am chasing it.

Fixed two minor bugs, download updated. Latest changes:
  • Make "Improved Extension Mgmt" last for multi-actions (disables properly and redirects to core module)
  • Properly report list of extensions when confirming a multi-action
  • Properly checking for empty list of extensions
Regards,
-javiexin

Locked

Return to “Abandoned Extensions”