Passed
Push — master ( ed3a21...c78a04 )
by Guido
06:24
created

Index::opcache()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
c 1
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
namespace Gvera\Controllers;
3
4
use Gvera\Cache\Cache;
5
use Gvera\Helpers\http\JSONResponse;
6
7
/**
8
 * Controller Class Doc Comment
9
 *
10
 * @category Class
11
 * @package  Controllers
12
 * @author   Guido Vera <[email protected]>
13
 * @license  http://www.gnu.org/copyleft/gpl.html GNU General Public License
14
 * @link     http://www.github.com/veraguido/gv
15
 */
16
class Index extends GvController
17
{
18
    public function index()
19
    {
20
        $welcomeJson = [
21
            'gv' => ["Hello there :)"]
22
            ];
23
        $this->httpResponse->response(new JSONResponse($welcomeJson));
24
    }
25
26
    public function cacheType()
27
    {
28
        $this->httpResponse->response(new JSONResponse(["cache" => get_class(Cache::getCache())]));
29
    }
30
31
    public function opcache()
32
    {
33
        $this->httpResponse->response(new JSONResponse(["opcache_enabled" => opcache_get_status()['opcache_enabled']]));
34
    }
35
}
36