Esempio n. 1
0
 /**
  * save xml file, optionally will return as string
  *
  * @param string $url xml file path
  * @param boolean $asString if true return as string
  * @return string|boolean
  * 
  * @example saveXmlFile('path/filename.xml'); save to file
  * @example saveXmlFile(false, true) will return as simple text
  */
 public function saveXmlFile($url, $asString = false)
 {
     Register::tracer('save xml file', debug_backtrace(), '7E3A02');
     $this->formatOutput = true;
     if ($url) {
         $bool = $this->save($url);
         if (!$bool) {
             $this->_error = 'save_file_error';
             return false;
         }
     }
     if ($asString) {
         return $this->saveXML();
     }
     return true;
 }