Login   Register  
PHP Classes
elePHPant
Icontem

True Singleton Class: PHP implementation of the singleton design pattern

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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 (7 years ago) RSS 2.0 feedStarStarStar 48%Total: 1,104 All time: 3,148 This week: 1,595Up
Version License PHP version Categories  
singleton_class 1.0.5GNU General Public Lice...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 is available for providing paid consulting. Contact sourav ray .
Classes: 2 packages by
Country: India India
Age: 35
All time rank: 150483 in India India
Week rank: 1803 Down131 in India India Down
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,104All time:3,148
 This week:0This week:1,595Up
 User Ratings  
 
 All time
Utility:68%StarStarStarStar
Consistency:62%StarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:48%StarStarStar
Rank:1760