Deprecate and remove cron.php in favour of occ system:cron and the cron route

Abierto
#41,914 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript, php
Área
backend, cli, web-dev

Línea de trabajo

Start by reading core/js/backgroundjobs.js, settings/templates/panels/admin/backgroundjobs.php, and the referenced cron.php CLI and web branches; then check the documentation and Docker images for cron.php crontab examples. The issue lists the intended transition for the next minor and major releases. Done means AJAX mode and admin guidance use the route or occ system:cron, legacy CLI use warns and later exits non-zero, and the web redirect remains for one major before removal.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

cron.php has two jobs today, and neither needs to be a standalone file any more:

  • Web (AJAX and webcron modes): it only redirects to the core.Cron.run route.
  • CLI: it shells out to occ system:cron (see #41895 for why that's fragile: it depends on the working directory, the exit code is lost, and system() is often disabled).

We've been telling admins to use occ system:cron for years, but the product still points at cron.php:

  • core/js/backgroundjobs.js:24 calls $.get(OC.webroot+'/cron.php') on every page load in AJAX mode, which is the default.
  • settings/templates/panels/admin/backgroundjobs.php:49 and :57 tell admins to call cron.php for both webcron and system cron (the strings are translated in about 25 l10n files).
  • Existing webcron registrations and crontab lines (php -f …/cron.php) in the wild, in docs and Docker images.

Deleting the file now would silently stop background jobs on AJAX-mode installs and on every legacy webcron or crontab setup.

Proposed path

Next minor (non-breaking):

  • Point backgroundjobs.js at the core.Cron.run route instead of /cron.php.
  • Reword the admin panel: system cron → occ system:cron, webcron → the route URL.
  • Check the docs and our Docker images for cron.php crontab lines and switch them to occ.
  • Make the CLI branch of cron.php log and print a deprecation warning.

Next major (breaking):

  • CLI branch of cron.php exits non-zero with "use occ system:cron" instead of running jobs.
  • Keep the web redirect for one more major, then remove cron.php.
Lenguaje dominante
PHP
Estrellas
8.8k
Forks
2.1k
Merge medio
19 h 32 min
PR fusionados (30 d)
56

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de owncloud/core

Todos los issues de owncloud/core

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.