/** * Copyright (C) 2014-2020 ServMask Inc. * * 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 3 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, see . * * ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗ * ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝ * ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝ * ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗ * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗ * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ */ if ( ! defined( 'ABSPATH' ) ) { die( 'Kangaroos cannot jump here' ); } class Ai1wm_Export_Content { public static function execute( $params ) { // Set archive bytes offset if ( isset( $params['archive_bytes_offset'] ) ) { $archive_bytes_offset = (int) $params['archive_bytes_offset']; } else { $archive_bytes_offset = ai1wm_archive_bytes( $params ); } // Set file bytes offset if ( isset( $params['file_bytes_offset'] ) ) { $file_bytes_offset = (int) $params['file_bytes_offset']; } else { $file_bytes_offset = 0; } // Set content bytes offset if ( isset( $params['content_bytes_offset'] ) ) { $content_bytes_offset = (int) $params['content_bytes_offset']; } else { $content_bytes_offset = 0; } // Get processed files size if ( isset( $params['processed_files_size'] ) ) { $processed_files_size = (int) $params['processed_files_size']; } else { $processed_files_size = 0; } // Get total content files size if ( isset( $params['total_content_files_size'] ) ) { $total_content_files_size = (int) $params['total_content_files_size']; } else { $total_content_files_size = 1; } // Get total content files count if ( isset( $params['total_content_files_count'] ) ) { $total_content_files_count = (int) $params['total_content_files_count']; } else { $total_content_files_count = 1; } // What percent of files have we processed? $progress = (int) min( ( $processed_files_size / $total_content_files_size ) * 100, 100 ); // Set progress Ai1wm_Status::info( sprintf( __( 'Archiving %d content files...
%d%% complete', AI1WM_PLUGIN_NAME ), $total_content_files_count, $progress ) ); // Flag to hold if file data has been processed $completed = true; // Start time $start = microtime( true ); // Get content list file $content_list = ai1wm_open( ai1wm_content_list_path( $params ), 'r' ); // Set the file pointer at the current index if ( fseek( $content_list, $content_bytes_offset ) !== -1 ) { // Open the archive file for writing $archive = new Ai1wm_Compressor( ai1wm_archive_path( $params ) ); // Set the file pointer to the one that we have saved $archive->set_file_pointer( $archive_bytes_offset ); // Loop over files while ( list( $file_abspath, $file_relpath, $file_size, $file_mtime ) = fgetcsv( $content_list ) ) { $file_bytes_written = 0; // Add file to archive if ( ( $completed = $archive->add_file( $file_abspath, $file_relpath, $file_bytes_written, $file_bytes_offset ) ) ) { $file_bytes_offset = 0; // Get content bytes offset $content_bytes_offset = ftell( $content_list ); } // Increment processed files size $processed_files_size += $file_bytes_written; // What percent of files have we processed? $progress = (int) min( ( $processed_files_size / $total_content_files_size ) * 100, 100 ); // Set progress Ai1wm_Status::info( sprintf( __( 'Archiving %d content files...
%d%% complete', AI1WM_PLUGIN_NAME ), $total_content_files_count, $progress ) ); // More than 10 seconds have passed, break and do another request if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) { if ( ( microtime( true ) - $start ) > $timeout ) { $completed = false; break; } } } // Get archive bytes offset $archive_bytes_offset = $archive->get_file_pointer(); // Truncate the archive file $archive->truncate(); // Close the archive file $archive->close(); } // End of the content list? if ( feof( $content_list ) ) { // Unset archive bytes offset unset( $params['archive_bytes_offset'] ); // Unset file bytes offset unset( $params['file_bytes_offset'] ); // Unset content bytes offset unset( $params['content_bytes_offset'] ); // Unset processed files size unset( $params['processed_files_size'] ); // Unset total content files size unset( $params['total_content_files_size'] ); // Unset total content files count unset( $params['total_content_files_count'] ); // Unset completed flag unset( $params['completed'] ); } else { // Set archive bytes offset $params['archive_bytes_offset'] = $archive_bytes_offset; // Set file bytes offset $params['file_bytes_offset'] = $file_bytes_offset; // Set content bytes offset $params['content_bytes_offset'] = $content_bytes_offset; // Set processed files size $params['processed_files_size'] = $processed_files_size; // Set total content files size $params['total_content_files_size'] = $total_content_files_size; // Set total content files count $params['total_content_files_count'] = $total_content_files_count; // Set completed flag $params['completed'] = $completed; } // Close the content list file ai1wm_close( $content_list ); return $params; } } Kiến Thức Kinh Tế - Trang 2 trên 32 - Vay Tài Chính 247

Category Archives: Kiến Thức Kinh Tế

Mệnh Thủy kỵ màu gì? Những màu nên tránh để không khắc nghịch vận mệnh

Mối liên hệ giữa màu sắc và vận mệnh trong phong thủy Theo học thuyết Ngũ hành, mỗi mệnh (Kim, Mộc, Thủy, Hỏa, Thổ) đều mang một nguồn năng lượng riêng, có thể bổ trợ hoặc xung khắc với các yếu tố khác thông qua màu sắc. Người mệnh Thủy – đại diện cho nước, […]

Cách trồng cây hạnh phúc trong nhà và ngoài trời: Hướng dẫn từ A–Z

Cây hạnh phúc là một trong những loại cây cảnh được ưa chuộng nhất hiện nay nhờ vẻ ngoài thanh thoát, tán lá mềm mại và ý nghĩa phong thủy tích cực. Tuy nhiên, để cây phát triển tốt, xanh mượt quanh năm và không bị vàng lá, héo rũ hay sâu bệnh, việc trồng […]

Tỳ Hưu là gì? Tìm hiểu nguồn gốc, truyền thuyết và ý nghĩa phong thủy

Tỳ Hưu là gì? Tỳ Hưu (hay còn gọi là Thiên Lộc, Tịch Tà) là một trong những linh vật phong thủy nổi tiếng nhất trong văn hóa phương Đông. Hình dáng của Tỳ Hưu là sự kết hợp giữa các loài linh thú: mình sư tử, đầu rồng, có cánh, không hậu môn – […]

Ứng dụng Ngũ hành trong đời sống Việt Nam Phong thủy, kiến trúc, ẩm thực và tín ngưỡng

Ngũ hành – Hệ tư tưởng gắn liền với văn hóa Việt Ngũ hành không chỉ là một học thuyết triết học cổ đại mà còn là hệ quy chiếu tư tưởng xuyên suốt nhiều khía cạnh đời sống người Việt. Từ cách chọn ngày cưới, xây nhà, bài trí phòng ở, cho tới món […]

Ngũ hành là gì? Giải nghĩa Kim, Mộc, Thủy, Hỏa, Thổ và quy luật tương sinh tương khắc

  Ngũ hành là gì? Ngũ hành là một học thuyết triết học cổ đại bắt nguồn từ Trung Hoa, bao gồm năm yếu tố cơ bản: Kim – Mộc – Thủy – Hỏa – Thổ, tượng trưng cho vạn vật trong vũ trụ. Học thuyết này được vận dụng trong nhiều lĩnh vực như: […]

Cây kim ngân hợp mệnh nào? Hướng đặt cây và cách chăm sóc để tăng tài lộc

Cây kim ngân và ý nghĩa phong thủy tổng quan Cây kim ngân từ lâu đã được xem là loại cây phong thủy có khả năng thu hút tài lộc, mang đến sự may mắn và ổn định cho gia chủ. Với hình dáng thanh thoát, thân xoắn tượng trưng cho sự gắn bó và […]

Phối màu hợp mệnh Thủy Gợi ý trang phục để sinh vượng khí

Vì sao phối màu theo phong thủy lại quan trọng với người mệnh Thủy? Màu sắc không chỉ là yếu tố thẩm mỹ mà còn ảnh hưởng đến năng lượng bản mệnh. Với người mệnh Thủy – đại diện cho nước, sự uyển chuyển và trí tuệ – việc chọn và phối màu đúng cách […]

Bí quyết làm bánh bông lan trứng muối không bị chìm trứng – thơm ngon từ bên trong

Vấn đề thường gặp: Trứng muối bị chìm, bánh không nở đều Một trong những lỗi phổ biến nhất khi làm bánh bông lan trứng muối tại nhà là trứng muối bị chìm xuống đáy, khiến phần topping mất thẩm mỹ, bánh không đều mặt và dễ chai đáy. Bên cạnh đó, một số người […]

Cây hạnh phúc hợp mệnh nào? Vị trí đặt cây và tác dụng mang lại may mắn cho gia chủ

Cây hạnh phúc trong phong thủy Cây hạnh phúc không chỉ là cây cảnh đẹp, dễ chăm mà còn được nhiều người đánh giá cao về mặt phong thủy. Nhờ hình dáng thanh thoát, tán lá xanh mềm mại, cây tượng trưng cho sự an yên, viên mãn và gắn kết giữa các thành viên […]

Mệnh Thủy hợp màu gì? 5 màu phong thủy giúp thu hút tài lộc và bình an

Tổng quan về mệnh Thủy trong Ngũ hành Trong hệ thống Ngũ hành gồm Kim – Mộc – Thủy – Hỏa – Thổ, mệnh Thủy tượng trưng cho nước – yếu tố của sự linh hoạt, mềm mại nhưng cũng rất mạnh mẽ và thâm sâu. Người mang mệnh Thủy thường có tính cách thông […]