Exemplo n.º 1
0
 protected function walkStrip(StripNode $strip)
 {
     $sym = $this->gensym();
     $vsym = $this->gensym();
     $echosym = $this->gensym();
     $ret = "";
     $ret .= "ob_start();";
     $ret .= implode("", $this->walkEach($strip->getBody()));
     $ret .= "{$sym} = ob_get_clean();";
     $ret .= "{$sym} = preg_split('/\\r\\n|\\r|\\n/', {$sym});";
     $ret .= "{$echosym} = '';";
     $ret .= "foreach ({$sym} as {$vsym}) { {$echosym} .= trim({$vsym}); }";
     $ret .= "echo {$echosym};";
     return $ret;
 }
 protected function walkStrip(StripNode $strip)
 {
     $this->walkEachDisallow($strip->getBody(), "strip");
 }
Exemplo n.º 3
0
 protected function walkStrip(StripNode $strip)
 {
     return new StripNode($this->walkEach($strip->getBody()));
 }
 protected function walkStrip(StripNode $strip)
 {
     $variableNames = array();
     foreach ($strip->getBody() as $statement) {
         foreach ($this->walk($statement) as $name => $_) {
             $variableNames[$name] = true;
         }
     }
     return $variableNames;
 }