Fix cs
modifié: core/lib/Thelia/Core/FileFormat/Archive/AbstractArchiveBuilder.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/Exception/TarArchiveException.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/Exception/ZipArchiveException.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/TarArchiveBuilder.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/TarBz2ArchiveBuilder.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/TarGzArchiveBuilder.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/ZipArchiveBuilder.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderInterface.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderManager.php modifié: core/lib/Thelia/Core/FileFormat/FormatInterface.php modifié: core/lib/Thelia/Core/FileFormat/Formatter/AbstractFormatter.php modifié: core/lib/Thelia/Core/FileFormat/Formatter/Exception/BadFormattedStringException.php nouveau fichier: core/lib/Thelia/Core/FileFormat/Formatter/FormatterData.php nouveau fichier: core/lib/Thelia/Core/FileFormat/Formatter/FormatterInterface.php modifié: core/lib/Thelia/Core/FileFormat/Formatter/FormatterManager.php modifié: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/TarArchiveBuilderTest.php modifié: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/TarBz2ArchiveBuilderTest.php modifié: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/TarGzArchiveBuilderTest.php modifié: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/ZipArchiveBuilderTest.php modifié: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilderManagerTest.php modifié: core/lib/Thelia/Tests/FileFormat/Formatter/FormatterManagerTest.php modifié: core/lib/Thelia/Tests/Tools/FakeFileDownloader.php modifié: core/lib/Thelia/Tests/Tools/FileDownloaderTest.php
This commit is contained in:
@@ -258,8 +258,12 @@ abstract class AbstractArchiveBuilder implements FormatInterface, ArchiveBuilder
|
|||||||
=======
|
=======
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
* @param string $environment
|
* @param string $environment
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
|
=======
|
||||||
|
* @param string $environment
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return $this
|
* @return $this
|
||||||
*
|
*
|
||||||
* Sets the execution environment of the Kernel,
|
* Sets the execution environment of the Kernel,
|
||||||
@@ -270,6 +274,7 @@ abstract class AbstractArchiveBuilder implements FormatInterface, ArchiveBuilder
|
|||||||
$this->environment = $environment;
|
$this->environment = $environment;
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
@@ -283,3 +288,6 @@ abstract class AbstractArchiveBuilder implements FormatInterface, ArchiveBuilder
|
|||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -20,8 +20,12 @@ namespace Thelia\Core\FileFormat\Archive\ArchiveBuilder\Exception;
|
|||||||
class TarArchiveException extends \Exception
|
class TarArchiveException extends \Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ namespace Thelia\Core\FileFormat\Archive\ArchiveBuilder\Exception;
|
|||||||
class ZipArchiveException extends \ErrorException
|
class ZipArchiveException extends \ErrorException
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
* @param string $directoryInArchive This is the directory where it will be stored in the archive
|
* @param string $directoryInArchive This is the directory where it will be stored in the archive
|
||||||
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
||||||
* @param bool $isOnline
|
* @param bool $isOnline
|
||||||
|
<<<<<<< HEAD
|
||||||
=======
|
=======
|
||||||
}*/
|
}*/
|
||||||
=======
|
=======
|
||||||
@@ -121,6 +122,8 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
||||||
* @param bool $isOnline
|
* @param bool $isOnline
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
* @throws \Thelia\Exception\FileNotReadableException
|
* @throws \Thelia\Exception\FileNotReadableException
|
||||||
@@ -184,11 +187,15 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
/**
|
/**
|
||||||
* @param $content
|
* @param $content
|
||||||
* @param $name
|
* @param $name
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $directoryInArchive
|
* @param string $directoryInArchive
|
||||||
=======
|
=======
|
||||||
* @param string $directoryInArchive
|
* @param string $directoryInArchive
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
* @param string $directoryInArchive
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws \ErrorException
|
* @throws \ErrorException
|
||||||
*
|
*
|
||||||
@@ -213,11 +220,15 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$this->tar->addFromString($name, $content);
|
$this->tar->addFromString($name, $content);
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
=======
|
=======
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
>>>>>>> Fix cs
|
||||||
throw new \ErrorException(
|
throw new \ErrorException(
|
||||||
$this->translator->trans(
|
$this->translator->trans(
|
||||||
"Error while writing the file into the archive, error message: %errmes",
|
"Error while writing the file into the archive, error message: %errmes",
|
||||||
@@ -229,10 +240,13 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
=======
|
=======
|
||||||
|
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
>>>>>>> Fix cs
|
||||||
/**
|
/**
|
||||||
* @param $directoryPath
|
* @param $directoryPath
|
||||||
* @return $this
|
* @return $this
|
||||||
@@ -248,11 +262,15 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$this->tar->addEmptyDir($directoryInArchive);
|
$this->tar->addEmptyDir($directoryInArchive);
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
=======
|
=======
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
>>>>>>> Fix cs
|
||||||
throw new \ErrorException(
|
throw new \ErrorException(
|
||||||
$this->translator->trans(
|
$this->translator->trans(
|
||||||
"The directory %dir has not been created in the archive",
|
"The directory %dir has not been created in the archive",
|
||||||
@@ -268,11 +286,15 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $pathToFile
|
* @param string $pathToFile
|
||||||
=======
|
=======
|
||||||
* @param string $pathToFile
|
* @param string $pathToFile
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
* @param string $pathToFile
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return null|string
|
* @return null|string
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
* @throws \Thelia\Exception\FileNotReadableException
|
* @throws \Thelia\Exception\FileNotReadableException
|
||||||
@@ -315,6 +337,7 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
=======
|
=======
|
||||||
|
|
||||||
=======
|
=======
|
||||||
@@ -324,6 +347,8 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
|
|
||||||
|
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
>>>>>>> Fix cs
|
||||||
/**
|
/**
|
||||||
* @param $pathInArchive
|
* @param $pathInArchive
|
||||||
* @return $this
|
* @return $this
|
||||||
@@ -424,11 +449,18 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
* @param string $pathToArchive
|
* @param string $pathToArchive
|
||||||
* @param string $environment
|
* @param string $environment
|
||||||
* @param bool $isOnline
|
* @param bool $isOnline
|
||||||
* @param FileDownloaderInterface $fileDownloader
|
* @param FileDownloaderInterface $fileDownloader
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
* @param string $pathToArchive
|
||||||
|
* @param string $environment
|
||||||
|
* @param bool $isOnline
|
||||||
|
* @param FileDownloaderInterface $fileDownloader
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
* @throws \Thelia\Exception\HttpUrlException
|
* @throws \Thelia\Exception\HttpUrlException
|
||||||
@@ -483,6 +515,9 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
*/
|
*/
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|
||||||
return $tar->setEnvironment($tar->environment);
|
return $tar->setEnvironment($tar->environment);
|
||||||
=======
|
=======
|
||||||
@@ -512,31 +547,43 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
/** @var \PharFileInfo $fileInfo */
|
/** @var \PharFileInfo $fileInfo */
|
||||||
$fileInfo = $this->tar[$pathToFile];
|
$fileInfo = $this->tar[$pathToFile];
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
if ($fileInfo->isFile()) {
|
if ($fileInfo->isFile()) {
|
||||||
=======
|
=======
|
||||||
if($fileInfo->isFile()) {
|
if($fileInfo->isFile()) {
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
if ($fileInfo->isFile()) {
|
||||||
|
>>>>>>> Fix cs
|
||||||
$isFile = true;
|
$isFile = true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Catch the exception to avoid its displaying.
|
* Catch the exception to avoid its displaying.
|
||||||
*/
|
*/
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
} catch (\BadMethodCallException $e) {}
|
} catch (\BadMethodCallException $e) {}
|
||||||
=======
|
=======
|
||||||
} catch(\BadMethodCallException $e) {}
|
} catch(\BadMethodCallException $e) {}
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
} catch (\BadMethodCallException $e) {}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|
||||||
return $isFile;
|
return $isFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $directory
|
* @param string $directory
|
||||||
=======
|
=======
|
||||||
* @param string $directory
|
* @param string $directory
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
* @param string $directory
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return bool
|
* @return bool
|
||||||
*
|
*
|
||||||
* Check if the archive has a directory
|
* Check if the archive has a directory
|
||||||
@@ -550,31 +597,43 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
/** @var \PharFileInfo $fileInfo */
|
/** @var \PharFileInfo $fileInfo */
|
||||||
$fileInfo = $this->tar[$pathToDir];
|
$fileInfo = $this->tar[$pathToDir];
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
if ($fileInfo->isDir()) {
|
if ($fileInfo->isDir()) {
|
||||||
=======
|
=======
|
||||||
if($fileInfo->isDir()) {
|
if($fileInfo->isDir()) {
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
if ($fileInfo->isDir()) {
|
||||||
|
>>>>>>> Fix cs
|
||||||
$isDir = true;
|
$isDir = true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Catch the exception to avoid its displaying.
|
* Catch the exception to avoid its displaying.
|
||||||
*/
|
*/
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
} catch (\BadMethodCallException $e) {}
|
} catch (\BadMethodCallException $e) {}
|
||||||
=======
|
=======
|
||||||
} catch(\BadMethodCallException $e) {}
|
} catch(\BadMethodCallException $e) {}
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
} catch (\BadMethodCallException $e) {}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|
||||||
return $isDir;
|
return $isDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $environment
|
* @param string $environment
|
||||||
=======
|
=======
|
||||||
* @param string $environment
|
* @param string $environment
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
* @param string $environment
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return $this
|
* @return $this
|
||||||
*
|
*
|
||||||
* Sets the execution environment of the Kernel,
|
* Sets the execution environment of the Kernel,
|
||||||
@@ -619,6 +678,7 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
$this->compressionEntryPoint();
|
$this->compressionEntryPoint();
|
||||||
|
|
||||||
} catch (\BadMethodCallException $e) {
|
} catch (\BadMethodCallException $e) {
|
||||||
|
<<<<<<< HEAD
|
||||||
=======
|
=======
|
||||||
switch ($this->compression) {
|
switch ($this->compression) {
|
||||||
case "gz":
|
case "gz":
|
||||||
@@ -637,15 +697,21 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
|
|
||||||
} catch(\BadMethodCallException $e) {
|
} catch(\BadMethodCallException $e) {
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
>>>>>>> Fix cs
|
||||||
/**
|
/**
|
||||||
* This should not happen
|
* This should not happen
|
||||||
*/
|
*/
|
||||||
$errorMessage = "You have badly called the method setEnvironment twice for %file";
|
$errorMessage = "You have badly called the method setEnvironment twice for %file";
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
} catch (\UnexpectedValueException $e) {
|
} catch (\UnexpectedValueException $e) {
|
||||||
=======
|
=======
|
||||||
} catch(\UnexpectedValueException $e) {
|
} catch(\UnexpectedValueException $e) {
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
} catch (\UnexpectedValueException $e) {
|
||||||
|
>>>>>>> Fix cs
|
||||||
$errorMessage = "The file %file is corrupted";
|
$errorMessage = "The file %file is corrupted";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -674,11 +740,15 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $initialString
|
* @param string $initialString
|
||||||
=======
|
=======
|
||||||
* @param string $initialString
|
* @param string $initialString
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
* @param string $initialString
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* Gives a valid file path for \ZipArchive
|
* Gives a valid file path for \ZipArchive
|
||||||
@@ -699,11 +769,15 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $initialString
|
* @param string $initialString
|
||||||
=======
|
=======
|
||||||
* @param string $initialString
|
* @param string $initialString
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
* @param string $initialString
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* Gives a valid directory path for \ZipArchive
|
* Gives a valid directory path for \ZipArchive
|
||||||
@@ -811,5 +885,9 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
{
|
{
|
||||||
return $this->compression;
|
return $this->compression;
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -45,7 +45,11 @@ class TarBz2ArchiveBuilder extends TarArchiveBuilder
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -49,8 +49,12 @@ class TarGzArchiveBuilder extends TarArchiveBuilder
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -94,11 +94,15 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
* On the destruction of the class,
|
* On the destruction of the class,
|
||||||
* remove the temporary file.
|
* remove the temporary file.
|
||||||
*/
|
*/
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
public function __destruct()
|
public function __destruct()
|
||||||
=======
|
=======
|
||||||
function __destruct()
|
function __destruct()
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
public function __destruct()
|
||||||
|
>>>>>>> Fix cs
|
||||||
{
|
{
|
||||||
if ($this->zip instanceof \ZipArchive) {
|
if ($this->zip instanceof \ZipArchive) {
|
||||||
@$this->zip->close();
|
@$this->zip->close();
|
||||||
@@ -126,10 +130,14 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @param string $filePath It is the path to access the file.
|
* @param string $filePath It is the path to access the file.
|
||||||
* @param string $directoryInArchive This is the directory where it will be stored in the archive
|
* @param string $directoryInArchive This is the directory where it will be stored in the archive
|
||||||
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
||||||
* @param bool $isOnline
|
* @param bool $isOnline
|
||||||
|
<<<<<<< HEAD
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
* @throws \Thelia\Exception\FileNotReadableException
|
* @throws \Thelia\Exception\FileNotReadableException
|
||||||
@@ -139,6 +147,8 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
* @param string $directoryInArchive This is the directory where it will be stored in the archive
|
* @param string $directoryInArchive This is the directory where it will be stored in the archive
|
||||||
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
||||||
* @param bool $isOnline
|
* @param bool $isOnline
|
||||||
|
=======
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
* @throws \Thelia\Exception\FileNotReadableException
|
* @throws \Thelia\Exception\FileNotReadableException
|
||||||
@@ -163,6 +173,7 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!empty($directoryInArchive)) {
|
if (!empty($directoryInArchive)) {
|
||||||
|
<<<<<<< HEAD
|
||||||
$this->addDirectory($directoryInArchive);
|
$this->addDirectory($directoryInArchive);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,6 +281,8 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if(!empty($directoryInArchive)) {
|
if(!empty($directoryInArchive)) {
|
||||||
|
=======
|
||||||
|
>>>>>>> Fix cs
|
||||||
$this->addDirectory($directoryInArchive);
|
$this->addDirectory($directoryInArchive);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,7 +456,7 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
/**
|
/**
|
||||||
* @param $content
|
* @param $content
|
||||||
* @param $name
|
* @param $name
|
||||||
* @param string $directoryInArchive
|
* @param string $directoryInArchive
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws \ErrorException
|
* @throws \ErrorException
|
||||||
*
|
*
|
||||||
@@ -510,7 +523,7 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $pathToFile
|
* @param string $pathToFile
|
||||||
* @return null|string
|
* @return null|string
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
* @throws \Thelia\Exception\FileNotReadableException
|
* @throws \Thelia\Exception\FileNotReadableException
|
||||||
@@ -540,7 +553,7 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $initialString
|
* @param string $initialString
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* Gives a valid file path for \ZipArchive
|
* Gives a valid file path for \ZipArchive
|
||||||
@@ -560,11 +573,12 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
if (preg_match("#\/?[^\/]+\/[^\/]+\/?#", $initialString)) {
|
if (preg_match("#\/?[^\/]+\/[^\/]+\/?#", $initialString)) {
|
||||||
$initialString = "/" . $initialString;
|
$initialString = "/" . $initialString;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $initialString;
|
return $initialString;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $initialString
|
* @param string $initialString
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* Gives a valid directory path for \ZipArchive
|
* Gives a valid directory path for \ZipArchive
|
||||||
@@ -717,6 +731,7 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $pathToArchive
|
* @param string $pathToArchive
|
||||||
* @param bool $isOnline
|
* @param bool $isOnline
|
||||||
@@ -730,6 +745,11 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
* @return $this
|
* @return $this
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
=======
|
=======
|
||||||
|
=======
|
||||||
|
* @param string $pathToArchive
|
||||||
|
* @param bool $isOnline
|
||||||
|
* @param FileDownloaderInterface $fileDownloader
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return ZipArchiveBuilder
|
* @return ZipArchiveBuilder
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
@@ -828,11 +848,15 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $directory
|
* @param string $directory
|
||||||
=======
|
=======
|
||||||
* @param string $directory
|
* @param string $directory
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
* @param string $directory
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return bool
|
* @return bool
|
||||||
*
|
*
|
||||||
* Checks if the link $directory exists and if it's not a file.
|
* Checks if the link $directory exists and if it's not a file.
|
||||||
@@ -853,11 +877,15 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $environment
|
* @param string $environment
|
||||||
=======
|
=======
|
||||||
* @param string $environment
|
* @param string $environment
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
* @param string $environment
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return $this
|
* @return $this
|
||||||
*
|
*
|
||||||
* Sets the execution environment of the Kernel,
|
* Sets the execution environment of the Kernel,
|
||||||
@@ -927,6 +955,7 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
\ZipArchive::CREATE
|
\ZipArchive::CREATE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
if ($opening !== true) {
|
if ($opening !== true) {
|
||||||
throw new \ErrorException(
|
throw new \ErrorException(
|
||||||
@@ -934,6 +963,9 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
"An unknown error append"
|
"An unknown error append"
|
||||||
=======
|
=======
|
||||||
if($opening !== true) {
|
if($opening !== true) {
|
||||||
|
=======
|
||||||
|
if ($opening !== true) {
|
||||||
|
>>>>>>> Fix cs
|
||||||
throw new \ErrorException(
|
throw new \ErrorException(
|
||||||
$this->translator->trans(
|
$this->translator->trans(
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
@@ -1052,11 +1084,15 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $initialString
|
* @param string $initialString
|
||||||
=======
|
=======
|
||||||
* @param string $initialString
|
* @param string $initialString
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
* @param string $initialString
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* Gives a valid file path for \ZipArchive
|
* Gives a valid file path for \ZipArchive
|
||||||
@@ -1085,18 +1121,26 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
$initialString = "/" . $initialString;
|
$initialString = "/" . $initialString;
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
=======
|
=======
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
|
||||||
|
>>>>>>> Fix cs
|
||||||
return $initialString;
|
return $initialString;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $initialString
|
* @param string $initialString
|
||||||
=======
|
=======
|
||||||
* @param string $initialString
|
* @param string $initialString
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
* @param string $initialString
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* Gives a valid directory path for \ZipArchive
|
* Gives a valid directory path for \ZipArchive
|
||||||
@@ -1219,6 +1263,7 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
|
|
||||||
@@ -1240,3 +1285,6 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
|||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
namespace Thelia\Core\FileFormat\Archive;
|
namespace Thelia\Core\FileFormat\Archive;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface ArchiveBuilderInterface
|
* Interface ArchiveBuilderInterface
|
||||||
* @package Thelia\Core\FileFormat\Archive
|
* @package Thelia\Core\FileFormat\Archive
|
||||||
@@ -32,10 +31,14 @@ interface ArchiveBuilderInterface
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @param string $filePath It is the path to access the file.
|
* @param string $filePath It is the path to access the file.
|
||||||
* @param string $directoryInArchive This is the directory where it will be stored in the archive
|
* @param string $directoryInArchive This is the directory where it will be stored in the archive
|
||||||
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
||||||
* @param bool $isOnline
|
* @param bool $isOnline
|
||||||
|
<<<<<<< HEAD
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
* @throws \Thelia\Exception\FileNotReadableException
|
* @throws \Thelia\Exception\FileNotReadableException
|
||||||
@@ -45,6 +48,8 @@ interface ArchiveBuilderInterface
|
|||||||
* @param string $directoryInArchive This is the directory where it will be stored in the archive
|
* @param string $directoryInArchive This is the directory where it will be stored in the archive
|
||||||
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
* @param null|string $name The name of the file in the archive. if it null or empty, it keeps the same name
|
||||||
* @param bool $isOnline
|
* @param bool $isOnline
|
||||||
|
=======
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
* @throws \Thelia\Exception\FileNotReadableException
|
* @throws \Thelia\Exception\FileNotReadableException
|
||||||
@@ -69,8 +74,12 @@ interface ArchiveBuilderInterface
|
|||||||
=======
|
=======
|
||||||
* @param $content
|
* @param $content
|
||||||
* @param $name
|
* @param $name
|
||||||
|
<<<<<<< HEAD
|
||||||
* @param string $directoryInArchive
|
* @param string $directoryInArchive
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
* @param string $directoryInArchive
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws \ErrorException
|
* @throws \ErrorException
|
||||||
*
|
*
|
||||||
@@ -79,11 +88,15 @@ interface ArchiveBuilderInterface
|
|||||||
public function addFileFromString($content, $name, $directoryInArchive = "/");
|
public function addFileFromString($content, $name, $directoryInArchive = "/");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $pathToFile
|
* @param string $pathToFile
|
||||||
=======
|
=======
|
||||||
* @param string $pathToFile
|
* @param string $pathToFile
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
* @param string $pathToFile
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return null|string
|
* @return null|string
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
* @throws \Thelia\Exception\FileNotReadableException
|
* @throws \Thelia\Exception\FileNotReadableException
|
||||||
@@ -149,6 +162,7 @@ interface ArchiveBuilderInterface
|
|||||||
public function buildArchiveResponse();
|
public function buildArchiveResponse();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
* @param string $pathToArchive
|
* @param string $pathToArchive
|
||||||
* @param bool $isOnline
|
* @param bool $isOnline
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
@@ -159,6 +173,10 @@ interface ArchiveBuilderInterface
|
|||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
=======
|
=======
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
|
=======
|
||||||
|
* @param string $pathToArchive
|
||||||
|
* @param bool $isOnline
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
* @throws \Thelia\Exception\HttpUrlException
|
* @throws \Thelia\Exception\HttpUrlException
|
||||||
@@ -188,17 +206,22 @@ interface ArchiveBuilderInterface
|
|||||||
public function hasFile($pathToFile);
|
public function hasFile($pathToFile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $directory
|
* @param string $directory
|
||||||
=======
|
=======
|
||||||
* @param string $directory
|
* @param string $directory
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
* @param string $directory
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return bool
|
* @return bool
|
||||||
*
|
*
|
||||||
* Check if the archive has a directory
|
* Check if the archive has a directory
|
||||||
*/
|
*/
|
||||||
public function hasDirectory($directory);
|
public function hasDirectory($directory);
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
@@ -216,3 +239,6 @@ interface ArchiveBuilderInterface
|
|||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class ArchiveBuilderManager
|
|||||||
$this->environment = $environment;
|
$this->environment = $environment;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param AbstractArchiveBuilder $archiveBuilder
|
* @param AbstractArchiveBuilder $archiveBuilder
|
||||||
* @return $this
|
* @return $this
|
||||||
@@ -46,6 +47,9 @@ class ArchiveBuilderManager
|
|||||||
$this->archiveBuilders[$archiveBuilder->getName()] = $archiveBuilder;
|
$this->archiveBuilders[$archiveBuilder->getName()] = $archiveBuilder;
|
||||||
=======
|
=======
|
||||||
* @param AbstractArchiveBuilder $archiveCreator
|
* @param AbstractArchiveBuilder $archiveCreator
|
||||||
|
=======
|
||||||
|
* @param AbstractArchiveBuilder $archiveCreator
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function add(AbstractArchiveBuilder $archiveCreator)
|
public function add(AbstractArchiveBuilder $archiveCreator)
|
||||||
@@ -143,5 +147,9 @@ class ArchiveBuilderManager
|
|||||||
{
|
{
|
||||||
return $this->archiveCreators;
|
return $this->archiveCreators;
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -56,7 +56,11 @@ interface FormatInterface
|
|||||||
*/
|
*/
|
||||||
public function getMimeType();
|
public function getMimeType();
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -18,24 +18,7 @@ use Thelia\Core\FileFormat\FormatInterface;
|
|||||||
* @package Thelia\Core\FileFormat\Formatter
|
* @package Thelia\Core\FileFormat\Formatter
|
||||||
* @author Benjamin Perche <bperche@openstudio.fr>
|
* @author Benjamin Perche <bperche@openstudio.fr>
|
||||||
*/
|
*/
|
||||||
abstract class AbstractFormatter implements FormatInterface
|
abstract class AbstractFormatter implements FormatInterface, FormatterInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @param array $data
|
|
||||||
* @return mixed
|
|
||||||
*
|
|
||||||
* Encodes an array to the desired format.
|
|
||||||
* $data array only contains array and scalar data.
|
|
||||||
*/
|
|
||||||
abstract public function encode(array $data);
|
|
||||||
|
|
||||||
/**
|
}
|
||||||
* @param $data
|
|
||||||
* @return array
|
|
||||||
* @throws \Thelia\Core\FileFormat\Formatter\Exception\BadFormattedStringException
|
|
||||||
*
|
|
||||||
* this method must do exactly the opposite of encode and return
|
|
||||||
* an array composed of array and scalar data.
|
|
||||||
*/
|
|
||||||
abstract public function decode($data);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ namespace Thelia\Core\FileFormat\Formatter\Exception;
|
|||||||
class BadFormattedStringException extends \ErrorException
|
class BadFormattedStringException extends \ErrorException
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
23
core/lib/Thelia/Core/FileFormat/Formatter/FormatterData.php
Normal file
23
core/lib/Thelia/Core/FileFormat/Formatter/FormatterData.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
/*************************************************************************************/
|
||||||
|
/* This file is part of the Thelia package. */
|
||||||
|
/* */
|
||||||
|
/* Copyright (c) OpenStudio */
|
||||||
|
/* email : dev@thelia.net */
|
||||||
|
/* web : http://www.thelia.net */
|
||||||
|
/* */
|
||||||
|
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||||
|
/* file that was distributed with this source code. */
|
||||||
|
/*************************************************************************************/
|
||||||
|
|
||||||
|
namespace Thelia\Core\FileFormat\Formatter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class FormatterData
|
||||||
|
* @package Thelia\Core\FileFormat\Formatter
|
||||||
|
* @author Benjamin Perche <bperche@openstudio.fr>
|
||||||
|
*/
|
||||||
|
class FormatterData
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
/*************************************************************************************/
|
||||||
|
/* This file is part of the Thelia package. */
|
||||||
|
/* */
|
||||||
|
/* Copyright (c) OpenStudio */
|
||||||
|
/* email : dev@thelia.net */
|
||||||
|
/* web : http://www.thelia.net */
|
||||||
|
/* */
|
||||||
|
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||||
|
/* file that was distributed with this source code. */
|
||||||
|
/*************************************************************************************/
|
||||||
|
|
||||||
|
namespace Thelia\Core\FileFormat\Formatter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface FormatterInterface
|
||||||
|
* @package Thelia\Core\FileFormat\Formatter
|
||||||
|
* @author Benjamin Perche <bperche@openstudio.fr>
|
||||||
|
*/
|
||||||
|
interface FormatterInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param FormatterData $data
|
||||||
|
* @return mixed
|
||||||
|
*
|
||||||
|
* This method must use a FormatterData object and output
|
||||||
|
* a formatted value.
|
||||||
|
*/
|
||||||
|
public function encode(FormatterData $data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $rawData
|
||||||
|
* @return FormatterData
|
||||||
|
*
|
||||||
|
* This must takes raw data as argument and outputs
|
||||||
|
* a FormatterData object.
|
||||||
|
*/
|
||||||
|
public function decode($rawData);
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ use Thelia\Core\Translation\Translator;
|
|||||||
* @package Thelia\Core\FileFormat\Formatter
|
* @package Thelia\Core\FileFormat\Formatter
|
||||||
* @author Benjamin Perche <bperche@openstudio.fr>
|
* @author Benjamin Perche <bperche@openstudio.fr>
|
||||||
*/
|
*/
|
||||||
class FormatterManager
|
class FormatterManager
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $formatters = array();
|
protected $formatters = array();
|
||||||
@@ -66,4 +66,4 @@ class FormatterManager
|
|||||||
{
|
{
|
||||||
return $this->formatters;
|
return $this->formatters;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ class TarArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->tar->formatDirectoryPath("//foo/bar///baz/")
|
$this->tar->formatDirectoryPath("//foo/bar///baz/")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testFormatFilePath()
|
public function testFormatFilePath()
|
||||||
{
|
{
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
@@ -522,5 +522,9 @@ class TarArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->tar->getCompression()
|
$this->tar->getCompression()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -36,7 +36,11 @@ class TarBz2ArchiveBuilderTest extends TarArchiveBuilderTest
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -13,9 +13,12 @@
|
|||||||
namespace Thelia\Tests\FileFormat\Archive\ArchiveBuilder;
|
namespace Thelia\Tests\FileFormat\Archive\ArchiveBuilder;
|
||||||
use Thelia\Core\FileFormat\Archive\ArchiveBuilder\TarGzArchiveBuilder;
|
use Thelia\Core\FileFormat\Archive\ArchiveBuilder\TarGzArchiveBuilder;
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
=======
|
=======
|
||||||
use Thelia\Core\HttpFoundation\Response;
|
use Thelia\Core\HttpFoundation\Response;
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
|
=======
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TarGzArchiveBuilderTest
|
* Class TarGzArchiveBuilderTest
|
||||||
@@ -40,7 +43,11 @@ class TarGzArchiveBuilderTest extends TarArchiveBuilderTest
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -693,6 +693,7 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
@@ -701,3 +702,6 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
|||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Finish implementing and testing zip
|
>>>>>>> Finish implementing and testing zip
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -72,8 +72,12 @@ class ArchiveBuilderManagerTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->manager->delete("foo");
|
$this->manager->delete("foo");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -71,4 +71,4 @@ class FormatterManagerTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$this->manager->delete("foo");
|
$this->manager->delete("foo");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ use Thelia\Tools\FileDownload\FileDownloader;
|
|||||||
class FakeFileDownloader extends FileDownloader
|
class FakeFileDownloader extends FileDownloader
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
* @param string $url
|
* @param string $url
|
||||||
* @param string $pathToStore
|
* @param string $pathToStore
|
||||||
@@ -29,6 +30,10 @@ class FakeFileDownloader extends FileDownloader
|
|||||||
* @param string $url
|
* @param string $url
|
||||||
* @param string $pathToStore
|
* @param string $pathToStore
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
* @param string $url
|
||||||
|
* @param string $pathToStore
|
||||||
|
>>>>>>> Fix cs
|
||||||
* @throws \Thelia\Exception\FileNotFoundException
|
* @throws \Thelia\Exception\FileNotFoundException
|
||||||
* @throws \ErrorException
|
* @throws \ErrorException
|
||||||
* @throws \HttpUrlException
|
* @throws \HttpUrlException
|
||||||
@@ -46,8 +51,12 @@ class FakeFileDownloader extends FileDownloader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
@@ -69,7 +69,11 @@ class FileDownloaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->downloader->download("https://github.com/thelia/thelia", "php://temp");
|
$this->downloader->download("https://github.com/thelia/thelia", "php://temp");
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
=======
|
=======
|
||||||
}
|
}
|
||||||
>>>>>>> Define archive builders and formatters
|
>>>>>>> Define archive builders and formatters
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
>>>>>>> Fix cs
|
||||||
|
|||||||
Reference in New Issue
Block a user