File dev-helper/update.php

Last commit: Sat Aug 22 02:27:48 2020 +0200	Jan Dankert	Recatoring: New script 'update.sh' for a more comfortable way to update the internal ui elements.
1 <?php 2 3 use cms\ui\themes\ThemeCompiler; 4 use language\LanguageCompiler; 5 6 define('XSD' ,'xsd' ); 7 define('TPL' ,'tpl' ); 8 define('ALL' ,'all' ); 9 define('CSS' ,'css' ); 10 define('JS' ,'js' ); 11 define('LANG','lang'); 12 13 $type = $_POST['type']; 14 15 16 if ( @$type ) 17 { 18 ini_set('display_errors', 1); 19 ini_set('html_errors', 0); 20 error_reporting(E_ALL & ~E_NOTICE); 21 22 require (__DIR__.'/../modules/autoload.php'); 23 24 header('Content-Type: text/plain'); 25 switch ($type) { 26 case XSD: 27 require (__DIR__.'/../modules/template_engine/components/XSDGenerator.php'); 28 break; 29 30 case TPL: 31 require (__DIR__.'/../modules/template_engine/TemplateCompiler.php'); 32 break; 33 34 case LANG: 35 $compiler = new LanguageCompiler(); 36 $compiler->updateProduction(); 37 break; 38 39 case CSS: 40 $compiler = new ThemeCompiler(); 41 $compiler->compileStyles(); 42 break; 43 44 case JS: 45 $compiler = new ThemeCompiler(); 46 $compiler->compileScripts(); 47 break; 48 49 default: 50 echo "Unknown type"; 51 http_response_code(400); // "Bad Request" 52 } 53 } 54 55 else { 56 ?> 57 <html> 58 59 <body> 60 61 62 <h1>Updating OpenRat UI components</h1> 63 64 <p><i>Only for developers</i></p> 65 66 <form action="./<?php echo basename(__FILE__) ?>" method="POST"> 67 68 69 <div><label><input type="radio" name="type" value="<?php echo XSD ?>" /> XSD Generator</label></div> 70 <div><label><input type="radio" name="type" value="<?php echo TPL ?>" /> Template Compiler</label></div> 71 <div><label><input type="radio" name="type" value="<?php echo CSS ?>" /> LESS Compiler and CSS Minifier</label></div> 72 <div><label><input type="radio" name="type" value="<?php echo JS ?>" /> JS Minifier</label></div> 73 <div><label><input type="radio" name="type" value="<?php echo LANG ?>" /> Language files Compiler</label></div> 74 75 <div><input type="submit" /></div> 76 </form> 77 78 </body> 79 </html><?php } ?>
Download dev-helper/update.php
History Sat, 22 Aug 2020 02:27:48 +0200 Jan Dankert Recatoring: New script 'update.sh' for a more comfortable way to update the internal ui elements. Fri, 21 Aug 2020 00:22:13 +0200 Jan Dankert Refactoring: Collect all frontend compiler scripts in update.php. Compiling of CSS and JS was extracted to a new TemplateCompiler. JS and CSS is now collected in a new openrat.[min.][js|css].