### Problem/Motivation
The CKEditor CodeMirror configuration form offers the “PHP (including HTML)” mode (`application/x-httpd-php`). However, the module's `ckeditor_codemirror/codemirror` library does not declare CodeMirror's PHP mode script (`mode/php/php.js`) or its required C-like mode dependency (`mode/clike/clike.js`).
Because these scripts are not attached, selecting PHP mode cannot provide PHP syntax highlighting.
This was reproduced against the current 3.1.x branch at commit `91a6393ee40af696e9f842efc5038c75cd042b94` in both environments:
* Drupal 10.6.15
* Drupal 11.4.5
* PHP 8.3.33
* CodeMirror 5.65.21
* `ckeditor5-source-editing-codemirror` 35.1.0
The isolated runtime probe completed successfully in both environments and confirmed that both `php.js` and `clike.js` are absent from the resolved library definition.
### Steps to reproduce
1. Install and enable CKEditor CodeMirror 3.1.x and its external libraries.
2. Configure a CKEditor 5 text format containing the Source Editing toolbar button.
3. Enable CodeMirror source highlighting.
4. Select “PHP (including HTML)” as the mode and save the text format.
5. Open a content editing form and switch CKEditor to source mode.
6. Inspect the JavaScript assets attached by the `ckeditor_codemirror/codemirror` library.
### Actual result
The following required CodeMirror assets are not attached:
* `/libraries/codemirror/mode/clike/clike.js`
* `/libraries/codemirror/mode/php/php.js`
PHP syntax highlighting is therefore unavailable.
### Expected result
The required C-like and PHP mode scripts are attached so that `application/x-httpd-php` is registered and PHP source is highlighted correctly.
### Proposed resolution
* Add `mode/clike/clike.js` and `mode/php/php.js` to the `ckeditor_codemirror/codemirror` library.
* Add automated regression coverage verifying that both assets are present in the resolved library definition.
### Remaining tasks
* [ ] Add the missing asset declarations.
* [ ] Add an automated regression test.
* [ ] Create and review the merge request.
* [ ] Verify automated test results.
### User interface changes
None.
### API changes
None.
### Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| ckeditor_codemirror_runtime_probe_20260825T005717Z.txt | 1.99 KB | andrei_vf |
Issue fork ckeditor_codemirror-3619036
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
andrei_vf commentedThe merge request is ready for review:
https://git.drupalcode.org/project/ckeditor_codemirror/-/merge_requests/13
The change declares the CodeMirror C-like and PHP mode assets and adds regression coverage for both resolved library paths.
Pipeline #936052 passed successfully:
* PHPUnit: 3 tests, 32 assertions.
* CSpell: 12 files checked, 0 issues.
* Composer and Composer lint checks passed.
The remaining non-blocking PHPStan findings are pre-existing issues in the project, and the PHPCS warning concerns a generated CI metadata file rather than this change.