PHPSocialNetwork / phpfastcache

A high-performance backend cache system. It is intended for use in speeding up dynamic web applications by alleviating database load. Well implemented, it can drops the database load to almost nothing, yielding faster page load times for users, better resource utilization. It is simple yet powerful.
https://www.phpfastcache.com
MIT License
2.36k stars 452 forks source link

Installation fails: 'Fatal error: Uncaught Error: Class "CacheManager" not found ...' #892

Closed andreaspacher closed 1 year ago

andreaspacher commented 1 year ago

What type of issue is this?

Incorrect/unexpected/unexplainable behavior

Operating system + version

Windows 10

PHP version

8.0.3

Connector/Database version (if applicable)

No response

Phpfastcache version

9.1.2 ✅

Describe the issue you're facing

I am trying to get Phpfastcache running.

I did both a manual download and used composer.

However, I get an error message: Fatal error: Uncaught Error: Class "CacheManager" not found ...

Expected behavior

No response

Code sample (optional)

An example code I used is:

# I checked, the path is correct!
require_once './vendor/autoload.php';

CacheManager::setDefaultConfig(new ConfigurationOption([
    'path' => '/cache', 
]));
$cache = \Phpfastcache\CacheManager::getInstance('Files');

Or I also tried:

use Phpfastcache\CacheManager;
use Phpfastcache\Config\ConfigurationOption;

CacheManager::setDefaultConfig(new ConfigurationOption([
    'path' => '/cache', 
]));
$cache = \Phpfastcache\CacheManager::getInstance('Files');

Suggestion to fix the issue (optional)

No response

References (optional)

No response

Do you have anything more you want to share? (optional)

No response

Have you searched in our Wiki before posting ?

github-actions[bot] commented 1 year ago

Hello curious contributor ! Since it seems to be your first contribution, make sure that you've been:

Geolim4 commented 1 year ago

Hello,

Just check your composer installation, something is not right, it looks like an autoload issue to me.

Look README: https://github.com/PHPSocialNetwork/phpfastcache/blob/master/README.md#construction-step-2-setup-your-website-code-to-implement-the-phpfastcache-calls-with-composer

Geolim4 commented 1 year ago

Hello @andreaspacher ,

I’m closing this issue for now because of (inactivity / outdated code / …).

You can always reopen it though! :) Please (update the issue / add comment / clarify …).

Regards, Georges.L