mezon / singleton
简单单例
1.0.1
2021-11-23 09:07 UTC
Requires
- php: >=7.2.0
Requires (Dev)
- infection/infection: ^0.21.5
- phpunit/php-token-stream: 3.1.2
- phpunit/phpunit: ^8.5
- vimeo/psalm: ^4.2
This package is auto-updated.
Last update: 2024-09-23 15:19:19 UTC
README
##简介##
此类实现了基本单例模式。
##使用##
在您的应用程序中使用单例行为非常简单。只需扩展 Singleton 类,并享受使用它!
查看代码
// including all necessary files require_once( dirname( dirname( dirname( __FILE__ ) ) ).'/conf/conf.php' ); require_once( $MEZON_PATH.'/vendor/singleton/singleton.php' ); // creatingyour own class class MyClass extends Singleton { // methods and their implementations }
这就完了!
您可以在模板引擎类中看到此模式的实际使用。