Step 1 and most trivial step in getting rid of bootstrap "phases" that have no place in an object-oriented service architecture:

The DRUPAL_BOOTSTRAP_DATABASE / _drupal_bootstrap_database() bootstrap phase just includes a PHP file for procedural functions only.

The file inclusion is moved into DRUPAL_BOOTSTRAP_PAGE_CACHE, which should be acceptable, because:

1. database.inc is just a few lines of code

2. once all "phases" are gone, all procedural helpers will be loaded in DRUPAL_BOOTSTRAP_FULL only.


This issue + effort competes with #2016629: Refactor bootstrap to better utilize the kernel, because I'm not able to see the point of having a concept of stacked bootstrap phases in D8's architecture. Migrating/converting them into DrupalKernel methods would be a waste of previous core contributor time and confusing at best.

CommentFileSizeAuthor
#1 drupal8.bootstrap-database-die.0.patch3.68 KBsun
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

sun’s picture

Assigned: Unassigned » sun
Issue summary: View changes
larowlan’s picture

Truth be told database.inc should die, db_ignore_slave() is the only function that doesn't wrap existing OO code.
But thats a pipe dream so +1.
We should consider marking everything in database.inc except that as @deprecated so we have the option to rip it out later.

ParisLiakos’s picture

+1 on @deprecated on everything in there except db_ignore_slave()

sun’s picture

We should consider marking everything in database.inc except that as @deprecated so we have the option to rip it out later.

That's a good idea, but not really relevant here :) So let's create a separate issue for that. :)

andypost’s picture

+++ b/core/includes/bootstrap.inc
@@ -2024,6 +2013,7 @@ function _drupal_bootstrap_page_cache() {
   require_once __DIR__ . '/cache.inc';
+  require_once __DIR__ . '/database.inc';

suppose this should be moved latter in code

sun’s picture

suppose this should be moved latter in code

As explained in the issue summary:

The file inclusion is moved into DRUPAL_BOOTSTRAP_PAGE_CACHE, which should be acceptable, because:

1. database.inc is just a few lines of code

2. once all "phases" are gone, all procedural helpers will be loaded in DRUPAL_BOOTSTRAP_FULL only.

Any other issues or can we move forward here? :)

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

we should collaborate on a co-ordinated approach/roadmap to get us to kernel-based web testing

Crell’s picture

Related: #1894396: Mark db_*() wrappers in database.inc as @deprecated for 9.x

That's on my todo list for this weekend. Meanwhile, I support this patch.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1: drupal8.bootstrap-database-die.0.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
Crell’s picture

Status: Needs review » Reviewed & tested by the community

Well since no one else is doing it...

sun’s picture

catch’s picture

Status: Reviewed & tested by the community » Fixed

#2023495: Make bootstrap three steps is trying to do similar, but I went to far working on a patch for that issue and blew everything up.

Let's commit this and keep going with getting rid of as many of these as possible.

sun’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.