compiler

TextileThis($plugin['help_raw']); } $code = file($s . '.php'); $plugin['code'] = ''; for ($i=1; $i < count($code) - 1; $i++) { $plugin['code'] .= rtrim($code[$i])."\n"; }; $plugin['md5'] = md5( $plugin['code'] ); $f = '../plugins/' . $_GET['plugin'] . '/current/' . $plugin['name'] . '.txt'; //var_dump($plugin); $fp = fopen($f, 'w+'); fwrite($fp, compile_plugin($plugin)); fclose($fp); echo "Plugin compiled."; }; ?>
plugin functions
compile
* @param $dir string absoluter Pfad zum Verzeichnis * @param $ordner bool sollen Ordner in die Liste aufgenommen werden? * @desc überprüft ein Verzeichnis und gibt alle enthaltenen Dateien (und Ordner) zurück */ function dirIndex($dir,$ordner = false){ if (is_dir($dir)){ $output = array(); $handle = opendir($dir); if (!$handle) { return false; } while ($file = readdir($handle)) { if ($file <> "." && $file <> ".." && $file <> ".svn" && $file <> "CVS") { if (!is_dir($file)) { $output[] = $file; } elseif (is_dir($file) && $ordner == true) { $output[] = $file; } } } closedir($handle); if (is_array($output)) { sort($output); } return $output; } return false; } function compile_plugin($plugin = false) { //header('Content-type: text/plain'); $compiled = date('r'); $header = << admin > plugins # Paste the following text into the 'Install plugin' box: # ...................................................................... EOF; $body = trim(chunk_split(base64_encode(gzencode(serialize($plugin))), 72)); return $header . "\n\n" . trim(chunk_split(base64_encode(serialize($plugin)), 72)). "\n"; } ?>