cloudinary_php icon indicating copy to clipboard operation
cloudinary_php copied to clipboard

Class 'Cloudinary\ClassUtils' not found

Open tanvihawkscode opened this issue 1 year ago • 1 comments

Class 'Cloudinary\ClassUtils' not found this error occur in BaseConfigSection.php file

tanvihawkscode avatar Mar 28 '24 11:03 tanvihawkscode

Can you please provide where in your script the error occur and the error message? I did a quick test on the PHP SDK but I'm unable to reproduce the error. If you can provide how to reproduce the error, it will be great.

atdcloud avatar Mar 28 '24 22:03 atdcloud

Using Cloudinary SDK v2.x

I'm having the same issue, I can't use composer or any other autoloader and I'm actually making my own loader.php requiring the proper files in the correct order.

"PHP message: PHP Fatal error:  Uncaught Error: Class 'Cloudinary\ClassUtils' not found in [redacted]/src/Configuration/BaseConfigSection.php:208

I can't seem to find the class definition of ClassUtils anywhere in the v2.x SDK.

ClassUtils call in Configuration/BaseConfigSection.php :

        return array_filter(
            ClassUtils::getConstants(static::class, $blacklisted),
            static function ($key) {
                return ! empty($key) && is_string($key);
            }
        );

I guess I'll have the same issue with ArrayUtils, JsonUtils and StringUtils :

namespace Cloudinary\Configuration;

use Cloudinary\ArrayUtils;
use Cloudinary\ClassUtils;
use Cloudinary\JsonUtils;
use Cloudinary\StringUtils;

Any help would be greatly appreciated. Thank you.

edit: I found all missing files, they are in the transformation-builder-sdk package.

tbsandco avatar May 21 '25 13:05 tbsandco

@tbsandco , do you still need assistance from us? I'm not quite clear base from your last update.

atdcloud avatar May 22 '25 01:05 atdcloud

@atdcloud Greetings, I found a way to include the missing files and decided to edit my question in case anyone had a similar issue. It also answers the original issue. It's all good on my hand thank you very much.

tbsandco avatar May 22 '25 06:05 tbsandco

Thanks for letting us know :)

dannyv-cloudinary avatar May 22 '25 11:05 dannyv-cloudinary