IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

[POO] Comment corriger l'erreur E_STRICT afin de standardiser le code pour PHP5 ?


Sujet :

Langage PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Février 2004
    Messages
    41
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 41
    Par défaut [POO] Comment corriger l'erreur E_STRICT afin de standardiser le code pour PHP5 ?
    Bonjour a tous,

    Je voudrais perreniser un code qui n'est pas Orienté PHP5.

    Je recupere cette erreur:

    Declaration of ServiceAuthenticator::authenticate() should be compatible with that of AuthenticatorBase::authenticate()


    issue ici:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
     
    [warning] 10:53:19 01/10/07 DEPRECATED ERROR: 
    Declaration of ServiceAuthenticator::authenticate() should be compatible with that of AuthenticatorBase::authenticate()
    Dans le fichier /var/www/php-/WEB-INF/classes/php/authenticator/ServiceAuthenticator.php à la ligne 180
     
    #0 /var/www/php-/WEB-INF/GlobalPrependEx.php(70): myErrorHandler(2048, 'Declaration of ...', '/var/www/php-...', 180, Array)
    #1 /var/www/php-/WEB-INF/GlobalPrependEx.php(70): include_once()
    #2 /var/www/php-/WEB-INF/globalPrepend.php(33): include_once('/var/www/php-...')
    #3 /var/www/site_at/WEB-INF/boot-php.inc(96): include_once('/var/www/php-...')
    #4 /var/www/site_at/Admin.php(8): include('/var/www/site...')
    #5 {main}
    Je n'arrive pas a comprendre cette erreur, même en traduisant ca ne me parle pas......

    L'erreur est lancée lorsqu'on include_once la classe ServiceAuthenticator.

    Voici la classe:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
     
     
    class ServiceAuthenticator extends AuthenticatorBase {
     
    	// ----- Instance Variables --------------------------------------------- //
     
    	/**
    	* Descriptive information about this implementation.
    	* @type string
    	*/
    	var $sInfo = 'php.authenticator.ServiceAuthenticator/1.0';
     
    	/**
    	* Character encoding to use to read the username and password parameters
    	* from the request. If not set, the encoding of the request body will be
    	* used.
    	* @type string
    	*/
    	var $sCharacterEncoding = '';
     
     
    	// ----- Public Properties ---------------------------------------------- //
     
    	/**
    	* Return descriptive information about this Valve implementation.
    	*/
    	function getInfo() {
    		return $this->sInfo;
    	}
     
    	/**
    	* Return the character encoding to use to read the username and password.
    	*/
    	function  getCharacterEncoding() {
    		return $this->sCharacterEncoding;
    	}
     
    	/**
    	* Set the character encoding to be used to read the username and password. 
    	*/
    	function  setCharacterEncoding($sCharacterEncoding) {
    		$this->sCharacterEncoding = $sCharacterEncoding;
    	}
     
     
    	// ----- Constructor ---------------------------------------------------- //
     
    	function ServiceAuthenticator() {
     
    		// Setup the parent object first
    		#parent::__construct();	// PHP5
    		parent::AuthenticatorBase();
     
    	}
     
     
    	// ----- Public Methods ------------------------------------------------- //
     
    	/**
    	* Authenticate the user (service) making this request, based on the 
    	* specified login configuration. Return <code>True</code> if any specified
    	* constraint has been satisfied, or <code>False</code> on failure to
    	* authenticate.
    	*
    	* @param Request		Request we are processing
    	* @param Response		Response we are creating
    	* @param LoginConfig	The LoginConfig configuration describing how 
    	*              			authentication should be performed.
    	* @returns boolean
    	*/
    	function authenticate(&$request, &$response, $oConfig) {
     
    		// References to objects we will need later
    		$oSession = Null;
     
    		// Have we already authenticated someone?
    		$oPrincipal = $request->getUserPrincipal();	// Principal
    		#String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE);
    		if($oPrincipalNote(PhpMVC_Auth_Const::getKey('SESS_USERNAME_NOTE'), $sUsername);
    		#$session->setNote(PhpMVC_Auth_Const::getKey('SESS_PASSWORD_NOTE'), $sPassword);
     
    		// Redirect the user to the original request URI:
    		// There is no login page for a service authentication (non-interactive logon), 
    		// so we just return True (auth=success) and garnt permission to access the 
    		// resourses guarded by this authenticator.
    		return True;	// 
     
    	}
    }

    Je vous remercie d'avance pour l'aide!!!

    Ronio

  2. #2
    Membre expérimenté

    Profil pro
    Inscrit en
    Juin 2002
    Messages
    6 152
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2002
    Messages : 6 152
    Par défaut
    Est-ce que vos méthodes sont strictement identiques au niveau de la déclaration de la méthode authentificate entre celle de la classe AuthenticatorBase et ServiceAuthenticator ?


    Julp.

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Février 2004
    Messages
    41
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 41
    Par défaut Merci Julp pour votre Réponse!
    Bonjour,

    MERCI beaucoup d'avoir répondu!

    Non, les méthodes authentificate de chacune des 2 classes ne sont pas pareil.

    la méthode authenticate de la classe AuthenticatorBase est vide.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    function authenticate($request, $response, $oConfig) {
    		// Create this method in a sub-class
    	}

    Si je comprend bien, il faut que je copie/colle la méthode non vide vers celle qui est vide pour corriger l'erreur ...?
    ( désolé d'avance si c'est une question bête... ).


    Ou plutôt juste mettre un ; dans la méthode vide.
    Normalement on redéfini la méthode donc c'est peut être ça.

    MERCI encore!

  4. #4
    Expert confirmé Avatar de Mr N.
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    5 418
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 5 418
    Par défaut
    Il faut AMHA enlever les & de ServiceAuthenticator::authenticate()

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Février 2004
    Messages
    41
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 41
    Par défaut Exact Mr N. MERCI
    Exact, c'etait bien cela,
    Merci Mr N.
    Merci beaucoup pour l'aide.

    J'ai corrigé les classes de mon appli de cette maniere .

    J'ai d'autres Erreurs strictes Je reposterai dans un new topic si j arrive pas.... car jcrois qu'elles sont differentes.


    Merci encore!

  6. #6
    Expert confirmé Avatar de Mr N.
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    5 418
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 5 418
    Par défaut
    Ben si tu as d'autres erreurs E_STRICT ce sujet de discussion est très bien. Pas la peine de multiplier...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 20
    Dernier message: 21/01/2008, 18h27
  2. Réponses: 4
    Dernier message: 11/01/2008, 21h37
  3. Comment corriger ces erreurs ?
    Par apt dans le forum Langage
    Réponses: 9
    Dernier message: 18/01/2007, 17h49
  4. [W3C] Comment corriger mon erreur d'affichage
    Par jeremy_chauvel dans le forum Balisage (X)HTML et validation W3C
    Réponses: 7
    Dernier message: 19/11/2006, 17h23
  5. Réponses: 3
    Dernier message: 21/07/2006, 15h50

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo