From 1c1c77e28d37fc506e1322907dd02a72b8203ade Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 9 Oct 2012 19:11:31 +0200 Subject: [PATCH] Fix missing container in FTP tasks --- lib/classes/task/databoxAbstract.class.php | 2 +- lib/classes/task/period/ftp.class.php | 10 +++++----- lib/classes/task/period/ftpPull.class.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/classes/task/databoxAbstract.class.php b/lib/classes/task/databoxAbstract.class.php index 5992ff9f3e..d274e39c99 100755 --- a/lib/classes/task/databoxAbstract.class.php +++ b/lib/classes/task/databoxAbstract.class.php @@ -81,7 +81,7 @@ abstract class task_databoxAbstract extends task_abstract } $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 { // get the records to process diff --git a/lib/classes/task/period/ftp.class.php b/lib/classes/task/period/ftp.class.php index 4a40c402cf..872a630bbc 100755 --- a/lib/classes/task/period/ftp.class.php +++ b/lib/classes/task/period/ftp.class.php @@ -350,7 +350,7 @@ class task_period_ftp extends task_appboxAbstract try { $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); 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"' . ' (Export du Document) : Transfert cancelled (le document n\'existe plus)') , basename($localfile), $record_id - , phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $base_id), $app)) . "\n
"; + , phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $base_id), $this->dependencyContainer)) . "\n
"; $this->logger->addDebug($line); @@ -621,13 +621,13 @@ class task_period_ftp extends task_appboxAbstract $transferts[] = '
  • ' . sprintf(_('task::ftp:Record %1$s - %2$s de la base (%3$s - %4$s) - %5$s') , $row["record_id"], $row["filename"] - , phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $row["base_id"]), $app) - , phrasea::bas_names($row['base_id'], $app), $row['subdef']) . ' : ' . _('Transfert OK') . '
  • '; + , phrasea::sbas_names(phrasea::sbasFromBas($this->dependencyContainer, $row["base_id"]), $this->dependencyContainer) + , phrasea::bas_names($row['base_id'], $this->dependencyContainer), $row['subdef']) . ' : ' . _('Transfert OK') . ''; } else { $transferts[] = '
  • ' . sprintf(_('task::ftp:Record %1$s - %2$s de la base (%3$s - %4$s) - %5$s') , $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') . '
  • '; $transfert_status = _('task::ftp:Certains documents n\'ont pas pu etre tranferes'); } diff --git a/lib/classes/task/period/ftpPull.class.php b/lib/classes/task/period/ftpPull.class.php index 555c0db8b1..4b950d9019 100755 --- a/lib/classes/task/period/ftpPull.class.php +++ b/lib/classes/task/period/ftpPull.class.php @@ -300,7 +300,7 @@ class task_period_ftpPull extends task_appboxAbstract } 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->chdir($this->ftppath); $list_1 = $ftp->list_directory(true);