PHP Classes
elePHPant
Icontem

Singleton Trait: Trait that adds singleton pattern to a class

Recommend this page to a friend!
  Info   View files Example   View files View files (15)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-07-10 (3 months ago) RSS 2.0 feedNot enough user ratingsTotal: 228 This week: 2All time: 7,593 This week: 591Up
Version License PHP version Categories
singleton-trait 3.2MIT/X Consortium ...5.4PHP 5, Language, Design Patterns, Traits
Description Author

This is a trait that adds singleton pattern to a class.

The trait can allow the creation of the first object of the class taking optional configuration parameters.

Classes that use the trait may override the init() method to process the parameters that may be restricted to the first instantiation of the object.

Picture of Asher Wolfstein
  Performance   Level  
Innovation award
Innovation award
Nominee: 5x

  Files folder image Files  
File Role Description
Files folder imageFalcraft (1 directory)
Files folder imagesrc (1 directory)
Files folder imagetests (1 directory)
Accessible without login Plain text file composer.json Conf. Composer File
Accessible without login Plain text file LICENSE.txt Lic. License (MIT)
Accessible without login Plain text file phpunit.xml Test Unit Testing
Accessible without login Plain text file README.txt Doc. README

 Version Control Reuses Unique User Downloads Download Rankings  
 0%1
Total:228
This week:2
All time:7,593
This week:591Up