From d419828855998fc7c1f9e93647b6a4091647d956 Mon Sep 17 00:00:00 2001 From: Edwin Smith Date: Mon, 3 Apr 2023 09:49:08 -0700 Subject: [PATCH] always throw in autoload_set_paths() Summary: Anything that breaks is an outstanding migration TODO Reviewed By: jthemphill Differential Revision: D43214849 fbshipit-source-id: d39e41c5c64ea90d4a57925d81cefdb602834f65 --- hphp/runtime/ext/hh/ext_hh.cpp | 42 +++------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/hphp/runtime/ext/hh/ext_hh.cpp b/hphp/runtime/ext/hh/ext_hh.cpp index cb0377f53a386..c5d4ee54570bd 100644 --- a/hphp/runtime/ext/hh/ext_hh.cpp +++ b/hphp/runtime/ext/hh/ext_hh.cpp @@ -76,45 +76,9 @@ bool HHVM_FUNCTION(autoload_is_native) { return autoloadMap && autoloadMap->isNative(); } -bool HHVM_FUNCTION(autoload_set_paths, - const Variant& map, - const String& root) { - // If we are using a native autoload map you are not allowed to override it - // in repo mode - if (RuntimeOption::RepoAuthoritative) { - return false; - } - - if (!RuntimeOption::AutoloadUserlandEnabled) { - SystemLib::throwInvalidOperationExceptionObject( - "Attempted to call HH\\autoload_set_paths() when " - "Autoload.UserlandEnabled is false. HH\\autoload_set_paths() will soon " - "be deleted so HHVM internals can start depending on native " - "autoloading."); - } else if (HHVM_FN(autoload_is_native)()) { - raise_notice( - "Attempted to call HH\\autoload_set_paths() while the native autoloader " - "is enabled. HH\\autoload_set_paths() disables the native autoloader, " - "putting us on a deprecated code path that will soon stop working."); - } - - if (map.isArray()) { - return AutoloadHandler::s_instance->setMap(map.asCArrRef(), root); - } - if (!(map.isObject() && map.toObject()->isCollection())) { - return false; - } - // Assume we have Map> - convert to - // array> - // - // Exception for 'failure' which should be a callable. - auto as_array = map.toArray(); - for (auto it = as_array.begin(); !it.end(); it.next()) { - if (it.second().isObject() && it.second().toObject()->isCollection()) { - as_array.set(it.first(), it.second().toArray()); - } - } - return AutoloadHandler::s_instance->setMap(as_array, root); +bool HHVM_FUNCTION(autoload_set_paths, const Variant&, const String&) { + SystemLib::throwInvalidOperationExceptionObject("NF FTW!"); + return false; } namespace {