本文整理汇总了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");