grommunio /
grommunio-web
| 1 | <?php |
||
| 2 | // Load the release files (concatenated, compressed) |
||
| 3 | define("LOAD_RELEASE", 1); |
||
| 4 | // Load the debug files (concatenated, not compressed) |
||
| 5 | define("LOAD_DEBUG", 2); |
||
| 6 | // Load the original source files (for developers) |
||
| 7 | define("LOAD_SOURCE", 3); |
||
| 8 | |||
| 9 | define('DEBUG_LOADER', LOAD_SOURCE); |
||
| 10 | define('PATH_PLUGIN_DIR', '.'); |
||
| 11 | |||
| 12 | include('defaults.php'); |
||
| 13 | include('server/includes/loader.php'); |
||
| 14 | include('server/includes/core/class.pluginmanager.php'); |
||
| 15 | |||
| 16 | function create_arg($files) { |
||
| 17 | $output = ''; |
||
| 18 | foreach($files as $file) { |
||
| 19 | $output .= file_get_contents($file); |
||
| 20 | } |
||
| 21 | return $output; |
||
| 22 | } |
||
| 23 | |||
| 24 | // Only include extjs-mod |
||
| 25 | function filter_extjsmod($file) { |
||
| 26 | return strpos($file, "extjs-mod") !== FALSE; |
||
| 27 | } |
||
| 28 | |||
| 29 | if ($argc < 3 ) { |
||
| 30 | exit("Usage: loadorder <extjs|grommunio> <filename>\n"); |
||
| 31 | } |
||
| 32 | |||
| 33 | $arg = $argv[1]; |
||
| 34 | $filename = $argv[2]; |
||
| 35 | if ($arg !== "extjs" && $arg !== "grommunio") { |
||
| 36 | exit("Invalid argument $arg"); |
||
| 37 | } |
||
| 38 | |||
| 39 | # TODO: refactor pluginmanager out |
||
| 40 | $GLOBALS['PluginManager'] = new PluginManager(false); |
||
| 41 | $loader = new FileLoader(); |
||
| 42 | |||
| 43 | if ($arg === "extjs") { |
||
| 44 | $files = array_filter($loader->getExtjsJavascriptFiles(LOAD_SOURCE), "filter_extjsmod"); |
||
| 45 | file_put_contents($filename, create_arg($files)); |
||
| 46 | } |
||
| 47 | |||
| 48 | if ($arg === "grommunio") { |
||
| 49 | $files = $loader->getZarafaJavascriptFiles(LOAD_SOURCE); |
||
| 50 | file_put_contents($filename, create_arg($files)); |
||
| 51 | } |
||
| 52 | |||
| 53 | ?> |
||
|
0 ignored issues
–
show
|
|||
| 54 |
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.