function create_offline_file($varname, $sourcefile, $destfile) { global $dir_path, $delete_file_array; $source = file_get_contents($sourcefile); // Remove comments from source $source = preg_replace('!/\\*.*?\\*/!s', '', $source); // If this is an xml file, remove the <? xml ... line $source = preg_replace('/<\\?.*\\?>/', '', $source); $dest = $varname . " = hereDoc(function(){/*!\n"; $dest .= $source; $dest .= "\n*/});"; directory_maker($destfile); file_put_contents($dir_path . $destfile, $dest); array_push($delete_file_array, $dir_path . $destfile); }
/** * * Function copy extra files * This function copies the files from parent template folder into the zip * @version 1.0 * @author Patrick Lockley, Tom Reijnders */ function copy_extra_files() { global $file_array, $dir_path, $xerte_toolkits_site, $delete_file_array; while ($file = array_pop($file_array)) { if (strlen($file[1]) == 0) { $string = str_replace($xerte_toolkits_site->root_file_path, "", $file[0]); } else { $string = $file[1]; } directory_maker($string); array_push($delete_file_array, $dir_path . $string); @copy($file[0], $dir_path . $string); } }