Differences From Artifact [06255be23d]:

To Artifact [2bf872f126]:


646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
...
668
669
670
671
672
673
674

675
676









677
678
679
680
681
682
683
684
685
686
687
688
            if (!(is_numeric($params['query']) && (int)$params['query'] === 1) && $params['query'] !== true)
                $url .= $params['query'];
        }

        return $url;
    }

    static public function find_csv_delim($fp)
    {
        $line = '';

        while ($line === '' && !feof($fp))
        {
            $line = trim(fgets($fp, 4096));
        }
................................................................................
            "\t"=> substr_count($line, "\t")
        ];

        arsort($delims);
        reset($delims);

        rewind($fp);

        return key($delims);
    }










    static public function row_to_csv($row)
    {
        $row = (array) $row;

        array_walk($row, function ($field) {
            return str_replace('"', '""', $field);
        });

        return '"' . implode('", "', $row) . '"';
    }
}







|







 







>


>
>
>
>
>
>
>
>
>












646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
...
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
            if (!(is_numeric($params['query']) && (int)$params['query'] === 1) && $params['query'] !== true)
                $url .= $params['query'];
        }

        return $url;
    }

    static public function find_csv_delim(&$fp)
    {
        $line = '';

        while ($line === '' && !feof($fp))
        {
            $line = trim(fgets($fp, 4096));
        }
................................................................................
            "\t"=> substr_count($line, "\t")
        ];

        arsort($delims);
        reset($delims);

        rewind($fp);

        return key($delims);
    }

    static public function skip_bom(&$fp)
    {
        // Skip BOM
        if (fgets($fp, 4) !== chr(0xEF) . chr(0xBB) . chr(0xBF))
        {
            fseek($fp, 0);
        }
    }

    static public function row_to_csv($row)
    {
        $row = (array) $row;

        array_walk($row, function ($field) {
            return str_replace('"', '""', $field);
        });

        return '"' . implode('", "', $row) . '"';
    }
}