3 namespace Shaarli\Api\Controllers
;
5 use Shaarli\Config\ConfigManager
;
9 * Abstract Class ApiController
11 * Defines REST API Controller dependencies injected from the container.
13 * @package Api\Controllers
15 abstract class ApiController
28 * @var \Shaarli\Bookmark\LinkDB
33 * @var \Shaarli\History
38 * @var int|null JSON style option.
43 * ApiController constructor.
45 * Note: enabling debug mode displays JSON with readable formatting.
47 * @param Container $ci Slim container.
49 public function __construct(Container
$ci)
52 $this->conf
= $ci->get('conf');
53 $this->linkDb
= $ci->get('db');
54 $this->history
= $ci->get('history');
55 if ($this->conf
->get('dev.debug', false)) {
56 $this->jsonStyle
= JSON_PRETTY_PRINT
;
58 $this->jsonStyle
= null;
67 public function getCi()