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


PHP main::start方法代码示例

本文整理汇总了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";
开发者ID:teenscode,项目名称:invite,代码行数:31,代码来源:index.php

示例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);
开发者ID:idlweb,项目名称:opendataleccebot,代码行数:30,代码来源:start.php


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