当前位置: 首页>>代码示例>>PHP>>正文


PHP PhutilServiceProfiler::installEchoListener方法代码示例

本文整理汇总了PHP中PhutilServiceProfiler::installEchoListener方法的典型用法代码示例。如果您正苦于以下问题:PHP PhutilServiceProfiler::installEchoListener方法的具体用法?PHP PhutilServiceProfiler::installEchoListener怎么用?PHP PhutilServiceProfiler::installEchoListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhutilServiceProfiler的用法示例。


在下文中一共展示了PhutilServiceProfiler::installEchoListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: phutil_console_wrap

}
echo phutil_console_wrap(phutil_console_format('This script will test that you have configured valid credentials for ' . 'access to a repository, so the Phabricator daemons can pull from it. ' . 'You should run this as the **same user you will run the daemons as**, ' . 'from the **same machine they will run from**. Doing this will help ' . 'detect various problems with your configuration, such as SSH issues.'));
list($whoami) = execx('whoami');
$whoami = trim($whoami);
$ok = phutil_console_confirm("Do you want to continue as '{$whoami}'?");
if (!$ok) {
    die(1);
}
$callsign = $argv[1];
echo "Loading '{$callsign}' repository...\n";
$repository = id(new PhabricatorRepository())->loadOneWhere('callsign = %s', $argv[1]);
if (!$repository) {
    throw new Exception("No such repository exists!");
}
$vcs = $repository->getVersionControlSystem();
PhutilServiceProfiler::installEchoListener();
echo "Trying to connect to the remote...\n";
switch ($vcs) {
    case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
        $err = $repository->passthruRemoteCommand('--limit 1 log %s', $repository->getRemoteURI());
        break;
    case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
        // Do an ls-remote on a nonexistent ref, which we expect to just return
        // nothing.
        $err = $repository->passthruRemoteCommand('ls-remote %s %s', $repository->getRemoteURI(), 'just-testing');
        break;
    default:
        throw new Exception("Unsupported repository type.");
}
if ($err) {
    echo phutil_console_format("<bg:red>** FAIL **</bg> Connection failed. The credentials for this " . "repository appear to be incorrectly configured.\n");
开发者ID:hwang36,项目名称:phabricator,代码行数:31,代码来源:test_connection.php

示例2: parseStandardArguments

 /**
  * Parse "standard" arguments and apply their effects:
  *
  *    --trace             Enable service call tracing.
  *    --no-ansi           Disable ANSI color/style sequences.
  *    --xprofile <file>   Write out an XHProf profile.
  *    --help              Show help.
  *
  * @return this
  *
  * @phutil-external-symbol function xhprof_enable
  */
 public function parseStandardArguments()
 {
     try {
         $this->parsePartial(array(array('name' => 'trace', 'help' => pht('Trace command execution and show service calls.'), 'standard' => true), array('name' => 'no-ansi', 'help' => pht('Disable ANSI terminal codes, printing plain text with ' . 'no color or style.'), 'conflicts' => array('ansi' => null), 'standard' => true), array('name' => 'ansi', 'help' => pht("Use formatting even in environments which probably " . "don't support it."), 'standard' => true), array('name' => 'xprofile', 'param' => 'profile', 'help' => pht('Profile script execution and write results to a file.'), 'standard' => true), array('name' => 'help', 'short' => 'h', 'help' => pht('Show this help.'), 'standard' => true), array('name' => 'show-standard-options', 'help' => pht('Show every option, including standard options like this one.'), 'standard' => true), array('name' => 'recon', 'help' => pht('Start in remote console mode.'), 'standard' => true)));
     } catch (PhutilArgumentUsageException $ex) {
         $this->printUsageException($ex);
         exit(self::PARSE_ERROR_CODE);
     }
     if ($this->getArg('trace')) {
         PhutilServiceProfiler::installEchoListener();
     }
     if ($this->getArg('no-ansi')) {
         PhutilConsoleFormatter::disableANSI(true);
     }
     if ($this->getArg('ansi')) {
         PhutilConsoleFormatter::disableANSI(false);
     }
     if ($this->getArg('help')) {
         $this->showHelp = true;
     }
     $xprofile = $this->getArg('xprofile');
     if ($xprofile) {
         if (!function_exists('xhprof_enable')) {
             throw new Exception(pht("To use '%s', you must install XHProf.", '--xprofile'));
         }
         xhprof_enable(0);
         register_shutdown_function(array($this, 'shutdownProfiler'));
     }
     $recon = $this->getArg('recon');
     if ($recon) {
         $remote_console = PhutilConsole::newRemoteConsole();
         $remote_console->beginRedirectOut();
         PhutilConsole::setConsole($remote_console);
     } else {
         if ($this->getArg('trace')) {
             $server = new PhutilConsoleServer();
             $server->setEnableLog(true);
             $console = PhutilConsole::newConsoleForServer($server);
             PhutilConsole::setConsole($console);
         }
     }
     return $this;
 }
开发者ID:WilkGardariki,项目名称:libphutil,代码行数:55,代码来源:PhutilArgumentParser.php

示例3: setTraceMode

 public final function setTraceMode()
 {
     $this->traceMode = true;
     PhutilServiceProfiler::installEchoListener();
     PhutilConsole::getConsole()->getServer()->setEnableLog(true);
     $this->didSetTraceMode();
     return $this;
 }
开发者ID:lsubra,项目名称:libphutil,代码行数:8,代码来源:PhutilDaemon.php

示例4: setTraceMode

 public final function setTraceMode()
 {
     $this->traceMode = true;
     PhutilServiceProfiler::installEchoListener();
     $this->didSetTraceMode();
     return $this;
 }
开发者ID:relrod,项目名称:libphutil,代码行数:7,代码来源:PhutilDaemon.php


注:本文中的PhutilServiceProfiler::installEchoListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。