nextcloud / nextcloud/server

Provide mechanism to override libraries with custom/patched versions

Open
#54,825 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage enhancement
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.
A lot of times, system admins have patches or modifications to libraries that they need to apply for their specific use cases. Many times, they have submitted a PR, it is yet to be approved or has gone stale, but they still need the feature. However, directly editing core files is a bad idea and causes system integrity checks to fail.

Describe the solution you'd like
It would be great if there was a way to add library overrides to the system so that the autoloader picks them up at runtime. Perhaps they could be placed in config/overrides/[path-of-lib-from-root], for example config/overrides/lib/private/DB/AdapterMySQL.php)

Describe alternatives you've considered
I did write a very hacky piece of logic in a *.config file that implements this functionality, but it's not ideal, and it would be good if there was something officially supported.

Additional context
An example, this PR has been open forever, and there are other users who rely on this functionality:
https://github.com/nextcloud/user_saml/pull/697

Until the PR is merged, it would be nice to be able to override the default libraries to provide the desired features.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the autoloader and the example path config/overrides/lib/private/DB/AdapterMySQL.php mentioned in the issue. Review the linked nextcloud/user_saml#697 pull request for the motivating use case. Done would mean a documented, officially supported override mechanism that preserves system integrity checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.