/** * Returns the mysqldump path if the server is enabled to execute it * @return boolean|string */ public static function GetMySqlDumpPath() { //Is shell_exec possible if (!DUP_Util::IsShellExecAvailable()) { return false; } $custom_mysqldump_path = DUP_Settings::Get('package_mysqldump_path'); $custom_mysqldump_path = strlen($custom_mysqldump_path) ? $custom_mysqldump_path : ''; //Common Windows Paths if (DUP_Util::IsOSWindows()) { $paths = array($custom_mysqldump_path, 'C:/xampp/mysql/bin/mysqldump.exe', 'C:/Program Files/xampp/mysql/bin/mysqldump', 'C:/Program Files/MySQL/MySQL Server 6.0/bin/mysqldump', 'C:/Program Files/MySQL/MySQL Server 5.5/bin/mysqldump', 'C:/Program Files/MySQL/MySQL Server 5.4/bin/mysqldump', 'C:/Program Files/MySQL/MySQL Server 5.1/bin/mysqldump', 'C:/Program Files/MySQL/MySQL Server 5.0/bin/mysqldump'); //Common Linux Paths } else { $path1 = ''; $path2 = ''; $mysqldump = `which mysqldump`; if (@is_executable($mysqldump)) { $path1 = !empty($mysqldump) ? $mysqldump : ''; } $mysqldump = dirname(`which mysql`) . "/mysqldump"; if (@is_executable($mysqldump)) { $path2 = !empty($mysqldump) ? $mysqldump : ''; } $paths = array($custom_mysqldump_path, $path1, $path2, '/usr/local/bin/mysqldump', '/usr/local/mysql/bin/mysqldump', '/usr/mysql/bin/mysqldump', '/usr/bin/mysqldump', '/opt/local/lib/mysql6/bin/mysqldump', '/opt/local/lib/mysql5/bin/mysqldump', '/opt/local/lib/mysql4/bin/mysqldump'); } // Find the one which works foreach ($paths as $path) { if (@is_executable($path)) { return $path; } } return false; }
<td><a href="http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time" target="_blank"><?php _e("Max Execution Time", 'wpduplicator'); ?> </a></td> <td><?php echo @ini_get('max_execution_time'); ?> </td> </tr> <tr> <td><a href="http://us3.php.net/shell_exec" target="_blank"><?php _e("Shell Exec", 'wpduplicator'); ?> </a></td> <td><?php echo DUP_Util::IsShellExecAvailable() ? _e("Is Supported", 'wpduplicator') : _e("Not Supported", 'wpduplicator'); ?> </td> </tr> <tr> <td class='dup-settings-diag-header' colspan="2">MySQL</td> </tr> <tr> <td><?php _e("Version", 'wpduplicator'); ?> </td> <td><?php echo $wpdb->db_version(); ?> </td>
<?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"' : ''; ?> />