本文整理匯總了PHP中Updater::parseDir方法的典型用法代碼示例。如果您正苦於以下問題:PHP Updater::parseDir方法的具體用法?PHP Updater::parseDir怎麽用?PHP Updater::parseDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Updater
的用法示例。
在下文中一共展示了Updater::parseDir方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: PclZip
}
}
if (!$error) {
@mkdir($basepath . "/cachefiles/update");
try {
$archive = new PclZip($basepath . "/cachefiles/update.zip");
$archive->extract($basepath . "/cachefiles/update");
$updater->upgradeLog("Extracting package content...", true, "Success");
} catch (Exception $e) {
$error = true;
$updater->upgradeLog("Extracting package content...", false, "Unknown error");
}
}
if (!$error) {
unlink($basepath . "/cachefiles/update.zip");
$new_files = $updater->parseDir($basepath . "/cachefiles/update/public_html");
if (count($new_files)) {
foreach ($new_files as $full_path => $file_size) {
if (substr_count($full_path, "vars.php") == 0 && (!isset($_POST['no_language']) || !$_POST['no_language'] || !substr_count($full_path, "/language/")) && (!isset($_POST['no_template']) || !$_POST['no_template'] || !substr_count($full_path, "/templates/"))) {
$sub_path = str_replace($basepath . "/cachefiles/update/public_html", "", $full_path);
$tmp = explode("/", $sub_path);
$file_name = $tmp[count($tmp) - 1];
unset($tmp[count($tmp) - 1]);
$file_path = implode("/", $tmp);
if (!file_exists($basepath . $sub_path)) {
$file_content = file_get_contents($full_path);
$res = $updater->updateFile($ftp_conn, $root_path, $file_content, $file_path, $file_name);
if ($res == 1) {
$updater->upgradeLog("New file: {$sub_path}", true, "Added");
} elseif ($res == 2) {
$updater->upgradeLog("New file: {$sub_path}", false, "Can't create folder");