factory.php 591 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. *
  8. */
  9. namespace OC\L10N;
  10. /**
  11. * TODO: Description
  12. */
  13. class Factory {
  14. /**
  15. * cached instances
  16. */
  17. protected $instances = array();
  18. /**
  19. * get an L10N instance
  20. * @param $app string
  21. * @param $lang string|null
  22. * @return \OC_L10N
  23. */
  24. public function get($app) {
  25. if (!isset($this->instances[$app])) {
  26. $this->instances[$app] = new \OC_L10N($app);
  27. }
  28. return $this->instances[$app];
  29. }
  30. }