<?php

/**
 *
 * @author p6
 * @property int streamIsOpen
 */
class SessionVars
{
  /**
   *
   * @var SessionVars
   */
  private static $_instance;
  /**
   *
   * @return SessionVars
   */
  public static function instance()
  {
    if(self::$_instance == null)
      self::$_instance = new SessionVars();
    return self::$_instance;
  }
  
  /**
   * @param string $name
   * @param mixed $value
   */
  public function __set($name, $value)
  {//logLine("$name, "._2str($value));
    $_SESSION[$name] = $value;
  }

  /**
   * 
   * @param string $name
   * @return mixed
   */
  public function __get($name)
  {
    return $_SESSION[$name];
  }
}
