mezon / singleton
Simple singleton
Installs: 1 450
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 0
Open Issues: 0
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-10-23 15:26:20 UTC
README
##Intro##
This class implements basic singleton pattern.
##Usage##
Using singleton behaviour in your applications is so simple as it can be. Just extend the class Singleton, and enjoy using it!
See the code:
// 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 }
That's all!
You can see the Template Engine class for real usage of this pattern.