INTEREST JOURNAL DRUPAL & WEB

Can Core CLI and PHP Replace Drush in Drupal 12 beta2?

About 1,000 words 5 min read

Japanese ↗
On this page

What can run without Drush in this beta environment?

The previous Drupal 12 beta record described dependency conflicts when attempting to install Drush. This follow-up checks which tasks can use the core CLI or PHP APIs in that same environment.

Core status reporting and cache rebuilding ran successfully. An extension-installation dry run also succeeded. Other tasks, including database updates and configuration synchronization, did not have matching commands in the observed registry.

Availability, help inspection and actual execution are recorded separately. Drush itself was not run in this environment.

Environment checked

These checks were performed on November 7, 2026 using the existing DDEV project on a MacBook.

Component Observed configuration
Drupal 12.0.0-beta2
Container PHP CLI 8.5.12
Symfony Console / Runtime Both v8.1.9 in composer.lock
Drush Not installed
Working directory Project root, one level above web

The host PHP was 8.4.27. Commands used ddev exec to run the container’s PHP. This was a local beta evaluation, not a production installation or upgrade test.

PHP, Symfony Console and the core CLI

PHP executes programs; it does not automatically provide Drush commands. Code that operates on Drupal must initialize the appropriate site and call its APIs or services.

Symfony Console provides the command-line infrastructure used by Drupal’s core CLI. The official CLI API overview ↗ describes the relationship to Drupal’s included Symfony version. A Symfony application’s bin/console or cache:clear command is not automatically a Drupal command.

The working entry point was vendor/bin/dr, a Composer proxy for core/scripts/dr. In the checked beta2 source, the older core/scripts/drupal is a deprecated forwarding script. See the core CLI change record ↗ and Symfony Console documentation .

Comparison by task

The Drush column identifies familiar counterparts from its documentation. It is not a side-by-side execution or complete option-compatibility test. Available core commands depend on the installed site and modules.

Task Drush example Core CLI or alternative Evidence in this environment
Status drush status vendor/bin/dr system:status Executed successfully; fields and formats need not match Drush
Cache rebuild drush cache:rebuild vendor/bin/dr cache:rebuild Executed; isolated test cache item disappeared
Cron drush cron vendor/bin/dr system:cron Registry and help only; tasks not run
One-time login URL drush user:login vendor/bin/dr user:login Registry and help only; no URL generated or login performed
Module installation drush pm:enable vendor/bin/dr ex:install, with aliases including pm:install Successful dry run for basic_auth; no installation
Theme installation drush theme:install vendor/bin/dr ex:install Help and source inspection only; no install or default-theme change
Database updates drush updatedb No matching command registered; official instructions also describe web-based update.php Registry absence verified; neither update method executed
Configuration synchronization drush config:export / config:import No matching commands registered No configuration synchronization performed
Configuration and state changes drush config:set / state:set No matching commands; a PHP API implementation would be separate work No setting changes performed
PHP execution drush php:eval A PHP script that initializes Drupal Read-only API checks ran; not arbitrary Drush compatibility
Database backup drush sql:dump DDEV export-db, for example Documented alternative; not run for this comparison

pm:uninstall and theme:enable were also absent from the observed registry. Theme installation through ex:install does not by itself mean changing the default theme. Inspect the actual command list and help for your version.

Commands executed

Run from the project root; the URL below belongs to this local evaluation site.

ddev exec php vendor/bin/dr --version
ddev exec php vendor/bin/dr --url=https://interest-dr12.ddev.site list --format=json
ddev exec php vendor/bin/dr --url=https://interest-dr12.ddev.site system:status
ddev exec php vendor/bin/dr --url=https://interest-dr12.ddev.site cache:rebuild

Status output reported Drupal 12.0.0-beta2, PHP 8.5.12 and the interest default theme. Cache rebuilding returned exit code 0.

To check behavior beyond the success message, I stored an isolated test cache item through PHP, ran the rebuild and confirmed that the item was gone. Node count (60), user count (2), default theme and maintenance state matched before and after. This checks selected values, not the absence of every database change.

The installation check used a dry run:

ddev exec php vendor/bin/dr --url=https://interest-dr12.ddev.site ex:install basic_auth --dry-run

It listed basic_auth as the proposed module and returned exit code 0 without installing it. An initial attempt using ban returned exit code 1 because that extension was not found in this environment. Names used in older guides cannot automatically be carried into another version.

Direct PHP means additional responsibilities

A PHP bootstrap also read the core version, entity counts, theme configuration and maintenance state. Drupal APIs were accessible without Drush.

That does not establish that a short PHP call replaces an entire Drush workflow. The script must handle autoloading, site selection, initialization and errors. Database updates and configuration imports also involve ordering, batch execution and failure handling. Those workflows were not tested here.

For reusable custom commands, the official command-porting guide ↗ describes separating services from CLI entry points. No custom command or additional package was installed for this comparison.

Findings and remaining work

When Drush installation is blocked, inspecting vendor/bin/dr list can reveal operations already provided by the target environment. Status reporting and cache rebuilding worked here; extension installation was checked only with a dry run.

Database updates, configuration synchronization and actual extension installation remain untested. Database-update checks should be a separate experiment with a backup and suitable update target, including consideration of the web-based update.php route described in the official core-update instructions ↗ .

These results describe this environment on November 7, 2026. They do not establish compatibility for future Drush releases or every Drupal 12 installation.

Other references: Drush command list , database updates , status reporting and DDEV commands .

Drupal 11 and 12 checks and samples · Previous Drupal 12 beta record

Follow-up: database updates and restoration

Tasks left untested above were followed up in a separate copy: web-based database updates, restoration after failure and a fixture-only custom PHP experiment. See the database-update follow-up . The table above remains the initial check record.

Drupal 11 & 12 checks and samples ↗