-
Notifications
You must be signed in to change notification settings - Fork 12
Hướng dẫn nâng cấp module tương thích bản 4.0.23 lên 4.0.29
Hướng dẫn này ghi lại các nội dung cần thực hiện để module đang hoạt động trên NukeViet 4.0.23 có thể chạy lên với NukeViet 4.0.29.
Tìm tất cả và thay thế những chỗ có cache theo quy luật sau
nv_get_cache thành: $nv_Cache->getItem
nv_set_cache thành: $nv_Cache->setItem
nv_delete_all_cache thành: $nv_Cache->delAll
nv_del_moduleCache thành: $nv_Cache->delMod
nv_db_cache thành: $nv_Cache->db
Nếu những chỗ nào dùng $nv_Cache
trong function, thì cần global biến $nv_Cache
Chỗ gọi hàm $nv_Cache→db()
bắt buộc phải truyền vào 3 tham số:(câu lệnh sql, key, tên module) trong đó key có thể để trống, tên module dùng $module_name
Tìm kiếm để thay thế các đoạn gọi class của NukeViet
new download( thành: new NukeViet\Files\Download(
new image( thành: new NukeViet\Files\Image(
new upload( thành: new NukeViet\Files\Upload(
new UrlGetContents( thành: new NukeViet\Client\UrlGetContents(
new Diagnostic( thành: new NukeViet\Client\Diagnostic(
new Gfonts( thành: new NukeViet\Client\Gfonts(
new NV_Http( thành: new NukeViet\Http\Http(
new NVftp( thành: new NukeViet\Ftp\Ftp(
new PHPMailer; thành: new PHPMailer\PHPMailer\PHPMailer();
new PHPMailer(); thành: new PHPMailer\PHPMailer\PHPMailer();
new Array2XML( thành: new NukeViet\Xml\Array2XML(
Các class sau mặc định không sử dung, nếu module của bạn còn sử dụng, cần viết lại các class này.
Minify_CSS_Compressor
CheckUrl
Hệ thống mặc định tạo ra nhóm thành viên mới đăng ký với ID=7, nếu module của bạn có sử dụng chức năng phân quyền cần lưu ý. Nhóm thành viên mới đăng ký là những thành viên vừa đăng ký xong, chưa được admin hoặc trưởng nhóm cho thành thành viên chính thức (Nhóm này mặc định không có, chỉ có nếu như module users có kích hoạt).
Tìm kiếm các đoạn liên quan đến js/ui/jquery.ui. để thay thế lại đường dẫn:
Ví dụ
<link rel="stylesheet" type="text/css" href="{NV_BASE_SITEURL}{NV_ASSETS_DIR}/js/ui/jquery.ui.core.css">
<link rel="stylesheet" type="text/css" href="{NV_BASE_SITEURL}{NV_ASSETS_DIR}/js/ui/jquery.ui.theme.css">
<link rel="stylesheet" type="text/css" href="{NV_BASE_SITEURL}{NV_ASSETS_DIR}/js/ui/jquery.ui.datepicker.css">
Thay bằng:
<link rel="stylesheet" type="text/css" href="{NV_BASE_SITEURL}{NV_ASSETS_DIR}/js/jquery-ui/jquery-ui.min.css">
Tìm các đoạn:
<script type="text/javascript" src="{NV_BASE_SITEURL}{NV_ASSETS_DIR}/js/ui/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="{NV_BASE_SITEURL}{NV_ASSETS_DIR}/js/ui/jquery.ui.datepicker.min.js"></script>
Thay bằng
<script type="text/javascript" src="{NV_BASE_SITEURL}{NV_ASSETS_DIR}/js/jquery-ui/jquery-ui.min.js"></script>
(Tương tự nếu code jquery-ui viết vào trong file php)
Gợi ý: Có thể tìm với khóa "js/ui" khi đó sẽ ra cả các file tpl và php có sử dụng.
Nếu module có sử dụng Class Diagnostic cần tải lại file tại https://github.com/nukeviet/plugin-sitediagnostic/tree/master/vendor/vinades/nukeviet/Client do class này đã bị loại khỏi bản mặc định