/** * 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 26 trên 32 - Vay Tài Chính 247

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

Mhe.vn Đơn Vị Độc Quyền Phân Phối Xe Nâng Hàng Komatsu tại Việt Nam

Doanh nghiệp bạn đang cần tìm đối tác xe nâng hàng Komatsu? Công ty đang có nhu cầu mua xe nâng hàng chất lượng? Công ty Marubeni – Mhe.vn sẽ là đối tác uy tín mà bạn nên lựa chọn khi có nhu cầu về xe nâng hàng Komatsu – thương hiệu xe nâng nổi tiếng đến […]

Top 10 thương hiệu gốm sứ hàng đầu tại Việt Nam

Có thể nói gốm sứ chính là một nét đẹp văn hoá của dân tộc Việt Nam ta. Các thương hiệu gốm sứ phần lớn được hình thành từ rất lâu đời và được duy trì, phát triển mạnh mẽ cho đến nay. Hầu hết những vật dụng từ gốm không chỉ phục vụ tốt […]

Địa chỉ mua bộ đồ thờ Bát Tràng đầy đủ uy tín, giá tốt

Vốn là nét truyền thống tốt đẹp của chả ông nên bộ đồ thờ luôn nhận được sự quan tâm đặc biệt. Và Bát Tràng chính là một trong những thương hiệu cung cấp bộ đồ thờ chất lượng trên thị trường. Bài viết dưới đây sẽ gợi ý về Decopro – Địa chỉ mua […]

Top 10 siêu thị lớn nhất tại Việt Nam

Kinh tế phát triển nên dịch vụ cửa hàng bán lẻ, hệ thống siêu thị cũng ngày càng được mở rộng. Tại Việt Nam hiện nay có rất nhiều thương hiệu siêu thị, chuỗi cửa hàng trải dài khắp các khu vực. Vậy những siêu thị lớn nào hiện đang được khách hàng Việt yêu […]

Top 10 công ty luật hàng đầu tại Việt Nam

Dịch vụ tư vấn pháp lý cũng như hỗ trợ giải quyết các tranh chấp liên quan đến pháp luật rất cần thiết đối với các cá nhân, doanh nghiệp. Nhằm cung ứng dịch vụ pháp lý thường xuyên, kịp thời cho khách hàng, các công ty luật tại Việt Nam đang không ngừng mở […]

Điểm danh Top 9 SEO Agency tin cậy (Top 2023 theo Clutch)

SEO (Search Engine Optimization) là một trong những chiến lược quan trọng trong marketing kỹ thuật số. Nó giúp các doanh nghiệp đẩy website của mình lên top đầu của kết quả tìm kiếm trên các công cụ tìm kiếm như Google, Bing, Yahoo, vv. Điều này giúp tăng tính tiếp cận, tính tin cậy […]

Tại sao nên cho bé học tại trường tiếng Anh Apollo English

Tiếng Anh chính là chiếc chìa khóa để mở ra cánh cổng tương lai cho con trẻ. Vì vậy, các bậc phụ huynh hiện nay rất quan tâm đến việc cho con mình đi học tiếng Anh ngay từ những ngày đầu. Nhưng vẫn còn nhiều bậc phụ huynh chưa biết nên cho con đi […]

Gửi hàng đi Nhật nhanh chóng, tiện lợi với dịch vụ tại 3A Express

Gửi hàng đi Nhật như thế nào nhanh chóng, tiện lợi với mức giá rẻ nhất là thắc mắc của không ít người. Nếu bạn đang có nhu cầu gửi hàng đi Nhật thì đừng bỏ qua bài viết ngày hôm nay nhé. Nhu cầu gửi hàng đi Nhật hiện nay Hiện nay nhu cầu gửi […]

Top 10 công ty Bất Động Sản Việt Nam uy tín nhất năm 2023

Dự án khu chung cư cao cấp hay các dự án khu nghỉ dưỡng đều được các công ty bất động sản lớn, có đủ uy tín thâu tóm. Tuy nhiên bạn đã biết top 10 công ty Bất Động Sản Việt Nam nổi tiếng “mát tay” trong việc thực hiện các dự án mang tầm cỡ […]

Top 10 công ty phần mềm hàng đầu tại Việt Nam

Các công ty phần mềm liên tục mọc lên khắp nơi để đáp ứng nhu cầu người dân trong thời đại kỹ thuật số. Tuy nhiên để tìm được một công ty phần mềm uy tín để hợp tác thì rất khó. Thế nên Top Google đã đưa ra các tiêu chí khách quan để […]