當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhabricatorEnv::getEmptyCWD方法代碼示例

本文整理匯總了PHP中PhabricatorEnv::getEmptyCWD方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorEnv::getEmptyCWD方法的具體用法?PHP PhabricatorEnv::getEmptyCWD怎麽用?PHP PhabricatorEnv::getEmptyCWD使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhabricatorEnv的用法示例。


在下文中一共展示了PhabricatorEnv::getEmptyCWD方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: newCustomEnvironment

 protected function newCustomEnvironment()
 {
     $env = array();
     // NOTE: See T2965. Some time after Git 1.7.5.4, Git started fataling if
     // it can not read $HOME. For many users, $HOME points at /root (this
     // seems to be a default result of Apache setup). Instead, explicitly
     // point $HOME at a readable, empty directory so that Git looks for the
     // config file it's after, fails to locate it, and moves on. This is
     // really silly, but seems like the least damaging approach to
     // mitigating the issue.
     $env['HOME'] = PhabricatorEnv::getEmptyCWD();
     if ($this->isAnySSHProtocol()) {
         $env['GIT_SSH'] = $this->getSSHWrapper();
     }
     if ($this->isAnyHTTPProtocol()) {
         $uri = $this->getURI();
         if ($uri) {
             $proxy = PhutilHTTPEngineExtension::buildHTTPProxyURI($uri);
             if ($proxy) {
                 if ($this->isHTTPSProtocol()) {
                     $env_key = 'https_proxy';
                 } else {
                     $env_key = 'http_proxy';
                 }
                 $env[$env_key] = (string) $proxy;
             }
         }
     }
     return $env;
 }
開發者ID:rchicoli,項目名稱:phabricator,代碼行數:30,代碼來源:DiffusionGitCommandEngine.php

示例2: executeRepositoryOperations

 protected function executeRepositoryOperations()
 {
     $repository = $this->getRepository();
     $args = $this->getArgs();
     if (!$args->getArg('tunnel')) {
         throw new Exception(pht('Expected `%s`!', 'svnserve -t'));
     }
     if ($this->shouldProxy()) {
         $command = $this->getProxyCommand();
         $this->isProxying = true;
         $cwd = null;
     } else {
         $command = csprintf('svnserve -t --tunnel-user=%s', $this->getUser()->getUsername());
         $cwd = PhabricatorEnv::getEmptyCWD();
     }
     $command = PhabricatorDaemon::sudoCommandAsDaemonUser($command);
     $future = new ExecFuture('%C', $command);
     // If we're receiving a commit, svnserve will fail to execute the commit
     // hook with an unhelpful error if the CWD isn't readable by the user we
     // are sudoing to. Switch to a readable, empty CWD before running
     // svnserve. See T10941.
     if ($cwd !== null) {
         $future->setCWD($cwd);
     }
     $this->inProtocol = new DiffusionSubversionWireProtocol();
     $this->outProtocol = new DiffusionSubversionWireProtocol();
     $this->command = id($this->newPassthruCommand())->setIOChannel($this->getIOChannel())->setCommandChannelFromExecFuture($future)->setWillWriteCallback(array($this, 'willWriteMessageCallback'))->setWillReadCallback(array($this, 'willReadMessageCallback'));
     $this->command->setPauseIOReads(true);
     $err = $this->command->execute();
     if (!$err && $this->didSeeWrite) {
         $this->getRepository()->writeStatusMessage(PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE, PhabricatorRepositoryStatusMessage::CODE_OKAY);
     }
     return $err;
 }
開發者ID:NeoArmageddon,項目名稱:phabricator,代碼行數:34,代碼來源:DiffusionSubversionServeSSHWorkflow.php


注:本文中的PhabricatorEnv::getEmptyCWD方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。