mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/12839] Include update related templates and assets in the package
PHPBB3-12839
This commit is contained in:
parent
cc0f931473
commit
9f76b3414c
1 changed files with 36 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue