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


PHP Terminus::launch_self方法代碼示例

本文整理匯總了PHP中Terminus::launch_self方法的典型用法代碼示例。如果您正苦於以下問題:PHP Terminus::launch_self方法的具體用法?PHP Terminus::launch_self怎麽用?PHP Terminus::launch_self使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Terminus的用法示例。


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

示例1: import

 /**
  * Import a new site
  * @package 2.0
  *
  * ## OPTIONS
  *
  * [--url=<url>]
  * : URL of archive to import
  *
  * [--name=<name>]
  * : (deprecated) use --site instead
  *
  * [--site=<site>]
  * : Name of the site to create (machine-readable)
  *
  * [--label=<label>]
  * : Label for the site
  *
  * [--org=<org>]
  * : UUID of organization to add this site to; or "None"
  *
  * @subcommand create-from-import
  */
 public function import($args, $assoc_args)
 {
     $url = Input::string($assoc_args, 'url', "URL of archive to import");
     if (!$url) {
         Terminus::error("Please enter a URL.");
     }
     $assoc_args['import'] = $url;
     Terminus::launch_self('sites', array('create'), $assoc_args);
 }
開發者ID:xwp,項目名稱:pantheon-cli,代碼行數:32,代碼來源:sites.php

示例2: delete

 /**
  * [Deprecated] Delete a site from pantheon; use `site delete` instead
  *
  * ## OPTIONS
  * [--site=<site>]
  * : ID of the site you want to delete
  *
  * [--force]
  * : to skip the confirmations
  */
 function delete($args, $assoc_args)
 {
     Terminus::launch_self('site', array('delete'), $assoc_args);
 }
開發者ID:reynoldsalec,項目名稱:cli,代碼行數:14,代碼來源:sites.php

示例3: import

 /**
  * Import a new site
  * @package 2.0
  *
  * ## OPTIONS
  *
  * [--url=<url>]
  * : Url of archive to import
  *
  * [--name=<name>]
  * : Name of the site to create (machine-readable)
  *
  * [--label=<label>]
  * : Label for the site
  *
  * [--org=<org>]
  * : UUID of organization to add this site to
  *
  * @subcommand create-from-import
  */
 public function import($args, $assoc_args)
 {
     $url = Input::string($assoc_args, 'url', "Url of archive to import");
     $label = Input::string($assoc_args, 'label', "Human readable label for the site");
     $slug = Utils\sanitize_name($label);
     $name = Input::string($assoc_args, 'name', "Machine name of the site; used as part of the default URL [ if left blank will be {$slug}]");
     $name = $name ? $name : $slug;
     $organization = Terminus::menu(Input::orglist(), false, "Choose organization");
     if (!$url) {
         Terminus::error("Please enter a url.");
     }
     Terminus::launch_self('sites', array('create'), array('label' => $label, 'name' => $name, 'org' => $organization));
     Terminus::launch_self('site', array('import'), array('url' => $url, 'site' => $name, 'nocache' => True));
 }
開發者ID:mikevanwinkle,項目名稱:cli,代碼行數:34,代碼來源:sites.php

示例4: _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->log()->error("Expired Session, please re-authenticate.");
         $this->cache->remove('session');
         Terminus::launch_self("auth", array("login"));
         $this->whoami();
         return true;
     } else {
         return $results['info']['http_code'] <= 199 || $results['info']['http_code'] >= 300 ? false : true;
     }
 }
開發者ID:jalama,項目名稱:cli,代碼行數:16,代碼來源:auth.php

示例5: import

 /**
  * Import a new site
  * @package 2.0
  *
  * ## OPTIONS
  *
  * [--url=<url>]
  * : URL of archive to import
  *
  * [--name=<name>]
  * : (deprecated) use --site instead
  *
  * [--site=<site>]
  * : Name of the site to create (machine-readable)
  *
  * [--label=<label>]
  * : Label for the site
  *
  * [--org=<id>]
  * : UUID of organization into which to add this site
  *
  * @subcommand import
  */
 public function import($args, $assoc_args)
 {
     $options = Sites_Command::getSiteCreateOptions($assoc_args);
     $url = Input::string($assoc_args, 'url', "URL of archive to import");
     if (!$url) {
         throw new TerminusException("Please enter a URL.");
     }
     $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);
     sleep(10);
     //To stop erroneous site-DNE errors
     Terminus::launch_self('site', array('import'), array('url' => $assoc_args['url'], 'site' => $options['name'], 'element' => 'all'));
 }
開發者ID:nataliejeremy,項目名稱:cli,代碼行數:40,代碼來源:sites.php


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