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


PHP Terminus::launchSelf方法代码示例

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


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

示例1: login

 /**
  * Log in as a user
  *
  *  ## OPTIONS
  * [<email>]
  * : Email address to log in as.
  *
  * [--password=<value>]
  * : Log in non-interactively with this password. Useful for automation.
  *
  * [--machine-token=<value>]
  * : Authenticate using an Auth0 token
  *
  * [--debug]
  * : dump call information when logging in.
  */
 public function login($args, $assoc_args)
 {
     // Try to login using a machine token, if provided.
     if (isset($assoc_args['machine-token']) || empty($args) && isset($_SERVER['TERMINUS_MACHINE_TOKEN'])) {
         $token = $_SERVER['TERMINUS_MACHINE_TOKEN'];
         if (isset($assoc_args['machine-token'])) {
             $token = $assoc_args['machine-token'];
         }
         $this->auth->logInViaMachineToken($token);
     } else {
         // Otherwise, do a normal email/password-based login.
         if (empty($args)) {
             if (isset($_SERVER['TERMINUS_USER'])) {
                 $email = $_SERVER['TERMINUS_USER'];
             } else {
                 $email = Terminus::prompt('Your email address?', null);
             }
         } else {
             $email = $args[0];
         }
         if (isset($assoc_args['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'));
 }
开发者ID:blueprintmrk,项目名称:cli,代码行数:46,代码来源:auth.php

示例2: testLaunchSelf

 public function testLaunchSelf()
 {
     $file_name = '/tmp/output';
     setOutputDestination($file_name);
     $return = Terminus::launchSelf("art unicorn > {$file_name}");
     $output = retrieveOutput($file_name);
     $this->assertTrue(strpos($output, "<.'_.''") !== false);
     $this->assertEquals($return, 0);
     resetOutputDestination($file_name);
 }
开发者ID:barkinet,项目名称:cli,代码行数:10,代码来源:test-terminus.php

示例3: testLaunchSelf

 public function testLaunchSelf()
 {
     $file_name = '/tmp/output';
     //Testing the library route
     setOutputDestination($file_name);
     $return = Terminus::launchSelf("art unicorn > {$file_name}");
     $output = retrieveOutput($file_name);
     $this->assertTrue(strpos($output, "<.'_.''") !== false);
     $this->assertEquals($return, 0);
     resetOutputDestination($file_name);
     //Testing the command-line route
     setOutputDestination($file_name);
     $GLOBALS['argv'] = [__DIR__ . '/../../php/boot-fs.php'];
     $return = Terminus::launchSelf("art unicorn > {$file_name}");
     $output = retrieveOutput($file_name);
     $this->assertTrue(strpos($output, "<.'_.''") !== false);
     $this->assertEquals($return, 0);
     resetOutputDestination($file_name);
 }
开发者ID:karudonaldson,项目名称:terminus,代码行数:19,代码来源:test-terminus.php

示例4: create

 /**
  * Create a new site
  *
  * ## OPTIONS
  *
  * [--site=<site>]
  * : Name of the site to create (machine-readable)
  *
  * [--name=<name>]
  * : (deprecated) use --site instead
  *
  * [--label=<label>]
  * : Label for the site
  *
  * [--upstream=<upstreamid>]
  * : Specify the upstream upstream to use
  *
  * [--org=<id>]
  * : UUID of organization into which to add this site
  *
  */
 public function create($args, $assoc_args)
 {
     $options = Sites_Command::getSiteCreateOptions($assoc_args);
     $upstream = Input::upstream($assoc_args, 'upstream');
     $options['upstream_id'] = $upstream->get('id');
     $this->log()->info("Creating new {upstream} installation ... ", array('upstream' => $upstream->get('longname')));
     $workflow = $this->sites->addSite($options);
     $workflow->wait();
     $this->workflowOutput($workflow);
     // Add Site to SitesCache
     $final_task = $workflow->get('final_task');
     $this->sites->addSiteToCache($final_task->site_id);
     Terminus::launchSelf('site', array('info'), array('site' => $options['name']));
     return true;
 }
开发者ID:blueprintmrk,项目名称:cli,代码行数:36,代码来源:sites.php

示例5: _checkSession

 private function _checkSession()
 {
     if (!property_exists($this, "session") || !property_exists($this->session, "user_uuid")) {
         return false;
     }
     $results = $this->terminus_request("user", $this->session->user_uuid, "profile", "GET");
     if ($results['info']['http_code'] >= 400) {
         $this->failure('Your session is expired. Please reauthenticate.');
         $this->cache->remove('session');
         Terminus::launchSelf("auth", array("login"));
         $this->whoami();
         return true;
     } else {
         return $results['info']['http_code'] <= 199 || $results['info']['http_code'] >= 300 ? false : true;
     }
 }
开发者ID:andrefy,项目名称:cli,代码行数:16,代码来源:auth.php


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