From 4e0c4c8f34d3eca1cecd50401d68161af9adfb8e Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Mon, 7 Oct 2013 09:38:35 +0200 Subject: move l10n factory into private --- lib/private/l10n/factory.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/private/l10n/factory.php (limited to 'lib/private/l10n') diff --git a/lib/private/l10n/factory.php b/lib/private/l10n/factory.php new file mode 100644 index 00000000000..ba168872acd --- /dev/null +++ b/lib/private/l10n/factory.php @@ -0,0 +1,34 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + * + */ + +namespace OC\L10N; + +/** + * TODO: Description + */ +class Factory { + /** + * cached instances + */ + protected $instances = array(); + + /** + * get an L10N instance + * @param $app string + * @param $lang string|null + * @return OC_L10N + */ + public function get($app) { + if (!isset($this->instances[$app])) { + $this->instances[$app] = new \OC_L10N($app); + } + return $this->instances[$app]; + } + +} -- cgit v1.2.3