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


PHP wpl_global::init_tmp_folder方法代码示例

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


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

?>
</span>
            <span class="wpl-requirement-current"><?php 
echo $wpl_writable ? __('Yes', WPL_TEXTDOMAIN) : __('No', WPL_TEXTDOMAIN);
?>
</span>
            <span class="wpl-requirement-status p-action-btn">
            	<i class="icon-<?php 
echo $wpl_writable ? 'confirm' : 'danger';
?>
"></i>
            </span>
		</li>
        <!-- WPL temporary directory permission -->
        <?php 
$wpl_tmp_writable = wpl_folder::exists(wpl_global::init_tmp_folder()) ? true : false;
?>
        <li>
        	<span class="wpl-requirement-name"><?php 
echo __('tmp directory', WPL_TEXTDOMAIN);
?>
</span>
            <span class="wpl-requirement-require"><?php 
echo __('Writable', WPL_TEXTDOMAIN);
?>
</span>
            <span class="wpl-requirement-current"><?php 
echo $wpl_tmp_writable ? __('Yes', WPL_TEXTDOMAIN) : __('No', WPL_TEXTDOMAIN);
?>
</span>
            <span class="wpl-requirement-status p-action-btn">
开发者ID:amankatoch,项目名称:wp-plugin,代码行数:31,代码来源:internal_requirements.php

示例3: import_settings

 private function import_settings()
 {
     $file = wpl_request::getVar('wpl_import_file', '', 'FILES');
     $tmp_directory = wpl_global::init_tmp_folder();
     $ext = strtolower(wpl_file::getExt($file['name']));
     $settings_file = $tmp_directory . 'settings.' . $ext;
     $response = wpl_global::upload($file, $settings_file, array('json', 'xml'), 20971520);
     #20MB
     if (trim($response['error']) != '') {
         echo json_encode($response);
         exit;
     }
     if (wpl_settings::import_settings($settings_file)) {
         $error = '';
         $message = __('Settings have been imported successfuly!', WPL_TEXTDOMAIN);
     } else {
         $error = '1';
         $message = __('Cannot import settings!', WPL_TEXTDOMAIN);
     }
     echo json_encode(array('error' => $error, 'message' => $message));
     exit;
 }
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:22,代码来源:wpl_ajax.php


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