Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
#1920902: Add a Drupal Yaml wrapper so we can default to PECL Yaml component if it is available.
Need to:
1. Tell people what's installed.
2. Potentially suggest the PECL parser if it's not installed.
Image module does the same for uploads.
Comment | File | Size | Author |
---|
Issue fork drupal-2157447
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:
- 2157447-add-hookrequirements-yaml changes, plain diff MR !5641
Comments
Comment #1
larowlanMakes sense
Comment #2
larowlanSomething like this
Screenshots:
Without
With
Comment #3
benjy CreditAttribution: benjy commentedMissing comma
And again.
Just a few style issues otherwise looks good.
Comment #5
larowlan2: yaml-extension-2157447.1.patch queued for re-testing.
Comment #6
benjy CreditAttribution: benjy commentedAdded the commas, fixed a typo and a minor rewording.
Comment #8
marvil07 CreditAttribution: marvil07 commentedI tested this locally both without and with the extension enabled, and it works as expected.
Comment #9
alexpottSurely this should only be done once #1920902: Add a Drupal Yaml wrapper so we can default to PECL Yaml component if it is available is done?
Comment #10
catchComment #11
marvil07 CreditAttribution: marvil07 commentedSorry for the confusion.
Comment #14
andypostI'd better displayed version installed somehow
Comment #15
sidharthapreroll patch against 8.3.x. tried to find out the version but not yet success.
Comment #16
andypostI think http://php.net/manual/en/reflectionextension.getversion.php is what you looking for
Comment #17
sidharthapThank you @andypost for sharing the link. Here is the updated patch along with the screen short after change.
Comment #18
andypostLooks great for me
Comment #19
tstoecklerAny reason we're not also doing this for
$phase == 'install'
?For checking the opcache extension, for example, we are also taking both install and runtime into account.
Comment #20
andypostProbably it makes sense to notice at install as well otoh this is PECL and not so easy as opcache shiped
Looking at #2792877: Symfony YAML parser fails on some strings when running PHP 7 also I worry about this sort of issues
Comment #24
andypostComment #25
andypostReroll & fix #19
Comment #26
alexpottThis shouldn't be a warning. It's not wrong to not use it. Personally I feel like this is not necessary to put requirements screen. Also I can't see how this is related to #2844452: Export configuration YAML strings as multiline at all.
Comment #27
andypostIt is related by different behavior when pecl enabled.
As it gives 10% speed-up sometimes this looks like warning similar to opcache
Comment #28
alexpott10% only on very cold caches. It is completely unlike opcache which affects every request. This affects 0 requests once caches are in place. Also the only reason you are seeing differences is because you are writing with PECL yaml which we do not support at all. All writes should take place with Symfony to ensure that config is transportable regardless of what you have installed.
Comment #29
andypostI wonders why you so cares about formating when yaml supposed to be formating agnostic, and it was the main reason to select it over more common xml because it more readable for humans
Finally core operates at config objects which are going to be typed (mostly) then excachange should just have tests that pecl->SF and back works at config level
Comment #30
alexpott@andypost so... we care about portability and people ending up with the same results regardless of what PHP extensions installed. And seeing unexpected differences in YAML files which end up having no differences in the data is to be avoided at all costs. That's why Symfony is always used to write. Plus there's the fact that Symfony respects the 1.2 spec whereas PECL is 1.1.
As stated before I think we shouldn't recommend PECL Yaml on the status report and certainly not with a warning.
Comment #31
joachim CreditAttribution: joachim as a volunteer commentedI agree that the WARNING is a bit alarming.
For comparison, upload progress doesn't set a severity level: https://api.drupal.org/api/drupal/core%21modules%21file%21file.install/f...
Comment #33
joachim CreditAttribution: joachim as a volunteer commentedLet's downgrade the warning.
Comment #43
andypostAs related showing it still good to have #3205480-18: Drop PECL YAML library support in favor of only Symfony YAML
Comment #45
andypostCreated MR with the latest patch
Comment #46
andypostFixed #33
Comment #47
alexpottI don't know if we have to recommend the PECL yaml parser. I think we could indicate what's be used for YAML parsing on the status report and link to a page on drupal.org that discusses the possibilities..
Comment #48
Wim Leers#47++
Recommending it is too strong, because one needs control over their hosting environment to be able to do this.
Informing is great 👍
Comment #49
andypostThe MR already provides informing
maybe it needs section at https://www.drupal.org/docs/getting-started/system-requirements/php-requ... with the link from report/status
Comment #50
Wim Leers"will improve" sounds like a recommendation to me? 😅
Left a suggestion for changing it to "merely informing", i.e. purely observing.
Comment #51
smustgrave CreditAttribution: smustgrave at Mobomo commentedAgree that
sounds like a recommendation, or. that not doing it means I'm doing something wrong.
But maybe that sentence could be added to a section in https://www.drupal.org/docs/getting-started/system-requirements/php-requ... that @andypost recommended.
So maybe
Comment #52
andypostIt becoming a follow-up for #3205480: Drop PECL YAML library support in favor of only Symfony YAML
Comment #53
andypostproper status