本文整理汇总了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);
}
示例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);
}
示例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));
}
示例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;
}
}
示例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'));
}