本文整理汇总了PHP中BackWPup_Job::sanitize_file_name方法的典型用法代码示例。如果您正苦于以下问题:PHP BackWPup_Job::sanitize_file_name方法的具体用法?PHP BackWPup_Job::sanitize_file_name怎么用?PHP BackWPup_Job::sanitize_file_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BackWPup_Job
的用法示例。
在下文中一共展示了BackWPup_Job::sanitize_file_name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: page
//.........这里部分代码省略.........
<th scope="row"><label for="archivename"><?php
_e('Archive name', 'backwpup');
?>
</label></th>
<td>
<input name="archivename" type="text" id="archivename"
value="<?php
echo BackWPup_Option::get($jobid, 'archivename');
?>
"
class="regular-text code help-tip" title="<?php
echo "<strong>" . esc_attr__('Replacement patterns:', 'backwpup') . "</strong><br />";
echo esc_attr__('%d = Two digit day of the month, with leading zeros', 'backwpup') . '<br />';
echo esc_attr__('%j = Day of the month, without leading zeros', 'backwpup') . '<br />';
echo esc_attr__('%m = Day of the month, with leading zeros', 'backwpup') . '<br />';
echo esc_attr__('%n = Representation of the month (without leading zeros)', 'backwpup') . '<br />';
echo esc_attr__('%Y = Four digit representation for the year', 'backwpup') . '<br />';
echo esc_attr__('%y = Two digit representation of the year', 'backwpup') . '<br />';
echo esc_attr__('%a = Lowercase ante meridiem (am) and post meridiem (pm)', 'backwpup') . '<br />';
echo esc_attr__('%A = Uppercase ante meridiem (AM) and post meridiem (PM)', 'backwpup') . '<br />';
echo esc_attr__('%B = Swatch Internet Time', 'backwpup') . '<br />';
echo esc_attr__('%g = Hour in 12-hour format, without leading zeros', 'backwpup') . '<br />';
echo esc_attr__('%G = Hour in 24-hour format, without leading zeros', 'backwpup') . '<br />';
echo esc_attr__('%h = Hour in 12-hour format, with leading zeros', 'backwpup') . '<br />';
echo esc_attr__('%H = Hour in 24-hour format, with leading zeros', 'backwpup') . '<br />';
echo esc_attr__('%i = Two digit representation of the minute', 'backwpup') . '<br />';
echo esc_attr__('%s = Two digit representation of the second', 'backwpup') . '<br />';
?>
" />
<?php
$current_time = current_time('timestamp');
$datevars = array('%d', '%j', '%m', '%n', '%Y', '%y', '%a', '%A', '%B', '%g', '%G', '%h', '%H', '%i', '%s');
$datevalues = array(date('d', $current_time), date('j', $current_time), date('m', $current_time), date('n', $current_time), date('Y', $current_time), date('y', $current_time), date('a', $current_time), date('A', $current_time), date('B', $current_time), date('g', $current_time), date('G', $current_time), date('h', $current_time), date('H', $current_time), date('i', $current_time), date('s', $current_time));
$archivename = str_replace($datevars, $datevalues, BackWPup_Job::sanitize_file_name(BackWPup_Option::get($jobid, 'archivename')));
echo '<p>Preview: <code><span id="archivefilename">' . $archivename . '</span><span id="archiveformat">' . BackWPup_Option::get($jobid, 'archiveformat') . '</span></code></p>';
?>
</td>
</tr>
<tr class="nosync">
<th scope="row"><?php
_e('Archive Format', 'backwpup');
?>
</th>
<td>
<fieldset>
<legend class="screen-reader-text"><span><?php
_e('Archive Format', 'backwpup');
?>
</span></legend>
<?php
if (function_exists('gzopen') || class_exists('ZipArchive')) {
echo '<label for="idarchiveformat-zip"><input class="radio help-tip" title="' . __('PHP Zip functions will be used if available (needs less memory). Otherwise the PCLZip class will be used.', 'backwpup') . '" type="radio"' . checked('.zip', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-zip" value=".zip" /> ' . __('Zip', 'backwpup') . '</label><br />';
} else {
echo '<label for="idarchiveformat-zip"><input class="radio help-tip" title="' . __('Disabled due to missing PHP function.', 'backwpup') . '" type="radio"' . checked('.zip', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-zip" value=".zip" disabled="disabled" /> ' . __('Zip', 'backwpup') . '</label><br />';
}
echo '<label for="idarchiveformat-tar"><input class="radio help-tip" title="' . __('A tarballed, not compressed archive (fast and less memory)', 'backwpup') . '" type="radio"' . checked('.tar', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-tar" value=".tar" /> ' . __('Tar', 'backwpup') . '</label><br />';
if (function_exists('gzopen')) {
echo '<label for="idarchiveformat-targz"><input class="radio help-tip" title="' . __('A tarballed, GZipped archive (fast and less memory)', 'backwpup') . '" type="radio"' . checked('.tar.gz', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-targz" value=".tar.gz" /> ' . __('Tar GZip', 'backwpup') . '</label><br />';
} else {
echo '<label for="idarchiveformat-targz"><input class="radio help-tip" title="' . __('Disabled due to missing PHP function.', 'backwpup') . '" type="radio"' . checked('.tar.gz', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-targz" value=".tar.gz" disabled="disabled" /> ' . __('Tar GZip', 'backwpup') . '</label><br />';
}
if (function_exists('bzopen')) {
echo '<label for="idarchiveformat-tarbz2"><input class="radio help-tip" title="' . __('A tarballed, BZipped archive (fast and less memory)', 'backwpup') . '" type="radio"' . checked('.tar.bz2', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-tarbz2" value=".tar.bz2" /> ' . __('Tar BZip2', 'backwpup') . '</label><br />';
} else {
echo '<label for="idarchiveformat-tarbz2"><input class="radio help-tip" title="' . __('Disabled due to missing PHP function.', 'backwpup') . '" type="radio"' . checked('.tar.bz2', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-tarbz2" value=".tar.bz2" disabled="disabled" /> ' . __('Tar BZip2', 'backwpup') . '</label><br />';
}
示例2: edit_form_post_save
/**
* @param $id
*/
public function edit_form_post_save($id)
{
global $wpdb;
/* @var wpdb $wpdb */
if ($_POST['dbdumpfilecompression'] === '' || $_POST['dbdumpfilecompression'] === '.gz') {
BackWPup_Option::update($id, 'dbdumpfilecompression', $_POST['dbdumpfilecompression']);
}
BackWPup_Option::update($id, 'dbdumpfile', BackWPup_Job::sanitize_file_name($_POST['dbdumpfile']));
//selected tables
$dbdumpexclude = array();
$checked_db_tables = array();
if (isset($_POST['tabledb'])) {
foreach ($_POST['tabledb'] as $dbtable) {
$checked_db_tables[] = sanitize_text_field($dbtable);
}
}
$dbtables = $wpdb->get_results('SHOW TABLES FROM `' . DB_NAME . '`', ARRAY_N);
foreach ($dbtables as $dbtable) {
if (!in_array($dbtable[0], $checked_db_tables, true)) {
$dbdumpexclude[] = $dbtable[0];
}
}
BackWPup_Option::update($id, 'dbdumpexclude', $dbdumpexclude);
}
示例3: edit_form_post_save
/**
* @param $id
*/
public function edit_form_post_save($id)
{
BackWPup_Option::update($id, 'wpexportcontent', $_POST['wpexportcontent']);
BackWPup_Option::update($id, 'wpexportfile', BackWPup_Job::sanitize_file_name($_POST['wpexportfile']));
if ($_POST['wpexportfilecompression'] == '' || $_POST['wpexportfilecompression'] == '.gz' || $_POST['wpexportfilecompression'] == '.bz2') {
BackWPup_Option::update($id, 'wpexportfilecompression', $_POST['wpexportfilecompression']);
}
}
示例4: edit_form_post_save
public function edit_form_post_save($id)
{
BackWPup_Option::update($id, 'widgetlistfile', BackWPup_Job::sanitize_file_name($_POST['widgetlistfile']));
}