mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Merge master fix
This commit is contained in:
@@ -264,6 +264,7 @@ class task_period_ftp extends task_appboxAbstract
|
|||||||
|
|
||||||
protected $proxy;
|
protected $proxy;
|
||||||
protected $proxyport;
|
protected $proxyport;
|
||||||
|
protected $debug;
|
||||||
|
|
||||||
protected function load_settings(SimpleXMLElement $sx_task_settings)
|
protected function load_settings(SimpleXMLElement $sx_task_settings)
|
||||||
{
|
{
|
||||||
@@ -279,12 +280,10 @@ class task_period_ftp extends task_appboxAbstract
|
|||||||
{
|
{
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
|
||||||
$proxyport = $proxy = $time2sleep = null;
|
$time2sleep = null;
|
||||||
$ftp_exports = array();
|
$ftp_exports = array();
|
||||||
|
|
||||||
$period = $this->period;
|
$period = $this->period;
|
||||||
$proxy = $this->proxy;
|
|
||||||
$proxyport = $this->proxyport;
|
|
||||||
$time2sleep = (int) ($period);
|
$time2sleep = (int) ($period);
|
||||||
|
|
||||||
$sql = "SELECT id FROM ftp_export WHERE crash>=nbretry
|
$sql = "SELECT id FROM ftp_export WHERE crash>=nbretry
|
||||||
@@ -343,6 +342,7 @@ class task_period_ftp extends task_appboxAbstract
|
|||||||
protected function process_one_content(appbox $appbox, Array $ftp_export)
|
protected function process_one_content(appbox $appbox, Array $ftp_export)
|
||||||
{
|
{
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
$registry = $appbox->get_registry();
|
||||||
|
|
||||||
$id = $ftp_export['id'];
|
$id = $ftp_export['id'];
|
||||||
$ftp_export[$id]["crash"] = $ftp_export["crash"];
|
$ftp_export[$id]["crash"] = $ftp_export["crash"];
|
||||||
@@ -366,7 +366,7 @@ class task_period_ftp extends task_appboxAbstract
|
|||||||
, $ftp_export["destfolder"]
|
, $ftp_export["destfolder"]
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($debug)
|
if ($this->debug)
|
||||||
echo $line;
|
echo $line;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +376,7 @@ class task_period_ftp extends task_appboxAbstract
|
|||||||
, " (" . date('r') . ")"
|
, " (" . date('r') . ")"
|
||||||
) . PHP_EOL;
|
) . PHP_EOL;
|
||||||
|
|
||||||
if ($debug)
|
if ($this->debug)
|
||||||
echo $line;
|
echo $line;
|
||||||
|
|
||||||
if (($ses_id = phrasea_create_session($usr_id)) == null)
|
if (($ses_id = phrasea_create_session($usr_id)) == null)
|
||||||
@@ -395,7 +395,7 @@ class task_period_ftp extends task_appboxAbstract
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
$ssl = ($ftp_export['ssl'] == '1');
|
$ssl = ($ftp_export['ssl'] == '1');
|
||||||
$ftp_client = new ftpclient($ftp_server, 21, 300, $ssl, $proxy, $proxyport);
|
$ftp_client = new ftpclient($ftp_server, 21, 300, $ssl, $this->proxy, $this->proxyport);
|
||||||
$ftp_client->login($ftp_user_name, $ftp_user_pass);
|
$ftp_client->login($ftp_user_name, $ftp_user_pass);
|
||||||
|
|
||||||
if ($ftp_export["passif"] == "1")
|
if ($ftp_export["passif"] == "1")
|
||||||
@@ -550,7 +550,7 @@ class task_period_ftp extends task_appboxAbstract
|
|||||||
, basename($localfile), $record_id
|
, basename($localfile), $record_id
|
||||||
, phrasea::sbas_names(phrasea::sbasFromBas($base_id))) . "\n<br/>";
|
, phrasea::sbas_names(phrasea::sbasFromBas($base_id))) . "\n<br/>";
|
||||||
|
|
||||||
if ($debug)
|
if ($this->debug)
|
||||||
echo $line;
|
echo $line;
|
||||||
|
|
||||||
$done = $file['error'];
|
$done = $file['error'];
|
||||||
@@ -561,7 +561,6 @@ class task_period_ftp extends task_appboxAbstract
|
|||||||
$stmt->execute(array(':done' => $done, ':file_id' => $file['id']));
|
$stmt->execute(array(':done' => $done, ':file_id' => $file['id']));
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
}
|
}
|
||||||
$done++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ftp_client->close();
|
$ftp_client->close();
|
||||||
@@ -571,7 +570,7 @@ class task_period_ftp extends task_appboxAbstract
|
|||||||
{
|
{
|
||||||
$state .= $line = $e . "\n";
|
$state .= $line = $e . "\n";
|
||||||
|
|
||||||
if ($debug)
|
if ($this->debug)
|
||||||
echo $line;
|
echo $line;
|
||||||
|
|
||||||
$sql = "UPDATE ftp_export SET crash=crash+1,date=now()
|
$sql = "UPDATE ftp_export SET crash=crash+1,date=now()
|
||||||
|
Reference in New Issue
Block a user