mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 06:42:42 +01:00
Fix some issues caught by HipHop, and work around some issues
caused by HipHop.
This commit is contained in:
parent
d4bd2b0edd
commit
eccc76dae6
20 changed files with 116 additions and 85 deletions
2
externals/phpmailer/class.phpmailer-lite.php
vendored
2
externals/phpmailer/class.phpmailer-lite.php
vendored
|
@ -370,7 +370,7 @@ class PHPMailerLite {
|
||||||
*/
|
*/
|
||||||
private function AddAnAddress($kind, $address, $name = '') {
|
private function AddAnAddress($kind, $address, $name = '') {
|
||||||
if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) {
|
if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) {
|
||||||
echo 'Invalid recipient array: ' . kind;
|
echo 'Invalid recipient array: ' . $kind;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$address = trim($address);
|
$address = trim($address);
|
||||||
|
|
6
externals/xhprof/xhprof_lib.php
vendored
6
externals/xhprof/xhprof_lib.php
vendored
|
@ -261,7 +261,7 @@ function xhprof_aggregate_runs($xhprof_runs_impl, $runs,
|
||||||
$bad_runs = array();
|
$bad_runs = array();
|
||||||
foreach($runs as $idx => $run_id) {
|
foreach($runs as $idx => $run_id) {
|
||||||
|
|
||||||
$raw_data = $xhprof_runs_impl->get_run($run_id, $source, $description);
|
$raw_data = $xhprof_runs_impl->get_run($run_id, $source, '?');
|
||||||
|
|
||||||
// use the first run to derive what metrics to aggregate on.
|
// use the first run to derive what metrics to aggregate on.
|
||||||
if ($idx == 0) {
|
if ($idx == 0) {
|
||||||
|
@ -283,7 +283,7 @@ function xhprof_aggregate_runs($xhprof_runs_impl, $runs,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($use_script_name) {
|
if ($use_script_name) {
|
||||||
$page = $description;
|
$page = '?';
|
||||||
|
|
||||||
// create a fake function '__script::$page', and have and edge from
|
// create a fake function '__script::$page', and have and edge from
|
||||||
// main() to '__script::$page'. We will also need edges to transfer
|
// main() to '__script::$page'. We will also need edges to transfer
|
||||||
|
@ -589,7 +589,7 @@ function xhprof_prune_run($raw_data, $prune_percent) {
|
||||||
|
|
||||||
$prune_threshold = (($main_info[$prune_metric] * $prune_percent) / 100.0);
|
$prune_threshold = (($main_info[$prune_metric] * $prune_percent) / 100.0);
|
||||||
|
|
||||||
init_metrics($raw_data, null, null, false);
|
// init_metrics($raw_data, null, null, false);
|
||||||
$flat_info = xhprof_compute_inclusive_times($raw_data);
|
$flat_info = xhprof_compute_inclusive_times($raw_data);
|
||||||
|
|
||||||
foreach ($raw_data as $parent_child => $info) {
|
foreach ($raw_data as $parent_child => $info) {
|
||||||
|
|
|
@ -212,27 +212,22 @@ class AphrontDefaultApplicationConfiguration
|
||||||
'<code>'.phutil_escape_html((string)$ex).'</code>'.
|
'<code>'.phutil_escape_html((string)$ex).'</code>'.
|
||||||
'</div>';
|
'</div>';
|
||||||
|
|
||||||
if ($this->getRequest()->isAjax()) {
|
$user = $this->getRequest()->getUser();
|
||||||
$dialog = new AphrontDialogView();
|
if (!$user) {
|
||||||
$dialog
|
// If we hit an exception very early, we won't have a user.
|
||||||
->setTitle('Exception!')
|
$user = new PhabricatorUser();
|
||||||
->setClass('aphront-exception-dialog')
|
|
||||||
->setUser($this->getRequest()->getUser())
|
|
||||||
->appendChild($content)
|
|
||||||
->addCancelButton('/');
|
|
||||||
|
|
||||||
$response = new AphrontDialogResponse();
|
|
||||||
$response->setDialog($dialog);
|
|
||||||
|
|
||||||
return $response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$view = new PhabricatorStandardPageView();
|
$dialog = new AphrontDialogView();
|
||||||
$view->setRequest($this->getRequest());
|
$dialog
|
||||||
$view->appendChild($content);
|
->setTitle('Exception!')
|
||||||
|
->setClass('aphront-exception-dialog')
|
||||||
|
->setUser($user)
|
||||||
|
->appendChild($content)
|
||||||
|
->addCancelButton('/');
|
||||||
|
|
||||||
$response = new AphrontWebpageResponse();
|
$response = new AphrontDialogResponse();
|
||||||
$response->setContent($view->render());
|
$response->setDialog($dialog);
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ phutil_require_module('phabricator', 'aphront/response/ajax');
|
||||||
phutil_require_module('phabricator', 'aphront/response/dialog');
|
phutil_require_module('phabricator', 'aphront/response/dialog');
|
||||||
phutil_require_module('phabricator', 'aphront/response/webpage');
|
phutil_require_module('phabricator', 'aphront/response/webpage');
|
||||||
phutil_require_module('phabricator', 'applications/base/controller/404');
|
phutil_require_module('phabricator', 'applications/base/controller/404');
|
||||||
|
phutil_require_module('phabricator', 'applications/people/storage/user');
|
||||||
phutil_require_module('phabricator', 'view/dialog');
|
phutil_require_module('phabricator', 'view/dialog');
|
||||||
phutil_require_module('phabricator', 'view/page/failure');
|
phutil_require_module('phabricator', 'view/page/failure');
|
||||||
phutil_require_module('phabricator', 'view/page/standard');
|
phutil_require_module('phabricator', 'view/page/standard');
|
||||||
|
|
|
@ -65,21 +65,30 @@ class PhabricatorOAuthLoginController extends PhabricatorAuthController {
|
||||||
'code' => $code,
|
'code' => $code,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$post_data = http_build_query($query_data);
|
||||||
|
$post_length = strlen($post_data);
|
||||||
|
|
||||||
$stream_context = stream_context_create(
|
$stream_context = stream_context_create(
|
||||||
array(
|
array(
|
||||||
'http' => array(
|
'http' => array(
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'header' => 'Content-type: application/x-www-form-urlencoded',
|
'header' =>
|
||||||
'content' => http_build_query($query_data),
|
"Content-Type: application/x-www-form-urlencoded\r\n".
|
||||||
|
"Content-Length: {$post_length}\r\n",
|
||||||
|
'content' => $post_data,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
$stream = fopen($auth_uri, 'r', false, $stream_context);
|
$stream = fopen($auth_uri, 'r', false, $stream_context);
|
||||||
|
|
||||||
$meta = stream_get_meta_data($stream);
|
$response = false;
|
||||||
$response = stream_get_contents($stream);
|
$meta = null;
|
||||||
|
if ($stream) {
|
||||||
|
$meta = stream_get_meta_data($stream);
|
||||||
|
$response = stream_get_contents($stream);
|
||||||
|
fclose($stream);
|
||||||
|
}
|
||||||
|
|
||||||
fclose($stream);
|
|
||||||
|
|
||||||
if ($response === false) {
|
if ($response === false) {
|
||||||
return $this->buildErrorResponse(new PhabricatorOAuthFailureView());
|
return $this->buildErrorResponse(new PhabricatorOAuthFailureView());
|
||||||
|
@ -127,7 +136,6 @@ class PhabricatorOAuthLoginController extends PhabricatorAuthController {
|
||||||
$user_id);
|
$user_id);
|
||||||
|
|
||||||
if ($current_user->getPHID()) {
|
if ($current_user->getPHID()) {
|
||||||
|
|
||||||
if ($known_oauth) {
|
if ($known_oauth) {
|
||||||
if ($known_oauth->getUserID() != $current_user->getID()) {
|
if ($known_oauth->getUserID() != $current_user->getID()) {
|
||||||
$dialog = new AphrontDialogView();
|
$dialog = new AphrontDialogView();
|
||||||
|
@ -285,11 +293,19 @@ class PhabricatorOAuthLoginController extends PhabricatorAuthController {
|
||||||
$request->setCookie('phsid', $session_key);
|
$request->setCookie('phsid', $session_key);
|
||||||
return id(new AphrontRedirectResponse())->setURI('/');
|
return id(new AphrontRedirectResponse())->setURI('/');
|
||||||
} catch (AphrontQueryDuplicateKeyException $exception) {
|
} catch (AphrontQueryDuplicateKeyException $exception) {
|
||||||
$key = $exception->getDuplicateKey();
|
|
||||||
if ($key == 'userName') {
|
$same_username = id(new PhabricatorUser())->loadOneWhere(
|
||||||
|
'userName = %s',
|
||||||
|
$user->getUserName());
|
||||||
|
|
||||||
|
$same_email = id(new PhabricatorUser())->loadOneWhere(
|
||||||
|
'email = %s',
|
||||||
|
$user->getEmail());
|
||||||
|
|
||||||
|
if ($same_username) {
|
||||||
$e_username = 'Duplicate';
|
$e_username = 'Duplicate';
|
||||||
$errors[] = 'That username is not unique.';
|
$errors[] = 'That username or email is not unique.';
|
||||||
} else if ($key == 'email') {
|
} else if ($same_email) {
|
||||||
$e_email = 'Duplicate';
|
$e_email = 'Duplicate';
|
||||||
$errors[] = 'That email is not unique.';
|
$errors[] = 'That email is not unique.';
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -60,8 +60,7 @@ class ConduitAPI_differential_markcommitted_Method extends ConduitAPIMethod {
|
||||||
$editor = new DifferentialCommentEditor(
|
$editor = new DifferentialCommentEditor(
|
||||||
$revision,
|
$revision,
|
||||||
$revision->getAuthorPHID(),
|
$revision->getAuthorPHID(),
|
||||||
DifferentialAction::ACTION_COMMIT,
|
DifferentialAction::ACTION_COMMIT);
|
||||||
$inline_comments = array());
|
|
||||||
$editor->save();
|
$editor->save();
|
||||||
|
|
||||||
$revision->setStatus(DifferentialRevisionStatus::COMMITTED);
|
$revision->setStatus(DifferentialRevisionStatus::COMMITTED);
|
||||||
|
|
|
@ -165,7 +165,7 @@ class DifferentialRevisionListData {
|
||||||
|
|
||||||
$this->revisions = $rev->loadAllFromArray($data);
|
$this->revisions = $rev->loadAllFromArray($data);
|
||||||
break;
|
break;
|
||||||
case self::QUERY_BY_PHID:
|
case self::QUERY_PHIDS:
|
||||||
$this->revisions = $this->loadAllWhere(
|
$this->revisions = $this->loadAllWhere(
|
||||||
'revision.phid in (%Ls)',
|
'revision.phid in (%Ls)',
|
||||||
$this->ids);
|
$this->ids);
|
||||||
|
@ -233,8 +233,11 @@ class DifferentialRevisionListData {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadAllOpenWithCCs(array $ccphids) {
|
private function loadAllOpenWithCCs(array $ccphids) {
|
||||||
|
$rev = new DifferentialRevision();
|
||||||
|
|
||||||
$revision = new DifferentialRevision();
|
$revision = new DifferentialRevision();
|
||||||
$data = queryfx_all(
|
$data = queryfx_all(
|
||||||
|
$rev->establishConnection('r'),
|
||||||
'SELECT revision.* FROM %T revision
|
'SELECT revision.* FROM %T revision
|
||||||
JOIN %T relationship ON relationship.revisionID = revision.id
|
JOIN %T relationship ON relationship.revisionID = revision.id
|
||||||
AND relationship.relation = %s
|
AND relationship.relation = %s
|
||||||
|
|
|
@ -516,7 +516,7 @@ class DifferentialChangesetParser {
|
||||||
$changeset->getTableName().'_parse_cache',
|
$changeset->getTableName().'_parse_cache',
|
||||||
$this->changesetID,
|
$this->changesetID,
|
||||||
$cache);
|
$cache);
|
||||||
} catch (QueryException $ex) {
|
} catch (AphrontQueryException $ex) {
|
||||||
// TODO: uhoh
|
// TODO: uhoh
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class ManiphestTaskListView extends AphrontView {
|
||||||
|
|
||||||
$views = array();
|
$views = array();
|
||||||
foreach ($this->tasks as $task) {
|
foreach ($this->tasks as $task) {
|
||||||
$view = new ManiphestTaskSummaryView($task);
|
$view = new ManiphestTaskSummaryView();
|
||||||
$view->setTask($task);
|
$view->setTask($task);
|
||||||
$view->setHandles($this->handles);
|
$view->setHandles($this->handles);
|
||||||
$views[] = $view->render();
|
$views[] = $view->render();
|
||||||
|
|
|
@ -72,7 +72,7 @@ class ManiphestTransactionListView extends AphrontView {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($groups as $group) {
|
foreach ($groups as $group) {
|
||||||
$view = new ManiphestTransactionDetailView($transaction);
|
$view = new ManiphestTransactionDetailView();
|
||||||
$view->setTransactionGroup($group);
|
$view->setTransactionGroup($group);
|
||||||
$view->setHandles($this->handles);
|
$view->setHandles($this->handles);
|
||||||
$view->setMarkupEngine($this->markupEngine);
|
$view->setMarkupEngine($this->markupEngine);
|
||||||
|
|
|
@ -69,14 +69,10 @@ class PhabricatorRepositoryCreateController extends PhabricatorController {
|
||||||
return id(new AphrontRedirectResponse())
|
return id(new AphrontRedirectResponse())
|
||||||
->setURI('/repository/edit/'.$repository->getID().'/');
|
->setURI('/repository/edit/'.$repository->getID().'/');
|
||||||
|
|
||||||
} catch (PhabricatorQueryDuplicateKeyException $ex) {
|
} catch (AphrontQueryDuplicateKeyException $ex) {
|
||||||
if ($ex->getDuplicateKey() == 'callsign') {
|
$e_callsign = 'Duplicate';
|
||||||
$e_callsign = 'Duplicate';
|
$errors[] = 'Callsign must be unique. Another repository already '.
|
||||||
$errors[] = 'Callsign must be unique. Another repository already '.
|
'uses that callsign.';
|
||||||
'uses that callsign.';
|
|
||||||
} else {
|
|
||||||
throw $ex;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
src/infrastructure/env/PhabricatorEnv.php
vendored
2
src/infrastructure/env/PhabricatorEnv.php
vendored
|
@ -30,7 +30,7 @@ final class PhabricatorEnv {
|
||||||
public static function getURI($path) {
|
public static function getURI($path) {
|
||||||
return rtrim(self::getEnvConfig('phabricator.base-uri'), '/').$path;
|
return rtrim(self::getEnvConfig('phabricator.base-uri'), '/').$path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getAllConfigKeys() {
|
public static function getAllConfigKeys() {
|
||||||
return self::$env;
|
return self::$env;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,15 +36,21 @@ abstract class AphrontDatabaseConnection {
|
||||||
abstract public function escapeStringForLikeClause($string);
|
abstract public function escapeStringForLikeClause($string);
|
||||||
|
|
||||||
public function queryData($pattern/*, $arg, $arg, ... */) {
|
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();
|
$args = func_get_args();
|
||||||
array_unshift($args, $this);
|
array_unshift($args, $this);
|
||||||
return call_user_func_array('queryfx_all', $args);
|
return hphp_workaround_call_user_func_array('queryfx_all', $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function query($pattern/*, $arg, $arg, ... */) {
|
public function query($pattern/*, $arg, $arg, ... */) {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
array_unshift($args, $this);
|
array_unshift($args, $this);
|
||||||
return call_user_func_array('queryfx', $args);
|
return hphp_workaround_call_user_func_array('queryfx', $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Probably need to reset these when we catch a connection exception
|
// TODO: Probably need to reset these when we catch a connection exception
|
||||||
|
|
|
@ -234,12 +234,11 @@ class AphrontMySQLDatabaseConnection extends AphrontDatabaseConnection {
|
||||||
case 1205: // Lock wait timeout exceeded
|
case 1205: // Lock wait timeout exceeded
|
||||||
throw new AphrontQueryRecoverableException("#{$errno}: {$error}");
|
throw new AphrontQueryRecoverableException("#{$errno}: {$error}");
|
||||||
case 1062: // Duplicate Key
|
case 1062: // Duplicate Key
|
||||||
$matches = null;
|
// NOTE: In some versions of MySQL we get a key name back here, but
|
||||||
$key = null;
|
// older versions just give us a key index ("key 2") so it's not
|
||||||
if (preg_match('/for key \'(.*)\'$/', $error, $matches)) {
|
// portable to parse the key out of the error and attach it to the
|
||||||
$key = $matches[1];
|
// exception.
|
||||||
}
|
throw new AphrontQueryDuplicateKeyException("{$errno}: {$error}");
|
||||||
throw new AphrontQueryDuplicateKeyException($key, "{$errno}: {$error}");
|
|
||||||
default:
|
default:
|
||||||
// TODO: 1064 is syntax error, and quite terrible in production.
|
// TODO: 1064 is syntax error, and quite terrible in production.
|
||||||
throw new AphrontQueryException("#{$errno}: {$error}");
|
throw new AphrontQueryException("#{$errno}: {$error}");
|
||||||
|
|
|
@ -21,14 +21,4 @@
|
||||||
*/
|
*/
|
||||||
class AphrontQueryDuplicateKeyException extends AphrontQueryException {
|
class AphrontQueryDuplicateKeyException extends AphrontQueryException {
|
||||||
|
|
||||||
private $duplicateKey;
|
|
||||||
|
|
||||||
public function getDuplicateKey() {
|
|
||||||
return $this->duplicateKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __construct($duplicate_key, $message) {
|
|
||||||
$this->duplicateKey = $duplicate_key;
|
|
||||||
parent::__construct($message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,9 +20,15 @@
|
||||||
* @group storage
|
* @group storage
|
||||||
*/
|
*/
|
||||||
function queryfx(AphrontDatabaseConnection $conn, $sql/*, ... */) {
|
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();
|
$argv = func_get_args();
|
||||||
$query = call_user_func_array('qsprintf', $argv);
|
$query = hphp_workaround_call_user_func_array('qsprintf', $argv);
|
||||||
return $conn->executeRawQuery($query);
|
$conn->executeRawQuery($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,7 +36,7 @@ function queryfx(AphrontDatabaseConnection $conn, $sql/*, ... */) {
|
||||||
*/
|
*/
|
||||||
function vqueryfx($conn, $sql, $argv) {
|
function vqueryfx($conn, $sql, $argv) {
|
||||||
array_unshift($argv, $conn, $sql);
|
array_unshift($argv, $conn, $sql);
|
||||||
return call_user_func_array('queryfx', $argv);
|
hphp_workaround_call_user_func_array('queryfx', $argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,8 +44,8 @@ function vqueryfx($conn, $sql, $argv) {
|
||||||
*/
|
*/
|
||||||
function queryfx_all($conn, $sql/*, ... */) {
|
function queryfx_all($conn, $sql/*, ... */) {
|
||||||
$argv = func_get_args();
|
$argv = func_get_args();
|
||||||
$ret = call_user_func_array('queryfx', $argv);
|
hphp_workaround_call_user_func_array('queryfx', $argv);
|
||||||
return $conn->selectAllResults($ret);
|
return $conn->selectAllResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,7 +53,7 @@ function queryfx_all($conn, $sql/*, ... */) {
|
||||||
*/
|
*/
|
||||||
function queryfx_one($conn, $sql/*, ... */) {
|
function queryfx_one($conn, $sql/*, ... */) {
|
||||||
$argv = func_get_args();
|
$argv = func_get_args();
|
||||||
$ret = call_user_func_array('queryfx_all', $argv);
|
$ret = hphp_workaround_call_user_func_array('queryfx_all', $argv);
|
||||||
if (count($ret) > 1) {
|
if (count($ret) > 1) {
|
||||||
throw new AphrontQueryCountException(
|
throw new AphrontQueryCountException(
|
||||||
'Query returned more than one row.');
|
'Query returned more than one row.');
|
||||||
|
@ -59,6 +65,6 @@ function queryfx_one($conn, $sql/*, ... */) {
|
||||||
|
|
||||||
function vqueryfx_all($conn, $sql, array $argv) {
|
function vqueryfx_all($conn, $sql, array $argv) {
|
||||||
array_unshift($argv, $conn, $sql);
|
array_unshift($argv, $conn, $sql);
|
||||||
$ret = call_user_func_array('queryfx', $argv);
|
hphp_workaround_call_user_func_array('queryfx', $argv);
|
||||||
return $conn->selectAllResults($ret);
|
return $conn->selectAllResults();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ final class AphrontHeadsupActionListView extends AphrontView {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render() {
|
public function render() {
|
||||||
|
|
||||||
require_celerity_resource('aphront-headsup-action-list-view-css');
|
require_celerity_resource('aphront-headsup-action-list-view-css');
|
||||||
|
|
||||||
$actions = array();
|
$actions = array();
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('phabricator', 'infrastructure/celerity/api');
|
||||||
phutil_require_module('phabricator', 'view/base');
|
phutil_require_module('phabricator', 'view/base');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -152,9 +152,12 @@ class PhabricatorStandardPageView extends AphrontPageView {
|
||||||
|
|
||||||
$login_stuff = null;
|
$login_stuff = null;
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
$user = null;
|
||||||
if ($request) {
|
if ($request) {
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
if ($user->getPHID()) {
|
// NOTE: user may not be set here if we caught an exception early
|
||||||
|
// in the execution workflow.
|
||||||
|
if ($user && $user->getPHID()) {
|
||||||
$login_stuff =
|
$login_stuff =
|
||||||
'Logged in as '.phutil_render_tag(
|
'Logged in as '.phutil_render_tag(
|
||||||
'a',
|
'a',
|
||||||
|
@ -203,16 +206,19 @@ class PhabricatorStandardPageView extends AphrontPageView {
|
||||||
}
|
}
|
||||||
$foot_links[] = $link;
|
$foot_links[] = $link;
|
||||||
}
|
}
|
||||||
// This ends up very early in tab order at the top of the page and there's
|
|
||||||
// a bunch of junk up there anyway, just shove it down here.
|
if ($user && $user->getPHID()) {
|
||||||
$foot_links[] = phabricator_render_form(
|
// This ends up very early in tab order at the top of the page and there's
|
||||||
$user,
|
// a bunch of junk up there anyway, just shove it down here.
|
||||||
array(
|
$foot_links[] = phabricator_render_form(
|
||||||
'action' => '/logout/',
|
$user,
|
||||||
'method' => 'post',
|
array(
|
||||||
'style' => 'display: inline',
|
'action' => '/logout/',
|
||||||
),
|
'method' => 'post',
|
||||||
'<button class="link">Logout</button>');
|
'style' => 'display: inline',
|
||||||
|
),
|
||||||
|
'<button class="link">Logout</button>');
|
||||||
|
}
|
||||||
|
|
||||||
$foot_links = implode(' · ', $foot_links);
|
$foot_links = implode(' · ', $foot_links);
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,11 @@
|
||||||
error_reporting(E_ALL | E_STRICT);
|
error_reporting(E_ALL | E_STRICT);
|
||||||
|
|
||||||
$env = getenv('PHABRICATOR_ENV'); // Apache
|
$env = getenv('PHABRICATOR_ENV'); // Apache
|
||||||
|
if (!$env) {
|
||||||
|
if (isset($_ENV['PHABRICATOR_ENV'])) {
|
||||||
|
$env = $_ENV['PHABRICATOR_ENV'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$env) {
|
if (!$env) {
|
||||||
phabricator_fatal_config_error(
|
phabricator_fatal_config_error(
|
||||||
|
@ -172,3 +177,11 @@ function phabricator_fatal_config_error($msg) {
|
||||||
die();
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue