This allows libphutil to have maps and libraries registered from an existing array. Currently when Phage runs (or any similar mechanism that bundles PHP into a single file or stream), all calls to PhutilSymbolLoader will return an empty set of classes when querying, because the appropriate maps haven't been loaded.
In my code, I'm using the following to load in the libphutil maps after concatenating all of the source files:
// $library is the library name, $map is the map returned // from getLibraryMap. foreach ($maps as $library => $map) { $library_serialized = base64_encode(serialize($library)); $map_serialized = base64_encode(serialize($map)); $bootstrap->addText(<<<EOF PhutilBootloader::getInstance()->registerInMemoryLibrary( unserialize(base64_decode("$library_serialized")), unserialize(base64_decode("$map_serialized"))); EOF ); }