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


PHP getHost函数代码示例

本文整理汇总了PHP中getHost函数的典型用法代码示例。如果您正苦于以下问题:PHP getHost函数的具体用法?PHP getHost怎么用?PHP getHost使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getHost函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getHtmlContext

function getHtmlContext($url)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, TRUE);
    //表示需要response header
    curl_setopt($ch, CURLOPT_NOBODY, FALSE);
    //表示需要response body
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_TIMEOUT, 120);
    $result = curl_exec($ch);
    global $header;
    if ($result) {
        $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
        $header = explode("\r\n", substr($result, 0, $headerSize));
        $body = substr($result, $headerSize);
    }
    if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == '200') {
        return $body;
    }
    if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == '302') {
        $location = getHeader("Location");
        if (strpos(getHeader("Location"), 'http://') == false) {
            $location = getHost($url) . $location;
        }
        return getHtmlContext($location);
    }
    return NULL;
}
开发者ID:t0n9,项目名称:PHPscan,代码行数:29,代码来源:s.php

示例2: getOpenID

 /**
  * 授权
  */
 public function getOpenID()
 {
     $weObj = new \System\lib\Wechat\Wechat($this->config("WEIXIN_CONFIG"));
     $this->weObj = $weObj;
     if (empty($_GET['code']) && empty($_GET['state'])) {
         $callback = getHostUrl();
         $reurl = $weObj->getOauthRedirect($callback, "1");
         redirect($reurl, 0, '正在发送验证中...');
         exit;
     } elseif (intval($_GET['state']) == 1) {
         $accessToken = $weObj->getOauthAccessToken();
         // 是否有用户记录
         $isUser = $this->table('user')->where(["openid" => $accessToken['openid'], 'is_on' => 1])->get(null, true);
         /*var_dump($isUser);exit();*/
         if ($isUser == null) {
             //没有此用户跳转至输入注册的页面
             header("LOCATION:" . getHost() . "/register.html");
         } else {
             $userID = $isUser['id'];
             $updateUser = $this->table('user')->where(['id' => $userID])->update(['last_login' => time(), 'last_ip' => ip2long(getClientIp())]);
             $_SESSION['userInfo'] = ['openid' => $isUser['openid'], 'userid' => $isUser['id'], 'nickname' => $isUser['nickname'], 'user_img' => $isUser['user_img']];
             //var_dump($_SESSION['userInfo']['openid']);exit();
             header("LOCATION:http://onebuy.ping-qu.com");
             //进入网站成功
             //用户取消授权
             //
             //$this->R('','90006');
         }
     }
 }
开发者ID:phpchen,项目名称:yiyuangou,代码行数:33,代码来源:UserController.class.php

示例3: setUp

 function setUp()
 {
     /*
      * This test requires that the fossology test archive has been
      * loaded under the name fossarchive-T.tar.bz2 For now, the setup
      * will just verify the material is there?
      */
     global $URL;
     global $name;
     global $safeName;
     $name = 'fossI16L518.tar.bz2';
     $safeName = escapeDots($name);
     $this->host = getHost($URL);
     $this->Login();
     /* check for existense of archive */
     $page = $this->mybrowser->get($URL);
     $page = $this->mybrowser->clickLink('Browse');
     $this->assertTrue($this->myassertText($page, '/Browse/'), "verifyFossI16L518 FAILED! Could not find Browse menu\n");
     $page = $this->mybrowser->clickLink('Testing');
     $this->assertTrue($this->myassertText($page, '/Testing/'), "verifyFossI16L518 FAILED! Could not find Testing folder\n");
     $result = $this->myassertText($page, "/{$safeName}/");
     if (!$result) {
         exit(FALSE);
     }
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:25,代码来源:bsam-verifyFossI16L518.php

示例4: getUrlfromDir

 function getUrlfromDir($local_dir)
 {
     //-------------------------------
     $server_dir = getWebDir($local_dir);
     $server_scheme = getScheme();
     $server_host = getHost();
     return "{$server_scheme}://{$server_host}/{$server_dir}";
 }
开发者ID:bryan-615,项目名称:sunwindwater,代码行数:8,代码来源:url.php

示例5: agregateLogs

 public function agregateLogs($error, $data = null)
 {
     App::getServiceLog()->log($error, $data);
     $subject = 'Message subject ąśżźćę';
     $body = App::template('stopsupervisor', array('error' => $error, 'data' => $data, 'host' => getHost()));
     $message = Swift_Message::newInstance()->setSubject('webservice [' . getHost() . '] - error')->setFrom('noreplay@pcube.com', 'webservice')->setTo(App::getConfig('swiftmailer.cron_log_errors'))->setBody($body, 'text/html')->addPart(strip_tags($body), 'text/plain');
     App::getServiceMailer()->send($message);
 }
开发者ID:stopsopa,项目名称:utils,代码行数:8,代码来源:LogService.php

示例6: get_source_domain

function get_source_domain($dname)
{
    $dname = getHost($dname);
    $dsub = substr($dname, 0, 4);
    if (strtolower($dsub) == "www.") {
        $dname = substr($dname, 4);
    }
    return $dname;
}
开发者ID:reDecore,项目名称:redecore.me,代码行数:9,代码来源:main.php

示例7: __construct

 function __construct($page, $url)
 {
     /* to do: check for http?  if not return null...)? */
     if (empty($page)) {
         return;
     }
     $this->page = $page;
     if (empty($url)) {
         return;
     }
     $this->host = getHost($url);
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:12,代码来源:parseFolderPath.php

示例8: raport

 public function raport()
 {
     $key = 'crontime';
     $limit = 8;
     $cache = App::getCache();
     $worker = App::getServiceWorker();
     $ltime = $cache->get($key);
     // poprzednie badanie
     //        niechginie($ltime);
     $ntime = date('Y-m-d H:i:s');
     // teraz
     $ltime or $ltime = $ntime;
     $cache->set($key, $ntime);
     //        nieginie($ltime);
     //        nieginie($worker->countErrorFromSince($ltime));
     //        niechginie($worker->getLastErrors($ltime));
     if ($num = $worker->countErrorFromSince($ltime)) {
         $body = App::template('cronraport', array('list' => $worker->getLastErrors($ltime, $limit), 'limit' => $limit, 'ltime' => $ltime, 'num' => $num, 'host' => getHost(), 'panel' => App::generate('admin', array(), $referenceType = true)));
         $message = Swift_Message::newInstance()->setSubject('webservice [' . getHost() . '] - error')->setFrom('noreplay@pcube.com', 'webservice')->setTo($this->emails)->setBody($body, 'text/html')->addPart(strip_tags($body), 'text/plain');
         App::getServiceMailer()->send($message);
     }
 }
开发者ID:stopsopa,项目名称:utils,代码行数:22,代码来源:RaportService.php

示例9: setUp

 function setUp()
 {
     /*
      * This test requires that the fossology test archive has been
      * loaded under the name 3files.tar.bz2
      */
     global $URL;
     global $name;
     global $safeName;
     $name = 'RedHat.tar.gz';
     $safeName = escapeDots($name);
     $this->host = getHost($URL);
     //print "SetUp: host is:$this->host\n";
     $this->Login();
     /* check for existense of archive */
     $page = $this->mybrowser->get($URL);
     $page = $this->mybrowser->clickLink('Browse');
     $this->assertTrue($this->myassertText($page, '/Browse/'), "verifySimpletest FAILED! Could not find Browse menu\n");
     $page = $this->mybrowser->clickLink('Testing');
     $this->assertTrue($this->myassertText($page, "/{$safeName}/"), "verifySimpleTest FAILED! Could not find RedHat.tar upload\n");
     $result = $this->myassertText($page, "/{$name}/");
     //if(!($result)) { echo "WTF!\n"; exit(FALSE); }
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:23,代码来源:printLicTbl.php

示例10: setUp

 function setUp()
 {
     /*
      * This test requires that the fossology test archive has been
      * loaded under the name 3files.tar.bz2
      */
     global $URL;
     global $name;
     global $safeName;
     $name = '3files.tar.bz2';
     $safeName = escapeDots($name);
     $this->host = getHost($URL);
     $this->Login();
     /* check for existense of archive */
     $page = $this->mybrowser->get($URL);
     $page = $this->mybrowser->clickLink('Browse');
     $this->assertTrue($this->myassertText($page, '/Browse/'), "verify3files FAILED! Could not find Browse menu\n");
     $page = $this->mybrowser->clickLink('Copyright');
     $this->assertTrue($this->myassertText($page, '/Copyright/'), "verify3files FAILED! Could not find copyright folder\n");
     $result = $this->myassertText($page, "/{$name}/");
     if (!$result) {
         exit(FALSE);
     }
 }
开发者ID:pombredanne,项目名称:fossology-test,代码行数:24,代码来源:verify3filesTest.php

示例11: setUp

 function setUp()
 {
     /*
      * This test requires that the fossology test archive has been
      * loaded under the name fossDirsOnly.tar.bz2
      */
     global $URL;
     global $name;
     global $safeName;
     print "starting verifyFossDirsOnly-SetUp\n";
     $name = 'fossDirsOnly.tar.bz2';
     $safeName = escapeDots($name);
     $this->host = getHost($URL);
     $this->Login();
     /* check for existense of archive */
     $page = $this->mybrowser->get($URL);
     $page = $this->mybrowser->clickLink('Browse');
     $this->assertTrue($this->myassertText($page, '/Browse/'), "verifyDirsOnly FAILED! Could not find Browse menu\n");
     $result = $this->myassertText($page, "/{$safeName}/");
     if (!$result) {
         $this->fail("Failure, cannot find archive {$name}, Stopping test\n");
         exit(1);
     }
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:24,代码来源:bsam-verifyFossDirsOnly.php

示例12: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/functions.php';
$queryList = getSQLQuery(getPDO());
$menuList = getMenuListForProcOrder(getPDO(), $queryList["SELECT_MENU_FOR_PROCORDER"]);
$menuData = getProced(getPDO(), $menuList);
$threadList = getThreadListUrl($menuData["menu_url"], getDiFix(getPDO(), "threadListUrlSuffix", $menuData["kind"], $queryList["SELECT_DIFIX"]));
var_dump($menuData);
var_dump(getUa(getPDO(), $queryList["SELECT_UA"]));
var_dump(getHost($menuData["menu_url"]));
$html = threadSteal(getPDO(), "133.130.96.221", "threadSteal", $threadList, $queryList["INSERT_IP_ACCESS"], getUa(getPDO(), $queryList["SELECT_UA"]), getHost($menuData["menu_url"]));
var_dump($html);
开发者ID:pecodrive,项目名称:stealsystem,代码行数:12,代码来源:ddddd.php

示例13: getPageUrl

/**
 * Get the url of corresponding page. for gene network diagram.
 * @param type $pageName
 * @param type $idArr
 * @return string
 */
function getPageUrl($pageName, $idArr = array(1, 2, 3, 4))
{
    $host = getHost();
    $param = idArr2Str($idArr);
    switch ($pageName) {
        case "entirePathway":
            $preUrl = "/mccap-server/app/page/mapEntirePathway.php?id=";
            break;
        case "metaPathway":
            $preUrl = "/mccap-server/app/page/mapMetaPathway.php?id=";
            break;
        case "entireModule":
            $preUrl = "/mccap-server/app/page/mapEntireModule.php?id=";
            break;
        case "metaModule":
            $preUrl = "/mccap-server/app/page/mapMetaModule.php?id=";
            break;
        default:
            $preUrl = "/mccap-server/app/page/error.php";
            $param = "";
            break;
    }
    $url = $host . $preUrl . $param;
    return $url;
}
开发者ID:ycduan,项目名称:UESTC_Software2015,代码行数:31,代码来源:util.php

示例14: _getFollowReply

 /**
  * 获取关注回复
  */
 private function _getFollowReply()
 {
     if (!empty($this->userInfo)) {
         //活动回复
         if (!empty($user['parent'] && !empty($user['parent_share_type']) && !empty($user['activity_id']))) {
             //是否在进行活动
             $isActivity = $this->table('activity_share_' . $user['parent_share_type'])->where(['is_on' => 1, 'is_show' => 1])->get(['id', 'start_time', 'end_time'], true);
             if ($isActivity) {
                 if (time() > $isActivity['start_time'] && time() < $isActivity['end_time']) {
                     switch ($user['parent_share_type']) {
                         case 1:
                             $content = '欢迎关注广融在线!你已获得参与广融活动“邀好友送特权利率”活动的资格。马上<a href="' . getHost() . '/activity/activity_1_1.html?activity_id=' . $user['activity_id'] . '">点击这里</a>进行领取!';
                             break;
                         case 2:
                             //$content='欢迎关注广融在线!你可参加“投资送现金活动”。马上<a href="'.getHost().'/activity/activity_2_1.html?activity_id='.$user['activity_id'].'">点击这里</a>了解活动详情!';
                             $content = '对!骚年你没关注错 !' . "\r\n";
                             $content .= '这是稳拿8%~13%收益的赚钱平台!' . "\r\n";
                             $content .= '投资随投随取,快捷方便!' . "\r\n";
                             $content .= '收益完胜各大银行和各类宝宝!' . "\r\n";
                             $content .= '快来参与日赚百元计划“领100元红包”吧!' . "\r\n";
                             $content .= '红包有限!先到先得哦~' . "\r\n";
                             $content .= '<a href="' . getHost() . '/activity/activity_2_1.html?activity_id=' . $user['activity_id'] . '">点击领100元红包</a>';
                             break;
                     }
                 }
             }
         }
     }
     $followReply = $this->table("wechat_response")->where(array("type" => 2, 'is_on' => 1))->get(null, true);
     if (!$followReply) {
         return false;
     }
     if ($followReply['rsp_type'] == 0) {
         //文本回复
         $this->weObj->text($followReply['text'])->reply();
         exit;
     }
     if ($followReply['rsp_type'] == 1) {
         //图文回复(未实现)
         // $news_temp = $this->table("wechat_news")->where(array("id" => $followReply['news'], 'is_on' => 1))->order('sort_order asc')->get(null, true);
         $news_temp = $this->table("wechat_news")->where(array("id" => $followReply['news'], 'is_on' => 1))->get();
         //get()内不能
         // $this->weObj->text("text")->reply();exit;
         foreach ($news_temp as $a) {
             $news[] = array('Title' => $a['title'], 'Description' => $a['desc'], 'PicUrl' => $a['img_thumb_360'], 'Url' => empty($a['url']) ? empty($a['url']) ? $this->config('WEIXIN_ARTICLE_PATH') . $a['id'] : $a['url'] : $a['url']);
         }
         $this->weObj->news($news)->reply();
         exit;
     }
 }
开发者ID:xiaoz,项目名称:yiyuangou,代码行数:53,代码来源:WechatController.class.php

示例15: getHostname

 public function getHostname()
 {
     return getHost();
 }
开发者ID:stopsopa,项目名称:utils,代码行数:4,代码来源:Request.php


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