This refactors the Server creation code, to make it easier to create new
Server implementations in the future, and to separate the LibEventServer
code from the main hphp_runtime library.
This defines a new ServerFactory interface, and a ServerFactoryRegistry
which maintains a mapping of server type strings to ServerFactory
objects. The HttpServer code now uses a ServerFactory to create the
m_pageServer, rather than directly creating a LibEventServer object.
Change the Server API so that users don't have to subclass it in order
to override shouldHandle(). Now users can specify a custom
std::function for checking allowed URLs.
This will make it easier to provide alternative Server implementations.
Previously InternalPageServerImpl had to subclass LibEventServer in
order to override shouldHandle(). This tied the code to LibEventServer,
so that it could not be easily changed to an alternative implementation.
It seems like this URL checking functionality should perhaps be moved
into the RequestHandler. However, for now this is a simpler change.
I was learning from @jdelong and he said that you should use
double quotes for local includes and angle brackets for library
includes. I asked why our code was the way it was, and he said he wanted
to clean it up. I beat him to it :)
Conflicts:
hphp/runtime/base/server/admin_request_handler.cpp
hphp/runtime/vm/named_entity.h
This gets rid of the (litstr) StringData and StackStringData
constructors, but keeps String(litstr). Also rename all
the instances of AttachLiteral to CopyString, since they now
mean the same thing.
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.