public function run(InputInterface $input, OutputInterface $output)
 {
     $this->depedencies = $this->getApplication()->getKernel()->getContainer()->get('mardraze_core.depedencies');
     $context = $this->depedencies->get('router')->getContext();
     $mainHost = $this->depedencies->getParameter('mardraze_http_host');
     $host = preg_replace('/http(s)?:\\/\\//', '', $mainHost);
     $scheme = strpos($mainHost, 'https:') === false ? 'http' : 'https';
     $context->setHost($host);
     $context->setScheme($scheme);
     $this->input = $input;
     $this->output = $output;
     return parent::run($input, $output);
 }
示例#2
0
 public function safe_call($twigFunction)
 {
     $obj = $this->depedencies->getTwig()->getFunction($twigFunction);
     if ($obj && method_exists($obj, 'getCallable')) {
         $callable = $obj->getCallable();
         $args = func_get_args();
         unset($args[0]);
         return call_user_func_array($callable, $args);
     }
 }
示例#3
0
 public function getFlash($key)
 {
     $this->depedencies->getRequest()->getSession()->getFlashBag()->get($key);
 }