Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294225

rebuild.php incompatible with PhpStorage classes that reside in contrib (DRUPAL_ROOT/modules/*)

$
0
0

Problem/Motivation

The drupal_rebuild() function (called from rebuild.php) isn't finding code that lives in DRUPAL_ROOT/modules.

To reproduce, create and enable a foobar module, and add this to modules/foobar/src/PhpStorage/MtimeReplace.php

/**
 * Test swapping out storage to contrib.
 */

namespace Drupal\foobar\PhpStorage;

use Drupal\Component\PhpStorage\MTimeProtectedFileStorage;

class CoordinatedMtimeReplace extends MTimeProtectedFileStorage {
  
}

then edit settings.php and add these lines:

$settings['php_storage']['twig'] = array(
  'class' => 'Drupal\foobar\PhpStorage\MtimeReplace',
  'secret' => $settings['hash_salt'],
);

running php rebuild.php now results in:

Fatal error: Class 'Drupal\foobar\PhpStorage\MtimeReplace' not found in /.../core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php on line 57

This was originally thought to be a drush issue, but is actually a problem with rebuild.php and drupal_rebuild().

Proposed resolution

Remaining tasks

User interface changes

API changes


Viewing all articles
Browse latest Browse all 294225

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>