本文整理匯總了PHP中FileWriter::open方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileWriter::open方法的具體用法?PHP FileWriter::open怎麽用?PHP FileWriter::open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileWriter
的用法示例。
在下文中一共展示了FileWriter::open方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: open
public function open()
{
if (!isset($this->document)) {
parent::open();
$this->document = new \DOMDocument('1.0', 'utf-8');
}
}
示例2: open
public function open()
{
if (!isset($this->document)) {
parent::open();
$this->document = new \XLSXWriter();
}
}
示例3: open
public function open()
{
if (!isset($this->document)) {
parent::open();
$filename = $this->getDDN();
$this->document = fopen($filename, 'w');
}
}
示例4: store
/**
* Stores current properties to specified file.
*
* @param PhingFile $file File to create/overwrite with properties.
* @param string $header Header text that will be placed (within comments) at the top of properties file.
* @return void
* @throws IOException - on error writing properties file.
*/
function store(PhingFile $file, $header = null)
{
// stores the properties in this object in the file denoted
// if file is not given and the properties were loaded from a
// file prior, this method stores them in the file used by load()
try {
$fw = new FileWriter($file);
$fw->open();
if ($header !== null) {
$fw->write("# " . $header . Phing::getProperty("line.separator"));
}
$fw->write($this->toString());
$fw->close();
} catch (IOException $e) {
throw new IOException("Error writing property file: " . $e->getMessage());
}
}