Further improve addScript logic, migrate to uksort()
Instead of the logic with `first` and `last`, store dependencies in an
own array and sort the scripts topologically by its dependencies later.
Signed-off-by: Jonas Meurer <jonas@freesources.org>
Improve unit testing for Util::addScript() and Util::getScript()
Instead of checking for a predefined order of the scripts, test the
logic: core first, dependencies before their children, no duplicates and
all scripts still listed.
Signed-off-by: Jonas Meurer <jonas@freesources.org>
The current OPcache recommendations match the PHP defaults, but the values are much higher than required to run Nextcloud, even with a high number of installed apps. On the other hand, when other applications use the same OPcache instance, the recommended values might not be sufficient. Accurate recommendations need to take into account actual OPcache usage.
With this commit, recommendations are shown to raise the config value if more than 90% of max cache size or number of keys is used.
The checks whether the module is loaded and whether the OPcache is properly configured have been merged into a single function. This allowed to reduce the overhead of OPcache configuration checks when the module is not loaded.
A check has been added whether Nextcloud is permitted to use the OPcache API. Without this, inconsistencies during core or app upgrades may cause errors and OPcache usage cannot be determined for the new usage based checks.
OPcache usage based checks are skipped when Nextcloud is not permitted to use the API.
Signed-off-by: MichaIng <micha@dietpi.com>
Discard share notification for non-existing groups
Group shares might exist even after a group got deleted.
This fix catches the situation and discards the notification for the
obsolete group.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Co-authored-by: Joas Schilling <coding@schilljs.com>
Introduce a new config option to prevent web UI admins to create
or edit external storages of type "local".
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Fix share owner not being displayed in sharing tab
This only concerns subfolder and files inside a shared folder and is
used as fallback when the OCS api returns a empty result, because it
only works on the shared folder and not the content inside of it.
This unify the tab with the folder list.
This offers a less descriptive share information but making the
OCS api returns all the details even for the subfolder would very
probably be bad for performance (since we would need to fetch the shares
for all the parent folders until we found one or are in the root folder).
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>