original_string: public function delete_store_instance($name) {
          if (!array_key_exists($name, $this->configstores)) {
              throw new cache_exception('The requested store does not exist.');
          }
          if ($this->configstores[$name]['default']) {
              throw new cache_exception('The can not delete the default stores.');
          }
          foreach ($this->configmodemappings as $mapping) {
              if ($mapping['store'] === $name) {
                  throw new cache_exception('You cannot delete a cache store that has mode mappings.');
              }
          }
          foreach ($this->configdefinitionmappings as $mapping) {
              if ($mapping['store'] === $name) {
                  throw new cache_exception('You cannot delete a cache store that has definition mappings.');
              }
          }
  
          // Call instance_deleted()
          $class = 'cachestore_'.$this->configstores[$name]['plugin'];
          $store = new $class($name, $this->configstores[$name]['configuration']);
          $store->instance_deleted();
  
          unset($this->configstores[$name]);
          $this->config_save();
          return true;
      }
code: public function delete_store_instance($name) {
          if (!array_key_exists($name, $this->configstores)) {
              throw new cache_exception('The requested store does not exist.');
          }
          if ($this->configstores[$name]['default']) {
              throw new cache_exception('The can not delete the default stores.');
          }
          foreach ($this->configmodemappings as $mapping) {
              if ($mapping['store'] === $name) {
                  throw new cache_exception('You cannot delete a cache store that has mode mappings.');
              }
          }
          foreach ($this->configdefinitionmappings as $mapping) {
              if ($mapping['store'] === $name) {
                  throw new cache_exception('You cannot delete a cache store that has definition mappings.');
              }
          }
  
          // Call instance_deleted()
          $class = 'cachestore_'.$this->configstores[$name]['plugin'];
          $store = new $class($name, $this->configstores[$name]['configuration']);
          $store->instance_deleted();
  
          unset($this->configstores[$name]);
          $this->config_save();
          return true;
      }
code_tokens: public function delete_store_instance ( $ name ) { if ( ! array_key_exists ( $ name , $ this -> configstores ) ) { throw new cache_exception ( 'The requested store does not exist.' ) ; } if ( $ this -> configstores [ $ name ] [ 'default' ] ) { throw new cache_exception ( 'The can not delete the default stores.' ) ; } foreach ( $ this -> configmodemappings as $ mapping ) { if ( $ mapping [ 'store' ] === $ name ) { throw new cache_exception ( 'You cannot delete a cache store that has mode mappings.' ) ; } } foreach ( $ this -> configdefinitionmappings as $ mapping ) { if ( $ mapping [ 'store' ] === $ name ) { throw new cache_exception ( 'You cannot delete a cache store that has definition mappings.' ) ; } } // Call instance_deleted() $ class = 'cachestore_' . $ this -> configstores [ $ name ] [ 'plugin' ] ; $ store = new $ class ( $ name , $ this -> configstores [ $ name ] [ 'configuration' ] ) ; $ store -> instance_deleted ( ) ; unset ( $ this -> configstores [ $ name ] ) ; $ this -> config_save ( ) ; return true ; }
docstring: Deletes a store instance.
  
  This function also calls save so you should redirect immediately, or at least very shortly after
  calling this method.
  
  @param string $name The name of the instance to delete.
  @return bool
  @throws cache_exception
docstring_tokens: Deletes a store instance .