lithium\g11n\catalog\adapter\Php::read()
Overrides
lithium\g11n\catalog\Adapter::read()
Reads data.
Parameters
-
string
$category
A category.
-
string
$locale
A locale identifier.
-
string
$scope
The scope for the current operation.
Returns
arraySource
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'));
} else {
$data = $this->_merge($data, compact('id', 'translated'));
}
}
}
return $data;
}