private function writeFile($string, $createPhp = true) { $myFile = $this->path; $customer = unserialize($_SESSION['customer']); $site = $customer->getSite(); $ext = substr($myFile, strrpos($myFile, '.')); if ($createPhp) { $this->templateFile = str_replace($ext, '_' . $site->getId() . '.php', $myFile); } else { $this->templateFile = $this->path; } /*write content*/ $filehandler = new Filemaker(); $filehandler->writeFile($this->templateFile, $string); }