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


PHP XMLWriter::openMemory方法代碼示例

本文整理匯總了PHP中XMLWriter::openMemory方法的典型用法代碼示例。如果您正苦於以下問題:PHP XMLWriter::openMemory方法的具體用法?PHP XMLWriter::openMemory怎麽用?PHP XMLWriter::openMemory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XMLWriter的用法示例。


在下文中一共展示了XMLWriter::openMemory方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Create new XMLWriter
  *
  * @param int $tempLocation Temporary storage location
  * @param string $tempFolder Temporary storage folder
  */
 public function __construct($tempLocation = self::STORAGE_MEMORY, $tempFolder = './')
 {
     // Create internal XMLWriter
     $this->xmlWriter = new \XMLWriter();
     // Open temporary storage
     if ($tempLocation == self::STORAGE_MEMORY) {
         $this->xmlWriter->openMemory();
     } else {
         // Create temporary filename
         $this->tempFile = @tempnam($tempFolder, 'xml');
         // Fallback to memory when temporary file cannot be used
         // @codeCoverageIgnoreStart
         // Can't find any test case. Uncomment when found.
         if ($this->xmlWriter->openUri($this->tempFile) === false) {
             $this->xmlWriter->openMemory();
         }
         // @codeCoverageIgnoreEnd
     }
     // Set xml Compatibility
     $compatibility = Settings::hasCompatibility();
     if ($compatibility) {
         $this->xmlWriter->setIndent(false);
         $this->xmlWriter->setIndentString('');
     } else {
         $this->xmlWriter->setIndent(true);
         $this->xmlWriter->setIndentString('  ');
     }
 }
開發者ID:FabianoFaria,項目名稱:ULA_front,代碼行數:34,代碼來源:XMLWriter.php

示例2: setupStoreData

 protected function setupStoreData()
 {
     // Using XMLWriter because SimpleXML namespaces on attribute names
     $this->doc = new XMLWriter();
     $this->doc->openMemory();
     $this->doc->setIndent(true);
     $this->doc->setIndentString('    ');
     $this->doc->startDocument('1.0', 'UTF-8');
     $this->doc->startElement('feed');
     $this->doc->writeAttribute('xmlns', 'http://www.w3.org/2005/Atom');
     $this->doc->writeAttribute('xmlns:g', 'http://base.google.com/ns/1.0');
     $this->doc->writeElement('title', $this->getConfig('title'));
     $this->doc->startElement('link');
     $this->doc->writeAttribute('rel', 'self');
     $this->doc->writeAttribute('href', $this->_store->getBaseUrl());
     $this->doc->endElement();
     $date = new Zend_Date();
     $this->doc->writeElement('updated', $date->get(Zend_Date::ATOM));
     $this->doc->startElement('author');
     $this->doc->writeElement('name', $this->getConfig('author'));
     $this->doc->endElement();
     $url = $this->_store->getBaseUrl();
     $day = $date->toString('yyyy-MM-dd');
     $path = $this->getConfig('output');
     $filename = $path . '/' . str_replace('+', '-', strtolower(urlencode($this->_store->getName()))) . '-products.xml';
     $this->doc->writeElement('id', 'tag:' . $url . ',' . $day . ':' . $filename);
 }
開發者ID:0l1v1er,項目名稱:MagentoExtensions,代碼行數:27,代碼來源:Cron.php

示例3: __construct

 /**
  * Create new XMLWriter
  *
  * @param int $tempLocation Temporary storage location
  * @param string $tempFolder Temporary storage folder
  */
 public function __construct($tempLocation = self::STORAGE_MEMORY, $tempFolder = './')
 {
     // Create internal XMLWriter
     $this->xmlWriter = new \XMLWriter();
     // Open temporary storage
     if ($tempLocation == self::STORAGE_MEMORY) {
         $this->xmlWriter->openMemory();
     } else {
         // Create temporary filename
         $this->tempFile = @tempnam($tempFolder, 'xml');
         // Open storage
         if ($this->xmlWriter->openUri($this->tempFile) === false) {
             // Fallback to memory...
             $this->xmlWriter->openMemory();
         }
     }
     // Set xml Compatibility
     $compatibility = Settings::getCompatibility();
     if ($compatibility) {
         $this->xmlWriter->setIndent(false);
         $this->xmlWriter->setIndentString('');
     } else {
         $this->xmlWriter->setIndent(true);
         $this->xmlWriter->setIndentString('  ');
     }
 }
開發者ID:kaantunc,項目名稱:MYK-BOR,代碼行數:32,代碼來源:XMLWriter.php

示例4: __construct

 /**
  * Create a new PHPPowerPoint_Shared_XMLWriter instance
  *
  * @param int		$pTemporaryStorage			Temporary storage location
  * @param string	$pTemporaryStorageFolder	Temporary storage folder
  */
 public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder = './')
 {
     // Create internal XMLWriter
     $this->_xmlWriter = new XMLWriter();
     // Open temporary storage
     if ($pTemporaryStorage == self::STORAGE_MEMORY) {
         $this->_xmlWriter->openMemory();
     } else {
         // Create temporary filename
         $this->_tempFileName = @tempnam($pTemporaryStorageFolder, 'xml');
         // Open storage
         if ($this->_xmlWriter->openUri($this->_tempFileName) === false) {
             // Fallback to memory...
             $this->_xmlWriter->openMemory();
         }
     }
     // Set default values
     // proposed to be false in production version
     $this->_xmlWriter->setIndent(true);
     //$this->_xmlWriter->setIndent(false);
     // Set indent
     // proposed to be '' in production version
     $this->_xmlWriter->setIndentString('  ');
     //$this->_xmlWriter->setIndentString('');
 }
開發者ID:aleph1888,項目名稱:elgg_file_takeout,代碼行數:31,代碼來源:XMLWriter.php

示例5: __construct

 /**
  * Constructor
  * 
  * @param PMF_Faq      $faq      PMF_Faq object
  * @param PMF_Category $category PMF_Category object 
  * 
  * return PMF_Export_Xhtml
  */
 public function __construct(PMF_Faq $faq, PMF_Category $category)
 {
     $this->faq = $faq;
     $this->category = $category;
     $this->xml = new XMLWriter();
     $this->xml->openMemory();
     $this->xml->setIndent(true);
 }
開發者ID:atlcurling,項目名稱:tkt,代碼行數:16,代碼來源:Xhtml.php

示例6: export

 /**
  * Fetches the site with the given name and exports it into XML.
  *
  * @param array<Site> $sites
  * @param boolean $tidy Whether to export formatted XML
  * @param string $nodeTypeFilter Filter the node type of the nodes, allows complex expressions (e.g. "TYPO3.Neos:Page", "!TYPO3.Neos:Page,TYPO3.Neos:Text")
  * @return string
  */
 public function export(array $sites, $tidy = false, $nodeTypeFilter = null)
 {
     $this->xmlWriter = new \XMLWriter();
     $this->xmlWriter->openMemory();
     $this->xmlWriter->setIndent($tidy);
     $this->exportSites($sites, $nodeTypeFilter);
     return $this->xmlWriter->outputMemory(true);
 }
開發者ID:mgoldbeck,項目名稱:neos-development-collection,代碼行數:16,代碼來源:SiteExportService.php

示例7: export

 /**
  * Fetches the site with the given name and exports it into XML.
  *
  * @param array<Site> $sites
  * @param boolean $tidy Whether to export formatted XML
  * @param string $nodeTypeFilter Filter the node type of the nodes, allows complex expressions (e.g. "TYPO3.Neos:Page", "!TYPO3.Neos:Page,TYPO3.Neos:Text")
  * @return string
  */
 public function export(array $sites, $tidy = FALSE, $nodeTypeFilter = NULL)
 {
     $this->xmlWriter = new \XMLWriter();
     $this->xmlWriter->openMemory();
     $this->xmlWriter->setIndent($tidy);
     $this->exportSites($sites, $nodeTypeFilter);
     return $this->xmlWriter->outputMemory(TRUE);
 }
開發者ID:radmiraal,項目名稱:neos-development-collection,代碼行數:16,代碼來源:SiteExportService.php

示例8: __construct

 /**
  * Set and instantiate new UTF-8 XML document
  */
 public function __construct()
 {
     $this->context = new \XMLWriter();
     $this->context->openMemory();
     $this->context->startDocument('1.0', 'UTF-8');
     $this->context->setIndent(true);
     $this->context->setIndentString("  ");
 }
開發者ID:genesisgateway,項目名稱:genesis_php,代碼行數:11,代碼來源:XML.php

示例9: __construct

 public function __construct(DOMElement $context, $line)
 {
     $this->contextNode = $context;
     $this->writer = new XMLWriter();
     $this->writer->openMemory();
     $this->writer->startElementNs(null, $context->nodeName, 'http://schema.phpunit.de/coverage/1.0');
     $this->writer->writeAttribute('nr', $line);
 }
開發者ID:CHRISTOPHERVANDOMME,項目名稱:zf2complet,代碼行數:8,代碼來源:Coverage.php

示例10: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     $this->map = new \XMLWriter();
     $this->map->openMemory();
     $this->map->startDocument('1.0', 'utf-8');
     $this->map->setIndent(true);
     $this->startSitemap();
 }
開發者ID:sebastian-marinescu,項目名稱:silex-sitemap-service-provider,代碼行數:11,代碼來源:SitemapGenerator.php

示例11: __construct

 /**
  * Construct a new instance of ConnectionParams.
  *
  * @param array &$connectionParams Connection parameters for database.
  */
 public function __construct(&$connectionParams)
 {
     $this->connectionParams = $connectionParams;
     $this->xmlWriter = new \XMLWriter();
     $this->xmlWriter->openMemory();
     $this->xmlWriter->startDocument('1.0', 'UTF-8', 'yes');
     $this->xmlWriter->setIndent(4);
 }
開發者ID:gizur,項目名稱:odatamysqlphpconnect,代碼行數:13,代碼來源:ConnectionParams.php

示例12: startDocument

 /**
  * Start document
  *
  * @param mixed $data
  */
 public function startDocument($data)
 {
     $this->checkStartDocument($data);
     $this->isEmpty = true;
     $this->xmlWriter = new \XMLWriter();
     $this->xmlWriter->openMemory();
     $this->xmlWriter->setIndent($this->formatOutput);
     $this->xmlWriter->startDocument('1.0', 'UTF-8');
 }
開發者ID:dfritschy,項目名稱:ezpublish-kernel,代碼行數:14,代碼來源:Xml.php

示例13: setUp

 public function setUp()
 {
     $this->gen = new Misc();
     $this->record = new \BeerXML\Record\Misc();
     $this->gen->setRecord($this->record);
     $this->xmlWriter = new \XMLWriter();
     $this->xmlWriter->openMemory();
     $this->gen->setXmlWriter($this->xmlWriter);
 }
開發者ID:georgeh,項目名稱:php-beerxml,代碼行數:9,代碼來源:MiscTest.php

示例14: setUp

 protected function setUp()
 {
     $this->generator = new MashProfile();
     $this->xml = new \XMLWriter();
     $this->xml->openMemory();
     $this->generator->setXmlWriter($this->xml);
     $this->record = new \BeerXML\Record\MashProfile();
     $this->generator->setRecord($this->record);
     parent::setUp();
 }
開發者ID:georgeh,項目名稱:php-beerxml,代碼行數:10,代碼來源:MashProfileTest.php

示例15: start

 /**
  * Defined by ReportInterface.
  *
  * @see ReportInterface::start()
  */
 public function start()
 {
     $this->writer = new XMLWriter();
     $this->writer->openMemory();
     $this->writer->setIndent(true);
     $this->writer->setIndentString('    ');
     $this->writer->startDocument('1.0', 'UTF-8');
     $this->writer->startElement('checkstyle');
     $this->writer->writeAttribute('version', '5.5');
 }
開發者ID:hippophp,項目名稱:hippo,代碼行數:15,代碼來源:CheckstyleReporter.php


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