From 7a267ee7f06a7f2e3742e87ba087ec03a9ed7089 Mon Sep 17 00:00:00 2001 From: patdenice Date: Fri, 21 Sep 2007 09:12:45 +0000 Subject: 0000421 : call a function to create empty local files during install and upgrade Avoid log errors git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2103 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions_upgrade.php | 19 +++++++++++++++++++ install.php | 4 ++++ upgrade.php | 3 +++ 3 files changed, 26 insertions(+) diff --git a/admin/include/functions_upgrade.php b/admin/include/functions_upgrade.php index 843efa58e..7c587c706 100644 --- a/admin/include/functions_upgrade.php +++ b/admin/include/functions_upgrade.php @@ -40,5 +40,24 @@ if you want to upgrade'; } } +// 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); + } + } +} ?> diff --git a/install.php b/install.php index 19eee1600..33ccec937 100644 --- a/install.php +++ b/install.php @@ -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']); diff --git a/upgrade.php b/upgrade.php index 065db9983..e97cb552f 100644 --- a/upgrade.php +++ b/upgrade.php @@ -247,6 +247,9 @@ else array_keys($datas[0]), $datas ); + + // Create empty local files to avoid log errors + create_empty_local_files(); $page['upgrade_end'] = get_moment(); -- cgit v1.2.3