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


PHP MainWP_Utility::getGetDataAuthed方法代码示例

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


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

示例1: fetchUrlAuthed

 static function fetchUrlAuthed(&$website, $what, $params = null, $checkConstraints = false, $pForceFetch = false, $pRetryFailed = true)
 {
     if ($params == null) {
         $params = array();
     }
     if ($what == 'stats' || $what == 'upgradeplugintheme' && isset($params['type']) && 'plugin' == $params['type']) {
         // to fix bug
         $try_tounch_plugins_page = get_option('mainwp_request_plugins_page_site_' . $website->id);
         if ('yes' == $try_tounch_plugins_page) {
             $page_plugins_url = MainWP_Utility::getGetDataAuthed($website, 'plugins.php');
             wp_remote_get($page_plugins_url, array('timeout' => 25, 'httpversion' => '1.1'));
         }
     }
     $params['optimize'] = get_option('mainwp_optimize') == 1 ? 1 : 0;
     $postdata = MainWP_Utility::getPostDataAuthed($website, $what, $params);
     $information = MainWP_Utility::fetchUrl($website, $website->url, $postdata, $checkConstraints, $pForceFetch, $website->verify_certificate, $pRetryFailed, $website->http_user, $website->http_pass, $website->ssl_version);
     if (is_array($information) && isset($information['sync']) && !empty($information['sync'])) {
         MainWP_Sync::syncInformationArray($website, $information['sync']);
         unset($information['sync']);
     }
     return $information;
 }
开发者ID:reeslo,项目名称:mainwp,代码行数:22,代码来源:class-mainwp-utility.php

示例2: openSiteRestore

    public static function openSiteRestore($website, $file, $size)
    {
        ?>
		<div class="wrap">
			<a href="https://mainwp.com" id="mainwplogo" title="MainWP" target="_blank"><img src="<?php 
        echo plugins_url('images/logo.png', dirname(__FILE__));
        ?>
" height="50" alt="MainWP"/></a>

			<h2><i class="fa fa-globe"></i> <?php 
        echo stripslashes($website->name);
        ?>
</h2>

			<div style="clear: both;"></div>
			<br/>

			<div id="mainwp_background-box">
				<?php 
        _e('Will redirect to your website immediately.', 'mainwp');
        $url = isset($website->siteurl) && $website->siteurl != '' ? $website->siteurl : $website->url;
        $url .= substr($url, -1) != '/' ? '/' : '';
        $postdata = MainWP_Utility::getGetDataAuthed($website, $file, MainWP_Utility::getFileParameter($website), true);
        $postdata['size'] = $size;
        ?>
				<form method="POST" action="<?php 
        echo $url;
        ?>
" id="redirectForm">
					<?php 
        foreach ($postdata as $name => $value) {
            echo '<input type="hidden" name="' . $name . '" value="' . $value . '" />';
        }
        ?>
				</form>
			</div>
		</div>
		<?php 
    }
开发者ID:jexmex,项目名称:mainwp,代码行数:39,代码来源:page-mainwp-site-open.php

示例3: backupDownloadFile

 public static function backupDownloadFile($pSiteId, $pType, $pUrl, $pFile)
 {
     $dir = dirname($pFile) . '/';
     @mkdir($dir, 0777, true);
     if (!file_exists($dir . 'index.php')) {
         @touch($dir . 'index.php');
     }
     //Clean old backups from our system
     $maxBackups = get_option('mainwp_backupsOnServer');
     if ($maxBackups === false) {
         $maxBackups = 1;
     }
     $dbBackups = array();
     $fullBackups = array();
     if (file_exists($dir) && ($dh = opendir($dir))) {
         while (($file = readdir($dh)) !== false) {
             if ($file != '.' && $file != '..') {
                 $theFile = $dir . $file;
                 if ($pType == 'db' && MainWP_Utility::isSQLFile($file)) {
                     $dbBackups[filemtime($theFile) . $file] = $theFile;
                 }
                 if ($pType == 'full' && MainWP_Utility::isArchive($file) && !MainWP_Utility::isSQLArchive($file)) {
                     $fullBackups[filemtime($theFile) . $file] = $theFile;
                 }
             }
         }
         closedir($dh);
     }
     krsort($dbBackups);
     krsort($fullBackups);
     $cnt = 0;
     foreach ($dbBackups as $key => $dbBackup) {
         $cnt++;
         if ($cnt >= $maxBackups) {
             @unlink($dbBackup);
         }
     }
     $cnt = 0;
     foreach ($fullBackups as $key => $fullBackup) {
         $cnt++;
         if ($cnt >= $maxBackups) {
             @unlink($fullBackup);
         }
     }
     $website = MainWP_DB::Instance()->getWebsiteById($pSiteId);
     MainWP_Utility::endSession();
     $what = null;
     if ($pType == 'db') {
         MainWP_Utility::downloadToFile(MainWP_Utility::getGetDataAuthed($website, $pUrl, 'fdl'), $pFile, false, $website->http_user, $website->http_pass);
     }
     if ($pType == 'full') {
         MainWP_Utility::downloadToFile(MainWP_Utility::getGetDataAuthed($website, $pUrl, 'fdl'), $pFile, false, $website->http_user, $website->http_pass);
     }
     return true;
 }
开发者ID:reeslo,项目名称:mainwp,代码行数:55,代码来源:page-mainwp-manage-sites.php


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