public function read($id) { #Como todo esta codificado, se decodifca al leer la sesion $resultados = $this->_db->query("SELECT data FROM __sesiones\r\n WHERE id = :id LIMIT 1;", array("id" => $id)); if ($resultados) { return (string) @Framework::Decrypt($resultados['data']); } else { return (string) @''; } }
public function __construct() { if (isset($_GET['url'])) { #Obtener la URL solicitada $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); $url = explode('/', $url); $url = array_filter($url); #Convertir la URL a nombres de objetos del sistema $this->_controlador = strtolower(array_shift($url)); if ($this->_controlador == "ejecuta") { $url = str_replace(substr($_GET['url'], strpos($_GET['url'], "/ejecuta/") + 8), Framework::Decrypt(substr($_GET['url'], strpos($_GET['url'], "/ejecuta/") + 8)), $_GET['url']); $url = explode('/', $url); $url = array_filter($url); $this->_controlador = strtolower(array_shift($url)); $this->_metodo = strtolower(array_shift($url)); $this->_argumentos = $url; } else { $this->_metodo = strtolower(array_shift($url)); $this->_argumentos = $url; } } #Limpiar parametros recibidos $this->_argumentos = Framework::limpiarEntrada($this->_argumentos); $_POST = Framework::limpiarEntrada($_POST); $_GET = Framework::limpiarEntrada($_GET); #Inicializar los atributos no recibidos en la URL if (!$this->_controlador) { $this->_controlador = DEFAULT_CONTROLLER; } if (!$this->_metodo) { $this->_metodo = 'index'; } if (!$this->_argumentos) { $this->_argumentos = array(); } }
public function read($id) { #Como todo esta codificado, se decodifca al leer la sesion return (string) @Framework::Decrypt(file_get_contents("{$this->savePath}/{$id}")); }