0000421 : call a function to create empty local files during install and upgrade
Avoid log errors git-svn-id: http://piwigo.org/svn/trunk@2102 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
179106efaf
commit
b4a1fa0312
@ -78,4 +78,24 @@ function prepare_conf_upgrade()
|
||||
$conf['tables']['old_permalinks_table'] = $prefixeTable.'old_permalinks';
|
||||
}
|
||||
|
||||
// Create empty local files to avoid log errors
|
||||
function create_empty_local_files()
|
||||
{
|
||||
$files =
|
||||
array (
|
||||
PHPWG_ROOT_PATH . 'template-common/local-layout.css',
|
||||
PHPWG_ROOT_PATH . 'template/yoga/local-layout.css'
|
||||
);
|
||||
|
||||
foreach ($files as $path)
|
||||
{
|
||||
if (!file_exists ($path))
|
||||
{
|
||||
$file = @fopen($path, "w");
|
||||
@fwrite($file , '/* You can modify this file */');
|
||||
@fclose($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -204,8 +204,12 @@ include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
|
||||
include(PHPWG_ROOT_PATH . 'include/constants.php');
|
||||
include(PHPWG_ROOT_PATH . 'include/functions.inc.php');
|
||||
include(PHPWG_ROOT_PATH . 'admin/include/functions.php');
|
||||
include(PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php');
|
||||
include(PHPWG_ROOT_PATH . 'include/template.php');
|
||||
|
||||
// Create empty local files to avoid log errors
|
||||
create_empty_local_files();
|
||||
|
||||
if ( isset( $_POST['language'] ))
|
||||
{
|
||||
$language = strip_tags($_POST['language']);
|
||||
|
@ -246,6 +246,9 @@ else
|
||||
array_keys($datas[0]),
|
||||
$datas
|
||||
);
|
||||
|
||||
// Create empty local files to avoid log errors
|
||||
create_empty_local_files();
|
||||
|
||||
$page['upgrade_end'] = get_moment();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user