Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php][sesje] session_save_set_handler
deirathe
post
Post #1





Grupa: Zarejestrowani
Postów: 426
Pomógł: 32
Dołączył: 24.05.2007

Ostrzeżenie: (0%)
-----


najpierw kawałek kodu:
  1. <?php
  2. class session{
  3. private static $sessionId;
  4. //db data
  5. private static $cdb;
  6. private static $host;
  7. private static $user;
  8. private static $pass;
  9. private static $db;
  10.  
  11.  
  12.  
  13. public static function on($useDB=false,$host="",$user="",$pass="",$db="",$type="mysql"){
  14. if(!self::$sessionId){
  15. if($useDB){
  16. $host?self::$host=$host:self::Exception();
  17. $user?self::$user=$user:self::Exception();
  18. $pass?self::$pass=$pass:self::Exception();
  19. $db?self::$db=$db:self::Exception();
  20. session_set_save_handler(self::_open(),self::_close(),self::_read(),self::_write(),self::_destroy(),self::_gc())or self::Exception();
  21. }
  22. self::$sessionId = session_id();
  23. }
  24. else self::Exception();
  25. }//end on
  26.  
  27. private static function Exception($nfo){
  28. require_once(dirname(__FILE__)."/Session/Exception.class.php");
  29. throw new Session_Exception($nfo);
  30. }
  31. public function sessionId(){
  32. return self::$sessionId;
  33. }
  34.  
  35.  
  36. /*-------------------------------------*
  37. |  -- session handlers -- |
  38. *-------------------------------------*/
  39. private static function _open(){
  40. self::$cdb = mysql_connect(self::$host,self::$user,self::$pass);
  41. return "";
  42.  
  43. }//end _open
  44. private static function _close(){
  45.  
  46. }//end _close
  47. private static function _read(){
  48.  
  49. }//end _read
  50. private static function _write(){
  51.  
  52. }//end _write
  53. private static function _destroy(){
  54.  
  55. }//end _destroy
  56. private static function _gc(){
  57.  
  58. }//end _gc
  59. }
  60. ?>


nie rozumiem czemu dostaje komunikat, skoro handlery są poustawiane:
Warning: session_set_save_handler() [function.session-set-save-handler]: Argument 1 is not a valid callback in /home/deirathe/domains/3ther.net/public_html/framework/session.class.php on line 28

czy ktoś może wie jak to naprawić??
dzięki z góry


--------------------
Kawałek mojego blogu
Everything should be as simple as possible but not simpler.
A Einstein
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 04:53