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


PHP phutil_console_format函數代碼示例

本文整理匯總了PHP中phutil_console_format函數的典型用法代碼示例。如果您正苦於以下問題:PHP phutil_console_format函數的具體用法?PHP phutil_console_format怎麽用?PHP phutil_console_format使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: getCommandHelp

    public function getCommandHelp()
    {
        return phutil_console_format(<<<EOTEXT
        View all assigned tasks.
EOTEXT
);
    }
開發者ID:milindc2031,項目名稱:Test,代碼行數:7,代碼來源:ArcanistTasksWorkflow.php

示例2: run

 public function run()
 {
     $roots = array();
     $roots['libphutil'] = dirname(phutil_get_library_root('phutil'));
     $roots['arcanist'] = dirname(phutil_get_library_root('arcanist'));
     foreach ($roots as $lib => $root) {
         echo "Upgrading {$lib}...\n";
         if (!Filesystem::pathExists($root . '/.git')) {
             throw new ArcanistUsageException("{$lib} must be in its git working copy to be automatically " . "upgraded. This copy of {$lib} (in '{$root}') is not in a git " . "working copy.");
         }
         $working_copy = ArcanistWorkingCopyIdentity::newFromPath($root);
         $configuration_manager = clone $this->getConfigurationManager();
         $configuration_manager->setWorkingCopyIdentity($working_copy);
         $repository_api = ArcanistRepositoryAPI::newAPIFromConfigurationManager($configuration_manager);
         $this->setRepositoryAPI($repository_api);
         // Require no local changes.
         $this->requireCleanWorkingCopy();
         // Require the library be on master.
         $branch_name = $repository_api->getBranchName();
         if ($branch_name != 'master') {
             throw new ArcanistUsageException("{$lib} must be on branch 'master' to be automatically upgraded. " . "This copy of {$lib} (in '{$root}') is on branch '{$branch_name}'.");
         }
         chdir($root);
         try {
             phutil_passthru('git pull --rebase');
         } catch (Exception $ex) {
             phutil_passthru('git rebase --abort');
             throw $ex;
         }
     }
     echo phutil_console_wrap(phutil_console_format("**Updated!** Your copy of arc is now up to date.\n"));
     return 0;
 }
開發者ID:ivoryxiong,項目名稱:arcanist,代碼行數:33,代碼來源:ArcanistUpgradeWorkflow.php

示例3: getCommandHelp

    public function getCommandHelp()
    {
        return phutil_console_format(<<<EOTEXT
          Deprecated. Moved to "close-revision".
EOTEXT
);
    }
開發者ID:nik-kor,項目名稱:arcanist,代碼行數:7,代碼來源:ArcanistMarkCommittedWorkflow.php

示例4: getCommandHelp

    public function getCommandHelp()
    {
        return phutil_console_format(<<<EOTEXT
          Supports: cli
          Create an alias from __command__ to __target__ (optionally, with
          __options__). For example:

            arc alias fpatch patch -- --force

          ...will create a new 'arc' command, 'arc fpatch', which invokes
          'arc patch --force ...' when run. NOTE: use "--" before specifying
          options!

          If you start an alias with "!", the remainder of the alias will be
          invoked as a shell command. For example, if you want to implement
          'arc ls', you can do so like this:

            arc alias ls '!ls'

          You can now run "arc ls" and it will behave like "ls". Of course, this
          example is silly and would make your life worse.

          You can not overwrite builtins, including 'alias' itself. The builtin
          will always execute, even if it was added after your alias.

          To remove an alias, run:

            arc alias fpatch

          Without any arguments, 'arc alias' will list aliases.
EOTEXT
);
    }
開發者ID:endlessm,項目名稱:arcanist,代碼行數:33,代碼來源:ArcanistAliasWorkflow.php

示例5: run

 public function run()
 {
     $revisions = $this->getConduit()->callMethodSynchronous('differential.query', array('authors' => array($this->getUserPHID()), 'status' => 'status-open'));
     if (!$revisions) {
         echo "You have no open Differential revisions.\n";
         return 0;
     }
     $repository_api = $this->getRepositoryAPI();
     $info = array();
     $status_len = 0;
     foreach ($revisions as $key => $revision) {
         $revision_path = Filesystem::resolvePath($revision['sourcePath']);
         $current_path = Filesystem::resolvePath($repository_api->getPath());
         if ($revision_path == $current_path) {
             $info[$key]['here'] = 1;
         } else {
             $info[$key]['here'] = 0;
         }
         $info[$key]['sort'] = sprintf('%d%04d%08d', $info[$key]['here'], $revision['status'], $revision['id']);
         $info[$key]['statusColorized'] = BranchInfo::renderColorizedRevisionStatus($revision['statusName']);
         $status_len = max($status_len, strlen($info[$key]['statusColorized']));
     }
     $info = isort($info, 'sort');
     foreach ($info as $key => $spec) {
         $revision = $revisions[$key];
         printf("%s %-" . ($status_len + 4) . "s D%d: %s\n", $spec['here'] ? phutil_console_format('**%s**', '*') : ' ', $spec['statusColorized'], $revision['id'], $revision['title']);
     }
     return 0;
 }
開發者ID:nik-kor,項目名稱:arcanist,代碼行數:29,代碼來源:ArcanistListWorkflow.php

示例6: getCommandHelp

    public function getCommandHelp()
    {
        return phutil_console_format(<<<EOTEXT
          Display inline comments related to a particular revision.
EOTEXT
);
    }
開發者ID:chaozhang80,項目名稱:tool-package,代碼行數:7,代碼來源:ArcanistInlinesWorkflow.php

示例7: getCommandHelp

    public function getCommandHelp()
    {
        return phutil_console_format(<<<TXT
          Shows coverage data from prior test run
TXT
);
    }
開發者ID:rogerwangzy,項目名稱:watchman,代碼行數:7,代碼來源:cover.php

示例8: getCommandHelp

    public function getCommandHelp()
    {
        return phutil_console_format(<<<EOTEXT
    Please use arc backout instead
EOTEXT
);
    }
開發者ID:ivoryxiong,項目名稱:arcanist,代碼行數:7,代碼來源:ArcanistRevertWorkflow.php

示例9: run

 public function run()
 {
     $roots = array('libphutil' => dirname(phutil_get_library_root('phutil')), 'arcanist' => dirname(phutil_get_library_root('arcanist')));
     foreach ($roots as $lib => $root) {
         echo phutil_console_format("%s\n", pht('Upgrading %s...', $lib));
         $working_copy = ArcanistWorkingCopyIdentity::newFromPath($root);
         $configuration_manager = clone $this->getConfigurationManager();
         $configuration_manager->setWorkingCopyIdentity($working_copy);
         $repository = ArcanistRepositoryAPI::newAPIFromConfigurationManager($configuration_manager);
         if (!Filesystem::pathExists($repository->getMetadataPath())) {
             throw new ArcanistUsageException(pht("%s must be in its git working copy to be automatically upgraded. " . "This copy of %s (in '%s') is not in a git working copy.", $lib, $lib, $root));
         }
         $this->setRepositoryAPI($repository);
         // Require no local changes.
         $this->requireCleanWorkingCopy();
         // Require the library be on master.
         $branch_name = $repository->getBranchName();
         if ($branch_name != 'master') {
             throw new ArcanistUsageException(pht("%s must be on branch '%s' to be automatically upgraded. " . "This copy of %s (in '%s') is on branch '%s'.", $lib, 'master', $lib, $root, $branch_name));
         }
         chdir($root);
         try {
             phutil_passthru('git pull --rebase');
         } catch (Exception $ex) {
             phutil_passthru('git rebase --abort');
             throw $ex;
         }
     }
     echo phutil_console_format("**%s** %s\n", pht('Updated!'), pht('Your copy of arc is now up to date.'));
     return 0;
 }
開發者ID:lewisf,項目名稱:arcanist,代碼行數:31,代碼來源:ArcanistUpgradeWorkflow.php

示例10: run

 public function run()
 {
     $srcdir = dirname(__FILE__) . '/../../';
     $engine = new WatchmanIntegrationEngine();
     $engine->setProjectRoot($srcdir);
     $paths = $this->getArgument('args');
     $results = $engine->run($paths);
     $failed = 0;
     $colors = array('pass' => '<fg:green>OK</fg>  ', 'fail' => '<fg:red>FAIL</fg>', 'skip' => '<fg:yellow>SKIP</fg>');
     foreach ($results as $result) {
         $res = $result->getResult();
         $status = idx($colors, $res, $res);
         echo phutil_console_format("{$status} %s (%.2fs)\n", $result->getName(), $result->getDuration());
         if ($res == 'pass' || $res == 'skip') {
             continue;
         }
         echo $result->getUserData() . "\n";
         $failed++;
     }
     if (!$failed) {
         echo phutil_console_format("\nAll %d tests passed/skipped :successkid:\n", count($results));
     } else {
         echo phutil_console_format("\n%d of %d tests failed\n", $failed, count($results));
     }
     return $failed ? 1 : 0;
 }
開發者ID:rogerwangzy,項目名稱:watchman,代碼行數:26,代碼來源:test.php

示例11: didExecute

 public function didExecute(PhutilArgumentParser $args)
 {
     foreach ($this->getAPIs() as $api) {
         $patches = $this->getPatches();
         $applied = $api->getAppliedPatches();
         if ($applied === null) {
             echo phutil_console_format("**%s**: %s\n", pht('Database Not Initialized'), pht('Run **%s** to initialize.', './bin/storage upgrade'));
             return 1;
         }
         $ref = $api->getRef();
         $table = id(new PhutilConsoleTable())->setShowHeader(false)->addColumn('id', array('title' => pht('ID')))->addColumn('host', array('title' => pht('Host')))->addColumn('status', array('title' => pht('Status')))->addColumn('duration', array('title' => pht('Duration')))->addColumn('type', array('title' => pht('Type')))->addColumn('name', array('title' => pht('Name')));
         $durations = $api->getPatchDurations();
         foreach ($patches as $patch) {
             $duration = idx($durations, $patch->getFullKey());
             if ($duration === null) {
                 $duration = '-';
             } else {
                 $duration = pht('%s us', new PhutilNumber($duration));
             }
             $table->addRow(array('id' => $patch->getFullKey(), 'host' => $ref->getRefKey(), 'status' => in_array($patch->getFullKey(), $applied) ? pht('Applied') : pht('Not Applied'), 'duration' => $duration, 'type' => $patch->getType(), 'name' => $patch->getName()));
         }
         $table->draw();
     }
     return 0;
 }
開發者ID:NeoArmageddon,項目名稱:phabricator,代碼行數:25,代碼來源:PhabricatorStorageManagementStatusWorkflow.php

示例12: getCommandHelp

    public function getCommandHelp()
    {
        return phutil_console_format(<<<TXT
          Generates an RPM suitable for use at Facebook
TXT
);
    }
開發者ID:rogerwangzy,項目名稱:watchman,代碼行數:7,代碼來源:package.php

示例13: getCommandHelp

    public function getCommandHelp()
    {
        return phutil_console_format(<<<EOTEXT
          Show what you're currently tracking in Phrequent.
EOTEXT
);
    }
開發者ID:milindc2031,項目名稱:Test,代碼行數:7,代碼來源:ArcanistTimeWorkflow.php

示例14: getCommandHelp

    public function getCommandHelp()
    {
        return phutil_console_format(<<<EOTEXT
        Close a task.
EOTEXT
);
    }
開發者ID:chaozhang80,項目名稱:tool-package,代碼行數:7,代碼來源:ArcanistCloseWorkflow.php

示例15: progress

 private function progress($results, $numTests)
 {
     static $colors = array(ArcanistUnitTestResult::RESULT_PASS => 'green', ArcanistUnitTestResult::RESULT_FAIL => 'red', ArcanistUnitTestResult::RESULT_SKIP => 'yellow', ArcanistUnitTestResult::RESULT_BROKEN => 'red', ArcanistUnitTestResult::RESULT_UNSOUND => 'yellow', ArcanistUnitTestResult::RESULT_POSTPONED => 'yellow');
     $s = "[";
     $lastColor = "";
     foreach ($results as $result) {
         $color = $colors[$result->getResult()];
         if (!$color && $lastColor) {
             $s .= "</bg>";
         } elseif (!$lastColor && $color) {
             $s .= "<bg:{$color}>";
         } elseif ($lastColor !== $color) {
             $s .= "</bg><bg:{$color}>";
         }
         $lastColor = $color;
         $s .= ".";
     }
     if ($lastColor) {
         $s .= "</bg>";
     }
     $c = count($results);
     if ($numTests) {
         $s .= str_repeat(" ", $numTests - $c) . " {$c}/{$numTests}]";
     } else {
         $s .= " {$c}]";
     }
     return phutil_console_format($s);
 }
開發者ID:mingxingtan,項目名稱:polly,代碼行數:28,代碼來源:LitTestEngine.php


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