For my module cloudinary_storage_db I have a cloudinary_storage_db.services.yml with the following:

    class: Drupal\cloudinary_storage_db\CloudinaryStorageDb

There is a matching CloudinaryStorageDb.php file in my module's src directory. Unfortunately, it doesn't seem to load, and class_exists('CloudinaryStorageDb') returns false. What am I missing here? I've tried clearing caches multiple times to no avail. How can I force it to load the file? Do I have to do an include - thought the autoloading eliminated that?

The class file contains this:

namespace Drupal\cloudinary_storage_db;

use Drupal\cloudinary_storage\CloudinaryStorage;

 * Implements cloudinary storage with database.
class CloudinaryStorageDb extends CloudinaryStorage {
  • 1
    Are you injecting this service anywhere or calling it with the global Drupal service container?
    – Kevin
    Aug 8, 2016 at 20:11
  • 2
    class_exists('CloudinaryStorageDb') won't find a class because the parameter is not using the full namespace. You would need to try class_exists('\Drupal\cloudinary_storage_db\CloudinaryStorageDb')
    – mradcliffe
    Aug 8, 2016 at 20:13
  • Also, see: drupal.org/node/2133171
    – Kevin
    Aug 8, 2016 at 20:37


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.