@@ -190,7 +190,7 @@ |
||
| 190 | 190 | */ |
| 191 | 191 | public function getFileStream($fileName) |
| 192 | 192 | { |
| 193 | - return fopen('phar://'.$this->archiveFileName . '/' . $fileName, 'rb'); |
|
| 193 | + return fopen('phar://'.$this->archiveFileName.'/'.$fileName, 'rb'); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -31,11 +31,11 @@ |
||
| 31 | 31 | $archive = $this->getArchive($input, $output); |
| 32 | 32 | |
| 33 | 33 | if (disk_free_space($output_dir) < $archive->getOriginalSize()) { |
| 34 | - throw new \LogicException('Archive size ' . implode($this->formatSize($archive->getOriginalSize())) . ' is more that available on disk ' |
|
| 34 | + throw new \LogicException('Archive size '.implode($this->formatSize($archive->getOriginalSize())).' is more that available on disk ' |
|
| 35 | 35 | . implode($this->formatSize(disk_free_space($output_dir)))); |
| 36 | 36 | } |
| 37 | 37 | $archive->extractFiles($output_dir, $entry_selector, true); |
| 38 | - $output->writeln('<info>Extracted all archive contents (' . implode($this->formatSize($archive->getOriginalSize())) . ')</info>'); |
|
| 38 | + $output->writeln('<info>Extracted all archive contents ('.implode($this->formatSize($archive->getOriginalSize())).')</info>'); |
|
| 39 | 39 | |
| 40 | 40 | return 0; |
| 41 | 41 | } |
@@ -26,15 +26,15 @@ |
||
| 26 | 26 | $file = realpath($input->getArgument('archive')); |
| 27 | 27 | $archive = $this->getArchive($input, $output); |
| 28 | 28 | |
| 29 | - $output->writeln('Filename: ' . $file . ' (changed <comment>' . $this->formatDate(filemtime($file)) . '</comment>)'); |
|
| 30 | - $output->writeln('Type: <info>' . $archive->getFormat() . '</info>, mime <info>' . $archive->getMimeType() . '</info> (via driver <comment>' . $archive->getDriverType() . '</comment>)'); |
|
| 31 | - $output->writeln('Contains: ' . $archive->countFiles() . ' file' . ($archive->countFiles() > 1 ? 's' : null)); |
|
| 29 | + $output->writeln('Filename: '.$file.' (changed <comment>'.$this->formatDate(filemtime($file)).'</comment>)'); |
|
| 30 | + $output->writeln('Type: <info>'.$archive->getFormat().'</info>, mime <info>'.$archive->getMimeType().'</info> (via driver <comment>'.$archive->getDriverType().'</comment>)'); |
|
| 31 | + $output->writeln('Contains: '.$archive->countFiles().' file'.($archive->countFiles() > 1 ? 's' : null)); |
|
| 32 | 32 | $output->writeln('Size:'); |
| 33 | - $output->writeln("\t". 'uncompressed: '.implode(' ', $this->formatSize($archive->getOriginalSize(), 2))); |
|
| 34 | - $output->writeln("\t" . 'compressed: ' . implode(' ', $this->formatSize($archive->getCompressedSize(), 2))); |
|
| 35 | - $output->writeln("\t" . 'ratio: <info>' . round($archive->getOriginalSize() / $archive->getCompressedSize(), 6) . '/1 (' . floor($archive->getCompressedSize() / $archive->getOriginalSize() * 100) . '%</info>)'); |
|
| 33 | + $output->writeln("\t".'uncompressed: '.implode(' ', $this->formatSize($archive->getOriginalSize(), 2))); |
|
| 34 | + $output->writeln("\t".'compressed: '.implode(' ', $this->formatSize($archive->getCompressedSize(), 2))); |
|
| 35 | + $output->writeln("\t".'ratio: <info>'.round($archive->getOriginalSize() / $archive->getCompressedSize(), 6).'/1 ('.floor($archive->getCompressedSize() / $archive->getOriginalSize() * 100).'%</info>)'); |
|
| 36 | 36 | if (!empty($comment = $archive->getComment())) |
| 37 | - $output->writeln('Comment: <comment>' . $comment . '</comment>'); |
|
| 37 | + $output->writeln('Comment: <comment>'.$comment.'</comment>'); |
|
| 38 | 38 | |
| 39 | 39 | return 0; |
| 40 | 40 | } |
@@ -33,8 +33,9 @@ |
||
| 33 | 33 | $output->writeln("\t". 'uncompressed: '.implode(' ', $this->formatSize($archive->getOriginalSize(), 2))); |
| 34 | 34 | $output->writeln("\t" . 'compressed: ' . implode(' ', $this->formatSize($archive->getCompressedSize(), 2))); |
| 35 | 35 | $output->writeln("\t" . 'ratio: <info>' . round($archive->getOriginalSize() / $archive->getCompressedSize(), 6) . '/1 (' . floor($archive->getCompressedSize() / $archive->getOriginalSize() * 100) . '%</info>)'); |
| 36 | - if (!empty($comment = $archive->getComment())) |
|
| 37 | - $output->writeln('Comment: <comment>' . $comment . '</comment>'); |
|
| 36 | + if (!empty($comment = $archive->getComment())) { |
|
| 37 | + $output->writeln('Comment: <comment>' . $comment . '</comment>'); |
|
| 38 | + } |
|
| 38 | 39 | |
| 39 | 40 | return 0; |
| 40 | 41 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | $entry_selector = $input->getArgument('entrySelector'); |
| 34 | 34 | |
| 35 | 35 | $archive->extractFiles($output_dir, $entry_selector, true); |
| 36 | - $output->writeln('<info>Extracted:</info> ' . implode(', ', $entry_selector) . ' (' . count($entry_selector) . ') file(s)'); |
|
| 36 | + $output->writeln('<info>Extracted:</info> '.implode(', ', $entry_selector).' ('.count($entry_selector).') file(s)'); |
|
| 37 | 37 | |
| 38 | 38 | return 0; |
| 39 | 39 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | list($archive, $file) = $this->getArchiveAndFile($input, $output); |
| 34 | 34 | |
| 35 | 35 | $archive->deleteFiles($file); |
| 36 | - $output->writeln('<comment>- file "' . $file . '"</comment>'); |
|
| 36 | + $output->writeln('<comment>- file "'.$file.'"</comment>'); |
|
| 37 | 37 | |
| 38 | 38 | return 0; |
| 39 | 39 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $password = $input->getOption('password'); |
| 48 | 48 | $compression = $input->getOption('compression'); |
| 49 | 49 | if (!isset(static::$compressionLevels[$compression])) { |
| 50 | - throw new \InvalidArgumentException('Compression "' . $compression . '" is not valid'); |
|
| 50 | + throw new \InvalidArgumentException('Compression "'.$compression.'" is not valid'); |
|
| 51 | 51 | } |
| 52 | 52 | $compression = static::$compressionLevels[$compression]; |
| 53 | 53 | $path = $input->getOption('path'); |
@@ -59,9 +59,9 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | if (file_exists($archive_file)) { |
| 61 | 61 | if (is_dir($archive_file)) |
| 62 | - throw new \InvalidArgumentException($archive_file . ' is a directory!'); |
|
| 62 | + throw new \InvalidArgumentException($archive_file.' is a directory!'); |
|
| 63 | 63 | else { |
| 64 | - throw new \InvalidArgumentException('File "' . $archive_file . '" already exists!'); |
|
| 64 | + throw new \InvalidArgumentException('File "'.$archive_file.'" already exists!'); |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
@@ -73,11 +73,11 @@ discard block |
||
| 73 | 73 | case 'full': |
| 74 | 74 | $destination = ltrim($file_to_pack, '/'); |
| 75 | 75 | $files_list[$destination] = $file_to_pack; |
| 76 | - $output->writeln('<comment>' . $file_to_pack . ' => ' . $destination . '</comment>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 76 | + $output->writeln('<comment>'.$file_to_pack.' => '.$destination.'</comment>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 77 | 77 | break; |
| 78 | 78 | case 'root': |
| 79 | 79 | if (is_dir($file_to_pack)) { |
| 80 | - $output->writeln('<comment>' . $file_to_pack . ' => root</comment>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 80 | + $output->writeln('<comment>'.$file_to_pack.' => root</comment>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 81 | 81 | if (!isset($files_list[''])) { |
| 82 | 82 | $files_list[''] = $file_to_pack; |
| 83 | 83 | } elseif (is_string($files_list[''])) { |
@@ -86,35 +86,35 @@ discard block |
||
| 86 | 86 | $files_list[''][] = $file_to_pack; |
| 87 | 87 | } |
| 88 | 88 | } else { |
| 89 | - $output->writeln('<comment>' . $file_to_pack . ' => ' . basename($file_to_pack) . '</comment>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 89 | + $output->writeln('<comment>'.$file_to_pack.' => '.basename($file_to_pack).'</comment>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 90 | 90 | $files_list[basename($file_to_pack)] = $file_to_pack; |
| 91 | 91 | } |
| 92 | 92 | break; |
| 93 | 93 | case 'relative': |
| 94 | 94 | $destination = ltrim($file_to_pack, '/.'); |
| 95 | 95 | $files_list[$destination] = $file_to_pack; |
| 96 | - $output->writeln('<comment>' . $file_to_pack . ' => ' . $destination . '</comment>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 96 | + $output->writeln('<comment>'.$file_to_pack.' => '.$destination.'</comment>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 97 | 97 | break; |
| 98 | 98 | case 'basename': |
| 99 | 99 | $destination = basename($file_to_pack); |
| 100 | 100 | $files_list[$destination] = $file_to_pack; |
| 101 | - $output->writeln('<comment>' . $file_to_pack . ' => ' . $destination . '</comment>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 101 | + $output->writeln('<comment>'.$file_to_pack.' => '.$destination.'</comment>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 102 | 102 | break; |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $information = UnifiedArchive::prepareForArchiving($files_list, $archive_file); |
| 107 | 107 | if ($dry_run) { |
| 108 | - $output->writeln('Format: <info>' . $information['type'] . '</info>'); |
|
| 109 | - $output->writeln('Original size: <info>' . implode($this->formatSize($information['totalSize'])) . '</info>'); |
|
| 110 | - $output->writeln('Files: <info>' . $information['numberOfFiles'] . '</info>'); |
|
| 108 | + $output->writeln('Format: <info>'.$information['type'].'</info>'); |
|
| 109 | + $output->writeln('Original size: <info>'.implode($this->formatSize($information['totalSize'])).'</info>'); |
|
| 110 | + $output->writeln('Files: <info>'.$information['numberOfFiles'].'</info>'); |
|
| 111 | 111 | foreach ($information['files'] as $destination => $source) { |
| 112 | 112 | // is folder |
| 113 | 113 | if ($source === null) { |
| 114 | 114 | continue; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $output->writeln($source . ' => <comment>' . $destination . '</comment>'); |
|
| 117 | + $output->writeln($source.' => <comment>'.$destination.'</comment>'); |
|
| 118 | 118 | } |
| 119 | 119 | return 0; |
| 120 | 120 | } |
@@ -124,10 +124,10 @@ discard block |
||
| 124 | 124 | $progressBar = new ProgressBar($output, $information['numberOfFiles']); |
| 125 | 125 | $progressBar->setFormat('archiving'); |
| 126 | 126 | $progressBar->start(); |
| 127 | - $archived_files = UnifiedArchive::archiveFiles($files_list, $archive_file, $compression, $password, function ($currentFile, $totalFiles, $fsFilename, $archiveFilename) |
|
| 127 | + $archived_files = UnifiedArchive::archiveFiles($files_list, $archive_file, $compression, $password, function($currentFile, $totalFiles, $fsFilename, $archiveFilename) |
|
| 128 | 128 | use ($progressBar) { |
| 129 | 129 | if ($fsFilename === null) { |
| 130 | - $progressBar->setMessage('Creating ' . $archiveFilename); |
|
| 130 | + $progressBar->setMessage('Creating '.$archiveFilename); |
|
| 131 | 131 | } else { |
| 132 | 132 | $progressBar->setMessage($fsFilename); |
| 133 | 133 | } |
@@ -146,8 +146,8 @@ discard block |
||
| 146 | 146 | $archive->setComment($comment); |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - $output->writeln('Created <info>' . $archive_file . '</info> with <comment>' . $archived_files . '</comment> file(s) (' |
|
| 150 | - . implode($this->formatSize($archive->getOriginalSize())) . ') of total size ' |
|
| 149 | + $output->writeln('Created <info>'.$archive_file.'</info> with <comment>'.$archived_files.'</comment> file(s) (' |
|
| 150 | + . implode($this->formatSize($archive->getOriginalSize())).') of total size ' |
|
| 151 | 151 | . implode($this->formatSize(filesize($archive_file)))); |
| 152 | 152 | |
| 153 | 153 | return 0; |
@@ -27,14 +27,14 @@ |
||
| 27 | 27 | list($archive, $file) = $this->getArchiveAndFile($input, $output); |
| 28 | 28 | $destination = $input->getArgument('destination'); |
| 29 | 29 | if (is_dir($destination)) { |
| 30 | - $destination = $destination . '/' . basename($file); |
|
| 30 | + $destination = $destination.'/'.basename($file); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $overwrite = $input->getOption('overwrite'); |
| 34 | 34 | |
| 35 | 35 | if (file_exists($destination) && !$overwrite) { |
| 36 | 36 | if ($input->getOption('no-interaction')) { |
| 37 | - throw new \LogicException('File destination ' . $destination . ' exists'); |
|
| 37 | + throw new \LogicException('File destination '.$destination.' exists'); |
|
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |