77use Chell \Controllers \ErrorController ;
88use Chell \Exceptions \ChellException ;
99use Chell \Messages \TranslatorWrapper ;
10- use Chell \Models \Settings ;
11- use Chell \Models \SettingsCategory ;
1210use Chell \Models \SettingsContainer ;
1311use Chell \Plugins \SecurityPlugin ;
1412
@@ -108,6 +106,9 @@ function dump($dump)
108106 $ this ->setTranslator ();
109107 }
110108
109+ /**
110+ * Initializes PHP exception handler to Chell's custom handler.
111+ */
111112 private function setExceptionHandler ()
112113 {
113114 set_exception_handler ([&$ this , 'ExceptionHandler ' ]);
@@ -130,6 +131,9 @@ public function ExceptionHandler(Throwable $exception)
130131 new ErrorController (new ChellException ($ exception ));
131132 }
132133
134+ /**
135+ * Sets Phalcon's dispatcher and a beforeExecuteRoute to setup the SecurityPlugin, which enforces logins.
136+ */
133137 private function setDispatcher ()
134138 {
135139 $ this ->di ->set ('dispatcher ' , function () {
@@ -144,6 +148,9 @@ private function setDispatcher()
144148 });
145149 }
146150
151+ /**
152+ * Sets up Phalcon's crypt, whith the in settings defined crypt key. Used for encrypting/decrypting password for example.
153+ */
147154 private function setCrypt ()
148155 {
149156 $ settings = $ this ->settings ;
@@ -180,10 +187,10 @@ private function registerNamespaces()
180187 'Chell\Models ' => APP_PATH . 'app/models/ ' ,
181188 'Chell\Models\Kodi ' => APP_PATH . 'app/models/kodi/ ' ,
182189 'Chell\Plugins ' => APP_PATH . 'app/plugins/ ' ,
183- 'Duo ' => APP_PATH . 'app/vendor/duo / ' ,
184- 'Davidearl\WebAuthn ' => APP_PATH . 'app/vendor/WebAuthn/ ' ,
185- 'CBOR ' => APP_PATH . 'app/vendor/CBOR/ ' ,
186- 'phpseclib ' => APP_PATH . 'app/vendor/phpseclib/ '
190+ 'Duo ' => APP_PATH . 'app/vendor/duosecurity/duo_php/src / ' ,
191+ 'Davidearl\WebAuthn ' => APP_PATH . 'app/vendor/davidearl/webauthn/WebAuthn ' ,
192+ 'CBOR ' => APP_PATH . 'app/vendor/2tvenom/cborencode/src ' ,
193+ 'phpseclib ' => APP_PATH . 'app/vendor/phpseclib/phpseclib/phpseclib/ '
187194 ])->register ();
188195 }
189196
0 commit comments