當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wpl_global::get_web_page方法代碼示例

本文整理匯總了PHP中wpl_global::get_web_page方法的典型用法代碼示例。如果您正苦於以下問題:PHP wpl_global::get_web_page方法的具體用法?PHP wpl_global::get_web_page怎麽用?PHP wpl_global::get_web_page使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wpl_global的用法示例。


在下文中一共展示了wpl_global::get_web_page方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: update_package

 private function update_package()
 {
     $sid = wpl_request::getVar('sid');
     $tmp_directory = wpl_global::init_tmp_folder();
     $dest = $tmp_directory . 'package.zip';
     $zip_file = wpl_global::get_web_page('http://billing.realtyna.com/index.php?option=com_rls&view=downloadables&task=download&sid=' . $sid . '&randomkey=' . rand(1, 100));
     if (!$zip_file) {
         $this->response(array('success' => '0', 'error' => __('Error: #U202, Could not download the update package!', WPL_TEXTDOMAIN), 'message' => ''));
     }
     if (!class_exists('ZipArchive')) {
         $this->response(array('success' => '0', 'error' => __('Error: #U205, Your PHP has no ZipArchive support enabled!', WPL_TEXTDOMAIN), 'message' => ''));
     }
     if (!wpl_file::write($dest, $zip_file)) {
         $this->response(array('success' => '0', 'error' => __('Error: #U203, Could not create the update file!', WPL_TEXTDOMAIN), 'message' => ''));
     }
     if (!wpl_global::zip_extract($dest, $tmp_directory)) {
         $this->response(array('success' => '0', 'error' => __('Error: #U204, Could not extract the update file!', WPL_TEXTDOMAIN), 'message' => ''));
     }
     $script_file = $tmp_directory . 'installer.php';
     if (!wpl_file::exists($script_file)) {
         $this->response(array('error' => __("Installer file doesn't exist!", WPL_TEXTDOMAIN), 'message' => ''));
     }
     if (!is_writable(WPL_ABSPATH . 'WPL.php')) {
         $this->response(array('error' => __("PHP doesn't have write access to the files and directories!", WPL_TEXTDOMAIN), 'message' => ''));
     }
     /** including installer and run the install method **/
     include $script_file;
     if (!class_exists('wpl_installer')) {
         $this->response(array('error' => __("Installer class doesn't exist!", WPL_TEXTDOMAIN), 'message' => ''));
     }
     /** run install script **/
     $wpl_installer = new wpl_installer();
     $wpl_installer->path = $tmp_directory;
     if (!$wpl_installer->run()) {
         $this->response(array('error' => $wpl_installer->error, 'message' => ''));
     }
     /** Trigger Event **/
     wpl_global::event_handler('package_updated', array('package_id' => isset($wpl_installer->addon_id) ? $wpl_installer->addon_id : 0));
     $message = $wpl_installer->message ? $wpl_installer->message : __('Addon Updated.', WPL_TEXTDOMAIN);
     $this->response(array('error' => '', 'message' => $message));
 }
開發者ID:gvh1993,項目名稱:project-vvvh,代碼行數:41,代碼來源:wpl_ajax.php

示例2: check_realtyna_credentials

 /**
  * Checks Realtyna billing credentials
  * @author Howard <howard@realtyna.com>
  * @static
  * @return array
  */
 public static function check_realtyna_credentials()
 {
     /** import settings library **/
     _wpl_import('libraries.settings');
     $current_url = wpl_global::get_full_url();
     $domain = wpl_global::domain($current_url);
     $settings = wpl_global::get_settings();
     $phpver = phpversion();
     $wplversion = wpl_global::wpl_version();
     $wpversion = wpl_global::wp_version();
     $username = $settings['realtyna_username'];
     $password = $settings['realtyna_password'];
     $POST = array('domain' => $domain, 'wpversion' => $wpversion, 'wplversion' => $wplversion, 'phpver' => $phpver, 'username' => urlencode($username), 'password' => urlencode($password), 'command' => 'check_credentials', 'format' => 'json');
     $io_handler = 'http://billing.realtyna.com/io/io.php';
     $result = wpl_global::get_web_page($io_handler, $POST);
     $answer = json_decode($result, true);
     /** saving status **/
     $status = isset($answer['status']) ? $answer['status'] : 0;
     wpl_settings::save_setting('realtyna_verified', $status, 1);
     $message = $status ? __('Credentials verified.', WPL_TEXTDOMAIN) : __('Invalid credentials!', WPL_TEXTDOMAIN);
     $success = 1;
     return array('success' => $success, 'message' => $message, 'status' => $status);
 }
開發者ID:gvh1993,項目名稱:project-vvvh,代碼行數:29,代碼來源:global.php


注:本文中的wpl_global::get_web_page方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。