/** * Remove a named adapter * * @param $name * @return bool */ public function remove($name) { $key = "doctrine.connection.{$name}"; $this->globalConfig->deleteKey($key); $this->localConfig->deleteKey($key); return true; }
/** * Remove a named adapter * * @param string $name * @return true */ public function remove($name) { $key = 'db.adapters.' . $name; $this->globalConfig->deleteKey($key); $this->localConfig->deleteKey($key); return true; }
/** * Delete the REST configuration associated with the given * service * * @param DoctrineRestServiceEntity $entity */ public function deleteDoctrineRestConfig(DoctrineRestServiceEntity $entity) { // Get hydrator name $config = $this->configResource->fetch(true); $hydratorName = $config['zf-hal']['metadata_map'][$entity->entityClass]['hydrator']; $objectManagerClass = $config['doctrine-hydrator'][$hydratorName]['object_manager']; $key = ['doctrine-hydrator', $hydratorName]; $this->configResource->deleteKey($key); $key = ['zf-apigility', 'doctrine-connected', $entity->resourceClass]; $this->configResource->deleteKey($key); $key = ['zf-rest', $entity->controllerServiceName]; $this->configResource->deleteKey($key); $key = ['zf-content-negotiation', 'controllers', $entity->controllerServiceName]; $this->configResource->deleteKey($key); $key = ['zf-content-negotiation', 'accept-whitelist', $entity->controllerServiceName]; $this->configResource->deleteKey($key); $key = ['zf-content-negotiation', 'content-type-whitelist', $entity->controllerServiceName]; $this->configResource->deleteKey($key); $key = ['zf-hal', 'metadata_map', $entity->collectionClass]; $this->configResource->deleteKey($key); $key = ['zf-hal', 'metadata_map', $entity->entityClass]; $this->configResource->deleteKey($key); $validator = $config['zf-content-validation'][$entity->controllerServiceName]['input_filter']; $key = ['zf-content-validation', $entity->controllerServiceName]; $this->configResource->deleteKey($key); $key = ['input_filter_specs', $validator]; $this->configResource->deleteKey($key); }
/** * Delete any service manager configuration for the resource * * @param RestServiceEntity $entity */ public function deleteServiceManagerConfig(RestServiceEntity $entity) { $resourceClass = $entity->resourceClass; foreach (['invokables', 'factories'] as $serviceType) { $key = ['service_manager', $serviceType, $resourceClass]; $this->configResource->deleteKey($key); } }
/** * Remove authentication * * @return true */ public function removeOldAuthentication() { $configKeys = ['zf-mvc-auth.authentication.http', 'zf-oauth2.db', 'zf-oauth2.mongo', 'zf-oauth2.storage']; foreach ($configKeys as $key) { $this->globalConfig->deleteKey($key); $this->localConfig->deleteKey($key); } return true; }
/** * Delete the Content Negotiation configuration for a named RPC * service * * @param string $serviceName */ public function deleteContentNegotiationConfig($serviceName) { $key = array('zf-content-negotiation', 'controllers', $serviceName); $this->configResource->deleteKey($key); $key = array('zf-content-negotiation', 'accept-whitelist', $serviceName); $this->configResource->deleteKey($key); $key = array('zf-content-negotiation', 'content-type-whitelist', $serviceName); $this->configResource->deleteKey($key); }
/** * Remove authentication * * @return true */ public function remove() { $configKeys = array('zf-mvc-auth.authentication.http', 'zf-oauth2.db', 'zf-oauth2.mongo', 'zf-oauth2.storage', 'router.routes.oauth'); foreach ($configKeys as $key) { $this->globalConfig->deleteKey($key); $this->localConfig->deleteKey($key); } return true; }
public function testDeleteNonexistentKeyShouldDoNothing() { $config = []; $writer = new PhpArray(); $writer->toFile($this->file, $config); // Ensure the writer has written to the file! $this->assertEquals($config, include $this->file); // Create config resource, and delete a key $configResource = new ConfigResource($config, $this->file, $writer); $test = $configResource->deleteKey('sub.sub2.sub3'); // Verify what was returned was what we expected $expected = []; $this->assertEquals($expected, $test); // Verify the file contains what we expect $test = (include $this->file); $this->assertEquals($expected, $test); }
/** * Remove a Content Negotiation * * @param string $name * @return true */ public function remove($name) { $key = 'zf-content-negotiation.selectors.' . $name; $this->globalConfig->deleteKey($key); return true; }
/** * Delete authorization configuration associated with a service * * @param string $serviceName */ public function deleteAuthorizationConfig($serviceName) { $key = ['zf-mvc-auth', 'authorization', $serviceName]; $this->configResource->deleteKey($key); }