Exemplo n.º 1
0
 function load(k_Context $context)
 {
     if ($context->session('identity')) {
         return $context->session('identity');
     }
     return new k_Anonymous();
 }
Exemplo n.º 2
0
Arquivo: index.php Projeto: 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);
 }
Exemplo 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();
 }
Exemplo n.º 4
0
 function load(k_Context $context)
 {
     return new k_Translation2Translator($context->language()->isoCode());
 }
Exemplo 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");
 }
Exemplo 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);
 }