lithium\g11n\catalog\adapter\Php::read PHP Method

read() public method

Reads data.
public read ( string $category, string $locale, string $scope ) : array
$category string A category.
$locale string A locale identifier.
$scope string The scope for the current operation.
return array
    public function read($category, $locale, $scope)
    {
        $path = $this->_config['path'];
        $file = $this->_file($category, $locale, $scope);
        $data = array();
        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;
    }