lithium\g11n\catalog\adapter\Gettext::write()

public method

Writes data.

Parameters

  • string $category

    A category.

  • string $locale

    A locale identifier.

  • string $scope

    The scope for the current operation.

  • array $data

    The data to write.

Returns

boolean

Source

	public function write($category, $locale, $scope, array $data) {
		$files = $this->_files($category, $locale, $scope);

		foreach ($files as $file) {
			$method = '_compile' . ucfirst(pathinfo($file, PATHINFO_EXTENSION));

			if (!$stream = fopen($file, 'wb')) {
				return false;
			}
			$this->invokeMethod($method, array($stream, $data));
			fclose($stream);
		}
		return true;
	}