• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getHost函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了getHost函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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('[email protected]', '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('[email protected]', '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


示例16: threadSteal

     $encodiedThreadBaseHtml = threadSteal(getPDO(), $ip, "threadSteal", $threadList, $queryList["INSERT_IP_ACCESS"], getUa(getPDO(), $queryList["SELECT_UA"]), getHost($menuData["menu_url"]));
     $threadData = threadReArray(threadDataPregMatch($encodiedThreadBaseHtml, getDiRegex(getPDO(), "threadStealRegex", $menuData["kind"], $queryList["SELECT_DIREGEX"])), $threadUrl, $censorList);
     threadInsert(getPDO(), $threadData, $menuData["id"], $menuData["kind"], $queryList["INSERT_THREAD"]);
     unset($threadData);
 }
 if ($isResSteal) {
     $threadData = getThreadData(getPDO(), $menuData["id"], $queryList["SELECT_THREAD"]);
     $i = 0;
     foreach ($threadData as $value) {
         if ($value["thread_now_res_no"] - $value["res_end"] < (int) $fixedList["updateWaiting"]) {
             continue;
         } else {
             timeWeit((int) $fixedList["weitTimeMin"], (int) $fixedList["weitTimeMax"]);
         }
         $ip = useIp(getPDO(), getUseIpMod(getPDO()));
         $encodiedResBaseHtml = resSteal(getPDO(), $ip, "resSteal", $value["thread_url"], $queryList["INSERT_IP_ACCESS"], getUa(getPDO(), $queryList["SELECT_UA"]), getHost($menuData["menu_url"]));
         if (!$encodiedResBaseHtml) {
             continue;
         }
         $isoldLog = threadIsOldLog($encodiedResBaseHtml, getDiRegex(getPDO(), "threadOldlogedRegex", $menuData["kind"], $queryList["SELECT_DIREGEX"]));
         if ($isoldLog) {
             threadUpdateTois_oldlog($value["thread_sha"], $prepareStForTUIO, $dbHandle);
         }
         $resData = getResArray(getDiRegex(getPDO(), "resStealRegex", $menuData["kind"], $queryList["SELECT_DIREGEX"]), $encodiedResBaseHtml, $value["thread_sha"]);
         if (!$resData) {
             continue;
         }
         $ankaerLinkProced = resBodyAnkaerLinkProc($resData, getDiRegex(getPDO(), "resBodyAnkaerLinkStealRegex", $menuData["kind"], $queryList["SELECT_DIREGEX"]));
         if ($menuData["kind"] === "open2ch.net") {
             $imgLinkProced = resBodyImgLinkProcO(getPDO(), $ankaerLinkProced, $value["thread_sha"], getDiRegex(getPDO(), "resBodyImgLinkStealRegex", $menuData["kind"], $queryList["SELECT_DIREGEX"]), $queryList["UPDATE_THREAD_IS_IMG"], $fixedList["imgDirUrl"], $menuData["kind"]);
         } else {
开发者ID:pecodrive,项目名称:stealsystem,代码行数:31,代码来源:thread.php


示例17: logout

 /**
  * 注销
  */
 public function logout()
 {
     session_destroy();
     header("LOCATION:" . getHost() . "/admin/login.html");
     //跳转到login登录
 }
开发者ID:xiaoz,项目名称:yiyuangou,代码行数:9,代码来源:LoginController.class.php


示例18: session_start

<?php

session_start();
/**
 *	Class for authenticating the site
 *	
 *	by Petri Laihonen 26.01.2014
 *	
 */
$provideResponse = false;
$respArry = array();
$salt = "æøæ|asdrSDRAG12556AWQ899REG1WqerG#¤%#%&¤#YWRGHåäG?Rq+oew£#»qwer";
$server = getHost();
debugLog("Server: " . $server);
// sanitize some
$_POST = sanitize($_POST);
// Database credentials
require_once "dbCredentials.php";
debugLog("Required includes are now with us");
if (!($dbConn = mysqli_connect($conn, $dbUser, $dbPass, $database))) {
    $response = array('status' => 'fail', 'message' => 'database connect error.');
    debugLog('Database Connection Failed. Error:' . mysqli_error());
    echo json_encode($response);
    exit;
}
if (!$_SESSION['userId']) {
    if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) {
        header('HTTP/1.0 401 Unauthorized');
        header('WWW-Authenticate: Basic realm="Management Access"');
        $displayLogin = 1;
        // header("Location: ".$server."/login.php");
开发者ID:plaihonen,项目名称:tasker,代码行数:31,代码来源:auth.http.php


示例19: header

<?php

header("Location: " . getHost());
function getHost()
{
    $proto = empty($_SERVER['HTTPS']) ? "http://" : "https://";
    return $proto . $_SERVER['SERVER_NAME'];
}
开发者ID:plaihonen,项目名称:tasker,代码行数:8,代码来源:r.php


示例20: getModule

    if (isset($userInputNeeded['module'])) {
        $module = getModule();
    }
    if (isset($userInputNeeded['basePath'])) {
        $basePath = getBasePath($basePath);
    }
    if (isset($userInputNeeded['multisiteMode'])) {
        $multisiteMode = getMultisiteMode();
    }
    // Load supplemental multisite parameters:
    if ($multisiteMode == MULTISITE_HOST_BASED) {
        if ($opts->getOption('hostname')) {
            $host = $opts->getOption('hostname');
        } else {
            if ($interactive) {
                $host = getHost();
            }
        }
    }
}
// Make sure the override directory is initialized (using defaults or CLI
// parameters will not have initialized it yet; attempt to reinitialize it
// here is harmless if it was already initialized in interactive mode):
initializeOverrideDir($overrideDir, true);
// Normalize the module setting to remove whitespace:
$module = preg_replace('/\\s/', '', $module);
// Build the Windows start file in case we need it:
buildWindowsConfig($baseDir, $overrideDir, $module);
// Build the import configuration:
buildImportConfig($baseDir, $overrideDir, 'import.properties');
buildImportConfig($baseDir, $overrideDir, 'import_auth.properties');
开发者ID:tillk,项目名称:vufind,代码行数:31,代码来源:install.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getHostByAddr函数代码示例发布时间:2022-05-15
下一篇:
PHP getHolidays函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap