Completed
Pull Request — master (#588)
by Henry
06:28
created

Status::autorun()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 9.8333
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
namespace Redaxscript\Bootstrap;
3
4
use Redaxscript\Auth as BaseAuth;
5
use Redaxscript\Db;
6
7
/**
8
 * children class to boot the status
9
 *
10
 * @since 3.1.0
11
 *
12
 * @package Redaxscript
13
 * @category Bootstrap
14
 * @author Henry Ruhs
15
 */
16
17
class Status extends BootstrapAbstract
18
{
19
	/**
20
	 * automate run
21
	 *
22
	 * @since 3.1.0
23
	 */
24
25 2
	public function autorun()
26
	{
27 2
		$auth = new BaseAuth($this->_request);
28
29
		/* set the registry */
30
31 2
		if ($auth->getStatus())
32
		{
33 1
			$this->_registry->set('loggedIn', $this->_registry->get('token'));
34 1
			$this->_registry->set('authStatus', $auth->getStatus());
35
		}
36 2
		$this->_registry->set('dbStatus', Db::getStatus());
37 2
	}
38
}
39