Fix: Work with PHP < 5.3
This commit is contained in:
parent
1aaa1a51c5
commit
d8856bac5f
@ -83,6 +83,9 @@ if ($_GET["msg"])
|
||||
print "\n";
|
||||
}
|
||||
|
||||
|
||||
$label=getStaticMember($db, 'label');
|
||||
|
||||
?>
|
||||
|
||||
<!-- Dump of a server -->
|
||||
@ -99,7 +102,7 @@ if ($_GET["msg"])
|
||||
<div id="div_container_exportoptions">
|
||||
<fieldset id="exportoptions"><legend><?php echo $langs->trans("ExportMethod"); ?></legend>
|
||||
<?php
|
||||
if ($db::$label == 'MySQL')
|
||||
if ($label == 'MySQL')
|
||||
{
|
||||
?>
|
||||
<div class="formelementrow"><input type="radio" name="what" value="mysql" id="radio_dump_mysql" />
|
||||
@ -112,7 +115,7 @@ if ($_GET["msg"])
|
||||
<?php
|
||||
}
|
||||
}
|
||||
else if ($db::$label == 'PostgreSQL')
|
||||
else if ($label == 'PostgreSQL')
|
||||
{
|
||||
?>
|
||||
<div class="formelementrow"><input type="radio" name="what" value="postgresql" id="radio_dump_postgresql" />
|
||||
@ -122,7 +125,7 @@ if ($_GET["msg"])
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'No method available with database '.$db::$label;
|
||||
print 'No method available with database '.$label;
|
||||
}
|
||||
?>
|
||||
</fieldset>
|
||||
@ -134,7 +137,7 @@ if ($_GET["msg"])
|
||||
|
||||
<div id="div_container_sub_exportoptions">
|
||||
<?php
|
||||
if ($db::$label == 'MySQL')
|
||||
if ($label == 'MySQL')
|
||||
{
|
||||
?> <!-- Fieldset mysqldump -->
|
||||
<fieldset id="mysql_options"><legend><?php echo $langs->trans("MySqlExportParameters"); ?></legend>
|
||||
@ -217,7 +220,7 @@ if ($_GET["msg"])
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($db::$label == 'PostgreSQL')
|
||||
if ($label == 'PostgreSQL')
|
||||
{
|
||||
?> <!-- Fieldset pg_dump -->
|
||||
<fieldset id="postgresql_options"><legend><?php echo $langs->trans("PostgreSqlExportParameters"); ?></legend>
|
||||
@ -281,8 +284,8 @@ if ($_GET["msg"])
|
||||
id="filename_template"
|
||||
value="<?php
|
||||
$prefix='dump';
|
||||
if ($db::$label == 'MySQL') $prefix='mysqldump';
|
||||
if ($db::$label == 'PostgreSQL') $prefix='pg_dump';
|
||||
if ($label == 'MySQL') $prefix='mysqldump';
|
||||
if ($label == 'PostgreSQL') $prefix='pg_dump';
|
||||
$file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.sql';
|
||||
echo $file;
|
||||
?>" /> <br>
|
||||
@ -296,7 +299,7 @@ $compression=array(
|
||||
// 'zip' => array('function' => 'zip_open', 'id' => 'radio_compression_zip', 'label' => $langs->trans("Zip")), Not open source
|
||||
'gz' => array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")),
|
||||
);
|
||||
if ($db::$label == 'MySQL')
|
||||
if ($label == 'MySQL')
|
||||
{
|
||||
$compression['bz']=array('function' => 'bzopen', 'id' => 'radio_compression_bzip', 'label' => $langs->trans("Bzip2"));
|
||||
}
|
||||
@ -339,10 +342,10 @@ print "\n";
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
$result=$formfile->show_documents('systemtools','backup',$conf->admin->dir_output.'/backup',$_SERVER['PHP_SELF'],0,1,'',1,0,0,54,0,'',$langs->trans("PreviousDumpFiles"));
|
||||
//if ($result) print '<br><br>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
@ -58,6 +58,8 @@ print $langs->trans("RestoreDesc",DOL_DATA_ROOT).'<br><br>';
|
||||
print $langs->trans("RestoreDesc2",DOL_DATA_ROOT).'<br><br>';
|
||||
print $langs->trans("RestoreDesc3",DOL_DATA_ROOT).'<br><br>';
|
||||
|
||||
$label=getStaticMember($db, 'label');
|
||||
|
||||
?>
|
||||
|
||||
<fieldset id="fieldsetexport">
|
||||
@ -69,7 +71,7 @@ print $langs->trans("RestoreDesc3",DOL_DATA_ROOT).'<br><br>';
|
||||
<fieldset id="exportoptions">
|
||||
<legend><?php echo $langs->trans("ImportMethod"); ?></legend>
|
||||
<?php
|
||||
if ($db::$label == 'MySQL')
|
||||
if ($label == 'MySQL')
|
||||
{
|
||||
?>
|
||||
<div class="formelementrow">
|
||||
@ -78,7 +80,7 @@ print $langs->trans("RestoreDesc3",DOL_DATA_ROOT).'<br><br>';
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
else if ($db::$label == 'PostgreSQL')
|
||||
else if ($label == 'PostgreSQL')
|
||||
{
|
||||
?>
|
||||
<div class="formelementrow">
|
||||
@ -89,7 +91,7 @@ print $langs->trans("RestoreDesc3",DOL_DATA_ROOT).'<br><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'No method available with database '.$db::$label;
|
||||
print 'No method available with database '.$label;
|
||||
}
|
||||
?>
|
||||
</fieldset>
|
||||
@ -101,7 +103,7 @@ print $langs->trans("RestoreDesc3",DOL_DATA_ROOT).'<br><br>';
|
||||
|
||||
<div id="div_container_sub_exportoptions">
|
||||
<?php
|
||||
if ($db::$label == 'MySQL')
|
||||
if ($label == 'MySQL')
|
||||
{
|
||||
?>
|
||||
<fieldset id="mysql_options">
|
||||
@ -135,7 +137,7 @@ if ($db::$label == 'MySQL')
|
||||
</fieldset>
|
||||
<?php
|
||||
}
|
||||
else if ($db::$label == 'PostgreSQL')
|
||||
else if ($label == 'PostgreSQL')
|
||||
{
|
||||
?>
|
||||
<fieldset id="postgresql_options">
|
||||
@ -180,8 +182,7 @@ else if ($db::$label == 'PostgreSQL')
|
||||
</fieldset>
|
||||
|
||||
<?php
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
@ -394,7 +394,7 @@ function backup_tables($outputfile, $tables='*')
|
||||
|
||||
// Print headers and global mysql config vars
|
||||
$sqlhead = '';
|
||||
$sqlhead .= "-- ".$db::$label." dump via php
|
||||
$sqlhead .= "-- ".getStaticMember($db, 'label')." dump via php
|
||||
--
|
||||
-- Host: ".$db->db->host_info." Database: ".$db->database_name."
|
||||
-- ------------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user