本文整理汇总了PHP中main::start方法的典型用法代码示例。如果您正苦于以下问题:PHP main::start方法的具体用法?PHP main::start怎么用?PHP main::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类main
的用法示例。
在下文中一共展示了main::start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: primaryemail
$this->username = $this->client->currentUser()->show()["login"];
}
private function primaryemail()
{
$emails = $this->client->currentUser()->Emails()->all();
$primaryemail = null;
for ($i = 0; $i < count($emails); $i++) {
if ($emails[$i]["primary"] == 1) {
$primaryemail = $emails[$i]["email"];
}
}
$this->email = $primaryemail;
}
public function start()
{
$this->client = new \Github\Client();
$this->client->authenticate($_GET["access_token"], null, \Github\Client::AUTH_HTTP_TOKEN);
$this->ghusername();
$this->githubinvite();
$this->primaryemail();
$this->slackinvite();
return array();
}
}
if (!isset($_GET["access_token"])) {
die("Access token error");
}
$main = new main($_GET["access_token"]);
$main->start();
header("Location: https://teenscode.github.io/signup?gh=success&sl=success");
echo "Redirecting to https://teenscode.github.io/signup?gh=success&sl=success";
示例2: Telegram
//e non si imposta il primo paramentro da shell si assume di avere impostato il webhook e di utilizzare quello
include 'settings_t.php';
include 'getUpdates.php';
//istanzia oggetto Telegram
$bot_id = TELEGRAM_BOT;
$bot = new Telegram($bot_id);
//valuta se l'interfaccia è di tipo CLI per vedere il parametro e settare o rimuovere il webhook e poi esce (se lanciato da riga di comando)
if (php_sapi_name() == 'cli') {
if ($argv[1] == 'sethook') {
//setta il webhook
$bot->setWebhook(BOT_WEBHOOK);
} else {
if ($argv[1] == 'removehook') {
//rimuove il webhook
$bot->removeWebhook();
echo "webhook removed";
} else {
if ($argv[1] == 'getupdates') {
//esegue il getupdates manuale
getUpdates($bot);
}
}
}
exit;
}
//legge
$bot->init();
$update = $bot->getData();
$update_manager = new main();
$update_manager->start($bot, $update);