Esempio n. 1
0
 function load(k_Context $context)
 {
     if ($context->session('identity')) {
         return $context->session('identity');
     }
     return new k_Anonymous();
 }
Esempio n. 2
0
File: index.php Progetto: vih/vih.dk
 function load(k_Context $context)
 {
     // Default to English
     $phrases = array('Hello' => 'Hello', 'Meatballs' => 'Meatballs');
     if ($context->language()->isoCode() == 'sv') {
         $phrases = array('Hello' => 'Bork, bork, bork!', 'Meatballs' => 'Swedish meatballs');
     }
     return new SimpleTranslator($phrases);
 }
Esempio n. 3
0
 function load(k_Context $context)
 {
     if ($context->query('lang') == 'sv') {
         return new SwedishLanguage();
     } else {
         if ($context->query('lang') == 'en') {
             return new EnglishLanguage();
         }
     }
     return new EnglishLanguage();
 }
Esempio n. 4
0
 function load(k_Context $context)
 {
     return new k_Translation2Translator($context->language()->isoCode());
 }
Esempio n. 5
0
 function logRequestStart(k_Context $context)
 {
     $this->write('(request' . "\n" . '  (time "' . date("Y-m-d H:i:s") . '")' . "\n" . '  (method "' . $context->method() . '")' . "\n" . '  (request-uri "' . addslashes($context->requestUri()) . '")' . "\n" . '  (headers ' . $this->indent($this->dumper->dump($context->header())) . "))" . "\n");
 }
Esempio n. 6
0
 /**
  * @param string
  * @param mixed   The default value to return, if the value doesn't exist
  * @return string
  */
 function get($key, $default = null)
 {
     return isset($this->state[$this->namespace . $key]) ? $this->state[$this->namespace . $key] : $this->context->query($this->namespace . $key, $default);
 }