/** * * @param type $scr * @param type $dest * @return type */ public static function copy($src, $dest) { $dest_dir = dirname($dest); if (!file_exists($dest_dir)) { JchPlatformUtility::createFolder($dest_dir); } $context = stream_context_create(array('ssl' => array('verify_peer' => true, 'cafile' => dirname(__FILE__) . '/libs/cacert.pem'))); $src_stream = fopen($src, 'rb', false, $context); if ($src_stream === false) { return false; } $dest_stream = fopen($dest, 'wb'); return stream_copy_to_stream($src_stream, $dest_stream); }