Completed
Push — code-style-fixes ( e74773 )
by
unknown
24:44
created

Application::__construct()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 2

Importance

Changes 6
Bugs 2 Features 3
Metric Value
c 6
b 2
f 3
dl 0
loc 14
ccs 12
cts 12
cp 1
rs 9.4285
cc 2
eloc 11
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * ownCloud - mail
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author Thomas Müller <[email protected]>
9
 * @copyright Thomas Müller 2014
10
 */
11
12
namespace OCA\Mail\AppInfo;
13
14
use \OCP\AppFramework\App;
15
16
class Application extends App {
17
18 1
	public function __construct (array $urlParams=array()) {
19 1
		parent::__construct('mail', $urlParams);
20
21 1
		$container = $this->getContainer();
22 1
		$transport = $container->getServer()->getConfig()->getSystemValue('app.mail.transport', 'smtp');
23 1
		$testSmtp = $transport === 'smtp';
24
25 1
		$user = $container->query("UserId");
26 1
		$container->registerParameter("appName", "mail");
27 1
		$container->registerParameter("userFolder", $container->getServer()->getUserFolder($user));
28 1
		$container->registerParameter("testSmtp", $testSmtp);
29 1
		$container->registerParameter("referrer", isset($_SERVER['HTTP_REFERER']) ? : null);
30 1
		$container->registerParameter("hostname", \OCP\Util::getServerHostName());
31 1
	}
32
33
}
34