当前位置: 首页>>代码示例>>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;未经允许,请勿转载。