sanitizeBridgeName($request['bridge']); } if ($bridgeClassName === null) { throw new \InvalidArgumentException('Bridge name invalid!'); } // whitelist control if (!$bridgeFactory->isWhitelisted($bridgeClassName)) { throw new \Exception('This bridge is not whitelisted', 401); die; } $bridge = $bridgeFactory->create($bridgeClassName); $bridge->loadConfiguration(); $value = $request['value']; $cacheFactory = new CacheFactory(); $cache = $cacheFactory->create(); $cache->setScope(get_class($bridge)); $cache->setKey($key); $cache->saveData($value); header('Content-Type: text/plain'); echo 'done'; } }