Fix missing container in FTP tasks

This commit is contained in:
Nicolas Le Goff
2012-10-09 19:11:31 +02:00
parent 8710e0f3cb
commit 1c1c77e28d
3 changed files with 7 additions and 7 deletions

View File

@@ -81,7 +81,7 @@ abstract class task_databoxAbstract extends task_abstract
} }
$this->sbas_id = (int) $row['sbas_id']; $this->sbas_id = (int) $row['sbas_id'];
$this->log('This task works now on ' . phrasea::sbas_names($this->sbas_id, $app)); $this->log('This task works now on ' . phrasea::sbas_names($this->sbas_id, $this->dependencyContainer));
try { try {
// get the records to process // get the records to process

View File

@@ -350,7 +350,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, $this->proxy, $this->proxyport); $ftp_client = $this->dependencyContainer['phraseanet.ftp.client']($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") {
@@ -471,7 +471,7 @@ class task_period_ftp extends task_appboxAbstract
$state .= $line = sprintf(_('task::ftp:File "%1$s" (record %2$s) de la base "%3$s"' . $state .= $line = sprintf(_('task::ftp:File "%1$s" (record %2$s) de la base "%3$s"' .
' (Export du Document) : Transfert cancelled (le document n\'existe plus)') ' (Export du Document) : Transfert cancelled (le document n\'existe plus)')
, basename($localfile), $record_id , basename($localfile), $record_id
, phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $base_id), $app)) . "\n<br/>"; , phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $base_id), $this->dependencyContainer)) . "\n<br/>";
$this->logger->addDebug($line); $this->logger->addDebug($line);
@@ -621,13 +621,13 @@ class task_period_ftp extends task_appboxAbstract
$transferts[] = $transferts[] =
'<li>' . sprintf(_('task::ftp:Record %1$s - %2$s de la base (%3$s - %4$s) - %5$s') '<li>' . sprintf(_('task::ftp:Record %1$s - %2$s de la base (%3$s - %4$s) - %5$s')
, $row["record_id"], $row["filename"] , $row["record_id"], $row["filename"]
, phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $row["base_id"]), $app) , phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $row["base_id"]), $this->dependencyContainer)
, phrasea::bas_names($row['base_id'], $app), $row['subdef']) . ' : ' . _('Transfert OK') . '</li>'; , phrasea::bas_names($row['base_id'], $this->dependencyContainer), $row['subdef']) . ' : ' . _('Transfert OK') . '</li>';
} else { } else {
$transferts[] = $transferts[] =
'<li>' . sprintf(_('task::ftp:Record %1$s - %2$s de la base (%3$s - %4$s) - %5$s') '<li>' . sprintf(_('task::ftp:Record %1$s - %2$s de la base (%3$s - %4$s) - %5$s')
, $row["record_id"], $row["filename"] , $row["record_id"], $row["filename"]
, phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $row["base_id"]), $app), phrasea::bas_names($row['base_id'], $app) , phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $row["base_id"]), $this->dependencyContainer), phrasea::bas_names($row['base_id'], $this->dependencyContainer)
, $row['subdef']) . ' : ' . _('Transfert Annule') . '</li>'; , $row['subdef']) . ' : ' . _('Transfert Annule') . '</li>';
$transfert_status = _('task::ftp:Certains documents n\'ont pas pu etre tranferes'); $transfert_status = _('task::ftp:Certains documents n\'ont pas pu etre tranferes');
} }

View File

@@ -300,7 +300,7 @@ class task_period_ftpPull extends task_appboxAbstract
} }
try { try {
$ftp = new ftpclient($this->host, $port, 90, $this->ssl, $this->proxy, $this->proxyport); $ftp = $this->dependencyContainer['phraseanet.ftp.client']($this->host, $this->port, 90, $this->ssl, $this->proxy, $this->proxyport);
$ftp->login($this->user, $this->password); $ftp->login($this->user, $this->password);
$ftp->chdir($this->ftppath); $ftp->chdir($this->ftppath);
$list_1 = $ftp->list_directory(true); $list_1 = $ftp->list_directory(true);