#0 | Phalcon\Translate\Adapter\NativeArray->__construct |
#1 | Phalcon\Translate\TranslateFactory->newInstance /var/www/htdocs/app/components/Language.php (41) <?PHP namespace LOID\Component; class Language extends \Phalcon\Di\Injectable{ // Keyed by language name, values are file names private static $languages; private static $language; private static $language_file = NULL; public static function getPreferredLanguage(){ // Get the language from the session if(\Phalcon\DI::getDefault()->getSession()->get('language')){ $language = \Phalcon\DI::getDefault()->getSession()->get('language'); } else{ // Get the language from the browser $language = self::removePreferredDialect(\Phalcon\DI::getDefault()->getRequest()->getBestLanguage()); } if(self::langFileExists($language)) self::$language_file = self::$languages[$language]; else self::$language_file = self::$languages[\Phalcon\DI::getDefault()->getConfig()->language_default]; self::$language = $language; \Phalcon\DI::getDefault()->getSession()->set('language',$language); } public static function getTranslator(){ if(self::$language_file == NULL) self::getPreferredLanguage(); $Interpolator = new \Phalcon\Translate\InterpolatorFactory; $Factory = new \Phalcon\Translate\TranslateFactory($Interpolator); $messages = []; $messages = include \Phalcon\DI::getDefault()->getConfig()->dirs->languages.'/'.self::$language_file; $options = [ 'content'=>$messages ]; $Translator = $Factory->newInstance('array',$options); return $Translator; // $messages = new \Phalcon\Translate\Adapter\NativeArray([ // 'content'=>include(\Phalcon\DI::getDefault()->getConfig()->dirs->languages.'/'.self::$language_file) // ]); // return $messages; } public static function getLanguage(){ return self::$language; } public static function setLanguage($language){ \Phalcon\DI::getDefault()->getSession()->set('language',$language); self::getPreferredLanguage(); } /* Retrieves all available language files * Saves self::$languages as an array keyed by language name, valued by filenames * Anything before the first period is used as the language name: * So: en.php = en // OK * en-US.php = en-US // OK * en.US.php = en // Probably not OK */ private static function getAvailableLanguages(){ $langs = []; chdir(\Phalcon\DI::getDefault()->getConfig()->dirs->languages); $files = glob('*'); foreach($files as $filename){ $lang = substr($filename,0,strpos($filename,'.')); $langs[$lang] = $filename; } self::$languages = $langs; } /* Simply checks if a corresponding language file exists */ private static function langFileExists($language){ self::getAvailableLanguages(); return isset(self::$languages[$language]); } /* Strips any dialect (ie: en-US - removes "-US") from the preferred language */ private static function removePreferredDialect($language_name){ list($language,$dialect) = explode('-',$language_name); return $language; } } |
#2 | LOID\Component\Language::getTranslator /var/www/htdocs/app/controllers/ControllerBase.php (44) <?php /* * This controller isn't intended to be called when the /base/ URL is visited, * Rather it's a base class other controllers extend */ use LOID\Component\Feedback, LOID\Model\User; class ControllerBase extends \Phalcon\Mvc\Controller{ protected $loadFeedback = TRUE; public function beforeExecuteRoute(){ // Feedback is singleton, so view assignment can be done here // and errors added later will still be accessible in the view if($this->loadFeedback){ Feedback::get()->getFlashedMessages(); $this->view->Feedback = Feedback::get(); } if($this->request->isPost()){ if(!$this->csrf->checkToken()){ exit('CSRF token not set'); } } $this->view->csrf_key = $this->csrf->getTokenKey(); $this->view->csrf_value = $this->csrf->getToken(); if($this->session->has('authenticated')) $this->LoggedInUser = $this->view->LoggedInUser = User::findFirstByKey($this->session->get('username')); // Add the translator $this->setLanguage(); } public function setLanguage($language = NULL){ if($language != NULL){ \LOID\Component\Language::setLanguage($language); } $Translator = \LOID\Component\Language::getTranslator(); $this->view->t = $Translator; $this->Translator = $Translator; $this->view->language = \LOID\Component\Language::getLanguage(); } } |
#3 | ControllerBase->setLanguage /var/www/htdocs/app/controllers/ControllerBase.php (36) <?php /* * This controller isn't intended to be called when the /base/ URL is visited, * Rather it's a base class other controllers extend */ use LOID\Component\Feedback, LOID\Model\User; class ControllerBase extends \Phalcon\Mvc\Controller{ protected $loadFeedback = TRUE; public function beforeExecuteRoute(){ // Feedback is singleton, so view assignment can be done here // and errors added later will still be accessible in the view if($this->loadFeedback){ Feedback::get()->getFlashedMessages(); $this->view->Feedback = Feedback::get(); } if($this->request->isPost()){ if(!$this->csrf->checkToken()){ exit('CSRF token not set'); } } $this->view->csrf_key = $this->csrf->getTokenKey(); $this->view->csrf_value = $this->csrf->getToken(); if($this->session->has('authenticated')) $this->LoggedInUser = $this->view->LoggedInUser = User::findFirstByKey($this->session->get('username')); // Add the translator $this->setLanguage(); } public function setLanguage($language = NULL){ if($language != NULL){ \LOID\Component\Language::setLanguage($language); } $Translator = \LOID\Component\Language::getTranslator(); $this->view->t = $Translator; $this->Translator = $Translator; $this->view->language = \LOID\Component\Language::getLanguage(); } } |
#4 | ControllerBase->beforeExecuteRoute |
#5 | Phalcon\Dispatcher\AbstractDispatcher->dispatch |
#6 | Phalcon\Mvc\Application->handle /var/www/htdocs/public/index.php (18) <?php $Debug = new \Phalcon\Debug(); $Debug->setUri('https://loid.augustana.ualberta.ca/public/assets/debug/'); $Debug->listen(); #try{ require '../app/config/bootstrap.php'; # # Handle the requested URL # $App = new \Phalcon\Mvc\Application($DI); # # Echo the output # echo $App->handle($Config->dirs->application_request_uri)->getContent(); /* } catch(\Phalcon\Exception $e){ echo 'Phalcon Exception: ',$e->getMessage(); } */ |
Key | Value |
---|---|
_url | /login/ |
return | apply/75 |
Key | Value |
---|---|
REDIRECT_REDIRECT_HTTPS | on |
REDIRECT_REDIRECT_SSL_TLS_SNI | loid.augustana.ualberta.ca |
REDIRECT_REDIRECT_STATUS | 200 |
REDIRECT_HTTPS | on |
REDIRECT_SSL_TLS_SNI | loid.augustana.ualberta.ca |
REDIRECT_STATUS | 200 |
HTTPS | on |
SSL_TLS_SNI | loid.augustana.ualberta.ca |
SSL_SERVER_S_DN_C | CA |
SSL_SERVER_S_DN_ST | Alberta |
SSL_SERVER_S_DN_L | Edmonton |
SSL_SERVER_S_DN_O | University of Alberta |
SSL_SERVER_S_DN_CN | *.augustana.ualberta.ca |
SSL_SERVER_I_DN_C | BE |
SSL_SERVER_I_DN_O | GlobalSign nv-sa |
SSL_SERVER_I_DN_CN | GlobalSign RSA OV SSL CA 2018 |
SSL_SERVER_SAN_DNS_0 | *.augustana.ualberta.ca |
SSL_SERVER_SAN_DNS_1 | augustana.ualberta.ca |
SSL_VERSION_INTERFACE | mod_ssl/2.4.62 |
SSL_VERSION_LIBRARY | OpenSSL/1.1.1w |
SSL_PROTOCOL | TLSv1.3 |
SSL_SECURE_RENEG | true |
SSL_COMPRESS_METHOD | NULL |
SSL_CIPHER | TLS_AES_256_GCM_SHA384 |
SSL_CIPHER_EXPORT | false |
SSL_CIPHER_USEKEYSIZE | 256 |
SSL_CIPHER_ALGKEYSIZE | 256 |
SSL_CLIENT_VERIFY | NONE |
SSL_SERVER_M_VERSION | 3 |
SSL_SERVER_M_SERIAL | 0335E47EE9F963E531BC9BF3 |
SSL_SERVER_V_START | Feb 21 14:56:05 2024 GMT |
SSL_SERVER_V_END | Mar 24 14:56:04 2025 GMT |
SSL_SERVER_S_DN | CN=*.augustana.ualberta.ca,O=University of Alberta,L=Edmonton,ST=Alberta,C=CA |
SSL_SERVER_I_DN | CN=GlobalSign RSA OV SSL CA 2018,O=GlobalSign nv-sa,C=BE |
SSL_SERVER_A_KEY | rsaEncryption |
SSL_SERVER_A_SIG | sha256WithRSAEncryption |
SSL_SESSION_ID | 51d3804fcbc54ac02ab5d7c9aaf57ed0e6ea887ff7ee8dbb77fe6b005b11d3a4 |
SSL_SESSION_RESUMED | Initial |
HTTP_ACCEPT | */* |
HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
HTTP_ACCEPT_ENCODING | gzip, br, zstd, deflate |
HTTP_HOST | loid.augustana.ualberta.ca |
PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
SERVER_SIGNATURE | <address>Apache/2.4.62 (Debian) Server at loid.augustana.ualberta.ca Port 443</address>\n |
SERVER_SOFTWARE | Apache/2.4.62 (Debian) |
SERVER_NAME | loid.augustana.ualberta.ca |
SERVER_ADDR | 142.244.26.151 |
SERVER_PORT | 443 |
REMOTE_ADDR | 3.147.89.50 |
DOCUMENT_ROOT | /var/www/htdocs |
REQUEST_SCHEME | https |
CONTEXT_PREFIX | |
CONTEXT_DOCUMENT_ROOT | /var/www/htdocs |
SERVER_ADMIN | webmaster@localhost |
SCRIPT_FILENAME | /var/www/htdocs/public/index.php |
REMOTE_PORT | 59845 |
REDIRECT_URL | /public/login/ |
REDIRECT_QUERY_STRING | _url=/login/&return=apply%2F75 |
GATEWAY_INTERFACE | CGI/1.1 |
SERVER_PROTOCOL | HTTP/1.1 |
REQUEST_METHOD | GET |
QUERY_STRING | _url=/login/&return=apply%2F75 |
REQUEST_URI | /login/?return=apply%2F75 |
SCRIPT_NAME | /public/index.php |
PHP_SELF | /public/index.php |
REQUEST_TIME_FLOAT | 1733003544.1026 |
REQUEST_TIME | 1733003544 |
# | Path |
---|---|
0 | /var/www/htdocs/public/index.php |
1 | /var/www/htdocs/app/config/bootstrap.php |
2 | /var/www/htdocs/app/libraries/dump.php |
3 | /var/www/htdocs/app/libraries/vendor/autoload.php |
4 | /var/www/htdocs/app/libraries/vendor/composer/autoload_real.php |
5 | /var/www/htdocs/app/libraries/vendor/composer/platform_check.php |
6 | /var/www/htdocs/app/libraries/vendor/composer/ClassLoader.php |
7 | /var/www/htdocs/app/libraries/vendor/composer/autoload_static.php |
8 | /var/www/htdocs/app/libraries/vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php |
9 | /var/www/htdocs/app/config/config.php |
10 | /var/www/htdocs/app/components/Auth.php |
11 | /var/www/htdocs/app/controllers/LoginController.php |
12 | /var/www/htdocs/app/controllers/ControllerBase.php |
13 | /var/www/htdocs/app/components/ACL.php |
14 | /var/www/htdocs/app/components/Feedback.php |
15 | /var/www/htdocs/app/components/CSRF.php |
16 | /var/www/htdocs/app/components/Language.php |
17 | /var/www/htdocs/app/lang/_README |
Memory | |
---|---|
Usage | 2097152 |