本文整理汇总了PHP中parent::type方法的典型用法代码示例。如果您正苦于以下问题:PHP parent::type方法的具体用法?PHP parent::type怎么用?PHP parent::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parent
的用法示例。
在下文中一共展示了parent::type方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: success
public static function success($message, $template = null)
{
if (!is_null($template)) {
parent::$template = $template;
}
parent::$type = 'success';
parent::loadMessage($message);
}
示例2: wpadm_show_backup
public static function wpadm_show_backup()
{
require_once DRBBACKUP_BASE_DIR . "/modules/dropbox.class.php";
parent::$type = 'full';
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
if ($dropbox_options) {
$dropbox_options = unserialize(base64_decode($dropbox_options));
if (isset($dropbox_options['app_key']) && isset($dropbox_options['app_secret']) && isset($dropbox_options['auth_token_secret'])) {
$dropbox = new dropbox($dropbox_options['app_key'], $dropbox_options['app_secret'], $dropbox_options['auth_token_secret']);
$folder_project = self::getNameProject();
$backups = $dropbox->listing($folder_project);
$n = count($backups['items']);
$data['data'] = array();
for ($i = 0; $i < $n; $i++) {
$backup = $dropbox->listing($folder_project . "/" . $backups['items'][$i]['name']);
$data['data'][$i]['name'] = $backups['items'][$i]['name'];
$data['data'][$i]['size'] = (double) $backup['size'] * 1024 * 1024;
$data['data'][$i]['dt'] = parent::getDateInName($backups['items'][$i]['name']);
$data['data'][$i]['count'] = count($backup['items']);
$data['data'][$i]['type'] = 'dropbox';
$k = $data['data'][$i]['count'];
$data['data'][$i]['files'] = '[';
for ($j = 0; $j < $k; $j++) {
$data['data'][$i]['files'] .= $backup['items'][$j]['name'] . ',';
}
}
}
}
if (isset($_GET['pay']) && $_GET['pay'] == 'success') {
if (!file_exists(WPAdm_Core::getTmpDir() . "/pay_success")) {
file_put_contents(WPAdm_Core::getTmpDir() . "/pay_success", 1);
parent::setMessage(langWPADM::get('', false));
}
}
if (isset($_GET['pay']) && $_GET['pay'] == 'cancel') {
parent::setError(langWPADM::get('Checkout was canceled', false));
}
$data_local = parent::read_backups();
if (isset($data['data'])) {
$data['data'] = array_merge($data_local['data'], $data['data']);
$data['md5'] = md5(print_r($data['data'], 1));
} else {
$data = $data_local;
}
if (file_exists(WPAdm_Core::getTmpDir() . "/pay_success")) {
$plugin_info = get_plugins("/" . parent::$plugin_name);
$plugin_version = isset($plugin_info[parent::$plugin_name . '.php']['Version']) ? $plugin_info[parent::$plugin_name . '.php']['Version'] : '';
$data_server = parent::sendToServer(array('actApi' => "proBackupCheck", 'site' => home_url(), 'email' => get_option('admin_email'), 'plugin' => parent::$plugin_name, 'key' => '', 'plugin_version' => $plugin_version));
if (isset($data_server['status']) && $data_server['status'] == 'success' && isset($data_server['key'])) {
update_option(PREFIX_BACKUP_ . 'pro-key', $data_server['key']);
if (isset($data_server['url']) && !empty($data_server['url'])) {
parent::setMessage(str_replace('&s', $data_server['url'], langWPADM::get('The "Dropbox backup & restore PRO" version can be downloaded here <a href="&s">download</a>', false)));
}
}
}
if (!function_exists('get_plugins')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$stars5 = file_exists(WPAdm_Core::getTmpDir() . "/notice-star");
$plugin_data = array_values(get_plugins('/dropbox-backup'));
$is_runnig = WPAdm_Running::is_running();
$show = !get_option('wpadm_pub_key') && is_super_admin();
$error = parent::getError(true);
$msg = parent::getMessage(true);
$base_path = DRBBACKUP_BASE_DIR;
ob_start();
require_once $base_path . DIRECTORY_SEPARATOR . "template" . DIRECTORY_SEPARATOR . "wpadm_show_backup.php";
echo ob_get_clean();
}
示例3: wpadm_show_backup
public static function wpadm_show_backup()
{
require_once DRBBACKUP_BASE_DIR . "/modules/dropbox.class.php";
parent::$type = 'full';
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
if ($dropbox_options) {
$dropbox_options = unserialize(base64_decode($dropbox_options));
if (isset($dropbox_options['app_key']) && isset($dropbox_options['app_secret']) && isset($dropbox_options['auth_token_secret'])) {
$dropbox = new dropbox($dropbox_options['app_key'], $dropbox_options['app_secret'], $dropbox_options['auth_token_secret']);
$folder_project = self::getNameProject();
$backups = $dropbox->listing($folder_project);
$n = count($backups['items']);
$data['data'] = array();
for ($i = 0; $i < $n; $i++) {
$backup = $dropbox->listing($folder_project . "/" . $backups['items'][$i]['name']);
$data['data'][$i]['name'] = $backups['items'][$i]['name'];
$data['data'][$i]['size'] = (int) $backup['size'] * 1024 * 1024;
$data['data'][$i]['dt'] = parent::getDateInName($backups['items'][$i]['name']);
$data['data'][$i]['count'] = count($backup['items']);
$data['data'][$i]['type'] = 'dropbox';
$k = $data['data'][$i]['count'];
$data['data'][$i]['files'] = '[';
for ($j = 0; $j < $k; $j++) {
$data['data'][$i]['files'] .= $backup['items'][$i]['name'] . ',';
}
}
}
}
$data_local = parent::read_backups();
if (isset($data['data'])) {
$data['data'] = array_merge($data_local['data'], $data['data']);
$data['md5'] = md5(print_r($data['data'], 1));
} else {
$data = $data_local;
}
$show = !get_option('wpadm_pub_key') && is_super_admin();
$error = parent::getError(true);
$msg = parent::getMessage(true);
$base_path = DRBBACKUP_BASE_DIR;
ob_start();
require_once $base_path . DIRECTORY_SEPARATOR . "template" . DIRECTORY_SEPARATOR . "wpadm_show_backup.php";
echo ob_get_clean();
}
示例4: wpadm_show_backup
public static function wpadm_show_backup()
{
if (isset($_POST['access_key_id']) && isset($_POST['secret_access_key']) && isset($_POST['bucket'])) {
$bucket = trim($_POST['bucket']);
$access_key_id = stripslashes(trim($_POST['access_key_id']));
$secret_access_key = stripslashes(trim($_POST['secret_access_key']));
$bucketLen = strlen($bucket);
$error = array();
if ($bucketLen < 3 || $bucketLen > 63 || preg_match('/(\\d+\\.){3}\\d+$/', $bucket) || !preg_match('/^[a-z0-9]([a-z0-9\\-\\.]*[a-z0-9])?$/', $bucket)) {
$_SESSION['errorMsgWpadmDB'] = 'Incorrect Bucket Name';
}
if (!isset($_SESSION['errorMsgWpadmDB'])) {
self::setAmazonOption($access_key_id, $secret_access_key, $bucket);
}
}
parent::$type = 'db';
$amazon_option = self::getAmazonOptions();
if ($amazon_option) {
$data = self::getBackupsInAmazon($amazon_option);
}
require_once dirname(__FILE__) . "/class-wpadm-core.php";
$data_local = parent::read_backups();
if (isset($data['data'])) {
$data['data'] = array_merge($data_local['data'], $data['data']);
$data['md5'] = md5(print_r($data['data'], 1));
} else {
$data = $data_local;
}
$error = parent::getError(true);
$show = !get_option('wpadm_pub_key') && is_super_admin();
$msg = parent::getMessage(true);
ob_start();
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "template/wpadm_show_backup.php";
echo ob_get_clean();
}