minifier.php
\file \brief JS and CSS minifier.
Use this script to minify JS and CSS files from src/js and src/css to js/ and css/.
PHP version 8.1
Tags
Table of Contents
Constants
- LWT_CSS_FILES = array('src/css/css_charts.css', 'src/css/feed_wizard.css', 'src/css/gallery.css', 'src/css/jplayer.css', 'src/css/jquery-ui.css', 'src/css/jquery.tagit.css', 'src/css/styles.css')
- LWT_JS_FILES = array('src/js/audio_controller.js', 'src/js/third_party/countuptimer.js', 'src/js/jq_feedwizard.js', 'src/js/text_events.js', 'src/js/jq_pgm.js', 'src/js/overlib_interface.js', 'src/js/pgm.js', 'src/js/translation_api.js', 'src/js/unloadformcheck.js', 'src/js/third_party/sorttable.js', 'src/js/user_interactions.js')
Functions
- minifyJS() : string
- Minify a JavaScript file and outputs the result to js/
- minifyCSS() : string
- Minify a JavaScript file and outputs the result to css/
- minifyAllJS() : string
- Minify all JavaScript files
- minifyAllCSS() : void
- Minify all Cascading-Style Sheet (CSS) files
- regenerateSingleTheme() : void
- Regenerate a single theme.
- regenerateThemes() : void
- Find and regenerate all themes. CSS is minified while other files are copied.
- minify_everything() : void
- One-do-all command to minify all your JS, CSS, and regenerate themes.
Constants
LWT_CSS_FILES
public
array<string|int, string>
LWT_CSS_FILES
= array('src/css/css_charts.css', 'src/css/feed_wizard.css', 'src/css/gallery.css', 'src/css/jplayer.css', 'src/css/jquery-ui.css', 'src/css/jquery.tagit.css', 'src/css/styles.css')
LWT_CSS_FILES All the paths of CSS files to be minified.
LWT_JS_FILES
public
array<string|int, string>
LWT_JS_FILES
= array('src/js/audio_controller.js', 'src/js/third_party/countuptimer.js', 'src/js/jq_feedwizard.js', 'src/js/text_events.js', 'src/js/jq_pgm.js', 'src/js/overlib_interface.js', 'src/js/pgm.js', 'src/js/translation_api.js', 'src/js/unloadformcheck.js', 'src/js/third_party/sorttable.js', 'src/js/user_interactions.js')
LWT_JS_FILES All the paths of JS files to be minified.
Tags
Functions
minifyJS()
Minify a JavaScript file and outputs the result to js/
minifyJS(string $path, string $outputPath) : string
Parameters
- $path : string
-
Input file path with extension.
- $outputPath : string
-
Output file path with extension
Tags
Return values
string —Minified content
minifyCSS()
Minify a JavaScript file and outputs the result to css/
minifyCSS(string $path, string $outputPath) : string
Parameters
- $path : string
-
Input file path with extension.
- $outputPath : string
-
Output file path with extension
Tags
Return values
string —Minified content
minifyAllJS()
Minify all JavaScript files
minifyAllJS() : string
Tags
Return values
string —Minified code
minifyAllCSS()
Minify all Cascading-Style Sheet (CSS) files
minifyAllCSS() : void
Tags
regenerateSingleTheme()
Regenerate a single theme.
regenerateSingleTheme(string $parent_folder, string $theme_folder) : void
Parameters
- $parent_folder : string
-
Path to the parent folder (I. E. src/themes/)
- $theme_folder : string
-
Name of the theme folder
regenerateThemes()
Find and regenerate all themes. CSS is minified while other files are copied.
regenerateThemes() : void
Nested folders are ignored.
minify_everything()
One-do-all command to minify all your JS, CSS, and regenerate themes.
minify_everything() : void