Work on POO optimize
This commit is contained in:
parent
4772e51d12
commit
fce53afce4
@ -83,7 +83,6 @@ if ($_GET["msg"])
|
|||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Dump of a server -->
|
<!-- Dump of a server -->
|
||||||
@ -100,7 +99,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 ($db::$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" />
|
||||||
@ -113,7 +112,7 @@ if ($_GET["msg"])
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($db->label == 'PostgreSQL')
|
else if ($db::$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" />
|
||||||
@ -123,7 +122,7 @@ if ($_GET["msg"])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print 'No method available with database '.$db->label;
|
print 'No method available with database '.$db::$label;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@ -135,7 +134,7 @@ if ($_GET["msg"])
|
|||||||
|
|
||||||
<div id="div_container_sub_exportoptions">
|
<div id="div_container_sub_exportoptions">
|
||||||
<?php
|
<?php
|
||||||
if ($db->label == 'MySQL')
|
if ($db::$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>
|
||||||
@ -218,7 +217,7 @@ if ($_GET["msg"])
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($db->label == 'PostgreSQL')
|
if ($db::$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>
|
||||||
@ -282,8 +281,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 ($db::$label == 'MySQL') $prefix='mysqldump';
|
||||||
if ($db->label == 'PostgreSQL') $prefix='pg_dump';
|
if ($db::$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>
|
||||||
@ -297,7 +296,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 ($db::$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"));
|
||||||
}
|
}
|
||||||
@ -331,10 +330,10 @@ print "\n";
|
|||||||
?></fieldset>
|
?></fieldset>
|
||||||
|
|
||||||
|
|
||||||
<center><input type="submit" class="button"
|
<div align="center"><input type="submit" class="button"
|
||||||
value="<?php echo $langs->trans("GenerateBackup") ?>" id="buttonGo" /><br>
|
value="<?php echo $langs->trans("GenerateBackup") ?>" id="buttonGo" /><br>
|
||||||
<br>
|
<br>
|
||||||
</center>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -69,7 +69,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 ($db::$label == 'MySQL')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<div class="formelementrow">
|
<div class="formelementrow">
|
||||||
@ -78,7 +78,7 @@ print $langs->trans("RestoreDesc3",DOL_DATA_ROOT).'<br><br>';
|
|||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else if ($db->label == 'PostgreSQL')
|
else if ($db::$label == 'PostgreSQL')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<div class="formelementrow">
|
<div class="formelementrow">
|
||||||
@ -89,7 +89,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 '.$db::$label;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@ -101,7 +101,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 ($db::$label == 'MySQL')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<fieldset id="mysql_options">
|
<fieldset id="mysql_options">
|
||||||
@ -135,7 +135,7 @@ if ($db->label == 'MySQL')
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else if ($db->label == 'PostgreSQL')
|
else if ($db::$label == 'PostgreSQL')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<fieldset id="postgresql_options">
|
<fieldset id="postgresql_options">
|
||||||
|
|||||||
@ -208,7 +208,7 @@ if ($what == 'mysql')
|
|||||||
@dol_delete_file($outputerror,1);
|
@dol_delete_file($outputerror,1);
|
||||||
@rename($outputfile,$outputerror);
|
@rename($outputfile,$outputerror);
|
||||||
// Si safe_mode on et command hors du parametre exec, on a un fichier out vide donc errormsg vide
|
// Si safe_mode on et command hors du parametre exec, on a un fichier out vide donc errormsg vide
|
||||||
if (! $errormsg)
|
if (! $errormsg)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errormsg=$langs->trans("ErrorFailedToRunExternalCommand");
|
$errormsg=$langs->trans("ErrorFailedToRunExternalCommand");
|
||||||
@ -395,7 +395,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 .= "-- ".$db::$label." dump via php
|
||||||
--
|
--
|
||||||
-- Host: ".$db->db->host_info." Database: ".$db->database_name."
|
-- Host: ".$db->db->host_info." Database: ".$db->database_name."
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class DoliDBMssql
|
|||||||
//! Database handler
|
//! Database handler
|
||||||
var $db;
|
var $db;
|
||||||
//! Database type
|
//! Database type
|
||||||
static $type='mssql';
|
public $type='mssql';
|
||||||
//! Database label
|
//! Database label
|
||||||
static $label='MSSQL';
|
static $label='MSSQL';
|
||||||
//! Charset used to force charset when creating database
|
//! Charset used to force charset when creating database
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class DoliDBMysql
|
|||||||
//! Database handler
|
//! Database handler
|
||||||
var $db;
|
var $db;
|
||||||
//! Database type
|
//! Database type
|
||||||
static $type='mysql';
|
public $type='mysql';
|
||||||
//! Database label
|
//! Database label
|
||||||
static $label='MySQL';
|
static $label='MySQL';
|
||||||
//! Charset used to force charset when creating database
|
//! Charset used to force charset when creating database
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class DoliDBMysqli
|
|||||||
//! Database handler
|
//! Database handler
|
||||||
var $db;
|
var $db;
|
||||||
//! Database type
|
//! Database type
|
||||||
static $type='mysqli';
|
public $type='mysqli';
|
||||||
//! Database label
|
//! Database label
|
||||||
static $label='MySQL';
|
static $label='MySQL';
|
||||||
//! Charset used to force charset when creating database
|
//! Charset used to force charset when creating database
|
||||||
|
|||||||
@ -32,8 +32,11 @@
|
|||||||
*/
|
*/
|
||||||
class DoliDBPgsql
|
class DoliDBPgsql
|
||||||
{
|
{
|
||||||
var $db; // Database handler
|
//! Database handler
|
||||||
static $type='pgsql'; // Name of manager
|
var $db;
|
||||||
|
//! Database type
|
||||||
|
public $type='pgsql'; // Name of manager
|
||||||
|
//! Database label
|
||||||
static $label='PostgreSQL'; // Label of manager
|
static $label='PostgreSQL'; // Label of manager
|
||||||
//! Charset
|
//! Charset
|
||||||
static $forcecharset='latin1';
|
static $forcecharset='latin1';
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class DoliDBSqlite
|
|||||||
//! Database handler
|
//! Database handler
|
||||||
var $db;
|
var $db;
|
||||||
//! Database type
|
//! Database type
|
||||||
static $type='sqlite';
|
public $type='sqlite';
|
||||||
//! Database label
|
//! Database label
|
||||||
static $label='Sqlite';
|
static $label='Sqlite';
|
||||||
//! Charset used to force charset when creating database
|
//! Charset used to force charset when creating database
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user