PHP Singleton PDO

后端 未结 3 756
滥情空心
滥情空心 2021-02-09 08:50

from http://www.php.net/manual/en/class.pdo.php

###### config.ini ######
db_driver=mysql
db_user=root
db_password=924892xp

[dsn]
host=localhost
port=3306
dbname         


        
3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-09 09:29

    A singleton is an object that ensures that only one instance of itself is active at a time. That is, you can only make one per program, if you know what I mean.

    A static method is one that can be called like a normal function, outside of object context. Like SomeClass:afunc() and not only $this->afunc().

提交回复
热议问题