PHP Singleton PDO

后端 未结 5 1618
臣服心动
臣服心动 2021-02-09 08:45

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         


        
5条回答
  •  轮回少年
    2021-02-09 09:14

    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().

提交回复
热议问题