1<?php 2 3// We have to test this because the command-line argument will fail silently 4// if the extension could not be loaded: 5// php -dextension=ext/google/protobuf/modules/protouf.so 6if (!extension_loaded("protobuf")) { 7 throw new Exception("Protobuf extension not loaded"); 8} 9 10spl_autoload_register(function($class) { 11 if (strpos($class, "Google\\Protobuf") === 0) { 12 throw new Exception("When using the C extension, we should not load runtime class: " . $class); 13 } 14}, true, true); 15