1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Merge branch 'master' of github.com:facebook/phabricator

This commit is contained in:
jungejason 2011-03-03 12:09:05 -08:00
commit eebf231683
4 changed files with 12 additions and 29 deletions

View file

@ -14,6 +14,10 @@
"aphront" : "Aphront (Web Stack)",
"console" : "DarkConsole (Debugging Console)",
"storage" : "Storage"
}
},
"engines" : [
["DivinerArticleEngine", {}],
["DivinerXHPEngine", {}]
]
}

View file

@ -36,21 +36,15 @@ abstract class AphrontDatabaseConnection {
abstract public function escapeStringForLikeClause($string);
public function queryData($pattern/*, $arg, $arg, ... */) {
if (false) {
// Workaround for the HPHP workaround: ensure we include this module
// since we really are using the function.
queryfx($this, $pattern);
}
$args = func_get_args();
array_unshift($args, $this);
return hphp_workaround_call_user_func_array('queryfx_all', $args);
return call_user_func_array('queryfx_all', $args);
}
public function query($pattern/*, $arg, $arg, ... */) {
$args = func_get_args();
array_unshift($args, $this);
return hphp_workaround_call_user_func_array('queryfx', $args);
return call_user_func_array('queryfx', $args);
}
// TODO: Probably need to reset these when we catch a connection exception

View file

@ -20,14 +20,8 @@
* @group storage
*/
function queryfx(AphrontDatabaseConnection $conn, $sql/*, ... */) {
if (false) {
// Workaround for the HPHP workaround: ensure we include this module
// since we really are using the function.
qsprintf($conn, $sql);
}
$argv = func_get_args();
$query = hphp_workaround_call_user_func_array('qsprintf', $argv);
$query = call_user_func_array('qsprintf', $argv);
$conn->executeRawQuery($query);
}
@ -36,7 +30,7 @@ function queryfx(AphrontDatabaseConnection $conn, $sql/*, ... */) {
*/
function vqueryfx($conn, $sql, $argv) {
array_unshift($argv, $conn, $sql);
hphp_workaround_call_user_func_array('queryfx', $argv);
call_user_func_array('queryfx', $argv);
}
/**
@ -44,7 +38,7 @@ function vqueryfx($conn, $sql, $argv) {
*/
function queryfx_all($conn, $sql/*, ... */) {
$argv = func_get_args();
hphp_workaround_call_user_func_array('queryfx', $argv);
call_user_func_array('queryfx', $argv);
return $conn->selectAllResults();
}
@ -53,7 +47,7 @@ function queryfx_all($conn, $sql/*, ... */) {
*/
function queryfx_one($conn, $sql/*, ... */) {
$argv = func_get_args();
$ret = hphp_workaround_call_user_func_array('queryfx_all', $argv);
$ret = call_user_func_array('queryfx_all', $argv);
if (count($ret) > 1) {
throw new AphrontQueryCountException(
'Query returned more than one row.');
@ -65,6 +59,6 @@ function queryfx_one($conn, $sql/*, ... */) {
function vqueryfx_all($conn, $sql, array $argv) {
array_unshift($argv, $conn, $sql);
hphp_workaround_call_user_func_array('queryfx', $argv);
call_user_func_array('queryfx', $argv);
return $conn->selectAllResults();
}

View file

@ -176,12 +176,3 @@ function phabricator_fatal_config_error($msg) {
die();
}
/**
* Workaround for HipHop bug, see Facebook Task #503624.
*/
function hphp_workaround_call_user_func_array($func, array $array) {
$f = new ReflectionFunction($func);
return $f->invokeArgs($array);
}