diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-08-18 10:47:49 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-08-23 19:44:04 +0200 |
commit | 9b8ca9ad1f3df5d32df241d8848c8dc92c9a1fc2 (patch) | |
tree | 72aa5edaaa4b3c3ded5931c6914988ac9dce9467 /lib/private/Mail | |
parent | 604c1752845df068a7dd5d168abfbfc04065ac3f (diff) | |
download | nextcloud-server-9b8ca9ad1f3df5d32df241d8848c8dc92c9a1fc2.tar.gz nextcloud-server-9b8ca9ad1f3df5d32df241d8848c8dc92c9a1fc2.zip |
Move findBinaryFinder and isFunctionEnabled away from OC_Helper
findBinaryFinder is now a service that is still private but with some
minor optimization (remove the hasKey check).
isFunctionEnabled is now in OCP\Util
Both function are still keep but all internal usage in nextcloud/server
were migrated to the new usage, so that we can remove it in 26
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib/private/Mail')
-rw-r--r-- | lib/private/Mail/Mailer.php | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index 991d1b202ec..d0c3b04eacb 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -39,6 +39,7 @@ use Egulias\EmailValidator\EmailValidator; use Egulias\EmailValidator\Validation\RFCValidation; use OCP\Defaults; use OCP\EventDispatcher\IEventDispatcher; +use OCP\IBinaryFinder; use OCP\IConfig; use OCP\IL10N; use OCP\IURLGenerator; @@ -71,19 +72,14 @@ use Psr\Log\LoggerInterface; class Mailer implements IMailer { /** @var \Swift_Mailer Cached mailer */ private $instance = null; - /** @var IConfig */ - private $config; + private IConfig $config; private LoggerInterface $logger; /** @var Defaults */ private $defaults; - /** @var IURLGenerator */ - private $urlGenerator; - /** @var IL10N */ - private $l10n; - /** @var IEventDispatcher */ - private $dispatcher; - /** @var IFactory */ - private $l10nFactory; + private IURLGenerator $urlGenerator; + private IL10N $l10n; + private IEventDispatcher $dispatcher; + private IFactory $l10nFactory; public function __construct(IConfig $config, LoggerInterface $logger, @@ -309,7 +305,7 @@ class Mailer implements IMailer { $binaryPath = '/var/qmail/bin/sendmail'; break; default: - $sendmail = \OC_Helper::findBinaryPath('sendmail'); + $sendmail = \OCP\Server::get(IBinaryFinder::class)->findBinaryPath('sendmail'); if ($sendmail === null) { $sendmail = '/usr/sbin/sendmail'; } |