fix: Change back base.php to have the same behavior as before

Isolated OC in its own file instead so that index.php can do finer init.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2026-03-12 12:22:17 +01:00 committed by Carl Schwan
parent 6fc03681bd
commit 94102ac464
No known key found for this signature in database
GPG key ID: 02325448204E452A
8 changed files with 2561 additions and 1319 deletions

View file

@ -30,7 +30,6 @@ function exceptionHandler($exception) {
}
try {
require_once __DIR__ . '/lib/base.php';
OC::init();
// set to run indefinitely if needed
if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {

View file

@ -17,8 +17,6 @@ require_once __DIR__ . '/lib/versioncheck.php';
try {
require_once __DIR__ . '/lib/base.php';
OC::init();
if (isset($argv[1]) && ($argv[1] === '-h' || $argv[1] === '--help')) {
echo 'Description:
Run the background job routine

View file

@ -19,7 +19,9 @@ use OCP\Server;
use OCP\Template\ITemplateManager;
use Psr\Log\LoggerInterface;
require_once __DIR__ . '/lib/base.php';
require_once __DIR__ . '/lib/OC.php';
\OC::boot();
$handler = static function () {
try {

2554
lib/OC.php Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -280,7 +280,6 @@ class Router implements IRouter {
$this->loadRoutes();
}
$this->eventLogger->start('route:url:match', 'Symfony url matcher call');
$matcher = new UrlMatcher($this->root, $this->context);
try {

View file

@ -11,7 +11,6 @@ use OCP\IRequest;
use OCP\Server;
require_once __DIR__ . '/../lib/base.php';
OC::init();
header('Content-Type: application/json');

View file

@ -97,8 +97,6 @@ function resolveService($service) {
try {
require_once __DIR__ . '/lib/base.php';
OC::init();
// All resources served via the DAV endpoint should have the strictest possible
// policy. Exempted from this is the SabreDAV browser plugin which overwrites
// this policy with a softer one if debug mode is enabled.