略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Yaf_Application::__sleep

2023-12-02

Yaf_Application::__sleep

(Yaf >=1.0.0)

Yaf_Application::__sleepYaf_Application 不能被序列化

说明

private Yaf_Application::__sleep ( void ) : void

参数

此函数没有参数。

返回值

add a note add a note

User Contributed Notes 1 note

up
0
akbarishahin at gmail dot com
4 months ago
class Connection
{
    protected $link;
    private $dsn, $username, $password;
   
    public function __construct($dsn, $username, $password)
    {
        $this->dsn = $dsn;
        $this->username = $username;
        $this->password = $password;
        $this->connect();
    }
   
    private function connect()
    {
        $this->link = new PDO($this->dsn, $this->username, $this->password);
    }
   
    public function __sleep()
    {
        return array('dsn', 'username', 'password');
    }
   
   
}

官方地址:https://www.php.net/manual/en/yaf-application.sleep.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3