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

PHP DUP_Util类代码示例

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

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



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

示例1: createFromTemplate

 /**
  *  createFromTemplate
  *  Generates the final installer file from the template file
  */
 private function createFromTemplate($template)
 {
     global $wpdb;
     DUP_Log::Info("INSTALLER FILE: Preping for use");
     $installer = DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH_TMP) . "/{$this->Package->NameHash}_installer.php";
     //$tablePrefix = (is_multisite()) ? $wpdb->get_blog_prefix() : $wpdb->prefix;
     //Option values to delete at install time
     $deleteOpts = $GLOBALS['DUPLICATOR_OPTS_DELETE'];
     $replace_items = array("fwrite_url_old" => get_option('siteurl'), "fwrite_package_name" => "{$this->Package->NameHash}_archive.zip", "fwrite_package_notes" => $this->Package->Notes, "fwrite_secure_name" => $this->Package->NameHash, "fwrite_url_new" => $this->Package->Installer->OptsURLNew, "fwrite_dbhost" => $this->Package->Installer->OptsDBHost, "fwrite_dbname" => $this->Package->Installer->OptsDBName, "fwrite_dbuser" => $this->Package->Installer->OptsDBUser, "fwrite_dbpass" => '', "fwrite_ssl_admin" => $this->Package->Installer->OptsSSLAdmin, "fwrite_ssl_login" => $this->Package->Installer->OptsSSLLogin, "fwrite_cache_wp" => $this->Package->Installer->OptsCacheWP, "fwrite_cache_path" => $this->Package->Installer->OptsCachePath, "fwrite_wp_tableprefix" => $wpdb->prefix, "fwrite_opts_delete" => json_encode($deleteOpts), "fwrite_blogname" => esc_html(get_option('blogname')), "fwrite_wproot" => DUPLICATOR_WPROOTPATH, "fwrite_duplicator_version" => DUPLICATOR_VERSION);
     if (file_exists($template) && is_readable($template)) {
         $err_msg = "ERROR: Unable to read/write installer. \nERROR INFO: Check permission/owner on file and parent folder.\nInstaller File = <{$installer}>";
         $install_str = $this->parseTemplate($template, $replace_items);
         empty($install_str) ? DUP_Log::Error("{$err_msg}", "DUP_Installer::createFromTemplate => file-empty-read") : DUP_Log::Info("INSTALLER FILE: Template parsed with new data");
         //INSTALLER FILE
         $fp = !file_exists($installer) ? fopen($installer, 'x+') : fopen($installer, 'w');
         if (!$fp || !fwrite($fp, $install_str, strlen($install_str))) {
             DUP_Log::Error("{$err_msg}", "DUP_Installer::createFromTemplate => file-write-error");
         }
         @fclose($fp);
     } else {
         DUP_Log::Error("Installer Template missing or unreadable.", "Template [{$template}]");
     }
     @unlink($template);
     DUP_Log::Info("INSTALLER FILE: Complete [{$installer}]");
 }
开发者ID:tlandn,项目名称:akvo-web,代码行数:29,代码来源:package.installer.php


示例2: duplicator_activate

 function duplicator_activate()
 {
     global $wpdb;
     $table_name = $wpdb->prefix . "duplicator_packages";
     //PRIMARY KEY must have 2 spaces before for dbDelta to work
     $sql = "CREATE TABLE `{$table_name}` (\r\n\t\t\t`id`\t\tBIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT  PRIMARY KEY,\r\n\t\t\t`name`\t\tVARCHAR(250)\tNOT NULL,\r\n\t\t\t`hash`\t\tVARCHAR(50)\t\tNOT NULL,\r\n\t\t\t`status`\tINT(11)\t\t\tNOT NULL,\r\n\t\t\t`created`\tDATETIME\t\tNOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t`owner`\t\tVARCHAR(60)\t\tNOT NULL,\r\n\t\t\t`package`\tMEDIUMBLOB\t\tNOT NULL )";
     require_once DUPLICATOR_WPROOTPATH . 'wp-admin/includes/upgrade.php';
     @dbDelta($sql);
     //WordPress Options Hooks
     update_option('duplicator_version_plugin', DUPLICATOR_VERSION);
     //Setup All Directories
     DUP_Util::InitSnapshotDirectory();
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:13,代码来源:duplicator.php


示例3: SaveViewStateByPost

 /** 
  * Saves the state of a UI element via post params
  * @return json result string
  * <code>
  * //JavaScript Ajax Request
  * Duplicator.UI.SaveViewStateByPost('dup-pack-archive-panel', 1);
  * 
  * //Call PHP Code
  * $view_state       = DUP_UI::GetViewStateValue('dup-pack-archive-panel');
  * $ui_css_archive   = ($view_state == 1)   ? 'display:block' : 'display:none';
  * </code>
  */
 public static function SaveViewStateByPost()
 {
     DUP_Util::CheckPermissions('read');
     $post = stripslashes_deep($_POST);
     $key = esc_html($post['key']);
     $value = esc_html($post['value']);
     $success = self::SaveViewState($key, $value);
     //Show Results as JSON
     $json = array();
     $json['key'] = $key;
     $json['value'] = $value;
     $json['update-success'] = $success;
     die(json_encode($json));
 }
开发者ID:tofubuddha,项目名称:example,代码行数:26,代码来源:ui.php


示例4: duplicator_activate

 function duplicator_activate()
 {
     global $wpdb;
     //Only update database on version update
     if (DUPLICATOR_VERSION != get_option("duplicator_version_plugin")) {
         $table_name = $wpdb->prefix . "duplicator_packages";
         //PRIMARY KEY must have 2 spaces before for dbDelta to work
         //see: https://codex.wordpress.org/Creating_Tables_with_Plugins
         $sql = "CREATE TABLE `{$table_name}` (\n\t\t\t   id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t   name VARCHAR(250) NOT NULL,\n\t\t\t   hash VARCHAR(50) NOT NULL,\n\t\t\t   status INT(11) NOT NULL,\n\t\t\t   created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t   owner VARCHAR(60) NOT NULL,\n\t\t\t   package MEDIUMBLOB NOT NULL,\n\t\t\t   PRIMARY KEY  (id),\n\t\t\t   KEY hash (hash))";
         require_once DUPLICATOR_WPROOTPATH . 'wp-admin/includes/upgrade.php';
         @dbDelta($sql);
     }
     //WordPress Options Hooks
     update_option('duplicator_version_plugin', DUPLICATOR_VERSION);
     //Setup All Directories
     DUP_Util::InitSnapshotDirectory();
 }
开发者ID:netmagik,项目名称:netmagik,代码行数:17,代码来源:duplicator.php


示例5: GetChecks

 /** 
  * Gets the system checks which are not required
  * @return array   An array of system checks
  */
 public static function GetChecks()
 {
     $checks = array();
     //CHK-SRV-100: PHP SETTINGS
     $php_test1 = ini_get("open_basedir");
     $php_test1 = empty($php_test1) ? true : false;
     $php_test2 = ini_get("max_execution_time");
     $php_test2 = $php_test2 > DUPLICATOR_SCAN_TIMEOUT || strcmp($php_test2, 'Off') == 0 || $php_test2 == 0 ? 'Good' : 'Warn';
     $checks['CHK-SRV-100'] = $php_test1 && $php_test2 ? 'Good' : 'Warn';
     //CHK-SRV-101: WORDPRESS SETTINGS
     //Version
     global $wp_version;
     $version_test = version_compare($wp_version, DUPLICATOR_SCAN_MIN_WP) >= 0 ? true : false;
     //Cache
     $Package = DUP_Package::GetActive();
     $cache_path = DUP_Util::SafePath(WP_CONTENT_DIR) . '/cache';
     $dirEmpty = DUP_Util::IsDirectoryEmpty($cache_path);
     $dirSize = DUP_Util::GetDirectorySize($cache_path);
     $cach_filtered = in_array($cache_path, explode(';', $Package->Archive->FilterDirs));
     $cache_test = $cach_filtered || $dirEmpty || $dirSize < DUPLICATOR_SCAN_CACHESIZE ? true : false;
     //Core Files
     $files = array();
     $files['wp-config.php'] = file_exists(DUP_Util::SafePath(DUPLICATOR_WPROOTPATH . '/wp-config.php'));
     $files_test = $files['wp-config.php'];
     $checks['CHK-SRV-101'] = $files_test && $cache_test && $version_test ? 'Good' : 'Warn';
     //CHK-SRV-102: WEB SERVER
     $servers = $GLOBALS['DUPLICATOR_SERVER_LIST'];
     $test = false;
     foreach ($servers as $value) {
         if (stristr($_SERVER['SERVER_SOFTWARE'], $value)) {
             $test = true;
             break;
         }
     }
     $checks['CHK-SRV-102'] = $test ? 'Good' : 'Warn';
     //RESULTS
     $result = in_array('Warn', $checks);
     $checks['Success'] = !$result;
     return $checks;
 }
开发者ID:NallelyFlores89,项目名称:telesinergia,代码行数:44,代码来源:server.php


示例6: switch

<?php

require_once DUPLICATOR_PLUGIN_PATH . 'classes/package.php';
global $wpdb;
//POST BACK
$action_updated = null;
if (isset($_POST['action'])) {
    $action_result = DUP_Settings::DeleteWPOption($_POST['action']);
    switch ($_POST['action']) {
        case 'duplicator_package_active':
            $action_response = __('Package settings have been reset.', 'duplicator');
            break;
    }
}
DUP_Util::InitSnapshotDirectory();
$Package = DUP_Package::GetActive();
$package_hash = $Package->MakeHash();
$dup_tests = array();
$dup_tests = DUP_Server::GetRequirements();
$default_name = DUP_Package::GetDefaultName();
$view_state = DUP_UI::GetViewStateArray();
$ui_css_storage = isset($view_state['dup-pack-storage-panel']) && $view_state['dup-pack-storage-panel'] ? 'display:block' : 'display:none';
$ui_css_archive = isset($view_state['dup-pack-archive-panel']) && $view_state['dup-pack-archive-panel'] ? 'display:block' : 'display:none';
$ui_css_installer = isset($view_state['dup-pack-installer-panel']) && $view_state['dup-pack-installer-panel'] ? 'display:block' : 'display:none';
$dup_intaller_files = implode(", ", array_keys(DUP_Server::GetInstallerFiles()));
$dbbuild_mode = DUP_Settings::Get('package_mysqldump') && DUP_Database::GetMySqlDumpPath() ? 'mysqldump' : 'PHP';
?>

<style>
    /* -----------------------------
    REQUIREMENTS*/
开发者ID:creotip,项目名称:trento,代码行数:31,代码来源:new1.base.php


示例7: strlen

:</td>
			<td><?php 
echo strlen($package->Installer->OptsURLNew) ? $package->Installer->OptsURLNew : DUP_Util::__("- not set -");
?>
</td>
		</tr>
	</table>
</div>
</div>

<?php 
if ($debug_on) {
    ?>
	<div style="margin:0">
		<a href="javascript:void(0)" onclick="jQuery(this).parent().find('.dup-pack-debug').toggle()">[<?php 
    DUP_Util::_e("View Package Object");
    ?>
]</a><br/>
		<pre class="dup-pack-debug" style="display:none"><?php 
    @print_r($package);
    ?>
 </pre>
	</div>
<?php 
}
?>
	


<script type="text/javascript">
jQuery(document).ready(function ($) 
开发者ID:creotip,项目名称:trento,代码行数:31,代码来源:detail.php


示例8: dirsToArray_New

 private function dirsToArray_New($path)
 {
     $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD);
     $files = iterator_to_array($iterator);
     $items = array();
     foreach ($files as $file) {
         if ($file->isDir()) {
             $items[] = DUP_Util::SafePath($file->getRealPath());
         }
     }
     return $items;
 }
开发者ID:carlosburbano,项目名称:lb_009_cchc_saloninmobiliario,代码行数:12,代码来源:package.archive.php


示例9: getFiles

 private function getFiles()
 {
     foreach ($this->Dirs as $key => $val) {
         $files = DUP_Util::ListFiles($val);
         foreach ($files as $filePath) {
             $fileName = basename($filePath);
             if (!is_dir($filePath)) {
                 if (!in_array(@pathinfo($filePath, PATHINFO_EXTENSION), $this->FilterExtsAll)) {
                     //Unreadable
                     if (!is_readable($filePath)) {
                         $this->FilterInfo->Files->Unreadable[] = $filePath;
                         continue;
                     }
                     $fileSize = @filesize($filePath);
                     $fileSize = empty($fileSize) ? 0 : $fileSize;
                     $invalid_test = strlen($filePath) > 250 || preg_match('/(\\/|\\*|\\?|\\>|\\<|\\:|\\|\\|)/', $fileName) || trim($fileName) == "";
                     if ($invalid_test || preg_match('/[^\\x20-\\x7f]/', $fileName)) {
                         $this->FilterInfo->Files->Warning[] = DUP_Encoding::toUTF8($filePath);
                     } else {
                         $this->Size += $fileSize;
                         $this->Files[] = $filePath;
                     }
                     if ($fileSize > DUPLICATOR_SCAN_WARNFILESIZE) {
                         $this->FilterInfo->Files->Size[] = $filePath . ' [' . DUP_Util::ByteSize($fileSize) . ']';
                     }
                 }
             }
         }
     }
 }
开发者ID:renztoygwapo,项目名称:lincoln,代码行数:30,代码来源:package.archive.php


示例10: isset

<?php

DUP_Util::CheckPermissions('manage_options');
global $wpdb;
//COMMON HEADER DISPLAY
require_once DUPLICATOR_PLUGIN_PATH . '/views/javascript.php';
require_once DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php';
$current_tab = isset($_REQUEST['tab']) ? esc_html($_REQUEST['tab']) : 'general';
?>

<style>

</style>

<div class="wrap">
	
    <?php 
duplicator_header(__("Settings", 'wpduplicator'));
?>

    <!--h2 class="nav-tab-wrapper">  
        <a href="?page=duplicator-settings&tab=general" class="nav-tab <?php 
echo $current_tab == 'general' ? 'nav-tab-active' : '';
?>
"> <?php 
_e('General', 'wpduplicator');
?>
</a>  
    </h2--> 	

    <?php 
开发者ID:healthcommcore,项目名称:osnap,代码行数:31,代码来源:controller.php


示例11: _e

?>
</td>
			 </tr>
			 <tr valign="top">
				 <td><?php 
_e('Free space', 'hyper-cache');
?>
</td>
				 <td><?php 
echo $perc;
?>
% -- <?php 
echo DUP_Util::ByteSize($space_free);
?>
 from <?php 
echo DUP_Util::ByteSize($space);
?>
<br/>
					  <small>
						  <?php 
_e("Note: This value is the physical servers hard-drive allocation.", 'wpduplicator');
?>
 <br/>
						  <?php 
_e("On shared hosts check your control panel for the 'TRUE' disk space quota value.", 'wpduplicator');
?>
					  </small>
				 </td>
			 </tr>	

		</table><br/>
开发者ID:donwea,项目名称:nhap.org,代码行数:31,代码来源:diagnostics.php


示例12: InitSnapshotDirectory

 /**
  *  Creates the snapshot directory if it doesn't already exisit
  */
 public static function InitSnapshotDirectory()
 {
     $path_wproot = DUP_Util::SafePath(DUPLICATOR_WPROOTPATH);
     $path_ssdir = DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH);
     $path_plugin = DUP_Util::SafePath(DUPLICATOR_PLUGIN_PATH);
     //--------------------------------
     //CHMOD DIRECTORY ACCESS
     //wordpress root directory
     @chmod($path_wproot, 0755);
     //snapshot directory
     @mkdir($path_ssdir, 0755);
     @chmod($path_ssdir, 0755);
     //snapshot tmp directory
     $path_ssdir_tmp = $path_ssdir . '/tmp';
     @mkdir($path_ssdir_tmp, 0755);
     @chmod($path_ssdir_tmp, 0755);
     //plugins dir/files
     @chmod($path_plugin . 'files', 0755);
     //--------------------------------
     //FILE CREATION
     //SSDIR: Create Index File
     $ssfile = @fopen($path_ssdir . '/index.php', 'w');
     @fwrite($ssfile, '<?php error_reporting(0);  if (stristr(php_sapi_name(), "fcgi")) { $url  =  "http://" . $_SERVER["HTTP_HOST"]; header("Location: {$url}/404.html");} else { header("HTTP/1.1 404 Not Found", true, 404);} exit(); ?>');
     @fclose($ssfile);
     //SSDIR: Create token file in snapshot
     $tokenfile = @fopen($path_ssdir . '/dtoken.php', 'w');
     @fwrite($tokenfile, '<?php error_reporting(0);  if (stristr(php_sapi_name(), "fcgi")) { $url  =  "http://" . $_SERVER["HTTP_HOST"]; header("Location: {$url}/404.html");} else { header("HTTP/1.1 404 Not Found", true, 404);} exit(); ?>');
     @fclose($tokenfile);
     //SSDIR: Create .htaccess
     $storage_htaccess_off = DUP_Settings::Get('storage_htaccess_off');
     if ($storage_htaccess_off) {
         @unlink($path_ssdir . '/.htaccess');
     } else {
         $htfile = @fopen($path_ssdir . '/.htaccess', 'w');
         $htoutput = "Options -Indexes";
         @fwrite($htfile, $htoutput);
         @fclose($htfile);
     }
     //SSDIR: Robots.txt file
     $robotfile = @fopen($path_ssdir . '/robots.txt', 'w');
     @fwrite($robotfile, "User-agent: * \nDisallow: /" . DUPLICATOR_SSDIR_NAME . '/');
     @fclose($robotfile);
     //PLUG DIR: Create token file in plugin
     $tokenfile2 = @fopen($path_plugin . 'installer/dtoken.php', 'w');
     @fwrite($tokenfile2, '<?php @error_reporting(0); @require_once("../../../../wp-admin/admin.php"); global $wp_query; $wp_query->set_404(); header("HTTP/1.1 404 Not Found", true, 404); header("Status: 404 Not Found"); @include(get_template_directory () . "/404.php"); ?>');
     @fclose($tokenfile2);
 }
开发者ID:jccultima123,项目名称:technovative-inc,代码行数:50,代码来源:utility.php


示例13: Create

 /**
  *  CREATE
  *  Creates the zip file and adds the SQL file to the archive
  */
 public static function Create(DUP_Archive $archive)
 {
     try {
         $timerAllStart = DUP_Util::GetMicrotime();
         $package_zip_flush = DUP_Settings::Get('package_zip_flush');
         self::$compressDir = rtrim(DUP_Util::SafePath($archive->PackDir), '/');
         self::$sqlPath = DUP_Util::SafePath("{$archive->Package->StorePath}/{$archive->Package->Database->File}");
         self::$zipPath = DUP_Util::SafePath("{$archive->Package->StorePath}/{$archive->File}");
         self::$zipArchive = new ZipArchive();
         self::$networkFlush = empty($package_zip_flush) ? false : $package_zip_flush;
         $filterDirs = empty($archive->FilterDirs) ? 'not set' : $archive->FilterDirs;
         $filterExts = empty($archive->FilterExts) ? 'not set' : $archive->FilterExts;
         $filterOn = $archive->FilterOn ? 'ON' : 'OFF';
         //LOAD SCAN REPORT
         $json = file_get_contents(DUPLICATOR_SSDIR_PATH_TMP . "/{$archive->Package->NameHash}_scan.json");
         self::$scanReport = json_decode($json);
         DUP_Log::Info("\n********************************************************************************");
         DUP_Log::Info("ARCHIVE (ZIP):");
         DUP_Log::Info("********************************************************************************");
         $isZipOpen = self::$zipArchive->open(self::$zipPath, ZIPARCHIVE::CREATE) === TRUE;
         if (!$isZipOpen) {
             DUP_Log::Error("Cannot open zip file with PHP ZipArchive.", "Path location [" . self::$zipPath . "]");
         }
         DUP_Log::Info("ARCHIVE DIR:  " . self::$compressDir);
         DUP_Log::Info("ARCHIVE FILE: " . basename(self::$zipPath));
         DUP_Log::Info("FILTERS: *{$filterOn}*");
         DUP_Log::Info("DIRS:  {$filterDirs}");
         DUP_Log::Info("EXTS:  {$filterExts}");
         DUP_Log::Info("----------------------------------------");
         DUP_Log::Info("COMPRESSING");
         DUP_Log::Info("SIZE:\t" . self::$scanReport->ARC->Size);
         DUP_Log::Info("STATS:\tDirs " . self::$scanReport->ARC->DirCount . " | Files " . self::$scanReport->ARC->FileCount);
         //ADD SQL
         $isSQLInZip = self::$zipArchive->addFile(self::$sqlPath, "database.sql");
         if ($isSQLInZip) {
             DUP_Log::Info("SQL ADDED: " . basename(self::$sqlPath));
         } else {
             DUP_Log::Error("Unable to add database.sql to archive.", "SQL File Path [" . self::$sqlath . "]");
         }
         self::$zipArchive->close();
         self::$zipArchive->open(self::$zipPath, ZipArchive::CREATE);
         //ZIP DIRECTORIES
         foreach (self::$scanReport->ARC->Dirs as $dir) {
             if (self::$zipArchive->addEmptyDir(ltrim(str_replace(self::$compressDir, '', $dir), '/'))) {
                 self::$countDirs++;
             } else {
                 //Don't warn when dirtory is the root path
                 if (strcmp($dir, rtrim(self::$compressDir, '/')) != 0) {
                     DUP_Log::Info("WARNING: Unable to zip directory: '{$dir}'" . rtrim(self::$compressDir, '/'));
                 }
             }
         }
         /* ZIP FILES: Network Flush
          *  This allows the process to not timeout on fcgi 
          *  setups that need a response every X seconds */
         if (self::$networkFlush) {
             foreach (self::$scanReport->ARC->Files as $file) {
                 if (self::$zipArchive->addFile($file, ltrim(str_replace(self::$compressDir, '', $file), '/'))) {
                     self::$limitItems++;
                     self::$countFiles++;
                 } else {
                     DUP_Log::Info("WARNING: Unable to zip file: {$file}");
                 }
                 //Trigger a flush to the web server after so many files have been loaded.
                 if (self::$limitItems > DUPLICATOR_ZIP_FLUSH_TRIGGER) {
                     $sumItems = self::$countDirs + self::$countFiles;
                     self::$zipArchive->close();
                     self::$zipArchive->open(self::$zipPath);
                     self::$limitItems = 0;
                     DUP_Util::FcgiFlush();
                     DUP_Log::Info("Items archived [{$sumItems}] flushing response.");
                 }
             }
             //Normal
         } else {
             foreach (self::$scanReport->ARC->Files as $file) {
                 if (self::$zipArchive->addFile($file, ltrim(str_replace(self::$compressDir, '', $file), '/'))) {
                     self::$countFiles++;
                 } else {
                     DUP_Log::Info("WARNING: Unable to zip file: {$file}");
                 }
             }
         }
         DUP_Log::Info(print_r(self::$zipArchive, true));
         //--------------------------------
         //LOG FINAL RESULTS
         DUP_Util::FcgiFlush();
         $zipCloseResult = self::$zipArchive->close();
         $zipCloseResult ? DUP_Log::Info("COMPRESSION RESULT: '{$zipCloseResult}'") : DUP_Log::Error("ZipArchive close failure.", "This hosted server may have a disk quota limit.\nCheck to make sure this archive file can be stored.");
         $timerAllEnd = DUP_Util::GetMicrotime();
         $timerAllSum = DUP_Util::ElapsedTime($timerAllEnd, $timerAllStart);
         self::$zipFileSize = @filesize(self::$zipPath);
         DUP_Log::Info("COMPRESSED SIZE: " . DUP_Util::ByteSize(self::$zipFileSize));
         DUP_Log::Info("ARCHIVE RUNTIME: {$timerAllSum}");
         DUP_Log::Info("MEMORY STACK: " . DUP_Server::GetPHPMemory());
     } catch (Exception $e) {
//.........这里部分代码省略.........
开发者ID:DylanGroenewoud,项目名称:PVNG,代码行数:101,代码来源:package.archive.zip.php


示例14:

<?php

DUP_Util::CheckPermissions('read');
require_once DUPLICATOR_PLUGIN_PATH . '/assets/js/javascript.php';
require_once DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php';
?>
<style>
    div.dup-support-all {font-size:13px; line-height:20px}
    div.dup-support-txts-links {width:100%;font-size:14px; font-weight:bold; line-height:26px; text-align:center}
    div.dup-support-hlp-area {width:375px; height:160px; float:left; border:1px solid #dfdfdf; border-radius:4px; margin:10px; line-height:18px;box-shadow: 0 8px 6px -6px #ccc;}
    table.dup-support-hlp-hdrs {border-collapse:collapse; width:100%; border-bottom:1px solid #dfdfdf}
    table.dup-support-hlp-hdrs {background-color:#efefef;}
    div.dup-support-hlp-hdrs {
        font-weight:bold; font-size:17px; height: 35px; padding:5px 5px 5px 10px;
        background-image:-ms-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
        background-image:-moz-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
        background-image:-o-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
        background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #FFFFFF), color-stop(1, #DEDEDE));
        background-image:-webkit-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
        background-image:linear-gradient(to bottom, #FFFFFF 0%, #DEDEDE 100%);
    }
    div.dup-support-hlp-hdrs div {padding:5px; margin:4px 20px 0px -20px;  text-align: center;}
    div.dup-support-hlp-txt{padding:10px 4px 4px 4px; text-align:center}
</style>


<div class="wrap dup-wrap dup-support-all">
	
    <?php 
duplicator_header(__("Help", 'duplicator'));
?>
开发者ID:netmagik,项目名称:netmagik,代码行数:31,代码来源:help.php


示例15: phpDump

 private function phpDump()
 {
     global $wpdb;
     $wpdb->query("SET session wait_timeout = " . DUPLICATOR_DB_MAX_TIME);
     $handle = fopen($this->dbStorePath, 'w+');
     $tables = $wpdb->get_col('SHOW TABLES');
     $filterTables = isset($this->FilterTables) ? explode(',', $this->FilterTables) : null;
     $tblAllCount = count($tables);
     $tblFilterOn = $this->FilterOn ? 'ON' : 'OFF';
     $qryLimit = DUP_Settings::Get('package_phpdump_qrylimit');
     if (is_array($filterTables) && $this->FilterOn) {
         foreach ($tables as $key => $val) {
             if (in_array($tables[$key], $filterTables)) {
                 unset($tables[$key]);
             }
         }
     }
     $tblCreateCount = count($tables);
     $tblFilterCount = $tblAllCount - $tblCreateCount;
     DUP_Log::Info("TABLES: total:{$tblAllCount} | filtered:{$tblFilterCount} | create:{$tblCreateCount}");
     DUP_Log::Info("FILTERED: [{$this->FilterTables}]");
     $sql_header = "/* DUPLICATOR MYSQL SCRIPT CREATED ON : " . @date("Y-m-d H:i:s") . " */\n\n";
     $sql_header .= "SET FOREIGN_KEY_CHECKS = 0;\n\n";
     fwrite($handle, $sql_header);
     //BUILD CREATES:
     //All creates must be created before inserts do to foreign key constraints
     foreach ($tables as $table) {
         //$sql_del = ($GLOBALS['duplicator_opts']['dbadd_drop']) ? "DROP TABLE IF EXISTS {$table};\n\n" : "";
         //@fwrite($handle, $sql_del);
         $create = $wpdb->get_row("SHOW CREATE TABLE `{$table}`", ARRAY_N);
         @fwrite($handle, "{$create[1]};\n\n");
     }
     //BUILD INSERTS:
     //Create Insert in 100 row increments to better handle memory
     foreach ($tables as $table) {
         $row_count = $wpdb->get_var("SELECT Count(*) FROM `{$table}`");
         //DUP_Log::Info("{$table} ({$row_count})");
         if ($row_count > $qryLimit) {
             $row_count = ceil($row_count / $qryLimit);
         } else {
             if ($row_count > 0) {
                 $row_count = 1;
             }
         }
         if ($row_count >= 1) {
             fwrite($handle, "\n/* INSERT TABLE DATA: {$table} */\n");
         }
         for ($i = 0; $i < $row_count; $i++) {
             $sql = "";
             $limit = $i * $qryLimit;
             $query = "SELECT * FROM `{$table}` LIMIT {$limit}, {$qryLimit}";
             $rows = $wpdb->get_results($query, ARRAY_A);
             if (is_array($rows)) {
                 foreach ($rows as $row) {
                     $sql .= "INSERT INTO `{$table}` VALUES(";
                     $num_values = count($row);
                     $num_counter = 1;
                     foreach ($row as $value) {
                         if (is_null($value) || !isset($value)) {
                             $num_values == $num_counter ? $sql .= 'NULL' : ($sql .= 'NULL, ');
                         } else {
                             $num_values == $num_counter ? $sql .= '"' . @esc_sql($value) . '"' : ($sql .= '"' . @esc_sql($value) . '", ');
                         }
                         $num_counter++;
                     }
                     $sql .= ");\n";
                 }
                 fwrite($handle, $sql);
             }
         }
         //Flush buffer if enabled
         if ($this->networkFlush) {
             DUP_Util::FcgiFlush();
         }
         $sql = null;
         $rows = null;
     }
     $sql_footer = "\nSET FOREIGN_KEY_CHECKS = 1; \n\n";
     $sql_footer .= "/* Duplicator WordPress Timestamp: " . date("Y-m-d H:i:s") . "*/\n";
     $sql_footer .= "/* " . DUPLICATOR_DB_EOF_MARKER . " */\n";
     fwrite($handle, $sql_footer);
     $wpdb->flush();
     fclose($handle);
 }
开发者ID:aaronfrey,项目名称:PepperLillie-TAT,代码行数:84,代码来源:package.database.php


示例16: glob

<?php

require_once DUPLICATOR_PLUGIN_PATH . '/views/javascript.php';
require_once DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php';
$logs = glob(DUPLICATOR_SSDIR_PATH . '/*.log');
if ($logs != false && count($logs)) {
    usort($logs, create_function('$a,$b', 'return filemtime($b) - filemtime($a);'));
    @chmod(DUP_Util::SafePath($logs[0]), 0644);
}
$logname = isset($_GET['logname']) ? trim($_GET['logname']) : "";
$refresh = isset($_POST['refresh']) && $_POST['refresh'] == 1 ? 1 : 0;
$auto = isset($_POST['auto']) && $_POST['auto'] == 1 ? 1 : 0;
//Check for invalid file
if (isset($_GET['logname'])) {
    $validFiles = array_map('basename', $logs);
    if (validate_file($logname, $validFiles) > 0) {
        unset($logname);
    }
    unset($validFiles);
}
if (!isset($logname) || !$logname) {
    $logname = count($logs) > 0 ? basename($logs[0]) : "";
}
$logurl = get_site_url(null, '', is_ssl() ? 'https' : 'http') . '/' . DUPLICATOR_SSDIR_NAME . '/' . $logname;
$logfound = strlen($logname) > 0 ? true : false;
?>

<style>
	div#dup-refresh-count {display: inline-block}
	table#dup-log-panels {width:100%; }
	td#dup-log-panel-left {width:75%;}
开发者ID:KimcoBlogSC,项目名称:Blog,代码行数:31,代码来源:logging.php


示例17: foreach

						<?php 
foreach ($phpdump_chunkopts as $value) {
    $selected = $package_phpdump_qrylimit == $value ? "selected='selected'" : '';
    echo "<option {$selected} value='{$value}'>" . number_format($value) . '</option>';
}
?>
					</select>
					 <i style="font-size:12px">(<?php 
_e("higher values speed up build times but uses more memory", 'wpduplicator');
?>
)</i> 
					
				</div><br/>

                <?php 
if (!DUP_Util::IsShellExecAvailable()) {
    ?>
                    <p class="description">
                        <?php 
    _e("This server does not have shell_exec configured to run.", 'wpduplicator');
    echo '<br/>';
    _e("Please contact the server administrator to enable this feature.", 'wpduplicator');
    ?>
                    </p>
                <?php 
} else {
    ?>
                    <input type="radio" name="package_dbmode" value="mysql" id="package_mysqldump" <?php 
    echo $package_mysqldump ? 'checked="checked"' : '';
    ?>
 />
开发者ID:ICONVI,项目名称:sigmacatweb,代码行数:31,代码来源:general.php


示例18: GetPHPMemory

 /** 
  * Get PHP memory useage 
  * @return string   Returns human readable memory useage.
  */
 public static function GetPHPMemory($peak = false)
 {
     if ($peak) {
         $result = 'Unable to read PHP peak memory usage';
         if (function_exists('memory_get_peak_usage')) {
             $result = DUP_Util::ByteSize(memory_get_peak_usage(true));
         }
     } else {
         $result = 'Unable to read PHP memory usage';
         if (function_exists('memory_get_usage')) {
             $result = DUP_Util::ByteSize(memory_get_usage(true));
         }
     }
     return $result;
 }
开发者ID:DylanGroenewoud,项目名称:PVNG,代码行数:19,代码来源:server.php


示例19: isset

<?php

DUP_Util::CheckPermissions('export');
global $wpdb;
//COMMON HEADER DISPLAY
require_once DUPLICATOR_PLUGIN_PATH . '/views/javascript.php';
require_once DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php';
$current_tab = isset($_REQUEST['tab']) ? esc_html($_REQUEST['tab']) : 'list';
?>

<style>
	//TOOLBAR TABLE
	table#dup-toolbar td {padding:0px; white-space:nowrap;}
	table#dup-toolbar td.dup-toolbar-btns {width:100%; text-align: right; vertical-align: bottom}
	table#dup-toolbar td.dup-toolbar-btns a {font-size:16px}
	table#dup-toolbar td.dup-toolbar-btns span {font-size:16px; font-weight: bold}
	table#dup-toolbar {width:100%; border:0px solid red; padding: 0; margin:0 0 10px 0; height: 35px}
	
    /*WIZARD TABS */
    div#dup-wiz {padding:0px; margin:0;  }
    div#dup-wiz-steps {margin:10px 0px 0px 10px; padding:0px;  clear:both; font-size:12px; min-width:350px;}
    div#dup-wiz-title {padding:2px 0px 0px 0px; font-size:18px;}
	div#dup-wiz-steps a span {font-size:10px}
    /* wiz-steps numbers */
    #dup-wiz span {display:block;float:left; text-align:center; width:14px; margin:4px 5px 0px 0px; line-height:13px; color:#ccc; border:1px solid #CCCCCC; border-radius:5px; }
    /* wiz-steps default*/
    #dup-wiz a { position:relative; display:block; width:auto; min-width:55px; height:25px; margin-right:8px; padding:0px 10px 0px 10px; float:left; line-height:24px; color:#000; background:#E4E4E4; border-radius:5px }
	/* wiz-steps active*/
    #dup-wiz .active-step a {color:#fff; background:#BBBBBB;}
    #dup-wiz .active-step span {color:#fff; border:1px solid #fff;}
	/* wiz-steps completed */
开发者ID:Lumbe,项目名称:dev_servus,代码行数:31,代码来源:controller.php


示例20: duplicator_menu

 /**
  *  DUPLICATOR_MENU
  *  Loads the menu item into the WP tools section and queues the actions for only this plugin */
 function duplicator_menu()
 {
     $wpfront_caps_translator = 'wpfront_user_role_editor_duplicator_translate_capability';
     //Main Menu
     $perms = 'export';
     $perms = apply_filters($wpfront_caps_translator, $perms);
     $main_menu = add_menu_page('Duplicator Plugin', 'Duplicator', $perms, 'duplicator', 'duplicator_get_menu', plugins_url('duplicator/assets/img/create.png'));
     $perms = 'export';
     $perms = apply_filters($wpfront_caps_translator, $perms);
     $page_packages = add_submenu_page('duplicator', DUP_Util::__('Packages'), DUP_Util::__('Packages'), $perms, 'duplicator', 'duplicator_get_menu');
     $perms = 'manage_options';
     $perms = apply_filters($wpfront_caps_translator, $perms);
     $page_settings = add_submenu_page('duplicator', DUP_Util::__('Settings'), DUP_Util::__('Settings'), $perms, 'duplicator-settings', 'duplicator_get_menu');
     $perms = 'manage_options';
     $perms = apply_filters($wpfront_caps_translator, $perms);
     $page_tools = add_submenu_page('duplicator', DUP_Util::__('Tools'), DUP_Util::__('Tools'), $perms, 'duplicator-tools', 'duplicator_get_menu');
     $perms = 'manage_options';
     $perms = apply_filters($wpfront_caps_translator, $perms);
     $page_help = add_submenu_page('duplicator', DUP_Util::__('Help'), DUP_Util::__('Help'), $perms, 'duplicator-help', 'duplicator_get_menu');
     $perms = 'manage_options';
     $perms = apply_filters($wpfront_caps_translator, $perms);
     $page_about = add_submenu_page('duplicator', DUP_Util::__('About'), DUP_Util::__('About'), $perms, 'duplicator-about', 'duplicator_get_menu');
     $perms = 'manage_options';
     $go_pro_link = '<span style="color:#f18500">' . DUP_Util::__('Go Pro!') . '</span>';
     $perms = apply_filters($wpfront_caps_translator, $perms);
     $page_gopro = add_submenu_page('duplicator', $go_pro_link, $go_pro_link, $perms, 'duplicator-gopro', 'duplicator_get_menu');
     //Apply Scripts
     add_action('admin_print_scripts-' . $page_packages, 'duplicator_scripts');
     add_action('admin_print_scripts-' . $page_settings, 'duplicator_scripts');
     add_action('admin_print_scripts-' . $page_help, 'duplicator_scripts');
     add_action('admin_print_scripts-' . $page_tools, 'duplicator_scripts');
     add_action('admin_print_scripts-' . $page_about, 'duplicator_scripts');
     add_action('admin_print_scripts-' . $page_gopro, 'duplicator_scripts');
     //Apply Styles
     add_action('admin_print_styles-' . $page_packages, 'duplicator_styles');
     add_action('admin_print_styles-' . $page_settings, 'duplicator_styles');
     add_action('admin_print_styles-' . $page_help, 'duplicator_styles');
     add_action('admin_print_styles-' . $page_tools, 'duplicator_styles');
     add_action('admin_print_styles-' . $page_about, 'duplicator_styles');
     add_action('admin_print_styles-' . $page_gopro, 'duplicator_styles');
 }
开发者ID:renztoygwapo,项目名称:lincoln,代码行数:44,代码来源:duplicator.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Daemon类代码示例发布时间:2022-05-23
下一篇:
PHP DUP_Settings类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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