7
7
use Chell \Controllers \ErrorController ;
8
8
use Chell \Exceptions \ChellException ;
9
9
use Chell \Messages \TranslatorWrapper ;
10
- use Chell \Models \Settings ;
11
- use Chell \Models \SettingsCategory ;
12
10
use Chell \Models \SettingsContainer ;
13
11
use Chell \Plugins \SecurityPlugin ;
14
12
@@ -108,6 +106,9 @@ function dump($dump)
108
106
$ this ->setTranslator ();
109
107
}
110
108
109
+ /**
110
+ * Initializes PHP exception handler to Chell's custom handler.
111
+ */
111
112
private function setExceptionHandler ()
112
113
{
113
114
set_exception_handler ([&$ this , 'ExceptionHandler ' ]);
@@ -130,6 +131,9 @@ public function ExceptionHandler(Throwable $exception)
130
131
new ErrorController (new ChellException ($ exception ));
131
132
}
132
133
134
+ /**
135
+ * Sets Phalcon's dispatcher and a beforeExecuteRoute to setup the SecurityPlugin, which enforces logins.
136
+ */
133
137
private function setDispatcher ()
134
138
{
135
139
$ this ->di ->set ('dispatcher ' , function () {
@@ -144,6 +148,9 @@ private function setDispatcher()
144
148
});
145
149
}
146
150
151
+ /**
152
+ * Sets up Phalcon's crypt, whith the in settings defined crypt key. Used for encrypting/decrypting password for example.
153
+ */
147
154
private function setCrypt ()
148
155
{
149
156
$ settings = $ this ->settings ;
@@ -180,10 +187,10 @@ private function registerNamespaces()
180
187
'Chell\Models ' => APP_PATH . 'app/models/ ' ,
181
188
'Chell\Models\Kodi ' => APP_PATH . 'app/models/kodi/ ' ,
182
189
'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/ '
187
194
])->register ();
188
195
}
189
196
0 commit comments