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


PHP Terminus::addCommand方法代码示例

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


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

示例1: all

 * Show Pantheon upstream information
 */
class Upstreams_Command extends TerminusCommand
{
    /**
     * Search for Pantheon upstream info
     *
     * ### OPTIONS
     *
     * [--category=<category>]
     * : general, publishing, commerce, etc
     *
     * [--type=<type>]
     * : Pantheon internal upstream type definition
     *
     * [--framework=<drupal|wordpress>]
     * : Filter based on framework
     *
     * @subcommand list
     * @alias all
     **/
    public function all($args = array(), $assoc_args = array())
    {
        $upstreams = new Upstreams();
        $upstreams_list = $upstreams->getFilteredMemberList($assoc_args, 'id', array('id', 'longname', 'category', 'type', 'framework'));
        $this->output()->outputRecordList($upstreams_list, array('id' => 'ID', 'longname' => 'Name', 'category' => 'Category', 'type' => 'Type', 'framework' => 'Framework'));
        return $upstreams;
    }
}
Terminus::addCommand('upstreams', 'Upstreams_Command');
开发者ID:RobLoach,项目名称:cli,代码行数:30,代码来源:upstreams.php

示例2: __construct

 */
class Instruments_Command extends TerminusCommand
{
    /**
     * Instantiates object, ensures login
     *
     * @return [Instruments_Command] $this
     */
    public function __construct()
    {
        Auth::ensureLogin();
        parent::__construct();
    }
    /**
     * Show a list of your instruments on Pantheon
     *
     * @subcommand list
     */
    public function all($args, $assoc_args)
    {
        $user = new User();
        $instruments = $user->instruments->all();
        $data = array();
        foreach ($instruments as $id => $instrument) {
            $data[] = array('label' => $instrument->get('label'), 'id' => $instrument->get('id'));
        }
        $this->output()->outputRecordList($data);
    }
}
Terminus::addCommand('instruments', 'Instruments_Command');
开发者ID:RobLoach,项目名称:cli,代码行数:30,代码来源:instruments.php

示例3: unset

        $assoc_args['env'] = $environment = Input::env($assoc_args);
        $server = $this->getAppserverInfo(array('site' => $site->get('id'), 'environment' => $environment));
        # Sanitize assoc args so we don't try to pass our own flags.
        # TODO: DRY this out?
        if (isset($assoc_args['site'])) {
            unset($assoc_args['site']);
        }
        if (isset($assoc_args['env'])) {
            unset($assoc_args['env']);
        }
        # Create user-friendly output
        $flags = '';
        foreach ($assoc_args as $k => $v) {
            if (isset($v) && (string) $v != '') {
                $flags .= "--{$k}={$v} ";
            } else {
                $flags .= "--{$k} ";
            }
        }
        if (in_array(Terminus::getConfig('format'), array('bash', 'json', 'silent'))) {
            $assoc_args['pipe'] = 1;
        }
        $this->log()->info("Running drush {cmd} {flags} on {site}-{env}", array('cmd' => $command, 'flags' => $flags, 'site' => $site->get('name'), 'env' => $environment));
        $result = $this->sendCommand($server, 'drush', $args, $assoc_args);
        if (Terminus::getConfig('format') != 'normal') {
            $this->output()->outputRecordList($result);
        }
    }
}
Terminus::addCommand('drush', 'Drush_Command');
开发者ID:RobLoach,项目名称:cli,代码行数:30,代码来源:drush.php

示例4: wipe

     * [--site=<site>]
     * : Site to use
     *
     * [--env=<env>]
     * : Environment to be wiped
     */
    public function wipe($args, $assoc_args)
    {
        $site = $this->sites->get(Input::sitename($assoc_args));
        $env = $site->environments->get(Input::env($assoc_args, 'env'));
        Terminus::confirm('Are you sure you want to wipe {site}-{env}?', array('site' => $site->get('name'), 'env' => $env->get('id')));
        $workflow = $env->wipe();
        $workflow->wait();
        $this->log()->info('Successfully wiped {site}-{env}', array('site' => $site->get('name'), 'env' => $env->get('id')));
    }
    /**
     * Checks to ensure user can access the given organization
     *
     * @param [string] $org_id Organization name or UUID
     * @return [boolean] $is_ok True if this organization is accessible
     */
    private function isOrgAccessible($org_id)
    {
        $user = new User();
        $org = $user->organizations->get($org_id);
        $is_ok = is_object($org);
        return $is_ok;
    }
}
\Terminus::addCommand('site', 'Site_Command');
开发者ID:RobLoach,项目名称:cli,代码行数:30,代码来源:site.php

示例5: password

                $password = $assoc_args['password'];
            } else {
                $password = Terminus::promptSecret('Your dashboard password (input will not be shown)');
            }
            $this->auth->logInViaUsernameAndPassword($email, $password);
        }
        $this->log()->debug(get_defined_vars());
        Terminus::launchSelf('art', array('fist'));
    }
    /**
     * Log yourself out and remove the secret session key.
     */
    public function logout()
    {
        $this->log()->info('Logging out of Pantheon.');
        $this->cache->remove('session');
    }
    /**
     * Find out what user you are logged in as.
     */
    public function whoami()
    {
        if (Session::getValue('user_uuid')) {
            $this->output()->outputValue(Session::getValue('user_uuid'), 'You are authenticated as');
        } else {
            $this->failure('You are not logged in.');
        }
    }
}
Terminus::addCommand('auth', 'Auth_Command');
开发者ID:blueprintmrk,项目名称:cli,代码行数:30,代码来源:auth.php

示例6: array

                    $this->log()->info('Backing up ' . $site->get('name') . '.');
                    $backup = $env->createBackup(array('element' => 'all'));
                    // Only continue if the backup was successful.
                    if ($backup) {
                        $this->log()->info("Backup of " . $site->get('name') . " created.");
                        $this->log()->info('Updating ' . $site->get('name') . '.');
                        // Apply the update, failure here would trigger a guzzle exception so no need to validate success.
                        $response = $site->applyUpstreamUpdates($env->get('id'), $updatedb, $xoption);
                        $data[$site->get('name')]['status'] = 'Updated';
                        $this->log()->info($site->get('name') . ' is updated.');
                    } else {
                        $data[$site->get('name')]['status'] = 'Backup failed';
                        $this->log()->error('There was a problem backing up ' . $site->get('name') . '. Update aborted.');
                    }
                }
            } else {
                if (isset($assoc_args['report'])) {
                    $data[$site->get('name')] = array('site' => $site->get('name'), 'status' => "Up to date");
                }
            }
        }
        if (!empty($data)) {
            sort($data);
            $this->output()->outputRecordList($data);
        } else {
            $this->log()->info('No sites in need of updating.');
        }
    }
}
Terminus::addCommand('sites', 'Sites_Command');
开发者ID:blueprintmrk,项目名称:cli,代码行数:30,代码来源:sites.php

示例7: cache_clear

    public function cache_clear($args, $assoc_args)
    {
        if (isset($assoc_args['cache'])) {
            $this->cache->remove($assoc_args['cache']);
        } else {
            $this->cache->flush();
        }
    }
    /**
     * Instantiate a console within Terminus
     *
     * ## OPTIONS
     *
     * [--site=<site>]
     * : name of site to load
     *
     * @subcommand console
     */
    public function console($args, $assoc_args)
    {
        $user = new User();
        if (isset($assoc_args['site'])) {
            $sitename = $assoc_args['site'];
            $site_id = $this->sitesCache->findId($sitename);
            $site = new Site($site_id);
        }
        eval(\Psy\sh());
    }
}
Terminus::addCommand('cli', 'CLI_Command');
开发者ID:RobLoach,项目名称:cli,代码行数:30,代码来源:cli.php

示例8: array

        }
        # see https://github.com/pantheon-systems/titan-mt/blob/master/dashboardng/app/workshops/site/models/environment.coffee
        $server = array('user' => "{$environment}.{$site->get('id')}", 'host' => "appserver.{$environment}.{$site->get('id')}.drush.in", 'port' => '2222');
        if (strpos(TERMINUS_HOST, 'onebox') !== FALSE) {
            $server['user'] = "appserver.{$environment}.{$site->get('id')}";
            $server['host'] = TERMINUS_HOST;
        }
        # Sanitize assoc args so we don't try to pass our own flags.
        # TODO: DRY this out?
        unset($assoc_args['site']);
        if (isset($assoc_args['env'])) {
            unset($assoc_args['env']);
        }
        # Create user-friendly output
        $flags = '';
        foreach ($assoc_args as $k => $v) {
            if (isset($v) && (string) $v != '') {
                $flags .= "--{$k}=" . escapeshellarg($v) . ' ';
            } else {
                $flags .= "--{$k} ";
            }
        }
        $this->log()->info("Running wp {cmd} {flags} on {site}-{env}", array('cmd' => $command, 'flags' => $flags, 'site' => $site->get('name'), 'env' => $environment));
        $result = $this->sendCommand($server, 'wp', $args, $assoc_args);
        if (Terminus::getConfig('format') != 'normal') {
            $this->output()->outputRecordList($result);
        }
    }
}
Terminus::addCommand('wp', 'WPCLI_Command');
开发者ID:RobLoach,项目名称:cli,代码行数:30,代码来源:wp.php

示例9: render_subcommands

    }
    private static function render_subcommands($command)
    {
        $subcommands = array();
        foreach ($command->getSubcommands() as $subcommand) {
            $subcommands[$subcommand->getName()] = $subcommand->getShortdesc();
        }
        if (Terminus::getConfig('format') == 'json') {
            return $subcommands;
        }
        $max_len = self::get_max_len(array_keys($subcommands));
        $lines = array();
        foreach ($subcommands as $name => $desc) {
            $lines[] = str_pad($name, $max_len) . "\t\t\t" . $desc;
        }
        return $lines;
    }
    private static function get_max_len($strings)
    {
        $max_len = 0;
        foreach ($strings as $str) {
            $len = strlen($str);
            if ($len > $max_len) {
                $max_len = $len;
            }
        }
        return $max_len;
    }
}
Terminus::addCommand('help', 'Help_Command');
开发者ID:RobLoach,项目名称:cli,代码行数:30,代码来源:help.php

示例10: array

 * Print the pantheon art
 *
 */
class Art_Command extends TerminusCommand
{
    private $works = array("fist" => "CiAgICAgICAgLisuCiAgICAgICAgLis/OgogICAgICAgICAuKz8/LgogICAgICAgICAgID8/PyAuCiAgICAgICAgICAgKz8/Py4KICAgICAgKz8/Pz8/Pz8/Pz0uCiAgICAgIC4/Pz8/Pz8/Pz8/Py4KICAgICAgLj8/Pz8/Pz8/Pz8/Py4KCiAgICAgIyMjIyMjIyMjIyMgIyMjIyMjIyMKICAgICAjIyMjIyMjIyMjIyMuIyMjIyMjIy4KICAgICAjIyMjIyMjICMjIyMgIC4uLi4uLi4KICAgICAjIyMjIyMjIyAjIyMjICMjIyMjIyMgICAgICAgICAgICAgICAgNTAgNDEgNEUgNTQgNDggNDUgNEYgNEUKICAgICAjIyMjIyMjIyMuIyMjIy4jIyMjIyMgICAgICAgIF9fX19fX19fX19fX18gIF9fICBfX19fX19fXyAgX19fXyAgX19fX19fCiAgICAgIyMjIyMjICAuLi4gICAgICAgICAgICAgICAgIC9fICBfXy8gX18vIF8gXC8gIHwvICAvICBfLyB8LyAvIC8gLyAvIF9fLwogICAgICMjIyMjIyMuPz8uIyMjIyMjIyMjIyAgICAgICAgLyAvIC8gXy8vICwgXy8gL3xfLyAvLyAvLyAgICAvIC9fLyAvXCBcCiAgICAgIyMjIyMjI34rPz8uIyMjIyMjIyMjICAgICAgIC9fLyAvX19fL18vfF8vXy8gIC9fL19fXy9fL3xfL1xfX19fL19fXy8KICAgICAjIyMjIyMjIy4/Py4uCiAgICAgIyMjIyMjIyMjLj8/LiMjIyMjIyMuCiAgICAgIyMjIyMjIyMjLis/PyAjIyMjIyMuCiAgICAgICAgICAgICAgIC4rPy4KICAgICAgICAgLj8/Pz8/Pz8/Pz8/Py4KICAgICAgICAgICArPz8/Pz8/Pz8/PywKICAgICAgICAgICAgLj8/Pz8rKysrKysuCiAgICAgICAgICAgICAgPz8/Py4KICAgICAgICAgICAgICAuPz8/LAogICAgICAgICAgICAgICAufj8/LgogICAgICAgICAgICAgICAgIC4/PwogICAgICAgICAgICAgICAgICAuPywu", "unicorn" => "ICAgICAgIFwKICAgICAgICBcCiAgICAgICAgIFxcCiAgICAgICAgICBcXAogICAgICAgICAgID5cLzcKICAgICAgIF8uLSg2JyAgXAogICAgICAoPV9fXy5fL2AgXAogICAgICAgICAgICkgIFwgfAogICAgICAgICAgLyAgIC8gfAogICAgICAgICAvICAgID4gLwogICAgICAgIGogICAgPCBfXAogICAgXy4tJyA6ICAgICAgYGAuCiAgICBcIHI9Ll9cICAgICAgICBgLgogICA8YFxcXyAgXCAgICAgICAgIC5gLS4KICAgIFwgci03ICBgLS4gLl8gICcgLiAgYFwKICAgICBcYCwgICAgICBgLS5gNyAgNykgICApCiAgICAgIFwvICAgICAgICAgXHwgIFwnICAvIGAtLl8KICAgICAgICAgICAgICAgICB8fCAgICAuJwogICAgICAgICAgICAgICAgICBcXCAgKAogICAgICAgICAgICAgICAgICAgPlwgID4KICAgICAgICAgICAgICAgLC4tJyA+LicKICAgICAgICAgICAgICA8LidfLicnCiAgICAgICAgICAgICAgICA8Jw==", "druplicon" => "ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGQnLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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U1NTU1OT2Q6JycnJydsMFdYMGt4a09OTXgnJycnJzpPV01NTU5kLiAgICAgIA0KICAgICAgICAuJycnJycnJycnJycnJzpsb29vb29sOiwnJycnJycnJ09XTzonJycnJycnT046JycnJycnLGNsYy4gICAgICAgIA0KICAgICAgICAgIC4nJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnLCwnICAgICAgICAgIA0KICAgICAgICAgICAgLicnJycnJycnJycnJycnJycnJycnO2MnJycnJycnJycnJycnJycnJyc6bycnJywsLiAgICAgICAgICAgIA0KICAgICAgICAgICAgICAuLicnJycnJycnJycnJycnJyc7V01OT2RsOjs7LCwsLDs6Y294ME5OaywsJy4gICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAuLicnJycnJycnJycnJycnLG9PWFdNTU1NTU1NTU1NTktrbzosJy4gICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgLi4uJycnJycnJycnJycnJycsOzs6Ojo7OywsJycuLiAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAuLi4uLicnJycnJycnJycnJy4uLi4gICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0K", "wordpress" => "ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLi4uLi4uLi4uLi4uLi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4gICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIC4uJy4uLiAgICAgICAgICAgICAgICAgICAgICAgIC4uLicuLiAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgLi4nLi4gICAgICAgICAgLi4uLi4uLi4uLi4uLi4gICAgICAgICAgLi4nLi4gICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgLi4nLi4gICAgICAgLi4uJycnJycnJycnJycnJycnJycnJycuLi4gICAgICAgIC4nLi4gICAgICAgICAgICAgICAKICAgICAgICAgICAgIC4uLi4gICAgICAuLicnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycuLiAgICAgLi4nLiAgICAgICAgICAgICAKICAgICAgICAgICAuJy4gICAgIC4uJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycuLiAgICAgLicuICAgICAgICAgICAKICAgICAgICAgLicuICAgICAuJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJy4gICAgICAuJy4gICAgICAgICAKICAgICAgICAuLiAgICAgLicnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJy4gICAgICAgICAgIC4uLiAgICAgICAKICAgICAgLicuICAgIC4nJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnLiAgICAgICAgICAgICAuJy4gICAgICAKICAgICAuJy4gICAgLi4uLi4uLi4uLi4uJycnJycuLi4uLi4uLi4uLi4uLi4uLi4uLi4nJycnJycnICAgICAgICAgICAgICAgICcuICAgICAKICAgIC4nICAgICAgICAgICAgICAgICAgLicnJy4gICAgICAgICAgICAgICAgICAgIC4nJycnJycnICAgICAgICAgICAgICAgICAnLiAgICAKICAgLicgICAgICAgICAgICAgIC4uJycnJycnJycnJycuLiAgICAgICAgICAgLi4nJycnJycnJycnLiAgICAgICAgICAgIC4gICAgJy4gICAKICAuJy4gICAuICAgICAgICAgICAnJycnJycnJycnJycnJy4gICAgICAgICAgLicnJycnJycnJycnJy4gICAgICAgICAgIC4uICAgLicuICAKICAnLiAgICAnLiAgICAgICAgICAuJycnJycnJycnJycnJycuICAgICAgICAgIC4nJycnJycnJycnJycnLiAgICAgICAgIC4nLiAgIC4nICAKIC4nICAgIC4nJy4gICAgICAgICAgLicnJycnJycnJycnJycnICAgICAgICAgICAuJycnJycnJycnJycnJy4gICAgICAgICcnJyAgICAnLiAKICcuICAgLicnJycgICAgICAgICAgIC4nJycnJycnJycnJycnLiAgICAgICAgICAgJycnJycnJycnJycnJycgICAgICAgICcnJy4gICAuJyAKLicuICAgLicnJycuICAgICAgICAgICAnJycnJycnJycnJycnJy4gICAgICAgICAgLicnJycnJycnJycnJycuICAgICAgLicnJy4gICAgJy4KLicgICAgJycnJycnLiAgICAgICAgICAuJycnJycnJycnJycnJycuICAgICAgICAgIC4nJycnJycnJycnJycnICAgICAuJycnJycgICAgJy4KLicgICAgJycnJycnJy4gICAgICAgICAgLicnJycnJycnJycnJycuICAgICAgICAgICAnJycnJycnJycnJycnICAgICAnJycnJycgICAgJycKLicgICAgJycnJycnJycgICAgICAgICAgICcnJycnJycnJycnJycgICAgICAgICAgICAuJycnJycnJycnJycuICAgIC4nJycnJycgICAgJycKLicgICAgJycnJycnJycuICAgICAgICAgIC4nJycnJycnJycnJy4gICAgICAgICAgICAgLicnJycnJycnJycuICAgLicnJycnJycgICAgJy4KLicuICAgLicnJycnJycnLiAgICAgICAgICAuJycnJycnJycnLiAgICcuICAgICAgICAgICcnJycnJycnJy4gICAgJycnJycnJy4gICAgJy4KICcuICAgLicnJycnJycnJy4gICAgICAgICAgJycnJycnJycnICAgLicnICAgICAgICAgIC4nJycnJycnJyAgICAuJycnJycnJy4gICAuJyAKIC4nICAgIC4nJycnJycnJycgICAgICAgICAgLicnJycnJycuICAuJycnLiAgICAgICAgICAuJycnJycnLiAgIC4nJycnJycnJyAgICAnLiAKICAnLiAgICAnJycnJycnJycnICAgICAgICAgIC4nJycnJy4gICAnJycnJy4gICAgICAgICAgJycnJycuICAgLicnJycnJycnLiAgIC4nICAKICAuJy4gICAuJycnJycnJycnLiAgICAgICAgICAnJycnJyAgIC4nJycnJycuICAgICAgICAgLicnJycuICAgJycnJycnJycuICAgLicuICAKICAgLicuICAgLicnJycnJycnJy4gICAgICAgICAuJycnLiAgLicnJycnJycnICAgICAgICAgIC4nJy4gICAuJycnJycnJy4gICAgJy4gICAKICAgIC4nICAgIC4nJycnJycnJycgICAgICAgICAgLicuICAuJycnJycnJycnLiAgICAgICAgICAuJyAgIC4nJycnJycnLiAgICAnLiAgICAKICAgICAuJy4gICAgLicnJycnJycuICAgICAgICAgIC4gICAnJycnJycnJycnJy4gICAgICAgICAuLiAgICcnJycnJy4gICAgICcuICAgICAKICAgICAgLicuICAgIC4nJycnJycnLiAgICAgICAgICAgIC4nJycnJycnJycnJycuICAgICAgICAgICAgLicnJycnLiAgICAuJy4gICAgICAKICAgICAgICAuJy4gICAgLicnJycnJy4gICAgICAgICAgLicnJycnJycnJycnJycnICAgICAgICAgICAuJycnJy4gICAgIC4uICAgICAgICAKICAgICAgICAgLicuICAgICAuJycnJycgICAgICAgICAgJycnJycnJycnJycnJycnLiAgICAgICAgIC4nJycuICAgICAuJy4gICAgICAgICAKICAgICAgICAgICAuJy4gICAgIC4uJycuICAgICAgICAuJycnJycnJycnJycnJycnJy4gICAgICAgICcuLiAgICAgLicuICAgICAgICAgICAKICAgICAgICAgICAgIC4uLi4gICAgICAuLiAgICAgIC4nJycnJycnJycnJycnJycnJycuICAgICAgICAgICAgLi4uLiAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIC4nLi4gICAgICAgICAgICcnJycnJycnJycnJycnJycnJycuICAgICAgICAgLi4nLi4gICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgIC4uLi4gICAgICAgICAgIC4uLi4uLi4uLi4uLiAgICAgICAgICAgLi4nLiAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIC4uLi4uLiAgICAgICAgICAgICAgICAgICAgICAgIC4uLicuLiAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4gICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLi4uLi4uJycuLi4uLi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK");
    /**
     * View Pantheon artwork
     *
     * ## Options
     *
     * fist
     *
     * unicorn
     *
     * druplicon
     *
     * wordpress
     */
    function __invoke($args, $assoc_args)
    {
        $artwork = array_shift($args) ?: array_rand($this->works);
        if (!empty($artwork) && array_key_exists($artwork, $this->works)) {
            echo Terminus::colorize("%g" . base64_decode($this->works[$artwork]) . "%n") . "\n";
        } else {
            $this->failure('No formula for requested artwork');
        }
    }
}
Terminus::addCommand('art', 'Art_Command');
开发者ID:RobLoach,项目名称:cli,代码行数:30,代码来源:art.php

示例11: index

     * ## OPTIONS
     * [--site=<site>]
     * : Site from which to list workflows
     *
     * @subcommand list
     */
    public function index($args, $assoc_args)
    {
        $site = $this->sites->get(Input::sitename($assoc_args));
        $workflows = $site->workflows->all();
        $data = array();
        foreach ($workflows as $workflow) {
            $user = 'Pantheon';
            if (isset($workflow->get('user')->email)) {
                $user = $workflow->get('user')->email;
            }
            if ($workflow->get('total_time')) {
                $elapsed_time = $workflow->get('total_time');
            } else {
                $elapsed_time = time() - $workflow->get('created_at');
            }
            $data[] = array('id' => $workflow->id, 'env' => $workflow->get('environment'), 'workflow' => $workflow->get('description'), 'user' => $user, 'status' => $workflow->get('phase'), 'time' => sprintf("%ds", $elapsed_time));
        }
        if (count($data) == 0) {
            $this->log()->warning('No workflows have been run on {site}', array('site' => $site->get('name')));
        }
        $this->output()->outputRecordList($data, array('update' => 'Last update'));
    }
}
\Terminus::addCommand('workflows', 'Workflows_Command');
开发者ID:RobLoach,项目名称:cli,代码行数:30,代码来源:workflows.php

示例12: getNonmemberSiteList

        }
        return $list;
    }
    /**
     * Retrieves a succinct list of non-member sites
     *
     * @param [array] $memberships Members of this org
     * @return [array] $list
     */
    private function getNonmemberSiteList($memberships)
    {
        $members = $this->getMemberSiteList($memberships);
        $sites = $this->sites->getMemberList();
        $list = array_diff($sites, $members);
        return $list;
    }
    /**
     * Determines whether the site is a member of an org
     *
     * @param [array] $memberships Members of this org
     * @return [boolean] $is_member
     */
    private function siteIsMember($memberships, $site_id)
    {
        $list = $this->getMemberSiteList($memberships);
        $is_member = isset($list[$site_id]) || array_search($site_id, $list) !== false;
        return $is_member;
    }
}
Terminus::addCommand('organizations', 'Organizations_Command');
开发者ID:RobLoach,项目名称:cli,代码行数:30,代码来源:organizations.php

示例13: testAddCommand

 public function testAddCommand()
 {
     Terminus::addCommand('auth', 'AuthCommand');
 }
开发者ID:dalin-,项目名称:cli,代码行数:4,代码来源:test-terminus.php


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