lithium\g11n\catalog\adapter\Php::read()

public method

Reads data.

Parameters

  • string $category

    A category.

  • string $locale

    A locale identifier.

  • string $scope

    The scope for the current operation.

Returns

array

Source

	public function read($category, $locale, $scope) {
		$path = $this->_config['path'];
		$file = $this->_file($category, $locale, $scope);
		$data = [];

		if (file_exists($file)) {
			foreach (require $file as $id => $translated) {
				if (strpos($id, '|') !== false) {
					list($id, $context) = explode('|', $id);
				}
				$data = $this->_merge($data, compact('id', 'translated', 'context'));
			}
		}
		return $data;
	}