Add files via upload

This commit is contained in:
Fernando Méndez
2021-05-10 22:22:32 +02:00
committed by GitHub
parent c012b3b617
commit 805dffd5ba
8 changed files with 663 additions and 5 deletions

View File

@ -71,10 +71,24 @@ class Aplicacion {
public function init($bdDatosConexion) {
if ( ! $this->inicializada ) {
$this->bdDatosConexion = $bdDatosConexion;
//session_start();
if ( $this->is_session_started() === FALSE ) session_start();
$this->inicializada = true;
}
}
/**
* Inicia la sesión, si esta no se había iniciado.
*/
protected function is_session_started(){
if ( php_sapi_name() !== 'cli' ) {
if ( version_compare(phpversion(), '5.4.0', '>=') ) {
return session_status() === PHP_SESSION_ACTIVE ? TRUE : FALSE;
} else {
return session_id() === '' ? FALSE : TRUE;
}
}
return FALSE;
}
/**
* Cierre de la aplicación.