public static function compile($files) { $content = "<?php\n"; foreach ($files as $file) { $content .= file::compile($file); } $content .= "\n?>"; return $content; }
public static function runtime() { if (!is_file(ZOTOP_RUNTIME . DS . '~runtime.php')) { $registers = zotop::register(); $content = array(); $content[] = '<?php'; foreach ($registers as $file) { $content[] = file::compile($file); } $content[] = '?>'; file::write(ZOTOP_RUNTIME . DS . '~runtime.php', implode("\n", $content)); } //缓存配置文件 zotop::data(ZOTOP_RUNTIME . DS . '~config.php', zotop::config()); }
<?php require 'class/file.php'; echo file::compile('../files/sample_code/6/');