Page MenuHomePhabricator
Paste P2090

(An Untitled Masterwork)
ActivePublic

Authored by amckinley on Apr 11 2018, 7:04 PM.
/**
* @phutil-external-symbol class PhabricatorEnv
**/
protected function newConduitClient() {
$key_path = $this->getPath('conf/keystore/client.key');
$pub_path = $this->getPath('conf/keystore/client.pub');
$private_key = Filesystem::readFile($key_path);
$private_key = new PhutilOpaqueEnvelope($private_key);
$public_key = Filesystem::readFile($pub_path);
if ($this->getHostAttribute('role') == 'local') {
// Modify the configured base URI so that we respect the port and
// protocol if they're set up in an unusual way.
$admin_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri');
$admin_uri = new PhutilURI($base_uri);
$admin_uri = (string)$base_uri;
} else {
$admin_uri = 'https://admin.phacility.com/';
}
return id(new ConduitClient($admin_uri))
->setSigningKeys($public_key, $private_key);
}

Event Timeline

amckinley created this paste.Apr 11 2018, 7:04 PM

Hmm, I can't reproduce the issue. Here's pre-comment:

epriestley@orbital ~/dev/core/lib/core $ git show
commit 05061db436f53f1b787209fce229da5797012634
Author: epriestley <git@epriestley.com>
Date:   Wed Apr 11 12:07:26 2018 -0700

    WIP

diff --git a/lib/core/src/workflow/base/CoreWorkflow.php b/lib/core/src/workflow/base/CoreWorkflow.php
index 97d79cb..5b5aeb9 100644
--- a/lib/core/src/workflow/base/CoreWorkflow.php
+++ b/lib/core/src/workflow/base/CoreWorkflow.php
@@ -461,6 +461,10 @@ abstract class CoreWorkflow extends PhutilArgumentWorkflow {
     $private_key = new PhutilOpaqueEnvelope($private_key);
     $public_key = Filesystem::readFile($pub_path);
 
+    if (false) {
+      PhabricatorEnv::m();
+    }
+
     if ($this->getHostAttribute('role') == 'local') {
       $admin_uri = 'http://local.phacility.com/';
     } else {
epriestley@orbital ~/dev/core/lib/core $ arc lint
>>> Lint for lib/core/src/workflow/base/CoreWorkflow.php:


   Error  (PHL1) Unknown Symbol
    Use of unknown class 'PhabricatorEnv'. Common causes are:
    
      - Your libphutil/ is out of date.
        This is the most common cause.
        Update this copy of libphutil:
    /Users/epriestley/dev/core/lib/libphutil
    
      - Some other library is out of date.
        Update the library this symbol appears in.
    
      - This symbol is misspelled.
        Spell the symbol name correctly.
        Symbol name spelling is case-sensitive.
    
      - This symbol was added recently.
        Run `arc liberate` on the library it was added to.
    
      - This symbol is external. Use `@phutil-external-symbol`.
        Use `grep` to find usage examples of this directive.
    
    *** ALTHOUGH USUALLY EASY TO FIX, THIS IS A SERIOUS ERROR.
    *** THIS ERROR IS YOUR FAULT. YOU MUST RESOLVE IT.

             462     $public_key = Filesystem::readFile($pub_path);
             463 
             464     if (false) {
    >>>      465       PhabricatorEnv::m();
                       ^
             466     }
             467 
             468     if ($this->getHostAttribute('role') == 'local') {

Here's post-comment:

epriestley@orbital ~/dev/core/lib/core $ git show
commit fbb8537b0b79be4e83b1104d7c8a652b7b1de484
Author: epriestley <git@epriestley.com>
Date:   Wed Apr 11 12:07:26 2018 -0700

    WIP

diff --git a/lib/core/src/workflow/base/CoreWorkflow.php b/lib/core/src/workflow/base/CoreWorkflow.php
index 97d79cb..c668b63 100644
--- a/lib/core/src/workflow/base/CoreWorkflow.php
+++ b/lib/core/src/workflow/base/CoreWorkflow.php
@@ -453,6 +453,9 @@ abstract class CoreWorkflow extends PhutilArgumentWorkflow {
       $message);
   }
 
+ /**
+   * @phutil-external-symbol class PhabricatorEnv
+   **/
   protected function newConduitClient() {
     $key_path = $this->getPath('conf/keystore/client.key');
     $pub_path = $this->getPath('conf/keystore/client.pub');
@@ -461,6 +464,10 @@ abstract class CoreWorkflow extends PhutilArgumentWorkflow {
     $private_key = new PhutilOpaqueEnvelope($private_key);
     $public_key = Filesystem::readFile($pub_path);
 
+    if (false) {
+      PhabricatorEnv::m();
+    }
+
     if ($this->getHostAttribute('role') == 'local') {
       $admin_uri = 'http://local.phacility.com/';
     } else {
epriestley@orbital ~/dev/core/lib/core $ arc lint
 OKAY  No lint messages.