3 namespace Shaarli\Api\Controllers
;
5 use Shaarli\Bookmark\BookmarkServiceInterface
;
6 use Shaarli\Config\ConfigManager
;
11 * Abstract Class ApiController
13 * Defines REST API Controller dependencies injected from the container.
15 * @package Api\Controllers
17 abstract class ApiController
30 * @var BookmarkServiceInterface
32 protected $bookmarkService;
40 * @var int|null JSON style option.
45 * ApiController constructor.
47 * Note: enabling debug mode displays JSON with readable formatting.
49 * @param Container $ci Slim container.
51 public function __construct(Container
$ci)
54 $this->conf
= $ci->get('conf');
55 $this->bookmarkService
= $ci->get('db');
56 $this->history
= $ci->get('history');
57 if ($this->conf
->get('dev.debug', false)) {
58 $this->jsonStyle
= JSON_PRETTY_PRINT
;
60 $this->jsonStyle
= null;
69 public function getCi()