Squashed 'libs/protobuf/' content from commit fcd3b9a85
git-subtree-dir: libs/protobuf git-subtree-split: fcd3b9a85ef36e46643dc30176cea1a7ad62e02b
This commit is contained in:
14
php/tests/force_c_ext.php
Normal file
14
php/tests/force_c_ext.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?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);
|
||||
Reference in New Issue
Block a user