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