П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое







Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 98194 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 29079 раз(а).

Учебник HTML.
Просмотров 56200 раз(а).

Руководство по PHP5.
Просмотров 25940 раз(а).

Хостинг через призму DNS.
Просмотров 30469 раз(а).

Подборка текстов стандартных документов.
Просмотров 28983 раз(а).

Учебник PHP - Самоучитель
Просмотров 33731 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 34989 раз(а).

Внешние атаки...
Просмотров 26957 раз(а).

Учебник PHP.
Просмотров 22783 раз(а).

SSI в примерах.
Просмотров 17856 раз(а).



 
 



Руководство по PHP
Пред. Глава 18. Classes and Objects (PHP 4) След.

The magic functions __sleep and __wakeup

serialize() checks if your class has a function with the magic name __sleep. If so, that function is being run prior to any serialization. It can clean up the object and is supposed to return an array with the names of all variables of that object that should be serialized.

The intended use of __sleep is to close any database connections that object may have, committing pending data or perform similar cleanup tasks. Also, the function is useful if you have very large objects which need not be saved completely.

Conversely, unserialize() checks for the presence of a function with the magic name __wakeup. If present, this function can reconstruct any resources that object may have.

The intended use of __wakeup is to reestablish any database connections that may have been lost during serialization and perform other reinitialization tasks.


Пред. Начало След.
Serializing objects - objects in sessions Уровень выше References inside the constructor


 





Copyright © 2005-2011 Project.Net.Ru