Advertisement
Guest User

Untitled

a guest
Jul 16th, 2013
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  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. ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement