public static function archiveFiles($fileOrFiles, $archiveName, $emulate = false)
    {
        if (file_exists($archiveName))
            throw new Exception('Archive '.$archiveName.' already exists!');

        self::checkRequirements();

        $archiveType = self::detectArchiveType($archiveName, false);
        //        if (in_array($archiveType, [TarArchive::TAR, TarArchive::TAR_GZIP, TarArchive::TAR_BZIP, TarArchive::TAR_LZMA, TarArchive::TAR_LZW], true))
        //            return TarArchive::archiveFiles($fileOrFiles, $archiveName, $emulate);
        if ($archiveType === false)
            return false;

        $files_list = self::createFilesList($fileOrFiles);
        if (empty($files_list))
            throw new InvalidArgumentException('Files list is empty!');

        // fake creation: return archive data
        if ($emulate) {
            $totalSize = 0;
            foreach ($files_list as $fn) $totalSize += filesize($fn);

            return array(
                'totalSize' => $totalSize,
                'numberOfFiles' => count($files_list),
                'files' => $files_list,
                'type' => $archiveType,
            );
        }

        if (!isset(static::$formatHandlers[$archiveType]))
            throw new Exception('Unsupported archive type: '.$archiveType.' of archive '.$archiveName);

        $handler_class = __NAMESPACE__.'\\Formats\\'.static::$formatHandlers[$archiveType];

        return $handler_class::createArchive($files_list, $archiveName);
    }