original_string: public function configuration_validation($data, $files, array $errors) {
          if (empty($errors['prefix'])) {
              $factory = cache_factory::instance();
              $config = $factory->create_config_instance();
              foreach ($config->get_all_stores() as $store) {
                  if ($store['plugin'] === 'apcu') {
                      if (isset($store['configuration']['prefix'])) {
                          if ($data['prefix'] === $store['configuration']['prefix']) {
                              // The new store has the same prefix as an existing store, thats a problem.
                              $errors['prefix'] = get_string('prefixnotunique', 'cachestore_apcu');
                              break;
                          }
                      } else if (empty($data['prefix'])) {
                          // The existing store hasn't got a prefix and neither does the new store, that's a problem.
                          $errors['prefix'] = get_string('prefixnotunique', 'cachestore_apcu');
                          break;
                      }
                  }
              }
          }
          return $errors;
      }
code: public function configuration_validation($data, $files, array $errors) {
          if (empty($errors['prefix'])) {
              $factory = cache_factory::instance();
              $config = $factory->create_config_instance();
              foreach ($config->get_all_stores() as $store) {
                  if ($store['plugin'] === 'apcu') {
                      if (isset($store['configuration']['prefix'])) {
                          if ($data['prefix'] === $store['configuration']['prefix']) {
                              // The new store has the same prefix as an existing store, thats a problem.
                              $errors['prefix'] = get_string('prefixnotunique', 'cachestore_apcu');
                              break;
                          }
                      } else if (empty($data['prefix'])) {
                          // The existing store hasn't got a prefix and neither does the new store, that's a problem.
                          $errors['prefix'] = get_string('prefixnotunique', 'cachestore_apcu');
                          break;
                      }
                  }
              }
          }
          return $errors;
      }
code_tokens: public function configuration_validation ( $ data , $ files , array $ errors ) { if ( empty ( $ errors [ 'prefix' ] ) ) { $ factory = cache_factory :: instance ( ) ; $ config = $ factory -> create_config_instance ( ) ; foreach ( $ config -> get_all_stores ( ) as $ store ) { if ( $ store [ 'plugin' ] === 'apcu' ) { if ( isset ( $ store [ 'configuration' ] [ 'prefix' ] ) ) { if ( $ data [ 'prefix' ] === $ store [ 'configuration' ] [ 'prefix' ] ) { // The new store has the same prefix as an existing store, thats a problem. $ errors [ 'prefix' ] = get_string ( 'prefixnotunique' , 'cachestore_apcu' ) ; break ; } } else if ( empty ( $ data [ 'prefix' ] ) ) { // The existing store hasn't got a prefix and neither does the new store, that's a problem. $ errors [ 'prefix' ] = get_string ( 'prefixnotunique' , 'cachestore_apcu' ) ; break ; } } } } return $ errors ; }
docstring: Validates the configuration data.
  
  We need to check that prefix is unique.
  
  @param array $data
  @param array $files
  @param array $errors
  @return array
  @throws coding_exception
docstring_tokens: Validates the configuration data .