diff options
author | Andreas Gohr <andi@splitbrain.org> | 2023-09-02 14:42:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-02 14:42:51 +0200 |
commit | 5ff5424d8c81c7123d8656a787af2ff85b3dec21 (patch) | |
tree | 322929ee01d892bb3c927e7fe1238369c647f820 /lib/exe/jquery.php | |
parent | 0613df3287b82a98b1e97cf86ed9d4c8fbd16f1c (diff) | |
parent | 91560755291852b8302767d454183a7662666f7e (diff) | |
download | dokuwiki-5ff5424d8c81c7123d8656a787af2ff85b3dec21.tar.gz dokuwiki-5ff5424d8c81c7123d8656a787af2ff85b3dec21.zip |
Merge pull request #4045 from dokuwiki/autofix
Use Rector to autofix code smell
Diffstat (limited to 'lib/exe/jquery.php')
-rw-r--r-- | lib/exe/jquery.php | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/exe/jquery.php b/lib/exe/jquery.php index b8638ecc0..7b0fceb72 100644 --- a/lib/exe/jquery.php +++ b/lib/exe/jquery.php @@ -2,10 +2,10 @@ use dokuwiki\Cache\Cache; -if(!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__) . '/../../'); -if(!defined('NOSESSION')) define('NOSESSION', true); // we do not use a session or authentication here (better caching) -if(!defined('NL')) define('NL', "\n"); -if(!defined('DOKU_DISABLE_GZIP_OUTPUT')) define('DOKU_DISABLE_GZIP_OUTPUT', 1); // we gzip ourself here +if (!defined('DOKU_INC')) define('DOKU_INC', __DIR__ . '/../../'); +if (!defined('NOSESSION')) define('NOSESSION', true); // we do not use a session or authentication here (better caching) +if (!defined('NL')) define('NL', "\n"); +if (!defined('DOKU_DISABLE_GZIP_OUTPUT')) define('DOKU_DISABLE_GZIP_OUTPUT', 1); // we gzip ourself here require_once(DOKU_INC . 'inc/init.php'); // MAIN @@ -20,23 +20,24 @@ jquery_out(); * * uses cache or fills it */ -function jquery_out() { +function jquery_out() +{ $cache = new Cache('jquery', '.js'); - $files = array( + $files = [ DOKU_INC . 'lib/scripts/jquery/jquery.min.js', - DOKU_INC . 'lib/scripts/jquery/jquery-ui.min.js', - ); + DOKU_INC . 'lib/scripts/jquery/jquery-ui.min.js' + ]; $cache_files = $files; $cache_files[] = __FILE__; // check cache age & handle conditional request // This may exit if a cache can be used - $cache_ok = $cache->useCache(array('files' => $cache_files)); + $cache_ok = $cache->useCache(['files' => $cache_files]); http_cached($cache->cache, $cache_ok); $js = ''; - foreach($files as $file) { - $js .= file_get_contents($file)."\n"; + foreach ($files as $file) { + $js .= file_get_contents($file) . "\n"; } stripsourcemaps($js); |