PHP Classes

Simple Singleton and Multiton Class: Create and manage one or more singleton objects

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 49%Total: 561 This week: 1All time: 5,436 This week: 560Up
Version License PHP version Categories
singleton-multiton 1.0GNU Lesser Genera...5.0PHP 5, Design Patterns
Description 

Author

This package can be used to create and manage one or more singleton objects.

There is one class that can manage one singleton object, assuring that only one instance of the class is created.

Another class can manage multiple singleton objects which are distinguished by name.

Innovation Award
PHP Programming Innovation award nominee
August 2010
Number 10
Singleton is a common design pattern used to assure that only one object of a given class is created within the lifetime of a running script.

Sometimes you need to manage multiple singletons for different classes. This package can be used to manage the creation of multiple singletons within the same script.

Manuel Lemos
Picture of Andrei Alexandru
  Performance   Level  
Name: Andrei Alexandru <contact>
Classes: 4 packages by
Country: Spain Spain
Age: 38
All time rank: 251565 in Spain Spain
Week rank: 411 Up13 in Spain Spain Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

  Files folder image Files  
File Role Description
Accessible without login Plain text file multiton.class.php Class Multiton Implementation Class
Accessible without login Plain text file multiton.test.php Example Usage ot the multiton Class
Accessible without login Plain text file singleton.class.php Class Singleton Implementation Class
Accessible without login Plain text file singleton.test.php Example Usage ot the singleton Class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:561
This week:1
All time:5,436
This week:560Up
 User Ratings  
 
 All time
Utility:70%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:65%StarStarStarStar
Tests:-
Videos:-
Overall:49%StarStarStar
Rank:2856