當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。