|
|
|
@ -408,7 +408,6 @@ std::string GeneratedClassFileName(const DescriptorType* desc, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template <typename DescriptorType> |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
std::string LegacyReadOnlyGeneratedClassFileName(const DescriptorType* desc, |
|
|
|
|
const Options& options) { |
|
|
|
|
std::string php_namespace = RootPhpNamespace(desc, options); |
|
|
|
@ -416,18 +415,6 @@ std::string LegacyReadOnlyGeneratedClassFileName(const DescriptorType* desc, |
|
|
|
|
return php_namespace + "/" + desc->name() + ".php"; |
|
|
|
|
} |
|
|
|
|
return desc->name() + ".php"; |
|
|
|
|
======= |
|
|
|
|
std::string LegacyGeneratedClassFileName(const DescriptorType* desc, |
|
|
|
|
const Options& options) { |
|
|
|
|
std::string result = LegacyFullClassName(desc, options); |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < result.size(); i++) { |
|
|
|
|
if (result[i] == '\\') { |
|
|
|
|
result[i] = '/'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return result + ".php"; |
|
|
|
|
>>>>>>> upstream/21.x |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string GeneratedServiceFileName(const ServiceDescriptor* service, |
|
|
|
@ -1276,17 +1263,10 @@ void GenerateMetadataFile(const FileDescriptor* file, const Options& options, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template <typename DescriptorType> |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
void LegacyReadOnlyGenerateClassFile(const FileDescriptor* file, |
|
|
|
|
const DescriptorType* desc, const Options& options, |
|
|
|
|
GeneratorContext* generator_context) { |
|
|
|
|
std::string filename = LegacyReadOnlyGeneratedClassFileName(desc, options); |
|
|
|
|
======= |
|
|
|
|
void LegacyGenerateClassFile(const FileDescriptor* file, |
|
|
|
|
const DescriptorType* desc, const Options& options, |
|
|
|
|
GeneratorContext* generator_context) { |
|
|
|
|
std::string filename = LegacyGeneratedClassFileName(desc, options); |
|
|
|
|
>>>>>>> upstream/21.x |
|
|
|
|
std::unique_ptr<io::ZeroCopyOutputStream> output( |
|
|
|
|
generator_context->Open(filename)); |
|
|
|
|
io::Printer printer(output.get(), '^'); |
|
|
|
@ -1300,30 +1280,11 @@ void LegacyGenerateClassFile(const FileDescriptor* file, |
|
|
|
|
"name", php_namespace); |
|
|
|
|
} |
|
|
|
|
std::string newname = FullClassName(desc, options); |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
printer.Print("class_exists(^new^::class);\n", |
|
|
|
|
"new", GeneratedClassNameImpl(desc)); |
|
|
|
|
printer.Print("@trigger_error(__NAMESPACE__ . '\\^old^ is deprecated and will be removed in " |
|
|
|
|
"the next major release. Use ^fullname^ instead', E_USER_DEPRECATED);\n\n", |
|
|
|
|
"old", desc->name(), |
|
|
|
|
======= |
|
|
|
|
printer.Print("if (false) {\n"); |
|
|
|
|
Indent(&printer); |
|
|
|
|
printer.Print("/**\n"); |
|
|
|
|
printer.Print(" * This class is deprecated. Use ^new^ instead.\n", |
|
|
|
|
"new", newname); |
|
|
|
|
printer.Print(" * @deprecated\n"); |
|
|
|
|
printer.Print(" */\n"); |
|
|
|
|
printer.Print("class ^old^ {}\n", |
|
|
|
|
"old", LegacyGeneratedClassName(desc)); |
|
|
|
|
Outdent(&printer); |
|
|
|
|
printer.Print("}\n"); |
|
|
|
|
printer.Print("class_exists(^new^::class);\n", |
|
|
|
|
"new", GeneratedClassNameImpl(desc)); |
|
|
|
|
printer.Print("@trigger_error('^old^ is deprecated and will be removed in " |
|
|
|
|
"the next major release. Use ^fullname^ instead', E_USER_DEPRECATED);\n\n", |
|
|
|
|
"old", LegacyFullClassName(desc, options), |
|
|
|
|
>>>>>>> upstream/21.x |
|
|
|
|
"fullname", newname); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|