/** * Writes the License text to a file * * @param string Filename to write to (default is ./LICENSE) * @return bool Success state * @access public */ function writeToFile($path = "./LICENSE") { $fp = new CodeGen_Tools_FileReplacer($path); $fp->puts($this->getText()); return $fp->close(); }
/** * Write EXPERIMENTAL file for non-stable extensions * * @access private * @param string directory to write to */ function writeExperimental() { if ($this->release && $this->release->getState() === 'stable') { return; } $this->addPackageFile("doc", "EXPERIMENTAL"); $fp = new CodeGen_Tools_FileReplacer($this->dirpath . "/EXPERIMENTAL"); $fp->puts("this extension is experimental,\nits functions may change their names \nor move to extension all together \nso do not rely to much on them \nyou have been warned!\n"); $fp->close(); }
/** * write current output buffer to file * * @param file path * @param formating flags * @access private */ function write() { $stat = true; if ($this->path) { $text = ob_get_clean(); $fp = new CodeGen_Tools_FileReplacer($this->path); if ($this->flags && self::OB_TABIFY) { $text = CodeGen_Tools_Indent::tabify($text); } else { if ($this->flags && self::OB_UNTABIFY) { $text = CodeGen_Tools_Indent::untabify($text); } } if ($this->flags && self::OB_DOSIFY) { $text = CodeGen_Tools_Indent::tabify($text); } $fp->puts($text); $stat = $fp->close(); $this->path = ""; } return $stat; }