From 2e8b1ec08f00101d63f5ec797d9db47faa99a6dc Mon Sep 17 00:00:00 2001 From: Fred Emmott Date: Fri, 14 Dec 2018 12:41:25 -0800 Subject: [PATCH] Don't generate `` - use the specified class to handle definitions that aren't the Map. Your handler will not be invoked for functions or constants @@ -121,7 +121,7 @@ How It Works - This is used to generate something similar to a classmap, except including other kinds of definitions - The map is provided to HHVM with [`HH\autoload_set_paths()`](https://docs.hhvm.com/hack/reference/function/HH.autoload_set_paths/) -The [Composer plugin API](https://getcomposer.org/doc/articles/plugins.md) allows it to re-generate the `vendor/hh_autoload.php` file automatically whenever Composer itself regenerates `vendor/autoload.php` +The [Composer plugin API](https://getcomposer.org/doc/articles/plugins.md) allows it to re-generate the `vendor/hh_autoload.hh` file automatically whenever Composer itself regenerates `vendor/autoload.php` Contributing ============ diff --git a/bin/hh-autoload b/bin/hh-autoload index c634a03..ae319f2 100755 --- a/bin/hh-autoload +++ b/bin/hh-autoload @@ -91,7 +91,7 @@ final class GenerateScript { ? ($importer->getConfig()['devFailureHandler'] ?? null) : ($importer->getConfig()['failureHandler'] ?? null); - $file = getcwd().'/vendor/hh_autoload.php'; + $file = getcwd().'/vendor/hh_autoload.hh'; (new Writer()) ->setBuilder($importer) ->setRoot(getcwd()) diff --git a/src/ComposerPlugin.php b/src/ComposerPlugin.php index 6a1d539..06c2735 100644 --- a/src/ComposerPlugin.php +++ b/src/ComposerPlugin.php @@ -79,7 +79,7 @@ public function onPostAutoloadDump(Event $event) { ->setRelativeAutoloadRoot($importer->getConfig()['relativeAutoloadRoot']) ->setFailureHandler($handler) ->setIsDev($event->isDevMode()) - ->writeToFile($this->vendor.'/hh_autoload.php'); + ->writeToFile($this->vendor.'/hh_autoload.hh'); } private function debugMessage(\HH\string $message) { diff --git a/src/Generated.hhi b/src/Generated.hhi deleted file mode 100644 index ce7bbca..0000000 --- a/src/Generated.hhi +++ /dev/null @@ -1,20 +0,0 @@ - \str_replace('array (', 'darray[', $$) + |> \str_replace(')', ']', $$); + $autoload_map_typedef = \var_export(__DIR__.'/AutoloadMap.php', true); $code = <<