SHARE
TWEET

Untitled

a guest Jul 16th, 2013 158 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $config->set([
  3.     'database' => function() {
  4.         static $connection;
  5.                 if (!isset($connection)) {
  6.                     $connection = new PDO(...);
  7.                 }
  8.                 return $connection;
  9.     },
  10.         'solr' => function() {
  11.         static $connection;
  12.                 if (!isset($connection)) {
  13.                     $connection = new Solarium\Client(...);
  14.                 }
  15.                 return $connection;
  16.         },
  17.         'cache' => function() {
  18.         static $connection;
  19.                 if (!isset($connection)) {
  20.                     $connection = new Memcache(...);
  21.                 }
  22.                 return $connection;
  23.         },
  24. ]);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top