Esempio n. 1
0
 public static function get()
 {
     if (is_array(self::$args)) {
         $args = self::$args;
     } else {
         $args = func_get_args();
     }
     if (is_array($args)) {
         foreach ($args as $key_title) {
             if (is_numeric($key_title)) {
                 $keys_array[] = '[' . $key_title . ']';
             } else {
                 $keys_array[] = '["' . $key_title . '"]';
             }
         }
         $keys_str = implode("", $keys_array);
         switch (self::$act) {
             case "write":
                 if (is_array(self::$write)) {
                     foreach (self::$write as $index => $write) {
                         $index_str = is_numeric($index) ? '[' . $index . ']' : '["' . $index . '"]';
                         eval('$_SESSION[CORE::$cfg["sess"]]' . $keys_str . $index_str . ' = "' . $write . '";');
                     }
                 } else {
                     eval('$_SESSION[CORE::$cfg["sess"]]' . $keys_str . ' = "' . self::$write . '";');
                 }
                 break;
             case "del":
                 eval('unset($_SESSION[CORE::$cfg["sess"]]' . $keys_str . ');');
                 return true;
                 break;
             default:
                 eval('$output = $_SESSION[CORE::$cfg["sess"]]' . $keys_str . ';');
                 self::$val = $output;
                 return $output;
                 break;
         }
     } else {
         eval('$output = $_SESSION[CORE::$cfg["sess"]];');
         self::$val = $output;
         return $output;
     }
 }