Debian Codegraph @

extra/protobuf/protobuf-24.4/conformance/autoload.php

raw
1 <?php
2
3 define("GOOGLE_INTERNAL_NAMESPACE", "Google\\Protobuf\\Internal\\");
4 define("GOOGLE_NAMESPACE", "Google\\Protobuf\\");
5 define("GOOGLE_GPBMETADATA_NAMESPACE", "GPBMetadata\\Google\\Protobuf\\");
6
7 function protobuf_autoloader_impl($class, $prefix) {
8 $length = strlen($prefix);
9 if ((substr($class, 0, $length) === $prefix)) {
10 $path = 'php/src/' . implode('/', array_map('ucwords', explode('\\', $class))) . '.php';
11 include_once $path;
12 }
13 }
14
15 function protobuf_autoloader($class) {
16 protobuf_autoloader_impl($class, GOOGLE_INTERNAL_NAMESPACE);
17 protobuf_autoloader_impl($class, GOOGLE_NAMESPACE);
18 protobuf_autoloader_impl($class, GOOGLE_GPBMETADATA_NAMESPACE);
19 }
20
21 spl_autoload_register('protobuf_autoloader');