Exemplo n.º 1
0
 /**
  * Creates a database dump
  *
  * @author         Jeff Behnke <*****@*****.**>
  * @copyright  (c) 2009-15 ValidWebs.com
  *
  * Created:    12/5/15, 2:43 AM
  *
  * @param        $host
  *
  * @param string $file_name
  *
  * @return bool|string
  */
 public function create_db_backup($host, $file_name = '')
 {
     $backup_status = false;
     $host_info = $this->set_host_info($host);
     $is_env = isset($host_info['is_env']) ? $host_info['is_env'] : false;
     // Backups for WP Starter
     if ($is_env) {
         $dash_hosts = new vvv_dash_hosts();
         $env_configs = $dash_hosts->get_wp_starter_configs($host_info);
         $configs = isset($env_configs[$host_info['host']]) ? $env_configs[$host_info['host']] : false;
         $db['db_name'] = $configs['DB_NAME'];
         $db['db_user'] = $configs['DB_USER'];
         $db['db_password'] = $configs['DB_PASSWORD'];
         $backup_status = vvv_dash_wp_starter_backup($host_info, $db, $file_name);
     } else {
         // All other backups
         $backup_status = vvv_dash_wp_backup($host, $file_name);
     }
     return $backup_status;
 }
Exemplo n.º 2
0
            $debug_log_path = VVV_WEB_ROOT . '/' . $type['key'] . '/wp-content/debug.log';
        }
    } else {
        $host = strstr($_GET['host'], '.', true);
        $debug_log_path = VVV_WEB_ROOT . '/' . $host . '/htdocs/wp-content/debug.log';
    }
    if ($debug_log_path && file_exists($debug_log_path)) {
        $debug_log = get_php_errors(21, 140, $debug_log_path);
    }
    if (is_array($debug_log)) {
        $debug_log_lines = format_php_errors($debug_log);
    }
}
if (isset($_POST)) {
    if (isset($_POST['backup']) && isset($_POST['host'])) {
        $backup_status = vvv_dash_wp_backup($_POST['host']);
    }
    if (isset($_POST['purge_hosts'])) {
        $purge_status = $cache->purge('host-sites');
    }
    if (isset($_POST['purge_themes'])) {
        $purge_status = $cache->purge('-themes');
    }
    if (isset($_POST['purge_plugins'])) {
        $purge_status = $cache->purge('-plugins');
    }
    if (isset($_POST['update_item'])) {
        if (isset($_POST['host'])) {
            $type = check_host_type($_POST['host']);
            if (isset($type['key'])) {
                if (isset($type['path'])) {