Query expressions may contain sub expressions that can only be evaluated in the context of the query expression. These expressions effectively parameterize the query sent to the query engine (which typically runs out of process). Since query provider (which is distinct from the query engine) also runs in a separate context (albeit in the same thread) cannot evaluate these expressions in the right context, these expressions are replaced with references to compiler generated parameter variables in the expression tree sent to the query provider. When a query is evaluated, the values of the elided expressions are provided to the query method as additional arguments (the first argument being the expression tree). Note that the first elided expression is the receiver object for the query method call.
The extraction algorithm is a top down left to right traversal of the query AST that elides any expression which is not of a form that query processors are expected to be able to handle. The permitted forms are simple variables (that are bound to identifiers introduced by the query expression), constants, some unary operations, some binary operations, simple function calls and property accesses. If a sub expression of a permitted form is not itself permissible, it is replaced with a query parameter reference.
Reviewed By: @paroski
Differential Revision: D1124818
Right now we print both to stderr and the log file. Instead I think we should just ignore the option altogether in CLI mode. If we want to support that option we should support the INI setting http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-log . The hdf option feels more like the apache log location than the php one.
Reviewed By: @jdelong
Differential Revision: D1085173
- This rerevert D1116195 and D1116199
- It also fixes a problem when ini files contains junk. So instead of outputing junk on stdout it now fails parsing those files
- I also went re-run a bunch of tests that now passes.
Reviewed By: @ptarjan
Differential Revision: D1127923
For a nonexistent class for which the autoloader map knows a file is
present known, the autoload should behave the same way as if a
require_once were made to that file and propagate any fatals that
result. If on the other hand, the file for the class was unknown or
the class was not successfully loaded (but there was no fatal), we
continue to call the userspace-supplied faiure callback function.
Reviewed By: @ptarjan
Differential Revision: D1122740
... the in-place mutating cousin of filter, retain takes a
predicate callback for each entry in the map and uses the return
value to determine whether to keep the element around.
Deferring ##Vector## and ##Set## (easy).
Reviewed By: @jdelong
Differential Revision: D1121508
Used by Mockery to get type hint values. I'm submitting a diff to Mockery to make it use getTypehintText if available, but this should be implemented anyway.
Added two tests - one for confirming we're Zend-compatible (with .expect generated by Zend), the other for checking that non-null defaults work for basic-type typehints (which aren't supported by Zend)
Reviewed By: @ptarjan
Differential Revision: D1127714
This can fail if we're out of file descriptors. Calling exit
while other threads are still running leads to bad crashes in random
places, depending on the order that global destructors get run.
Instead let's always_assert with a message.
Reviewed By: @scannell
Differential Revision: D1125004
add getRemoteAddr to fastcgi transport to return the proper header. if no remoteAddr set it to the remoteHost ( libevent ) only set REMOTE_HOST if there is something in it as per php-src
Closes#1559
Reviewed By: @scannell
Differential Revision: D1126545
Pulled By: @ptarjan
collectionDeepCopyBaseMap declared in ext_collections.h, but defined in
ext_collections.cpp. No idea why gcc doesn't catch it.
Reviewed By: @elgenie
Differential Revision: D1127006
I did this in preparation for something which ended up not working
out, but this could be worth keeping.
Reviewed By: @oyamauchi
Differential Revision: D1125965
Yaml just seems cleaner and overall better for this type of configuration.
Decided to use a PHP YAML parser to avoid having to turn on EnableZendCompat explictly at the command line, particularly in open source.
So chose: https://github.com/mustangostang/spyc
Reviewed By: @ptarjan
Differential Revision: D1127123
Change ext/reflection from IDL to HNI.
Also adds HNI support for HipHopSpecific through the
__HipHopSpecific user attribute. Code that wants to check for this
should use Func::getFuncInfo(mi) instead of Func::methInfo() (I only saw
Reflection using it).
Closes#1484
Reviewed By: @JoelMarcey
Differential Revision: D1124639
Pulled By: @scannell
The difference method is confusingly named; its name does not imply that it
modifies the original Set. This diff renames "difference" to "removeAll" to
make it clearer. Eventually the difference() method will be removed after
all callers have been updated.
Reviewed By: @elgenie
Differential Revision: D1120227
Adds error handling to the bzerr*() functions, allowing one of
the current bad tests to pass.
Closes#1547
Reviewed By: @sgolemon
Differential Revision: D1125459
Pulled By: @scannell
Check passed header values for HTTPS.
IIS sets this header to "off" so check for that and empty value before
using transport->setSSL().
Only change to lower case if the value is not empty for performance.
Closes#1546
Reviewed By: @ptarjan
Differential Revision: D1125440
Pulled By: @scannell
I think this is what julk originally wanted. He has a `m_keepConn` boolean that is set by `ConnectionFlags::KEEP_CONN` and if that is false, he calls this callback in both the error and the success case.
This doesn't segfault when the connection is abruptly closed by the requestor.
Closes#1522
Reviewed By: @scannell
Differential Revision: D1124995
Some cases in class resolution that were happening for
builtins now won't (I checked). They are mostly just "in principle"
possible now, and shouldn't really happen as far as I know aside from
one case: if you put "implements Foo" and Foo is actually a class. I
can't get hphpc to mark AttrUnique on anything that would fail in
those places other than that.
Reviewed By: @edwinsmith
Differential Revision: D1125093
Now that HHBBC compiles systemlib, it needs to support
passing HNI-native function return types. Also I apparently missed
isAsync only on the parse side (a newish test caught it).
I made native info a struct even though it only has one thing so
far---I think later we'll want the function pointer and a flag about
whether we can invoke it with constant arguments during compilation
time.
Reviewed By: @edwinsmith
Differential Revision: D1125080
After turning on hhbbc on systemlib, these interface names
are statically resolved, so it was assuming things like $x instanceof
Traversable is only true if $x is an object, and that an array
couldn't pass one of those parameter type hints.
Reviewed By: @dariorussi
Differential Revision: D1125061
It was previously just a std::mutex around a
std::unordered_map, which seems to be a big source of contention after
putting systemlib is in the mix.
Reviewed By: @edwinsmith
Differential Revision: D1125048
After the change to include systemlib in hphpc's static
analysis, I temporarily cut them out of whole_program in HHBBC. The
problem was just that systemlib needs to end up merge only, but none
of hhbbc's output units are merge only. Solve this with a special
case in emit.cpp for now.
This seems to make a ~2x slow down in how long the first analyze pass
takes hhbbc. I think the reason is that now *tons* of things are
registering dependencies to common builtins that didn't use to
(e.g. idx)---it seems to be spending a lot of time on the single lock
there now. (Will probably change it to tbb ...)
Reviewed By: @dariorussi
Differential Revision: D1125024
Replace some uses with folly functions or boost. I kept
string_vsnprintf in its own header for now. We could probably move it
to folly/String.h (folly has stringPrintf and such, just no vararg
version), but on the other hand using va_list is not very encouraged
so maybe we should just leave it here for these legacy uses.
Reviewed By: @ptarjan
Differential Revision: D1124742
Few of them were using functions exported by util.h, they
were just using it to grab things like std::map. Fixed some
downstream direct-includes. Where trivial, used folly or boost
instead of Util::.
Reviewed By: @ptarjan
Differential Revision: D1124738
Out of util.h. For now, put drop_caches into
compatability.h, but that could easily turn into a blob-header also if
we're not careful. Also made some style changes: make the virtual
private (virtual functions should rarely be protected), override
keyword, non-static member initializer, s/class/struct/.
Reviewed By: @edwinsmith
Differential Revision: D1124736
There was no obvious context for why it was being emitted in
simplifyLdStack, and we don't need to emit it if the new value is already from
a raw load.
Reviewed By: @edwinsmith
Differential Revision: D1114188
LdLoc was the goal here (it was by far the most frequent punt). It's
really simple to implement, but it turned out that doing codegen for it
had a few cascading effects.
- We're now carrying registers across InterpOne calls, so switch to
using cgCallHelper there.
- Using cgCallHelper for interp-one now requires cgCallHelper to support
immediate arguments to helpers.
- IncRef and AssertType are now generated in such a way that we can't
punt on them (even if you punt on them, they show up in
hhbc-translator output).
Reviewed By: @edwinsmith
Differential Revision: D1120272