Writes XML File from Storage.
@access		public
@return 	bool
974835
public function write()
	{
		$writer	= new XML_DOM_FileWriter( $this->fileName );
		$root	= new XML_DOM_Node( $this->getOption( 'tag_root' ) );
		$this->writeRecursive( $root, $this->storage );
		return $writer->write( $root );
	}
486827
public function dump()
    {
        // Create a new XML document
        $document = new \DOMDocument('1.0', 'utf-8');
        $document->preserveWhiteSpace = false;
        $document->formatOutput = true;
        $document->loadXML($this->xml->asXML());

        return $document->saveXML();
    }
799411
private function write()
	{
		$content = '';

		foreach ($this->getFiles() as $file)
		{
			$content .= '$this->call(\'' . str_replace('.php', '', $file) . '\');';	
		}
		
		$databaseSeeder = str_replace('{calls}', $content, $this->getPattern());

		$this->getFilesystem()->put(app_path() . '/database/seeds/DatabaseSeeder.php', $databaseSeeder);
	}
1077289
public function saveXmlFile($path = '')
    {
        $this->formatOutput = true;

        if ($path) {
            $bool = @$this->save($path);
            if (!$bool) {
                $this->error = 'save_file_error';
                return false;
            }

            return true;
        }

        return $this->saveXML();
    }
151029
public function clear(): XmlStreamWriter
    {
        unset($this->writer);
        $this->writer = $this->createWriter($this->version(), $this->encoding());
        return parent::clear();
    }
295596
public function outputXML ()
	{
		
		// Create DOMDocument
		
		$doc	= new \DOMDocument ('1.0', 'UTF-8');
		
		// Generate XML
		
		$xml	= $this->generateXML ($doc);
		
		// Append XML
		
		$doc->appendChild ($xml);
		
		// Return XML
		
		return $doc->saveXML ();
		
	}
1134627
protected function close_xml_writer() {
        if ($this->xmlwriter instanceof xml_writer) {
            $this->xmlwriter->stop();
        }
        unset($this->xmlwriter);
        $this->xmlwriter = null;
        $this->xmlfilename = null;
    }
1089177
public function write()
    {
        try {
            $this->envWriter->save($this->answers);
            $this->io->out(sprintf('Answers saved to %s', $this->envFile));
            return true;
        } catch (WritableException $e) {
            $this->io->out($e->getMessage());
            return false;
        }
    }
508399
public function clear(): XmlStreamWriter
    {
        $this->doc          = new \DOMDocument($this->version(), $this->encoding());
        $this->openElements = [$this->doc];
        return parent::clear();
    }
421339
protected function write()
	{
		$file		= new FS_File_Writer( $this->fileName );
		$newLines	= array();
		$currentSection	= "";
		foreach( $this->lines as $line )
		{
			if( $this->usesSections() && preg_match( $this->patternSection, $line ) )
			{
				$lastSection = $currentSection;
#				$newAdded = array();
				if( $lastSection )
				{
					foreach( $this->added as $nr => $property )
					{
						if( $property['section'] == $lastSection )
						{
							if( !trim( $newLines[count($newLines)-1] ) )
								array_pop( $newLines );
							$newLines[]	= $this->buildLine( $property['key'], $property['value'], $property['comment'] );
							$newLines[]	= "";
							unset( $this->added[$nr] );
						}
#						else $newAdded[] = $property;
					}
				}
				$currentSection =  substr( trim( $line ), 1, -1 );
				if( !in_array( $currentSection, $this->sections ) )
					continue;
			}
			else if( preg_match( $this->patternProperty, $line ) )
			{
				$pos		= strpos( $line, "=" );
				$key		= trim( substr( $line, 0, $pos ) );
				$pureKey	= preg_replace( $this->patternDisabled, "", $key );
				$parts		= explode(  "//", trim( substr( $line, $pos+1 ) ) );
				if( count( $parts ) > 1 )
					$comment = trim( $parts[1] );
				if( $this->usesSections() )
				{
					if( in_array( $currentSection, $this->sections ) )
					{
						if( isset( $this->deleted[$currentSection] ) && in_array( $pureKey, $this->deleted[$currentSection] ) )
							unset( $line );
						else if( isset( $this->renamed[$currentSection] ) && in_array( $pureKey, array_keys( $this->renamed[$currentSection] ) ) )
						{
							$newKey	= $key	= $this->renamed[$currentSection][$pureKey];
							if( !$this->isActiveProperty( $newKey, $currentSection) )
								$key = $this->signDisabled.$key;
							$comment	= isset( $this->comments[$currentSection][$newKey] ) ? $this->comments[$currentSection][$newKey] : "";
							$line = $this->buildLine( $key, $this->properties[$currentSection][$newKey], $comment );
						}
						else
						{
							if( $this->isActiveProperty( $pureKey, $currentSection ) && preg_match( $this->patternDisabled, $key ) )
								$key = substr( $key, 1 );
							else if( !$this->isActiveProperty( $pureKey, $currentSection ) && !preg_match( $this->patternDisabled, $key ) )
								$key = $this->signDisabled.$key;
							$comment	= isset( $this->comments[$currentSection][$pureKey] ) ? $this->comments[$currentSection][$pureKey] : "";
							$line = $this->buildLine( $key, $this->properties[$currentSection][$pureKey], $comment );
						}
					}
					else
						unset( $line );
				}
				else
				{
					if( in_array( $pureKey, $this->deleted ) )
						unset( $line);
					else if( in_array( $pureKey, array_keys( $this->renamed ) ) )
					{
						$newKey	= $key	= $this->renamed[$pureKey];
						if( !$this->isActiveProperty( $newKey ) )
							$key = $this->signDisabled.$key;
						$line = $this->buildLine( $newKey, $this->properties[$newKey], $this->comments[$newKey] );
					}
					else
					{
						if( $this->isActiveProperty( $pureKey ) && preg_match( $this->patternDisabled, $key ) )
							$key = substr( $key, 1 );
						else if( !$this->isActiveProperty( $pureKey) && !preg_match( $this->patternDisabled, $key ) )
							$key = $this->signDisabled.$key;
						$line = $this->buildLine( $key, $this->properties[$pureKey], $this->getComment( $pureKey ) );
					}
				}
			}
			if( isset( $line ) )
				$newLines[] = $line;
		}
		foreach( $this->added as $property )
		{
			$newLine	= $this->buildLine( $property['key'], $property['value'], $property['comment'] );
			$newLines[]	= $newLine;
		}
		$result			= $file->writeArray( $newLines );
		$this->added	= array();
		$this->deleted	= array();
		$this->renamed	= array();
		$this->read();
		return $result;
	}
1248190
public function save () {
		if (isset ($this->_data['id'])) {
			return $this->_send_and_receive ($this->site . $this->element_name_plural . '/' . $this->_data['id'] . '.xml', 'PUT', $this->_data); // update
		}
		return $this->_send_and_receive ($this->site . $this->element_name_plural . '.xml', 'POST', $this->_data); // create
	}
536643
public function Write()
    {
        $content = "";

        foreach($this->preferences as $key => $data)
        {
            if(is_array($data))
            {
                $is_section = true;

                foreach($data as $dataKey => $dataValues)
                {
                    if(is_long($dataKey))
                    {
                        $is_section = false;
                        break;
                    }
                }

                $content .= "\n";

                //Write global array value
                if(!$is_section)
                {
                    foreach($data as $dataKey => $dataValue)
                    {
                        $content .= $key . '[] = "' . $dataValue . '"' . "\n";
                    }
                }

                //Write section
                else
                {
                    $content .= "[" . $key . "]\n";

                    foreach($data as $dataKey => $dataValue)
                    {
                        if(is_array($dataValue))
                        {
                            foreach($dataValue as $dataInnerValue)
                            {
                                $content .= $dataKey . '[] = "' . $dataInnerValue . '"' . "\n";
                            }
                        }
                        else
                        {
                            $content .= $dataKey . ' = "' . $dataValue . '"' . "\n";
                        }
                    }
                }

                $content .= "\n";
            }

            //Write global value
            else
            {
                $content .= $key . ' = "' . $data . '"' . "\n";
            }
        }

        file_put_contents($this->file, $content);
    }
1208301
public function writeXml(\XMLWriter $xmlWriter)
    {
        $xmlWriter->startElementNS(
            'atom',
            Resources::LINK,
            Resources::ATOM_NAMESPACE
        );
        $this->writeInnerXml($xmlWriter);
        $xmlWriter->endElement();
    }
409037
public function writeXml($filename)
    {
        $dom           = new DOMImplementation;
        $dtd           = $dom->createDocumentType('entity', '', $this->entityDtd);
        $xml           = $dom->createDocument('', '', $dtd);
        $xml->encoding = 'UTF-8';

        $root = $this->createRootElement($xml);
        $root->appendChild($this->createStorageElement($xml));
        $root->appendChild($this->createFieldsElement($xml));
        $root->appendChild($this->createRelationsElement($xml));

        $xml->formatOutput = true;
        $xml->save($filename);
    }
459168
public function IsXmlOutput () {
		if (isset($this->headers['Content-Type'])) {
			$value = $this->headers['Content-Type'];
			return strpos($value, 'xml') !== FALSE;
		}
		return FALSE;
	}
972586
public function write()
    {
        foreach ($this->parameters as $prop => $value) {
            $placeHolders[] = sprintf('<%s>', $prop);
            $replacements[] = $value;
        }

        $config = str_replace($placeHolders, $replacements, self::$configTemplate);
        $config = sprintf('%s%s%s', self::$defaultConfigTemplate, PHP_EOL, $config);

        if (true === $this->parameters['composer']) {
            $config = sprintf('%s%s%s', $config, PHP_EOL, self::$downloadComposerTaskTemplate);
        }

        if (true === $this->parameters['schemadb']) {
            $config = sprintf('%s%s%s', $config, PHP_EOL, self::$updateSchemaTaskTemplate);
        }

        fwrite($this->file, $this->addHeaders($config));
    }
869884
public function putXML(){
		$xml = $this->getXML();
		return $this->distributor->write($xml, $this->proper_path);
	}