aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-07-11 15:53:37 +0200
committerTristan Darricau <github@nicofuma.fr>2014-07-11 15:53:37 +0200
commitdd78b564e56152be559b4ec476e35698fa32e1bf (patch)
treeb676e8e8e5753d24a92390a8fd763f113064cc52
parent35588c20bd350743ff1b98993e3ea26c39be3567 (diff)
parent9f76b3414c2ad51f6917fa1b63eafc8540408393 (diff)
downloadforums-dd78b564e56152be559b4ec476e35698fa32e1bf.tar
forums-dd78b564e56152be559b4ec476e35698fa32e1bf.tar.gz
forums-dd78b564e56152be559b4ec476e35698fa32e1bf.tar.bz2
forums-dd78b564e56152be559b4ec476e35698fa32e1bf.tar.xz
forums-dd78b564e56152be559b4ec476e35698fa32e1bf.zip
Merge pull request #2723 from nickvergessen/ticket/12839
[ticket/12839] Include update related templates and assets in the package * nickvergessen/ticket/12839: [ticket/12839] Include update related templates and assets in the package
-rwxr-xr-xbuild/package.php42
1 files changed, 36 insertions, 6 deletions
diff --git a/build/package.php b/build/package.php
index d66238e471..c0db0c4011 100755
--- a/build/package.php
+++ b/build/package.php
@@ -195,12 +195,6 @@ if (sizeof($package->old_packages))
* referenced files from the same or subsequent directories.
*/
$copy_relative_directories = array(
- 'adm/style/admin.css' => array(
- 'copied' => false,
- 'copy' => array(
- 'adm/images/*' => 'adm/images',
- ),
- ),
'config/' => array(
'copied' => false,
'copy' => array(
@@ -269,6 +263,42 @@ if (sizeof($package->old_packages))
}
}
+ /**
+ * We need to always copy the template and asset files that we need in
+ * the update, to ensure that the page is displayed correctly.
+ */
+ $copy_update_files = array(
+ 'adm/images/*' => 'adm/images',
+ 'adm/style/admin.css' => 'adm/style',
+ 'adm/style/admin.js' => 'adm/style',
+ 'adm/style/ajax.js' => 'adm/style',
+ 'adm/style/install_*' => 'adm/style',
+ 'assets/javascript/*' => 'assets/javascript',
+ );
+
+ foreach ($copy_update_files as $source_files => $destination_dir)
+ {
+ // Create directories along the way?
+ $directories = explode('/', $destination_dir);
+
+ chdir($dest_filename_dir . '/install/update/new');
+ foreach ($directories as $dir)
+ {
+ $dir = trim($dir);
+ if ($dir)
+ {
+ if (!file_exists('./' . $dir))
+ {
+ $package->run_command('mkdir ' . $dir);
+ }
+ chdir('./' . $dir);
+ }
+ }
+ $source_dir_files = $package->locations['old_versions'] . $package->get('simple_name') . '/' . $source_files;
+ $destination_dir = $dest_filename_dir . '/install/update/new/' . $destination_dir;
+ $package->run_command('cp ' . $source_dir_files . ' ' . $destination_dir);
+ }
+
// Build index.php file for holding the file structure
$index_contents = '<?php