| Recommend this page to a friend! | 
|  Download | 
| Info | Example |  Files |  Install with Composer |  Download | Reputation | Support forum | Blog | Links | 
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not enough user ratings | Total: 250 | All time:  7,925 This week: 49  | ||||
| Version | License | PHP version | Categories | |||
| singleton-trait 3.2 | MIT/X Consortium ... | 5.4 | PHP 5, Language, Design Patterns, Traits | 
| Description | Author | |
| This is a trait that adds singleton pattern to a class. | 
| 
<?php
 | 
|  Files (15) | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Falcraft (1 directory) | ||||
|  src (1 directory) | ||||
|  tests (1 directory) | ||||
|    composer.json | Conf. | Composer File | ||
|    LICENSE.txt | Lic. | License (MIT) | ||
|    phpunit.xml | Test | Unit Testing | ||
|    README.txt | Doc. | README | ||
|  Files (15) | / | Falcraft | / | Patterns | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Exception (2 files) | ||||
|  Resource (1 file) | ||||
|    SingletonExampleAndTest.php | Example | A registry singleton example | ||
|  SingletonTrait.php | Class | The Singleton Trait | ||
|  Files (15) | / | Falcraft | / | Patterns | / | Exception | 
| File | Role | Description | 
|---|---|---|
|  ExceptionInterface.php | Class | Custom/Local Exception Interface | 
|  RuntimeException.php | Class | Custom/Local Runtime Exception | 
|  Files (15) | / | Falcraft | / | Patterns | / | Resource | 
| File | Role | Description | 
|---|---|---|
|  SingletonInterface.php | Class | An interface to identify singletons, separate from trait | 
|  Files (15) | / | src | / | Phabstractic | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Patterns (2 directories) | ||||
|    falcraftLoad.php | Conf. | Loader | ||
|  Files (15) | / | src | / | Phabstractic | / | Patterns | 
|  Files (15) | / | src | / | Phabstractic | / | Patterns | / | Exception | 
| File | Role | Description | 
|---|---|---|
|  ExceptionInterface.php | Class | exception classification | 
|  RuntimeException.php | Class | exception classification | 
|  Files (15) | / | src | / | Phabstractic | / | Patterns | / | Resource | 
| File | Role | Description | 
|---|---|---|
|  SingletonInterface.php | Class | Main Trait | 
|  SingletonTrait.php | Class | Main Trait | 
|  Files (15) | / | tests | / | Phabstractic | / | Patterns | / | Resource | 
| File | Role | Description | 
|---|---|---|
|    SingletonTrait.php | Test | unit testing | 
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
|  Install with Composer | 
| Version Control | Reuses | Unique User Downloads | Download Rankings | ||||||||||||||||
| 0% | 1 | 
 | 
 | 
| Applications that use this package | 
 If you know an application of this package, send a message to the author to add a link here.
 If you know an application of this package, send a message to the author to add a link here.
| Other classes that need this package | 
| Class | Why it is needed | Dependency | 
|---|---|---|
| PHP Registry with Singleton Trait | Required to make registry a singleton | Required | 
| Related pages | 
| Location in Git Hub Repository | 
| Info on Singleton Pattern | 
| Traits Explanation | 
| Singleton Class Explanation |