/** * Checks various php.ini values and the maximum file size to determine * the maximum size chunks a file can be split up into for upload * * @return int */ public function get_chunk_size() { $max = min($this->php_ini->get_bytes('upload_max_filesize'), $this->php_ini->get_bytes('post_max_size'), max(1, $this->php_ini->get_bytes('memory_limit')), $this->config['max_filesize']); // Use half of the maximum possible to leave plenty of room for other // POST data. return floor($max / 2); }
/** * Filling up system_data array */ protected function setup_system_data() { // Query maximum runtime from php.ini $execution_time = $this->php_ini->get_int('max_execution_time'); $execution_time = min(15, $execution_time / 2); $this->system_data['max_execution_time'] = $execution_time; // Set start time $this->system_data['start_time'] = time(); // Get memory limit $this->system_data['memory_limit'] = $this->php_ini->get_bytes('memory_limit'); }