| | |
| | | namespace JVBase\integrations; |
| | | |
| | | use Exception; |
| | | use JVBase\managers\CacheManager; |
| | | use JVBase\managers\Cache; |
| | | use JVBase\managers\UploadManager; |
| | | use JVBase\meta\MetaManager; |
| | | use JVBase\managers\ErrorHandler; |
| | |
| | | * Caching Configuration |
| | | */ |
| | | protected ?string $cacheName = null; |
| | | protected CacheManager $cache; |
| | | protected Cache $cache; |
| | | protected array $cacheStrategy = [ |
| | | 'aggressive' => 3600, // 1 hour for stable data (e.g., profile info) |
| | | 'moderate' => 300, // 5 minutes for semi-dynamic data (e.g., posts) |
| | |
| | | { |
| | | $this->cacheName = $this->cacheName ?: $this->service_name; |
| | | $this->userID = $userID; |
| | | $this->cache = CacheManager::for('integrations_' . $this->cacheName, $this->ttl); |
| | | $this->cache = Cache::for('integrations_' . $this->cacheName, $this->ttl); |
| | | |
| | | // Load error stats from cache |
| | | $this->loadErrorStats(); |
| | |
| | | |
| | | protected function clearCache():array |
| | | { |
| | | $success = $this->cache->clear(); |
| | | $success = $this->cache->flush(); |
| | | return [ |
| | | 'success' => $success, |
| | | ]; |
| | |
| | | $params = $this->addOAuthParams($params); |
| | | } |
| | | |
| | | $auth_url = $this->oauth['authorize'] . '?' . http_build_query($params); |
| | | |
| | | |
| | | return $auth_url; |
| | | return $this->oauth['authorize'] . '?' . http_build_query($params); |
| | | } |
| | | |
| | | /** |