PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.comp.lang.php > session_set_save_handler and error handling
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
session_set_save_handler and error handling

Réponse
 
LinkBack Outils de la discussion
Vieux 13/07/2007, 21h11   #1
Werner Elflein
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut session_set_save_handler and error handling

Let open, close, read, write, destroy and gc be PHP functions to save
the superglobal array $_SESSION in a database.

I would like to use the following code:

[1] session_set_save_handler(open,close,read,write,gc) ;
[2] session_start();
[3] if(!isset($_SESSION))
[4] {
/* error handling */
exit;
}
/* session okay */

But what will happen, if (e.g.) the database is down?
Means: What kind of error handling can or must be implemented within the
functions open, close, read, write, destroy and gc to get a stable
script? Of course, line [3] is not enough ...
  Réponse avec citation
Vieux 13/07/2007, 22h04   #2
Avinesh Bangar
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: session_set_save_handler and error handling

"Werner Elflein" <email@wernerelflein.de> wrote in message
news:f78m9f$q72$02$2@news.t-online.com...
> Let open, close, read, write, destroy and gc be PHP functions to save the
> superglobal array $_SESSION in a database.
>
> I would like to use the following code:
>
> [1] session_set_save_handler(open,close,read,write,gc) ;
> [2] session_start();
> [3] if(!isset($_SESSION))
> [4] {
> /* error handling */
> exit;
> }
> /* session okay */
>


Take a look at this:
http://www.zend.com/zend/spotlight/c...e8.php?print=1 It
essentially covers everything you're trying to do.

> But what will happen, if (e.g.) the database is down?


If no database connection is found or established, usually an E_WARNING
warning is presented (unless you have disabled such warnings).

Regards,
Avinesh


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h32.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,06782 seconds with 10 queries