Example #1
0
 /**
  *  Set Compiler option.
  *
  *  @return void
  */
 public static function setOption($option, $value)
 {
     switch (strtolower($option)) {
         case 'if_empty':
             self::$if_empty = (bool) $value;
             break;
         case 'enable_load':
             self::$enable_load = (bool) $value;
         case 'echo_concat':
             if ($value == '.' || $value == ',') {
                 self::$echo_concat = $value;
             }
             break;
         case 'autoescape':
             self::$autoescape = (bool) $value;
             break;
         case 'dot_as_object':
             self::$dot_as_object = (bool) $value;
             break;
         case 'strip_whitespace':
             self::$strip_whitespace = (bool) $value;
             break;
         case 'is_exec_enabled':
         case 'allow_exec':
             self::$is_exec_enabled = (bool) $value;
             break;
         case 'global':
             if (!is_array($value)) {
                 $value = array($value);
             }
             self::$global_context = $value;
             break;
     }
 }