Remove unused and deprecated methods from OCP\Util

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2018-03-12 14:37:02 +01:00
parent af89db3407
commit e1d95974bf
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
2 changed files with 1 additions and 102 deletions

View File

@ -125,7 +125,7 @@ interface IServerContainer extends IContainer {
* *
* @return \OCP\Files\Folder * @return \OCP\Files\Folder
* @since 6.0.0 * @since 6.0.0
* @deprecated since 9.2.0 use IAppData * @deprecated 9.2.0 use IAppData
*/ */
public function getAppFolder(); public function getAppFolder();

View File

@ -94,56 +94,6 @@ class Util {
return \OC_Util::getChannel(); return \OC_Util::getChannel();
} }
/**
* send an email
* @param string $toaddress
* @param string $toname
* @param string $subject
* @param string $mailtext
* @param string $fromaddress
* @param string $fromname
* @param int $html
* @param string $altbody
* @param string $ccaddress
* @param string $ccname
* @param string $bcc
* @deprecated 8.1.0 Use \OCP\Mail\IMailer instead
* @since 4.0.0
*/
public static function sendMail($toaddress, $toname, $subject, $mailtext, $fromaddress, $fromname,
$html = 0, $altbody = '', $ccaddress = '', $ccname = '', $bcc = '') {
$mailer = \OC::$server->getMailer();
$message = $mailer->createMessage();
$message->setTo([$toaddress => $toname]);
$message->setSubject($subject);
$message->setPlainBody($mailtext);
$message->setFrom([$fromaddress => $fromname]);
if($html === 1) {
$message->setHtmlBody($altbody);
}
if($altbody === '') {
$message->setHtmlBody($mailtext);
$message->setPlainBody('');
} else {
$message->setHtmlBody($mailtext);
$message->setPlainBody($altbody);
}
if(!empty($ccaddress)) {
if(!empty($ccname)) {
$message->setCc([$ccaddress => $ccname]);
} else {
$message->setCc([$ccaddress]);
}
}
if(!empty($bcc)) {
$message->setBcc([$bcc]);
}
$mailer->send($message);
}
/** /**
* write a message in the log * write a message in the log
* @param string $app * @param string $app
@ -243,17 +193,6 @@ class Util {
\OC_Util::addHeader($tag, $attributes, $text); \OC_Util::addHeader($tag, $attributes, $text);
} }
/**
* check if some encrypted files are stored
* @return bool
*
* @deprecated 8.1.0 No longer required
* @since 6.0.0
*/
public static function encryptedFiles() {
return false;
}
/** /**
* Creates an absolute url to the given app and file. * Creates an absolute url to the given app and file.
* @param string $app app * @param string $app app
@ -321,16 +260,6 @@ class Util {
return \OC::$server->getURLGenerator()->linkTo($app, $file, $args); return \OC::$server->getURLGenerator()->linkTo($app, $file, $args);
} }
/**
* Returns the server host, even if the website uses one or more reverse proxy
* @return string the server host
* @deprecated 8.1.0 Use \OCP\IRequest::getServerHost
* @since 4.0.0
*/
public static function getServerHost() {
return \OC::$server->getRequest()->getServerHost();
}
/** /**
* Returns the server host name without an eventual port number * Returns the server host name without an eventual port number
* @return string the server hostname * @return string the server hostname
@ -378,36 +307,6 @@ class Util {
return $user_part.'@localhost.localdomain'; return $user_part.'@localhost.localdomain';
} }
/**
* Returns the server protocol. It respects reverse proxy servers and load balancers
* @return string the server protocol
* @deprecated 8.1.0 Use \OCP\IRequest::getServerProtocol
* @since 4.5.0
*/
public static function getServerProtocol() {
return \OC::$server->getRequest()->getServerProtocol();
}
/**
* Returns the request uri, even if the website uses one or more reverse proxies
* @return string the request uri
* @deprecated 8.1.0 Use \OCP\IRequest::getRequestUri
* @since 5.0.0
*/
public static function getRequestUri() {
return \OC::$server->getRequest()->getRequestUri();
}
/**
* Returns the script name, even if the website uses one or more reverse proxies
* @return string the script name
* @deprecated 8.1.0 Use \OCP\IRequest::getScriptName
* @since 5.0.0
*/
public static function getScriptName() {
return \OC::$server->getRequest()->getScriptName();
}
/** /**
* Creates path to an image * Creates path to an image
* @param string $app app * @param string $app app