Removed unnecessary includes of well-known types from PHP generator. (#7311)

* Removed unnecessary includes of well-known types from PHP generator.

* Changed some split calls to work properly with the Copybara import rewrites.
pull/7317/head
Joshua Haberman 5 years ago committed by GitHub
parent 53128559ae
commit 4567a21004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      src/google/protobuf/compiler/php/php_generator.cc

@ -37,16 +37,6 @@
#include <google/protobuf/io/printer.h> #include <google/protobuf/io/printer.h>
#include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/stubs/strutil.h> #include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/any.pb.h>
#include <google/protobuf/api.pb.h>
#include <google/protobuf/duration.pb.h>
#include <google/protobuf/empty.pb.h>
#include <google/protobuf/field_mask.pb.h>
#include <google/protobuf/source_context.pb.h>
#include <google/protobuf/struct.pb.h>
#include <google/protobuf/timestamp.pb.h>
#include <google/protobuf/type.pb.h>
#include <google/protobuf/wrappers.pb.h>
#include <sstream> #include <sstream>
@ -1853,11 +1843,12 @@ bool Generator::GenerateAll(const std::vector<const FileDescriptor*>& files,
bool aggregate_metadata = false; bool aggregate_metadata = false;
std::set<string> aggregate_metadata_prefixes; std::set<string> aggregate_metadata_prefixes;
for (const auto& option : Split(parameter, ",")) { for (const auto& option : Split(parameter, ",", true)) {
const auto option_pair = Split(option, "="); const std::vector<std::string> option_pair = Split(option, "=", true);
if (HasPrefixString(option_pair[0], "aggregate_metadata")) { if (HasPrefixString(option_pair[0], "aggregate_metadata")) {
string options_string = option_pair[1]; string options_string = option_pair[1];
const auto options = Split(options_string, "#", false); const std::vector<std::string> options =
Split(options_string, "#", false);
aggregate_metadata = true; aggregate_metadata = true;
for (int i = 0; i < options.size(); i++) { for (int i = 0; i < options.size(); i++) {
aggregate_metadata_prefixes.insert(options[i]); aggregate_metadata_prefixes.insert(options[i]);

Loading…
Cancel
Save