Advertisement
laurensV6

Untitled

Jan 17th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. $di->set('config', $di->lazyNew(Config::class));
  2.  
  3. $di->set('pdo', $di->lazy(function () use ($di) {
  4.     $config = $di->get('config');
  5.     if($config->database){
  6.         return $di->lazyNew(PdoPlus::class);
  7.     } else {
  8.         return null;
  9.     }
  10. }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement