Source for file SC_Batch_Update.php
Documentation is available at SC_Batch_Update.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(CLASS_PATH .
"batch/SC_Batch.php");
* @author LOCKON CO.,LTD.
* 変換したいファイルの拡張子をカンマ区切りで羅列.
var $includes =
"php,inc,tpl,css,sql,js,png,jpg,gif,swf";
* @param string $target アップデータファイルのディレクトリパス
$bkupDistInfoArray =
array(); //バックアップファイル用のdistinfoファイル内容
$bkupPath =
DATA_PATH .
'downloads/backup/update_' .
time() .
'/';
$bkupPathFile =
$bkupPath .
'files/';
$this->mkdir_p($bkupPathFile .
'dummy');
'buckup_path' =>
$bkupPath
$msg =
'バックアップディレクトリの作成に失敗しました';
foreach ($fileArrays as $path) {
$fileName =
pathinfo($path, PATHINFO_BASENAME);
$suffix =
pathinfo($path, PATHINFO_EXTENSION);
$distinfo = isset
($distinfo) ?
$distinfo :
"";
if ($fileName ==
"distinfo.php") {
if (in_array($fileName, $excludeArray)) {
//$arrLog['ok'][] = "次のファイルは除外されました: " . $path;
$msg =
"次のファイルは除外されました: " .
$path;
//$arrLog[] = $sha1 . " => " . $path;
foreach ($includeArray as $include) {
if ($suffix ==
$include) {
if (!empty($distinfo[$sha1])) {
$msg =
"ハッシュ値が一致しないため, コピー先が取得できません: " .
$path;
$msg =
"同じ内容のファイルをスキップしました: " .
$out;
$bkupTo =
$bkupPathFile .
pathinfo($out, PATHINFO_BASENAME);
if (!@copy($out, $bkupTo)) {
$msg =
"バックアップファイルの作成に失敗しました: " .
$out .
' -> ' .
$bkupTo;
$msg =
"バックアップファイルの作成に成功しました: " .
$out .
' -> ' .
$bkupTo;
$handle =
@fopen($out, "w");
$handle =
@fopen($out, "w");
$msg =
"コピー先に書き込み権限がありません: " .
$out;
if (fwrite($handle, $contents) ===
false) {
$msg =
"コピー先に書き込み権限がありません: " .
$out;
$msg =
"ファイルのコピーに成功しました: " .
$out;
$handle =
@fopen($bkupPath .
'distinfo.php', "w");
$msg =
"distinfoファイルの作成に成功しました: " .
$bkupPath .
'distinfo.php';
$msg =
"distinfoファイルの作成に失敗しました: " .
$bkupPath .
'distinfo.php';
* $dir を再帰的に辿ってパス名を配列で返す.
* @return array $dir より下層に存在するパス名の配列
* @see http://www.php.net/glob
static $alldirs =
array();
$dirs =
glob($dir .
'/*');
if (is_array($dirs) &&
count($dirs) >
0) {
foreach ($dirs as $d) $alldirs[] =
$d;
foreach ($dirs as $dir) $this->listdirs($dir);
* @param string $path 絶対パス
// HTML_PATH/DATA_PATHの判別
if (preg_match("@\Q".
HTML_PATH.
"\E@", $path) >
0) {
} elseif (preg_match("@\Q".
DATA_PATH.
"\E@", $path) >
0) {
if (!@mkdir($dir)) break;
.
'$distifo = array(' .
"\n";
foreach ($bkupDistInfoArray as $key =>
$value) {
$src .=
"'${key}' => '${value}',\n";
Documentation generated on Tue, 28 Apr 2009 18:13:06 +0900 by phpDocumentor 1.4.2