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


PHP MainWP_Utility::tryVisit方法代码示例

本文整理汇总了PHP中MainWP_Utility::tryVisit方法的典型用法代码示例。如果您正苦于以下问题:PHP MainWP_Utility::tryVisit方法的具体用法?PHP MainWP_Utility::tryVisit怎么用?PHP MainWP_Utility::tryVisit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MainWP_Utility的用法示例。


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

示例1: isWebsiteAvailable

 public static function isWebsiteAvailable($website)
 {
     $http_user = null;
     $http_pass = null;
     $sslVersion = null;
     $verifyCertificate = null;
     if (is_object($website) && isset($website->url)) {
         $url = $website->url;
         $verifyCertificate = isset($website->verify_certificate) ? $website->verify_certificate : null;
         $http_user = $website->http_user;
         $http_pass = $website->http_pass;
         $sslVersion = $website->ssl_version;
     } else {
         $url = $website;
     }
     if (!self::isDomainValid($url)) {
         return false;
     }
     return MainWP_Utility::tryVisit($url, $verifyCertificate, $http_user, $http_pass, $sslVersion);
 }
开发者ID:reeslo,项目名称:mainwp,代码行数:20,代码来源:class-mainwp-utility.php

示例2: mainwp_testwp

 function mainwp_testwp()
 {
     $this->secure_request('mainwp_testwp');
     $url = null;
     $name = null;
     $http_user = null;
     $http_pass = null;
     $verifyCertificate = 1;
     $sslVersion = 0;
     if (isset($_POST['url'])) {
         $url = $_POST['url'];
         $verifyCertificate = $_POST['test_verify_cert'];
         $sslVersion = MainWP_Utility::getCURLSSLVersion($_POST['test_ssl_version']);
         $http_user = $_POST['http_user'];
         $http_pass = $_POST['http_pass'];
     } else {
         if (isset($_POST['siteid'])) {
             $website = MainWP_DB::Instance()->getWebsiteById($_POST['siteid']);
             if ($website) {
                 $url = $website->url;
                 $name = $website->name;
                 $verifyCertificate = $website->verify_certificate;
                 $sslVersion = $website->ssl_version;
                 $http_user = $website->http_user;
                 $http_pass = $website->http_pass;
             }
         }
     }
     $rslt = MainWP_Utility::tryVisit($url, $verifyCertificate, $http_user, $http_pass, $sslVersion);
     if (isset($rslt['error']) && $rslt['error'] != '' && substr($url, -9) != 'wp-admin/') {
         if (substr($url, -1) != '/') {
             $url .= '/';
         }
         $url .= 'wp-admin/';
         $newrslt = MainWP_Utility::tryVisit($url, $verifyCertificate, $http_user, $http_pass, $sslVersion);
         if (isset($newrslt['error']) && $rslt['error'] != '') {
             $rslt = $newrslt;
         }
     }
     if ($name != null) {
         $rslt['sitename'] = $name;
     }
     die(json_encode($rslt));
 }
开发者ID:jexmex,项目名称:mainwp,代码行数:44,代码来源:class-mainwp-post-handler.php


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