diff --git a/Dockerfile b/Dockerfile
index b9489fe6..beb3c42e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,7 +9,7 @@ RUN apt install -y composer imagemagick vim
COPY composer.json /app/
WORKDIR /app
-RUN mkdir -p lib/vendor/css lib/vendor/js lib/vendor/swf data/config
+RUN mkdir -p data/config
RUN composer install
COPY . /app/
diff --git a/composer.json b/composer.json
index 025aadfe..509164c6 100644
--- a/composer.json
+++ b/composer.json
@@ -24,6 +24,7 @@
"require" : {
"php" : ">=7.1",
+ "ext-pdo": "*",
"flexihash/flexihash" : "^2.0.0",
"ifixit/php-akismet" : "1.*",
@@ -36,36 +37,10 @@
"bower-asset/jquery-timeago" : "1.5.2",
"bower-asset/tablesorter" : "dev-master",
"bower-asset/mediaelement" : "2.21.1",
- "bower-asset/js-cookie" : "2.1.1",
- "ext-pdo": "*"
+ "bower-asset/js-cookie" : "2.1.1"
},
"require-dev" : {
"phpunit/phpunit" : "6.*"
- },
-
- "vendor-copy": {
- "vendor/bower-asset/jquery/dist/jquery.min.js" : "lib/vendor/js/jquery-1.12.3.min.js",
- "vendor/bower-asset/jquery/dist/jquery.min.map" : "lib/vendor/js/jquery-1.12.3.min.map",
- "vendor/bower-asset/jquery-timeago/jquery.timeago.js" : "lib/vendor/js/jquery.timeago.js",
- "vendor/bower-asset/tablesorter/jquery.tablesorter.min.js" : "lib/vendor/js/jquery.tablesorter.min.js",
- "vendor/bower-asset/mediaelement/build/flashmediaelement.swf" : "lib/vendor/swf/flashmediaelement.swf",
- "vendor/bower-asset/js-cookie/src/js.cookie.js" : "lib/vendor/js/js.cookie.js"
- },
-
- "scripts": {
- "pre-install-cmd" : [
- "php -r \"array_map('unlink', array_merge(glob('lib/vendor/js/j*.{js,map}', GLOB_BRACE), glob('lib/vendor/css/*.css'), glob('lib/vendor/swf/*.swf')));\""
- ],
- "pre-update-cmd" : [
- "php -r \"array_map('unlink', array_merge(glob('lib/vendor/js/j*.{js,map}', GLOB_BRACE), glob('lib/vendor/css/*.css'), glob('lib/vendor/swf/*.swf')));\""
- ],
-
- "post-install-cmd" : [
- "php -r \"array_map('copy', array_keys(json_decode(file_get_contents('composer.json'), TRUE)['vendor-copy']), json_decode(file_get_contents('composer.json'), TRUE)['vendor-copy']);\""
- ],
- "post-update-cmd" : [
- "php -r \"array_map('copy', array_keys(json_decode(file_get_contents('composer.json'), TRUE)['vendor-copy']), json_decode(file_get_contents('composer.json'), TRUE)['vendor-copy']);\""
- ]
}
}
diff --git a/core/_install.php b/core/_install.php
index d84fbbc4..d8971fc0 100644
--- a/core/_install.php
+++ b/core/_install.php
@@ -27,7 +27,7 @@ date_default_timezone_set('UTC');
Shimmie Installation
-
+
diff --git a/core/page.php b/core/page.php
index f802dbaf..e223500e 100644
--- a/core/page.php
+++ b/core/page.php
@@ -333,33 +333,17 @@ class Page {
}
/*** Generate CSS cache files ***/
- $css_lib_latest = $config_latest;
- $css_lib_files = zglob("lib/vendor/css/*.css");
- foreach($css_lib_files as $css) {
- $css_lib_latest = max($css_lib_latest, filemtime($css));
- }
- $css_lib_md5 = md5(serialize($css_lib_files));
- $css_lib_cache_file = data_path("cache/style.lib.{$theme_name}.{$css_lib_latest}.{$css_lib_md5}.css");
- if(!file_exists($css_lib_cache_file)) {
- $css_lib_data = "";
- foreach($css_lib_files as $file) {
- $file_data = file_get_contents($file);
- $pattern = '/url[\s]*\([\s]*["\']?([^"\'\)]+)["\']?[\s]*\)/';
- $replace = 'url("../../'.dirname($file).'/$1")';
- $file_data = preg_replace($pattern, $replace, $file_data);
- $css_lib_data .= $file_data . "\n";
- }
- file_put_contents($css_lib_cache_file, $css_lib_data);
- }
- $this->add_html_header("", 43);
-
$css_latest = $config_latest;
- $css_files = array_merge(zglob("lib/shimmie.css"), zglob("ext/{".ENABLED_EXTS."}/style.css"), zglob("themes/$theme_name/style.css"));
+ $css_files = array_merge(
+ zglob("lib/shimmie.css"),
+ zglob("ext/{".ENABLED_EXTS."}/style.css"),
+ zglob("themes/$theme_name/style.css"),
+ );
foreach($css_files as $css) {
$css_latest = max($css_latest, filemtime($css));
}
$css_md5 = md5(serialize($css_files));
- $css_cache_file = data_path("cache/style.main.{$theme_name}.{$css_latest}.{$css_md5}.css");
+ $css_cache_file = data_path("cache/style.{$theme_name}.{$css_latest}.{$css_md5}.css");
if(!file_exists($css_cache_file)) {
$css_data = "";
foreach($css_files as $file) {
@@ -374,29 +358,24 @@ class Page {
$this->add_html_header("", 100);
/*** Generate JS cache files ***/
- $js_lib_latest = $config_latest;
- $js_lib_files = zglob("lib/vendor/js/*.js");
- foreach($js_lib_files as $js) {
- $js_lib_latest = max($js_lib_latest, filemtime($js));
- }
- $js_lib_md5 = md5(serialize($js_lib_files));
- $js_lib_cache_file = data_path("cache/script.lib.{$theme_name}.{$js_lib_latest}.{$js_lib_md5}.js");
- if(!file_exists($js_lib_cache_file)) {
- $js_data = "";
- foreach($js_lib_files as $file) {
- $js_data .= file_get_contents($file) . "\n";
- }
- file_put_contents($js_lib_cache_file, $js_data);
- }
- $this->add_html_header("", 45);
-
$js_latest = $config_latest;
- $js_files = array_merge(zglob("lib/shimmie.js"), zglob("ext/{".ENABLED_EXTS."}/script.js"), zglob("themes/$theme_name/script.js"));
+ $js_files = array_merge(
+ [
+ "vendor/bower-asset/jquery/dist/jquery.min.js",
+ "vendor/bower-asset/jquery-timeago/jquery.timeago.js",
+ "vendor/bower-asset/tablesorter/jquery.tablesorter.min.js",
+ "vendor/bower-asset/js-cookie/src/js.cookie.js",
+ "lib/modernizr-3.3.1.custom.js",
+ ],
+ zglob("lib/shimmie.js"),
+ zglob("ext/{".ENABLED_EXTS."}/script.js"),
+ zglob("themes/$theme_name/script.js")
+ );
foreach($js_files as $js) {
$js_latest = max($js_latest, filemtime($js));
}
$js_md5 = md5(serialize($js_files));
- $js_cache_file = data_path("cache/script.main.{$theme_name}.{$js_latest}.{$js_md5}.js");
+ $js_cache_file = data_path("cache/script.{$theme_name}.{$js_latest}.{$js_md5}.js");
if(!file_exists($js_cache_file)) {
$js_data = "";
foreach($js_files as $file) {
diff --git a/ext/handle_video/theme.php b/ext/handle_video/theme.php
index 21d4ac61..7b319de2 100644
--- a/ext/handle_video/theme.php
+++ b/ext/handle_video/theme.php
@@ -9,7 +9,7 @@ class VideoFileHandlerTheme extends Themelet {
$full_url = make_http($ilink);
$autoplay = $config->get_bool("video_playback_autoplay");
$loop = $config->get_bool("video_playback_loop");
- $player = make_link('lib/vendor/swf/flashmediaelement.swf');
+ $player = make_link('vendor/bower-asset/mediaelement/build/flashmediaelement.swf');
$html = "Video not playing? Click here to download the file.
";
diff --git a/lib/vendor/js/modernizr-3.3.1.custom.js b/lib/modernizr-3.3.1.custom.js
similarity index 100%
rename from lib/vendor/js/modernizr-3.3.1.custom.js
rename to lib/modernizr-3.3.1.custom.js