(array $modules, $key = null, $sign = null)
| 247 | } |
| 248 | |
| 249 | protected function compileModules(array $modules, $key = null, $sign = null) |
| 250 | { |
| 251 | $xxtea = null; |
| 252 | if (!empty($key)) |
| 253 | { |
| 254 | $xxtea = new XXTEA(); |
| 255 | $xxtea->setKey($key); |
| 256 | } |
| 257 | |
| 258 | $modulesBytes = array(); |
| 259 | foreach ($modules as $path => $module) |
| 260 | { |
| 261 | $bytes = getScriptFileBytecodes($path, $module['tempFilePath'], $this->config['jit']); |
| 262 | if ($xxtea) |
| 263 | { |
| 264 | $bytes = $sign . $xxtea->encrypt($bytes); |
| 265 | file_put_contents($module['tempFilePath'], $bytes); |
| 266 | } |
| 267 | if (!$bytes) |
| 268 | { |
| 269 | print("\n"); |
| 270 | return false; |
| 271 | } |
| 272 | $modulesBytes[$path] = $bytes; |
| 273 | if (!$this->config['quiet']) |
| 274 | { |
| 275 | printf(" > get bytes [% 3d KB] %s\n", ceil(strlen($bytes) / 1024), $module['moduleName']); |
| 276 | } |
| 277 | } |
| 278 | return $modulesBytes; |
| 279 | } |
| 280 | |
| 281 | protected function createOutputZIP(array $modules, array $bytes) |
| 282 | { |
no test coverage detected