Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
503 B
15 lines
503 B
4 years ago
|
<?php
|
||
|
|
||
|
// We have to test this because the command-line argument will fail silently
|
||
|
// if the extension could not be loaded:
|
||
|
// php -dextension=ext/google/protobuf/modules/protouf.so
|
||
|
if (!extension_loaded("protobuf")) {
|
||
|
throw new Exception("Protobuf extension not loaded");
|
||
|
}
|
||
|
|
||
|
spl_autoload_register(function($class) {
|
||
|
if (strpos($class, "Google\\Protobuf") === 0) {
|
||
|
throw new Exception("When using the C extension, we should not load runtime class: " . $class);
|
||
|
}
|
||
|
}, true, true);
|