php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger

PHP Einsteiger PHP Problemlösungen für Spracheinsteiger
Archive: 2004, 2004/2, 2005, 2005/2, 2006, 2007, 2008, 2009, 2010,

Antwort
 
LinkBack Themen-Optionen Thema bewerten
Alt 09.08.2011, 17:10  
Benutzer
 
Registriert seit: 24.07.2011
Beiträge: 41
PHP-Kenntnisse:
Anfänger
Phantomias befindet sich auf einem aufstrebenden Ast
Standard Alternative PEAR Auth

Hallo liebe Helfer,

momentan nutze ich die PEAR Klasse Auth, um die Authentifizierung bzw. den Login einer Webapplikation zu realisieren. Ich verwende die Option 'DB', um die Daten gegen eine Datenbank zu authentifizieren. Im Grunde funktioniert auch alles wunderbar.
Allerdings habe ich - auf Empfehlungen hier im Forum - mein Error-Reporting auf E_ALL|E_STRICT gesetzt und bekomme nun - wenig verwunderlich - unter PHP5 einen Haufen "Strict" Hinweise.
Da ich im Moment sowieso alles überarbeite, stellt sich für mich die Frage, ob es mittlerweile nicht eine nicht veraltete bzw. bessere Alternative gibt. Eine Klasse selber schreiben traue ich mir im Moment nicht wirklich zu .

Wozu könnt ihr mir raten?

Vielen Dank! Liebe Grüße, Phantomias
Phantomias ist offline   Mit Zitat antworten
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 09.08.2011, 17:25  
Benutzer
 
Registriert seit: 24.07.2011
Beiträge: 41
PHP-Kenntnisse:
Anfänger
Phantomias befindet sich auf einem aufstrebenden Ast
Standard

Falls jemand die Fehlermeldungen interessieren (in meiner lokalen Testumgebung):
PHP-Code:
Strict StandardsNon-static method DB::isConnection() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARAuthContainerDB.php on line 150

Strict Standards
Non-static method DB::connect() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARAuthContainerDB.php on line 115

Strict Standards
Non-static method DB::parseDSN() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARDB.php on line 520

Strict Standards
Non-static method DB::isError() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARDB.php on line 557

Strict Standards
is_a(): DeprecatedPlease use the instanceof operator in C:xamppphpPEARDB.php on line 594

Strict Standards
Non-static method DB::isError() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARAuthContainerDB.php on line 129

Strict Standards
is_a(): DeprecatedPlease use the instanceof operator in C:xamppphpPEARDB.php on line 594

Strict Standards
Non-static method PEAR::isError() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARAuthContainerDB.php on line 129

Strict Standards
is_a(): DeprecatedPlease use the instanceof operator in C:xamppphpPEARPEAR.php on line 281

Strict Standards
Non-static method DB::isError() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARAuthContainerDB.php on line 152

Strict Standards
is_a(): DeprecatedPlease use the instanceof operator in C:xamppphpPEARDB.php on line 594

Strict Standards
Non-static method PEAR::isError() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARAuthContainerDB.php on line 152

Strict Standards
is_a(): DeprecatedPlease use the instanceof operator in C:xamppphpPEARPEAR.php on line 281

Strict Standards
Non-static method DB::isManip() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARDBcommon.php on line 2195

Strict Standards
Non-static method DB::isError() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARDBcommon.php on line 1217

Strict Standards
is_a(): DeprecatedPlease use the instanceof operator in C:xamppphpPEARDB.php on line 594

Strict Standards
Non-static method DB::isError() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARDBcommon.php on line 1356

Strict Standards
is_a(): DeprecatedPlease use the instanceof operator in C:xamppphpPEARDB.php on line 594

Strict Standards
Non-static method DB::isError() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARDB.php on line 1387

Strict Standards
is_a(): DeprecatedPlease use the instanceof operator in C:xamppphpPEARDB.php on line 594

Strict Standards
Non-static method DB::isError() should not be called staticallyassuming $this from incompatible context in C:xamppphpPEARAuthContainerDB.php on line 331

Strict Standards
is_a(): DeprecatedPlease use the instanceof operator in C:xamppphpPEARDB.php on line 594 
Phantomias ist offline   Mit Zitat antworten
Alt 09.08.2011, 17:43  
Erfahrener Benutzer
 
Benutzerbild von lstegelitz
 
Registriert seit: 07.09.2009
Beiträge: 4.005
PHP-Kenntnisse:
Fortgeschritten
lstegelitz ist einfach richtig nettlstegelitz ist einfach richtig nettlstegelitz ist einfach richtig nettlstegelitz ist einfach richtig nett
Standard

Zitat:
Strict Standards: Non-static method DB::isConnection() should not be called statically
Diese Meldungen solltest du auf jeden Fall verfolgen, das kann dir ansonsten böse um die Ohren fliegen.

In PHP4 wurden statische Methoden nicht als solche gekennzeichnet (mit PHP5 sollte dann vor einer statischen Methode auch das Schlüsselwort 'static' erscheinen)
Nimmst du nun einen PHP4 Sourcecode und lässt ihn unter PHP5 laufen, werden dir solche Aufrufe angemeckert.

PHP4:
PHP-Code:
classe MyClass {
  function 
method() {
    echo 
"call me static or non static";
  }
}
MyClass::method(); // in PHP 4 ok

$c = new MyClass();
$c->method(); // ebenfalls ok. 
PHP5
PHP-Code:
class MyClass {
  function 
method() {
    echo 
"non static";
  }
  static function 
static_method() {
    echo 
"static";
  }
}

MyClass::method(); // Non-static method ... should not be called statically
MyClass::static_method(); // ok

$c = new MyClass();

$c->method(); // ok
$c->static_method(); // ok (!) 
Eine statische Methode darfst du im Objektkontext aufrufen, eine nicht-statische MUSST du im Objektkontext aufrufen.
Im schlimmsten Fall verwendet die nicht-statische Methode nicht-statische Membervariablen (die sind an eine Objektinstanz gebunden), dann knallt es, wenn du die statisch aufrufst.
__________________
Über 90% aller Gewaltverbrechen passieren innerhalb von 24 Stunden nach dem Konsum von Brot.
lstegelitz ist offline   Mit Zitat antworten
Alt 09.08.2011, 19:32  
Benutzer
 
Registriert seit: 24.07.2011
Beiträge: 41
PHP-Kenntnisse:
Anfänger
Phantomias befindet sich auf einem aufstrebenden Ast
Standard

Hallo lstegelitz,

vielen Dank für deine Antwort. Tut mir leid, irgendwie haben wir aneinander "vorbeigeschrieben" und du hast dir so viel Mühe geben.
Ich weiß, wieso die Fehlermeldungen kommen, allerdings wollte ich ungern die PEAR-Klassen verändern (das hat verschiedene Gründe).

Ich wollte gerne wissen, ob es eine guteAlternative zu PEAR Auth gibt. Im Netz schwirren allerlei Code-Snipsel zu selbst geschriebenen Authentifizierungsklassen rum, allerdings machen viele davon selbst auf mich schon keinen guten Eindruck (bezogen auf die Programierung).

Vielen Dank!
Phantomias ist offline   Mit Zitat antworten
Alt 09.08.2011, 20:00  
hts
Erfahrener Benutzer
 
Registriert seit: 07.09.2010
Beiträge: 722
PHP-Kenntnisse:
Fortgeschritten
hts befindet sich auf einem aufstrebenden Ast
Standard

Zend_Auth?
http://framework.zend.com/manual/de/...r.dbtable.html
hts ist offline   Mit Zitat antworten
Alt 09.08.2011, 20:13  
Benutzer
 
Registriert seit: 24.07.2011
Beiträge: 41
PHP-Kenntnisse:
Anfänger
Phantomias befindet sich auf einem aufstrebenden Ast
Standard

Ist das auch sinnvoll, wenn man sonst überhaupt nichts aus dem Zend Framework nutzt?
Phantomias ist offline   Mit Zitat antworten
Alt 09.08.2011, 20:32  
fab
Erfahrener Benutzer
 
Benutzerbild von fab
 
Registriert seit: 28.07.2010
Beiträge: 2.308
PHP-Kenntnisse:
Fortgeschritten
fab ist ein Lichtblickfab ist ein Lichtblickfab ist ein Lichtblickfab ist ein Lichtblickfab ist ein Lichtblick
Standard

Definitiv. Das Zend Framework ist eigentlich eher eine Sammlung von mehr oder weniger eigenständigen Komponenten, das MVC-Framework ist nur ein Teil davon.

Zur Verdeutlichung: Selbst Fabien Potencier, der Kopf hinter Symfony, empfiehlt die Verwendung von Zend-Komponenten, unabhängig davon welches Framework man als Grundlage benutzt.
fab ist gerade online   Mit Zitat antworten
Alt 09.08.2011, 20:36  
Benutzer
 
Registriert seit: 24.07.2011
Beiträge: 41
PHP-Kenntnisse:
Anfänger
Phantomias befindet sich auf einem aufstrebenden Ast
Standard

Okay, vielen Dank für euren Vorschlag! Dann werde ich mir das mal genauer angucken!

Danke und euch noch einen schönen Abend!
Phantomias ist offline   Mit Zitat antworten
Antwort


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
pear installiert aber nicht gefunden countryking PHP Tipps 2010 2 20.08.2010 10:33
[Erledigt] generisches Auth Modul rudygotya Software-Design 9 31.07.2010 09:17
[Erledigt] Webbased PEAR fischlein PHP Tipps 2009 2 08.12.2009 05:39
PEAR Auth - Login funktioniert nicht Hugooo PHP Tipps 2009 16 27.08.2009 14:08
Unterschied von php mail()-Funktion zu PEAR $mail->send() Inchie PHP Tipps 2009 7 11.04.2009 13:39
Pear installieren 1und1 vServer nico47 Server, Hosting und Workstations 4 12.10.2008 19:37
Größenbeschränkung bei PEAR SOAP Antwort? Anotherone PHP-Fortgeschrittene 1 13.01.2008 20:32
PEAR Package installieren Zergling-new PHP Tipps 2006 6 03.01.2006 21:49
Pear Auth_HTTP - Loginbox lässt mich nicht rein PHP Tipps 2005-2 7 29.07.2005 21:34
[Erledigt] includepathproblem pear blockiert smarty und umgekehrt PHP Tipps 2005 1 08.05.2005 18:46
PEAR Installation PHP Tipps 2004-2 14 21.12.2004 16:20
[Erledigt] SOAP/Client.php: PHP Fatal error: Method SOAP_Client::__call PHP-Fortgeschrittene 6 25.11.2004 09:48
[Erledigt] PEAR WebDAV PHP-Fortgeschrittene 0 20.10.2004 15:21
Hilfe bei Pear benötigt PHP Tipps 2004 1 15.09.2004 18:04
pear install **** funzt nicht mrSpok PHP Tipps 2004 3 20.08.2004 10:10

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
pear auth, method db::iserror() should not be called statically in, non-static method pear::iserror() should not be called statically, assuming $this from incompatible context in, pear alternative, strict standards: non-static method pear::iserror() should not be called statically, assuming $this from incompatible context in, non-static method db::connect() should not be called statically, non-static method db::iserror() should not be called statically, alternative to pear auth, pear auth for php5, db connect pear strict standards: non-static method db::connect() should not be called statically, assuming $this from incompatible context in, strict standards: non-static method db::iserror(), soap pear iserror strict, soap pear iserror non-static method pear, php pear alternative, pear::iserror() should not be called statically, mvc strict standards: non-static method db::connect() should not be called statically, assuming $this from incompatible context, strict standards: non-static method jerror::iserror() should not be called statically, alternativa ad pear auth, alternative pear db, non-static method pear::iserror()

Alle Zeitangaben in WEZ +2. Es ist jetzt 16:03 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum