Define archive builders and formatters

nouveau fichier: core/lib/Thelia/Core/FileFormat/Archive/AbstractArchiveBuilder.php
	nouveau fichier: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/ZipArchiveBuilder.php
	nouveau fichier: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/ZipArchiveException.php
	nouveau fichier: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderInterface.php
	nouveau fichier: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderManager.php
	nouveau fichier: core/lib/Thelia/Core/FileFormat/FormatInterface.php
	nouveau fichier: core/lib/Thelia/Core/FileFormat/Formatter/AbstractFormatter.php
	nouveau fichier: core/lib/Thelia/Core/FileFormat/Formatter/Exception/BadFormattedStringException.php
	nouveau fichier: core/lib/Thelia/Core/FileFormat/Formatter/FormatterManager.php
	nouveau fichier: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/TestResources/bad_formatted.zip
	nouveau fichier: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/TestResources/test_file
	nouveau fichier: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/TestResources/well_formatted.zip
	nouveau fichier: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/ZipArchiveBuilderTest.php
	nouveau fichier: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilderManagerTest.php
	nouveau fichier: core/lib/Thelia/Tests/FileFormat/Formatter/FormatterManagerTest.php
	nouveau fichier: core/lib/Thelia/Tests/Tools/FakeFileDownloader.php
	nouveau fichier: core/lib/Thelia/Tests/Tools/FileDownloaderTest.php
	nouveau fichier: core/lib/Thelia/Tools/FileDownload/FileDownloader.php
	nouveau fichier: core/lib/Thelia/Tools/FileDownload/FileDownloaderAwareTrait.php
	nouveau fichier: core/lib/Thelia/Tools/FileDownload/FileDownloaderInterface.php
	modifié:         core/lib/Thelia/Tools/URL.php
This commit is contained in:
Benjamin Perche
2014-07-02 14:00:49 +02:00
parent 50adcecc27
commit 6af18cd3e7
19 changed files with 906 additions and 2 deletions

View File

@@ -17,7 +17,10 @@ use Thelia\Core\Translation\Translator as TheliaTranslator;
use Thelia\Exception\FileNotFoundException;
use Thelia\Exception\HttpUrlException;
use Thelia\Log\Tlog;
<<<<<<< HEAD
use Thelia\Tools\URL;
=======
>>>>>>> Define archive builders and formatters
/**
* Class FileDownloader
@@ -45,8 +48,13 @@ class FileDownloader implements FileDownloaderInterface
}
/**
<<<<<<< HEAD
* @param string $url
* @param string $pathToStore
=======
* @param string $url
* @param string $pathToStore
>>>>>>> Define archive builders and formatters
* @throws \Thelia\Exception\FileNotFoundException
* @throws \ErrorException
* @throws \HttpUrlException
@@ -125,7 +133,11 @@ class FileDownloader implements FileDownloaderInterface
*/
$file = @fopen($pathToStore, "w");
<<<<<<< HEAD
if ($file === false) {
=======
if($file === false) {
>>>>>>> Define archive builders and formatters
$translatedErrorMessage = $this->translator->trans(
"Failed to open a writing stream on the file: %file",
[
@@ -140,4 +152,8 @@ class FileDownloader implements FileDownloaderInterface
fputs($file, $response);
fclose($file);
}
<<<<<<< HEAD
}
=======
}
>>>>>>> Define archive builders and formatters

View File

@@ -35,7 +35,11 @@ trait FileDownloaderAwareTrait
}
/**
<<<<<<< HEAD
* @param FileDownloaderInterface $fileDownloader
=======
* @param FileDownloaderInterface $fileDownloader
>>>>>>> Define archive builders and formatters
* @return $this
*/
public function setFileDownloader(FileDownloaderInterface $fileDownloader)
@@ -44,4 +48,8 @@ trait FileDownloaderAwareTrait
return $this;
}
<<<<<<< HEAD
}
=======
}
>>>>>>> Define archive builders and formatters

View File

@@ -14,6 +14,10 @@ namespace Thelia\Tools\FileDownload;
use Psr\Log\LoggerInterface;
use Symfony\Component\Translation\Translator;
<<<<<<< HEAD
=======
>>>>>>> Define archive builders and formatters
/**
* Class FileDownloader
* @package Thelia\Tools\FileDownload
@@ -22,8 +26,13 @@ use Symfony\Component\Translation\Translator;
interface FileDownloaderInterface
{
/**
<<<<<<< HEAD
* @param string $url
* @param string $pathToStore
=======
* @param string $url
* @param string $pathToStore
>>>>>>> Define archive builders and formatters
* @throws \Thelia\Exception\FileNotFoundException
* @throws \ErrorException
* @throws \HttpUrlException
@@ -40,4 +49,8 @@ interface FileDownloaderInterface
* Returns an hydrated instance
*/
public static function getInstance();
<<<<<<< HEAD
}
=======
}
>>>>>>> Define archive builders and formatters