supprimé:        core/lib/Thelia/Controller/Admin/CustomerExportController.php
	modifié:         core/lib/Thelia/Controller/Admin/ExportController.php
	modifié:         core/lib/Thelia/Controller/Admin/ImportController.php
	modifié:         core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php
	modifié:         core/lib/Thelia/Core/Event/ImportExport.php
	modifié:         core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderManager.php
	modifié:         core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderManagerTrait.php
	modifié:         core/lib/Thelia/Core/FileFormat/Formatting/Exception/BadFormattedStringException.php
	modifié:         core/lib/Thelia/Core/FileFormat/Formatting/Formatter/XMLFormatter.php
	modifié:         core/lib/Thelia/Core/FileFormat/Formatting/FormatterManager.php
	modifié:         core/lib/Thelia/Core/FileFormat/Formatting/FormatterManagerTrait.php
	modifié:         core/lib/Thelia/Core/Template/Loop/ImportExportType.php
	modifié:         core/lib/Thelia/Model/Export.php
	modifié:         core/lib/Thelia/Model/Import.php
This commit is contained in:
Benjamin Perche
2014-07-18 14:35:07 +02:00
parent 4c165bc5d5
commit 0723f30695
14 changed files with 30 additions and 72 deletions

View File

@@ -1,36 +0,0 @@
<?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\Controller\Admin;
/**
* Class CustomerExportController
* @package Thelia\Controller\Admin
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class CustomerExportController extends BaseAdminController
{
public function newsletterSubscribers()
{
}
public function customers()
{
}
public function mailing()
{
}
}

View File

@@ -140,11 +140,11 @@ class ExportController extends BaseAdminController
}
/**
* @param AbstractFormatter $formatter
* @param ExportHandler $handler
* @param AbstractArchiveBuilder $archiveBuilder
* @param bool $includeImages
* @param bool $includeDocuments
* @param AbstractFormatter $formatter
* @param ExportHandler $handler
* @param AbstractArchiveBuilder $archiveBuilder
* @param bool $includeImages
* @param bool $includeDocuments
* @return Response
*
* Processes an export by returning a response with the export's content.
@@ -206,7 +206,7 @@ class ExportController extends BaseAdminController
}
/**
* @param ImagesExportInterface $handler
* @param ImagesExportInterface $handler
* @param AbstractArchiveBuilder $archiveBuilder
*
* Procedure that add images in the export's archive
@@ -224,7 +224,7 @@ class ExportController extends BaseAdminController
/**
* @param DocumentsExportInterface $handler
* @param AbstractArchiveBuilder $archiveBuilder
* @param AbstractArchiveBuilder $archiveBuilder
*
* Procedure that add documents in the export's archive
*/

View File

@@ -75,7 +75,6 @@ class ImportController extends BaseAdminController
$errorMessage = null;
$successMessage = null;
try {
$boundForm = $this->validateForm($form);
@@ -94,7 +93,6 @@ class ImportController extends BaseAdminController
$archiveBuilderManager
);
/** @var AbstractArchiveBuilder $archiveBuilder */
$archiveBuilder = $tools["archive_builder"];
@@ -140,9 +138,9 @@ class ImportController extends BaseAdminController
$archiveBuilder
);
} catch(FormValidationException $e) {
} catch (FormValidationException $e) {
$errorMessage = $this->createStandardFormValidationErrorMessage($e);
} catch(\Exception $e) {
} catch (\Exception $e) {
$errorMessage = $e->getMessage();
}
@@ -232,11 +230,11 @@ class ImportController extends BaseAdminController
try {
$formatter = $formatterManager->get($objectName);
} catch(\OutOfBoundsException $e) {}
} catch (\OutOfBoundsException $e) {}
try {
$archiveBuilder = $archiveBuilderManager->get($objectName);
} catch(\OutOfBoundsException $e) {}
} catch (\OutOfBoundsException $e) {}
break;
}
@@ -305,7 +303,6 @@ class ImportController extends BaseAdminController
return $this->getTranslator()->trans("Import successfully done");
}
/**
* @param integer $id
* @return Response
@@ -508,4 +505,4 @@ class ImportController extends BaseAdminController
return $category;
}
}
}

View File

@@ -12,7 +12,6 @@
namespace Thelia\Core\DependencyInjection\Loader;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\Propel;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Config\Util\XmlUtils;

View File

@@ -109,7 +109,7 @@ class ImportExport extends ActionEvent
}
/**
* @param FormatterData $data
* @param FormatterData $data
* @return $this
*/
public function setData(FormatterData $data)
@@ -146,5 +146,4 @@ class ImportExport extends ActionEvent
return $this->content;
}
}

View File

@@ -141,7 +141,8 @@ class ArchiveBuilderManager
}
}
public function getMimeTypes() {
public function getMimeTypes()
{
$mimeTypes = [];
/** @var AbstractArchiveBuilder $formatter */

View File

@@ -21,7 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
trait ArchiveBuilderManagerTrait
{
/**
* @param ContainerInterface $container
* @param ContainerInterface $container
* @return \Thelia\Core\FileFormat\Archive\ArchiveBuilderManager
*/
public function getArchiveBuilderManager(ContainerInterface $container)

View File

@@ -10,7 +10,7 @@
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace Thelia\Core\FileFormat\Formatter\Exception;
namespace Thelia\Core\FileFormat\Formatting\Exception;
/**
* Class BadFormattedStringException

View File

@@ -12,7 +12,7 @@
namespace Thelia\Core\FileFormat\Formatting\Formatter;
use Symfony\Component\DependencyInjection\SimpleXMLElement;
use Thelia\Core\FileFormat\Formatter\Exception\BadFormattedStringException;
use Thelia\Core\FileFormat\Formatting\Exception\BadFormattedStringException;
use Thelia\Core\FileFormat\Formatting\AbstractFormatter;
use Thelia\Core\FileFormat\Formatting\FormatterData;
use Thelia\Core\FileFormat\FormatType;
@@ -165,7 +165,8 @@ class XMLFormatter extends AbstractFormatter
return $parent === null ? $data : $parent;
}
public function getValue($name, array &$data) {
public function getValue($name, array &$data)
{
$value = $data[$name];
unset ($data[$name]);
@@ -175,7 +176,7 @@ class XMLFormatter extends AbstractFormatter
/**
* @param $rawData
* @return array
* @throws \Thelia\Core\FileFormat\Formatter\Exception\BadFormattedStringException
* @throws \Thelia\Core\FileFormat\Formatting\Exception\BadFormattedStringException
*/
public function rawDecode($rawData)
{

View File

@@ -119,7 +119,8 @@ class FormatterManager
return $extensions;
}
public function getExtensionsByTypes($types, $withDot = false) {
public function getExtensionsByTypes($types, $withDot = false)
{
$extensions = [];
/** @var AbstractFormatter $formatter */
@@ -174,7 +175,8 @@ class FormatterManager
return $selectedFormatters;
}
public function getMimeTypesByTypes($types) {
public function getMimeTypesByTypes($types)
{
if (!is_array($types)) {
$types = [$types];
}

View File

@@ -21,11 +21,11 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
trait FormatterManagerTrait
{
/**
* @param ContainerInterface $container
* @param ContainerInterface $container
* @return \Thelia\Core\FileFormat\Formatting\FormatterManager
*/
public function getFormatterManager(ContainerInterface $container)
{
return $container->get("thelia.manager.formatter_manager");
}
}
}

View File

@@ -59,10 +59,9 @@ abstract class ImportExportType extends BaseI18nLoop implements PropelSearchLoop
->set("POSITION", $type->getPosition())
->set("CATEGORY_ID", $type->getByName($this->getCategoryName()))
;
} catch(ClassNotFoundException $e) {
} catch(\ErrorException $e) {}
} catch (ClassNotFoundException $e) {
} catch (\ErrorException $e) {}
$loopResult->addRow($loopResultRow);
}

View File

@@ -163,7 +163,6 @@ class Export extends BaseExport
parent::delete($con);
}
public function hasImages(ContainerInterface $container)
{
if (static::$cache === null) {

View File

@@ -6,13 +6,11 @@ use Exception;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\ClassNotFoundException;
use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Propel;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Thelia\Core\Translation\Translator;
use Thelia\ImportExport\Import\ImportHandler;
use Thelia\Model\Base\Import as BaseImport;
use Thelia\Model\ImportQuery as ChildImportQuery;
use Thelia\Model\Map\ImportTableMap;
class Import extends BaseImport
@@ -99,7 +97,7 @@ class Import extends BaseImport
}
/**
* @param ContainerInterface $container
* @param ContainerInterface $container
* @return ImportHandler
* @throws \ErrorException
*/
@@ -160,5 +158,4 @@ class Import extends BaseImport
parent::delete($con);
}
}