當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FileWriter::open方法代碼示例

本文整理匯總了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');
     }
 }
開發者ID:beleneglorion,項目名稱:xtoy,代碼行數:7,代碼來源:SitemapWriter.php

示例2: open

 public function open()
 {
     if (!isset($this->document)) {
         parent::open();
         $this->document = new \XLSXWriter();
     }
 }
開發者ID:beleneglorion,項目名稱:xtoy,代碼行數:7,代碼來源:XLSXWriter.php

示例3: open

 public function open()
 {
     if (!isset($this->document)) {
         parent::open();
         $filename = $this->getDDN();
         $this->document = fopen($filename, 'w');
     }
 }
開發者ID:beleneglorion,項目名稱:xtoy,代碼行數:8,代碼來源:CSVWriter.php

示例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());
     }
 }
開發者ID:jonphipps,項目名稱:Metadata-Registry,代碼行數:25,代碼來源:Properties.php


注:本文中的FileWriter::open方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。