Skip to content
Snippets Groups Projects
Commit cb550768 authored by catch's avatar catch
Browse files

Issue #3260778 by andypost, daffie: Remove deprecated code from bootstrap.inc

parent 61bc211b
No related branches found
No related tags found
38 merge requests!7471uncessary 5 files are moved from media-library folder to misc folder,!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!54479.5.x SF update,!5014Issue #3071143: Table Render Array Example Is Incorrect,!4868Issue #1428520: Improve menu parent link selection,!4289Issue #1344552 by marcingy, Niklas Fiekas, Ravi.J, aleevas, Eduardo Morales...,!4114Issue #2707291: Disable body-level scrolling when a dialog is open as a modal,!3630Issue #2815301 by Chi, DanielVeza, kostyashupenko, smustgrave: Allow to create...,!3291Issue #3336463: Rewrite rules for gzipped CSS and JavaScript aggregates never match,!3143Issue #3313342: [PHP 8.1] Deprecated function: strpos(): Passing null to parameter #1 LayoutBuilderUiCacheContext.php on line 28,!3102Issue #3164428 by DonAtt, longwave, sahil.goyal, Anchal_gupta, alexpott: Use...,!2853#3274419 Makes BaseFieldOverride inherit the internal property from the base field.,!2719Issue #3110137: Remove Classy from core.,!2437Issue #3238257 by hooroomoo, Wim Leers: Fragment link pointing to <textarea>...,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2074Issue #2707689: NodeForm::actions() checks for delete access on new entities,!2062Issue #3246454: Add weekly granularity to views date sort,!1974Issue #3036862 demonstration,!1591Issue #3199697: Add JSON:API Translation experimental module,!1484Exposed filters get values from URL when Ajax is on,!1255Issue #3238922: Refactor (if feasible) uses of the jQuery serialize function to use vanillaJS,!1254Issue #3238915: Refactor (if feasible) uses of the jQuery ready function to use VanillaJS,!1162Issue #3100350: Unable to save '/' root path alias,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!957Added throwing of InvalidPluginDefinitionException from getDefinition().,!925Issue #2339235: Remove taxonomy hard dependency on node module,!877Issue #2708101: Default value for link text is not saved,!873Issue #2875228: Site install not using batch API service,!872Draft: Issue #3221319: Race condition when creating menu links and editing content deletes menu links,!844Resolve #3036010 "Updaters",!712Issue #2909128: Autocomplete intermittent on Chrome Android,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493,!485Sets the autocomplete attribute for username/password input field on login form.,!30Issue #3182188: Updates composer usage to point at ./vendor/bin/composer
......@@ -10,69 +10,6 @@
use Drupal\Core\Test\TestDatabase;
use Drupal\Core\Utility\Error;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
/**
* Minimum allowed version of PHP for Drupal to be bootstrapped.
*
* Below this version:
* - The installer cannot be run.
* - Updates cannot be run.
* - Modules and themes cannot be enabled.
* - If a site managed to bypass all of the above, then an error is shown in
* the status report and various fatal errors occur on various pages.
*
* @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
* \Drupal::MINIMUM_PHP instead.
*
* @see https://www.drupal.org/node/2909361
* @see install.php
*/
const DRUPAL_MINIMUM_PHP = \Drupal::MINIMUM_PHP;
/**
* Minimum supported version of PHP.
*
* Below this version:
* - New sites cannot be installed, except from within tests.
* - Updates from previous Drupal versions can be run, but users are warned
* that Drupal no longer supports that PHP version.
* - An error is shown in the status report that the PHP version is too old.
*
* @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
* \Drupal::MINIMUM_SUPPORTED_PHP instead.
*
* @see https://www.drupal.org/node/2909361
*/
const DRUPAL_MINIMUM_SUPPORTED_PHP = \Drupal::MINIMUM_SUPPORTED_PHP;
/**
* Minimum recommended version of PHP.
*
* Sites installing Drupal on PHP versions lower than this will see a warning
* message, but Drupal can still be installed. Used for (e.g.) PHP versions
* that have reached their EOL or will in the near future.
*
* @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
* \Drupal::RECOMMENDED_PHP instead.
*
* @see https://www.drupal.org/node/2909361
*/
const DRUPAL_RECOMMENDED_PHP = \Drupal::RECOMMENDED_PHP;
/**
* Minimum recommended value of PHP memory_limit.
*
* 64M was chosen as a minimum requirement in order to allow for additional
* contributed modules to be installed prior to hitting the limit. However,
* 40M is the target for the Standard installation profile.
*
* @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
* \Drupal::MINIMUM_PHP_MEMORY_LIMIT instead.
*
* @see https://www.drupal.org/node/2909361
*/
const DRUPAL_MINIMUM_PHP_MEMORY_LIMIT = \Drupal::MINIMUM_PHP_MEMORY_LIMIT;
/**
* Error reporting level: display no errors.
......@@ -123,104 +60,6 @@
*/
define('DRUPAL_ROOT', dirname(__DIR__, 2));
/**
* Returns and optionally sets the filename for a system resource.
*
* The filename, whether provided, cached, or retrieved from the database, is
* only returned if the file exists.
*
* This function plays a key role in allowing Drupal's resources (modules
* and themes) to be located in different places depending on a site's
* configuration. For example, a module 'foo' may legally be located
* in any of these three places:
*
* core/modules/foo/foo.info.yml
* modules/foo/foo.info.yml
* sites/example.com/modules/foo/foo.info.yml
*
* Calling drupal_get_filename('module', 'foo') will give you one of
* the above, depending on where the module is located.
*
* @param $type
* The type of the item; one of 'core', 'profile', 'module', 'theme', or
* 'theme_engine'.
* @param $name
* The name of the item for which the filename is requested. Ignored for
* $type 'core'.
* @param $filename
* The filename of the item if it is to be set explicitly rather
* than by consulting the database.
*
* @return string
* The filename of the requested item or NULL if the item is not found.
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
* \Drupal\Core\Extension\ExtensionPathResolver::getPathname() instead.
*
* @see https://www.drupal.org/node/2940438
*/
function drupal_get_filename($type, $name, $filename = NULL) {
@trigger_error('drupal_get_filename() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Extension\ExtensionPathResolver::getPathname() instead. See https://www.drupal.org/node/2940438', E_USER_DEPRECATED);
// Type 'core' only exists to simplify application-level logic; it always maps
// to the /core directory, whereas $name is ignored. It is only requested via
// \Drupal\Core\Extension\ExtensionList::getPath(). The file
// /core/core.info.yml does not exist, but is required since
// ExtensionList::getPath() returns the dirname() of the returned pathname.
if ($type === 'core') {
return 'core/core.info.yml';
}
try {
/** @var \Drupal\Core\Extension\ExtensionList $extension_list */
$extension_list = \Drupal::service("extension.list.$type");
if (isset($filename)) {
// Manually add the info file path of an extension.
$extension_list->setPathname($name, $filename);
}
return $extension_list->getPathname($name);
}
catch (ServiceNotFoundException $e) {
// Catch the exception. This will result in triggering an error.
// If the service is unknown, create a user-level error message.
trigger_error(
sprintf('Unknown type specified: "%s". Must be one of: "core", "profile", "module", "theme", or "theme_engine".', $type),
E_USER_WARNING
);
}
catch (\InvalidArgumentException $e) {
// Catch the exception. This will result in triggering an error.
// If the filename is still unknown, create a user-level error message.
trigger_error(
sprintf('The following %s is missing from the file system: %s', $type, $name),
E_USER_WARNING
);
}
}
/**
* Returns the path to a system item (module, theme, etc.).
*
* @param $type
* The type of the item; one of 'core', 'profile', 'module', 'theme', or
* 'theme_engine'.
* @param $name
* The name of the item for which the path is requested. Ignored for
* $type 'core'.
*
* @return string
* The path to the requested item or an empty string if the item is not found.
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
* \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.
*
* @see https://www.drupal.org/node/2940438
* @see \Drupal\Core\Extension\ExtensionList::getPath()
*/
function drupal_get_path($type, $name) {
@trigger_error('drupal_get_path() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead. See https://www.drupal.org/node/2940438', E_USER_DEPRECATED);
return dirname(drupal_get_filename($type, $name));
}
/**
* Translates a string to the current language or to a given language.
*
......
......@@ -446,19 +446,6 @@ protected function applyLibrariesOverride($libraries, $extension) {
return $libraries;
}
/**
* Wraps drupal_get_path().
*
* @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
* \Drupal\Core\Extension\ExtensionList::getPath() instead.
*
* @see https://www.drupal.org/node/2940438
*/
protected function drupalGetPath($type, $name) {
@trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead. See https://www.drupal.org/node/2940438', E_USER_DEPRECATED);
return $this->extensionPathResolver->getPath($type, $name);
}
/**
* Determines if the supplied string is a valid URI.
*/
......
<?php
namespace Drupal\KernelTests\Core\Bootstrap;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests that drupal_get_filename() works correctly.
*
* @group Bootstrap
* @group legacy
*/
class GetFilenameTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['system'];
/**
* Tests drupal_get_filename() deprecation.
*/
public function testDrupalGetFilename(): void {
$this->expectDeprecation('drupal_get_filename() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Extension\ExtensionPathResolver::getPathname() instead. See https://www.drupal.org/node/2940438');
$this->assertEquals('core/modules/system/system.info.yml', drupal_get_filename('module', 'system'));
}
/**
* Tests drupal_get_path() deprecation.
*/
public function testDrupalGetPath(): void {
$this->expectDeprecation('drupal_get_path() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead. See https://www.drupal.org/node/2940438');
$this->expectDeprecation('drupal_get_filename() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Extension\ExtensionPathResolver::getPathname() instead. See https://www.drupal.org/node/2940438');
$this->assertEquals('core/modules/system', drupal_get_path('module', 'system'));
}
}
......@@ -29,12 +29,12 @@ public function testEnsureComposerVersion() {
* Ensure that the configured php version matches the minimum php version.
*
* Also ensure that the minimum php version in the root-level composer.json
* file exactly matches DRUPAL_MINIMUM_PHP.
* file exactly matches \Drupal::MINIMUM_PHP.
*/
public function testEnsurePhpConfiguredVersion() {
$composer_json = json_decode(file_get_contents($this->root . '/composer.json'), TRUE);
$composer_core_json = json_decode(file_get_contents($this->root . '/core/composer.json'), TRUE);
$this->assertEquals(DRUPAL_MINIMUM_PHP, $composer_json['config']['platform']['php'], 'The DRUPAL_MINIMUM_PHP constant should always be exactly the same as the config.platform.php in the root composer.json.');
$this->assertEquals(\Drupal::MINIMUM_PHP, $composer_json['config']['platform']['php'], 'The \Drupal::MINIMUM_PHP constant should always be exactly the same as the config.platform.php in the root composer.json.');
$this->assertEquals($composer_core_json['require']['php'], '>=' . $composer_json['config']['platform']['php'], 'The config.platform.php configured version in the root composer.json file should always be exactly the same as the minimum php version configured in core/composer.json.');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment