Code Duplication    Length = 27-29 lines in 2 locations

class/pcltar.lib.php 2 locations

@@ 326-354 (lines=29) @@
323
     *
324
     * @return array|int
325
     */
326
    function PclTarList($p_tarname, $p_mode = '')
327
    {
328
        TrFctStart(__FILE__, __LINE__, 'PclTarList', "tar=$p_tarname, mode='$p_mode'");
329
        $v_result = 1;
330
331
        // ----- Extract the tar format from the extension
332
        if (($p_mode == '') || (($p_mode !== 'tar') && ($p_mode !== 'tgz'))) {
333
            if (($p_mode = PclTarHandleExtension($p_tarname)) == '') {
334
                // ----- Return
335
                TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
336
337
                return 0;
338
            }
339
        }
340
341
        // ----- Call the extracting fct
342
        $p_list = array();
343
        if (($v_result = PclTarHandleExtract($p_tarname, 0, $p_list, 'list', '', $p_mode, '')) != 1) {
344
            unset($p_list);
345
            TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
346
347
            return 0;
348
        }
349
350
        // ----- Return
351
        TrFctEnd(__FILE__, __LINE__, $p_list);
352
353
        return $p_list;
354
    }
355
356
    // --------------------------------------------------------------------------------
357
@@ 389-415 (lines=27) @@
386
     *
387
     * @return int
388
     */
389
    function PclTarExtract($p_tarname, $p_path = './', $p_remove_path = '', $p_mode = '')
390
    {
391
        TrFctStart(__FILE__, __LINE__, 'PclTarExtract', "tar='$p_tarname', path='$p_path', remove_path='$p_remove_path', mode='$p_mode'");
392
        $v_result = 1;
393
394
        // ----- Extract the tar format from the extension
395
        if (($p_mode == '') || (($p_mode !== 'tar') && ($p_mode !== 'tgz'))) {
396
            if (($p_mode = PclTarHandleExtension($p_tarname)) == '') {
397
                // ----- Return
398
                TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
399
400
                return 0;
401
            }
402
        }
403
404
        // ----- Call the extracting fct
405
        if (($v_result = PclTarHandleExtract($p_tarname, 0, $p_list, 'complete', $p_path, $p_mode, $p_remove_path)) != 1) {
406
            TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
407
408
            return 0;
409
        }
410
411
        // ----- Return
412
        TrFctEnd(__FILE__, __LINE__, $p_list);
413
414
        return $p_list;
415
    }
416
417
    // --------------------------------------------------------------------------------
418