1 Star 0 Fork 10

Discuz!应用中心 / DiscuzXPack

forked from 头上有灰机 / DiscuzXPack 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
package.php 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
oldhuhu 提交于 2019-12-12 17:06 . change all chinese to english
<?php
require_once "process_file_php.php";
require_once "process_file_js.php";
require_once "process_file.php";
require_once "md5files.php";
function prepare_package($encoding, $path, $target_path)
{
if (!in_array($encoding, array('SC_UTF8', 'TC_UTF8', 'SC_GBK', 'TC_BIG5'))) {
logging\error("unknown encoding %s", $encoding);
exit(1);
}
logging\info("---- preparing for %s ----", $encoding);
cpdir($path, $target_path);
// ipdata
$src = join_paths("dzfile/ipdata", $encoding, "tinyipdata.dat");
$target = join_paths($target_path, "upload/data/ipdata/tinyipdata.dat");
logging\info("copying tinyipdata.dat %s -> %s", $src, $target);
copy($src, $target);
if (starts_with($encoding, "TC_")) {
// 繁体图片
$src = "dzfile/image_big5";
$target = join_paths($target_path, "upload/static/image");
logging\info("copying traditional chinese images", $src, $target);
copy_all_files($src, $target);
convert_to_hant($target_path);
}
// 转换编码
if (ends_with($encoding, "_GBK")) {
convert_encoding_in($target_path, 'gbk');
}
if (ends_with($encoding, "_BIG5")) {
convert_encoding_in($target_path, 'big5');
}
if ($encoding != 'SC_UTF8') {
replace_encoding_variables($target_path, $encoding);
}
generate_discuzfiles_md5(join_paths($target_path, 'upload'));
}
?>
PHP
1
https://gitee.com/discuzaddons/DiscuzXPack.git
git@gitee.com:discuzaddons/DiscuzXPack.git
discuzaddons
DiscuzXPack
DiscuzXPack
master

搜索帮助