Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sm
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
sm
Merge requests
!19
Resolve
#3472868
"Switch to dex"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Resolve
#3472868
"Switch to dex"
issue/sm-3472868:3472868-switch-to-dex
into
1.x
Overview
0
Commits
1
Pipelines
1
Changes
5
Open
dpi
requested to merge
issue/sm-3472868:3472868-switch-to-dex
into
1.x
8 months ago
Overview
0
Commits
1
Pipelines
1
Changes
5
Expand
Closes
#3472868
0
0
Merge request reports
Compare
1.x
1.x (base)
and
latest version
latest version
96629ef0
1 commit,
8 months ago
5 files
+
6
−
52
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
bin/sm deleted
100755 → 0
+
0
−
47
Options
#!/usr/bin/env php
<?php
declare
(
strict_types
=
1
);
use
Composer\Autoload\ClassLoader
;
use
Drupal\Core\DrupalKernel
;
use
Drupal\Core\Site\Settings
;
use
Symfony\Component\Console\Application
;
use
Symfony\Component\HttpFoundation\Request
;
// We have the luxury of using this global.
# https://getcomposer.org/doc/articles/vendor-binaries.md#finding-the-composer-autoloader-from-a-binary
require_once
dirname
(
$GLOBALS
[
'_composer_autoload_path'
])
.
'/autoload_runtime.php'
;
if
(
'cli'
!==
\PHP_SAPI
)
{
throw
new
Exception
(
'This script must be run from the command line.'
);
}
// Utilizes the https://symfony.com/doc/current/components/runtime.html component
// to encapsulate the application cleanly.
return
static
function
(
array
$context
):
Application
{
$loaders
=
ClassLoader
::
getRegisteredLoaders
();
$classLoader
=
reset
(
$loaders
);
// Discovery can get out of whack if cleared caches and try to run this
// command without a web request priming discovery.
chdir
(
\DRUPAL_ROOT
);
$kernel
=
new
DrupalKernel
(
'prod'
,
$classLoader
,
FALSE
);
$kernel
::
bootEnvironment
();
$kernel
->
setSitePath
(
$context
[
'DRUPAL_DEV_SITE_PATH'
]
??
'sites/default'
);
Settings
::
initialize
(
$kernel
->
getAppRoot
(),
$kernel
->
getSitePath
(),
$classLoader
);
$kernel
->
boot
();
// Drupal is highly dependent on a Request:
$request
=
Request
::
createFromGlobals
();
$kernel
->
getContainer
()
->
get
(
'request_stack'
)
->
push
(
$request
);
// This sets things up, esp loadLegacyIncludes().
$kernel
->
preHandle
(
$request
);
$app
=
new
Application
(
'sm'
,
\Drupal
::
VERSION
);
// A container technique like Symfony.
$app
->
add
(
$kernel
->
getContainer
()
->
get
(
'console.command.messenger_consume_messages'
));
return
$app
;
};
Loading