PHP Classes
elePHPant
Icontem

True Singleton Class: PHP implementation of the singleton design pattern

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2007-09-26 (9 years ago) RSS 2.0 feedStarStarStar 48%Total: 1,125 All time: 3,225 This week: 1,042Up
Version License PHP version Categories
singleton_class 1.0.5GNU General Publi...5.0PHP 5, Language, Design Patterns
Description Author

In software engineering, a design pattern is a general solution to a common problem in software design. One of these design patterns is called the Singleton. It's purpose can be described quite briefly as follows:

Ensure a class has only one instance and provide a global point of access to it.

It achieves this by only creating a new instance the first time it is referenced, and thereafter it simply returns the handle to the existing instance.

--------------------------------------------------------------------------------------------

sTonClass is a base class that implements the singleton design pattern.

The class can only be instantiated using a static function that assures that there is only one object of that class.

If the class was already instantiated, it returns a reference to the previously created class object.

The class also provides functions for store, retrieving and deleting object properties.

Picture of sourav ray
Name: sourav ray <contact>
Classes: 2 packages by
Country: India India
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Plain text file singleton.class.php Class Singleton Class
Accessible without login Plain text file License.txt Lic. GPL License for sTonClass
Accessible without login Plain text file example.php Example example of use of singleton class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,125
This week:0
All time:3,225
This week:1,042Up
 User Ratings  
 
 All time
Utility:68%StarStarStarStar
Consistency:62%StarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:48%StarStarStar
Rank:2230