示例#1
0
	/**
	 * Save or get the package XML for this component.  This is useful for the
	 * packager
	 *
	 * @param boolean     $minified
	 * @param bool|string $filename
	 *
	 * @return string|null
	 */
	public function savePackageXML($minified = true, $filename = false) {

		$packagexml = new PackageXML();
		$packagexml->setFromComponent($this);

		$out = ($minified) ? $packagexml->asMinifiedXML() : $packagexml->asPrettyXML();

		if ($filename) {
			file_put_contents($filename, $out);
		}
		else {
			return $out;
		}
	}