mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-20 19:41:36 +02:00
cs Iterator and Registry
This commit is contained in:
@@ -52,9 +52,3 @@ abstract class Registry
|
||||
|
||||
// typically there would be methods to check if a key has already been registered and so on ...
|
||||
}
|
||||
|
||||
// while bootstrapping the application
|
||||
Registry::set(Registry::LOGGER, new \StdClass());
|
||||
|
||||
// throughout the application
|
||||
Registry::get(Registry::LOGGER)->log('foo');
|
||||
|
9
Registry/index.php
Normal file
9
Registry/index.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
use DesignPatterns\Registry;
|
||||
|
||||
// while bootstrapping the application
|
||||
Registry::set(Registry::LOGGER, new \StdClass());
|
||||
|
||||
// throughout the application
|
||||
Registry::get(Registry::LOGGER)->log('foo');
|
Reference in New Issue
Block a user