Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 30 | All time: 10,938 This week: 134![]() |
Version | License | PHP version | Categories | |||
mezon-singleton 1.0 | MIT/X Consortium ... | 5 | PHP 5, Language, Design Patterns |
Description | Author | |
This class can be used to create object of a class that only has 1 instance. |
This class implements basic singleton pattern.
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.
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation | ||
![]() |
Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.