I have a Drupal 7 module that uses the Symfony Yaml class. This is the contents of its composer.json

{
  "require": {
    "symfony/yaml": "3.1"
  }
}

Enabling the module with drush downloads the required library from Packagist and installs under the directory designated in the site's Composer File Directory (as set in Composer Manager).

However, when my module calls Yaml::parse, I get the following error:

Fatal error: Class 'Yaml' not found in ...module on line ...

I've looked at the autoloader files that lives below the vendor directory (../vendor/composer/, and they are being updated when I install the module and it looks like symfony/yaml is added in the right places.

What am I missing?

Comments

gisle created an issue. See original summary.

gisle’s picture

Issue summary: View changes
gisle’s picture

Status: Active » Closed (works as designed)

My bad.