Server IP : 104.21.14.103 / Your IP : 3.142.252.87 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/thread-self/root/proc/thread-self/root/home/giankuin/sieuthiweb.com.vn/dup-installer/classes/Chunk/ |
Upload File : |
<?php /** * Cunking manager with stored data in json file. * * Standard: PSR-2 * @link http://www.php-fig.org/psr/psr-2 Full Documentation * * @package SC\DUPX\Chunk * */ defined('ABSPATH') || defined('DUPXABSPATH') || exit; require_once(DUPX_INIT.'/classes/Chunk/class.chunkingmanager.php'); /** * Store position on json file * */ abstract class DUPX_ChunkingManager_file extends DUPX_ChunkingManager { /** * load data from previous step if exists * * @param string $key file name * @return mixed */ protected function getStoredData($key) { if (file_exists($key)) { $data = file_get_contents($key); return json_decode($data, true); } else { return null; } } /** * delete stored data if exists */ protected function deleteStoredData($key) { if (file_exists($key)) { unlink($key); } } /** * * @param string $key file path * @param mixed $data to save in file path * @return boolean|int This function returns the number of bytes that were written to the file, or FALSE on failure. * @throws Exception */ protected function saveStoredData($key, $data) { if (($json = DupProSnapJsonU::wp_json_encode($data)) === false) { throw new Exception('Json encode chunk data error'); } return file_put_contents($key, $json); } }