Microweber\Utils\Import::get PHP Method

get() public method

public get ( )
    public function get()
    {
        if (!is_admin()) {
            error('must be admin');
        }
        $here = $this->get_import_location();
        $files = glob("{$here}{*.sql,*.zip,*}", GLOB_BRACE);
        usort($files, function ($a, $b) {
            return filemtime($a) < filemtime($b);
        });
        $backups = array();
        if (!empty($files)) {
            foreach ($files as $file) {
                if (is_file($file)) {
                    //if (strpos($file, '.sql', 1) or strpos($file, '.zip', 1)) {
                    $mtime = filemtime($file);
                    // Get time and date from filename
                    $date = date('F d Y', $mtime);
                    $time = date('H:i:s', $mtime);
                    // Remove the sql extension part in the filename
                    //	$filenameboth = str_replace('.sql', '', $file);
                    $bak = array();
                    $bak['filename'] = basename($file);
                    $bak['date'] = $date;
                    $bak['time'] = str_replace('_', ':', $time);
                    $bak['size'] = filesize($file);
                    $backups[] = $bak;
                }
            }
            // }
        }
        return $backups;
    }