remove unused code
This commit is contained in:
@@ -91,8 +91,6 @@ class HttpException extends BaseAction implements EventSubscriberInterface
|
||||
// Define the template thant shoud be used
|
||||
$this->parser->setTemplateDefinition(TemplateHelper::getInstance()->getActiveFrontTemplate());
|
||||
|
||||
//$event->getRequest()->attributes->set('_view', ConfigQuery::getPageNotFoundView());
|
||||
|
||||
$response = new Response($this->parser->render(ConfigQuery::getPageNotFoundView()), 404);
|
||||
|
||||
$event->setResponse($response);
|
||||
|
||||
@@ -112,8 +112,6 @@ class Image extends BaseCachedFile implements EventSubscriberInterface
|
||||
throw new \InvalidArgumentException("Cache sub-directory and source file path cannot be null");
|
||||
}
|
||||
|
||||
// echo basename($source_file).": ";
|
||||
|
||||
// Find cached file path
|
||||
$cacheFilePath = $this->getCacheFilePath($subdir, $source_file, $event->isOriginalImage(), $event->getOptionsHash());
|
||||
|
||||
@@ -391,8 +389,6 @@ class Image extends BaseCachedFile implements EventSubscriberInterface
|
||||
|
||||
$image->resize(new Box($next_width, $next_height));
|
||||
|
||||
// echo "w=$dest_width, h=$dest_height, nw=$next_width, nh=$next_height, dx=$delta_x, dy=$delta_y, bw=$border_width, bh=$border_height\n";
|
||||
|
||||
if ($resize_mode == self::EXACT_RATIO_WITH_BORDERS) {
|
||||
|
||||
$border_width = intval(($dest_width - $next_width) / 2);
|
||||
|
||||
@@ -83,7 +83,7 @@ class CreateAdminUser extends ContainerAwareCommand
|
||||
{
|
||||
$output->writeln('Please enter the admin user information:');
|
||||
|
||||
$admin = $this->getAdminInfo($input, $output); // new Admin();
|
||||
$admin = $this->getAdminInfo($input, $output);
|
||||
|
||||
$admin->save();
|
||||
|
||||
|
||||
@@ -198,9 +198,6 @@ class Install extends ContainerAwareCommand
|
||||
|
||||
file_put_contents($configFile, $configContent);
|
||||
|
||||
// FA - no, as no further install will be possible
|
||||
// $fs->remove($sampleConfigFile);
|
||||
|
||||
$fs->remove($this->getContainer()->getParameter("kernel.cache_dir"));
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace Thelia\Condition\Implementation;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Allow every one, perform no check
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
|
||||
namespace Thelia\Condition\Implementation;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
use Thelia\Condition\Operators;
|
||||
use Thelia\Exception\InvalidConditionOperatorException;
|
||||
use Thelia\Exception\InvalidConditionValueException;
|
||||
|
||||
@@ -340,24 +340,6 @@ class CategoryController extends AbstractSeoCrudController
|
||||
return $response;
|
||||
}
|
||||
|
||||
// $content_id = intval($this->getRequest()->get('content_id'));
|
||||
//
|
||||
// if ($content_id > 0) {
|
||||
//
|
||||
// $event = new CategoryAddContentEvent(
|
||||
// $this->getExistingObject(),
|
||||
// $content_id
|
||||
// );
|
||||
//
|
||||
// try {
|
||||
// $this->dispatch(TheliaEvents::CATEGORY_ADD_CONTENT, $event);
|
||||
// }
|
||||
// catch (\Exception $ex) {
|
||||
// // Any error
|
||||
// return $this->errorPage($ex);
|
||||
// }
|
||||
// }
|
||||
|
||||
$this->redirectToEditionTemplate();
|
||||
}
|
||||
|
||||
|
||||
@@ -83,27 +83,13 @@ class SystemLogController extends BaseAdminController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed|\Thelia\Core\HttpFoundation\Response
|
||||
*/
|
||||
public function defaultAction()
|
||||
{
|
||||
if (null !== $response = $this->checkAuth(AdminResources::SYSTEM_LOG, array(), AccessManager::VIEW)) return $response;
|
||||
|
||||
/*
|
||||
const VAR_LEVEL = "tlog_level";
|
||||
const VAR_DESTINATIONS = "tlog_destinations";
|
||||
const VAR_PREFIXE = "tlog_prefix";
|
||||
const VAR_FILES = "tlog_files";
|
||||
const VAR_IP = "tlog_ip";
|
||||
const VAR_SHOW_REDIRECT = "tlog_show_redirect";
|
||||
|
||||
const DEFAULT_LEVEL = self::DEBUG;
|
||||
const DEFAUT_DESTINATIONS = "Thelia\Log\Destination\TlogDestinationFile";
|
||||
const DEFAUT_PREFIXE = "#NUM: #NIVEAU [#FICHIER:#FONCTION()] {#LIGNE} #DATE #HEURE: ";
|
||||
const DEFAUT_FILES = "*";
|
||||
const DEFAUT_IP = "";
|
||||
const DEFAUT_SHOW_REDIRECT = 0;
|
||||
|
||||
*/
|
||||
|
||||
// Hydrate the general configuration form
|
||||
$systemLogForm = new SystemLogConfigurationForm($this->getRequest(), 'form', array(
|
||||
'level' => ConfigQuery::read(Tlog::VAR_LEVEL, Tlog::DEFAULT_LEVEL),
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Core\Event\Address;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
use Thelia\Core\Event\ActionEvent;
|
||||
use Thelia\Model\Address;
|
||||
use Thelia\Model\Customer;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Core\Event\Address;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
use Thelia\Core\Event\ActionEvent;
|
||||
use Thelia\Model\Address;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace Thelia\Core\Event\Cart;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Thelia\Core\Event\ActionEvent;
|
||||
use Thelia\Model\Cart;
|
||||
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Core\Event\Customer;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Thelia\Model\Customer;
|
||||
|
||||
/**
|
||||
* Class CustomerCreateOrUpdateEvent
|
||||
* @package Thelia\Core\Event
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace Thelia\Core\Event\Customer;
|
||||
|
||||
use Thelia\Model\Customer;
|
||||
|
||||
class CustomerLoginEvent extends CustomerEvent
|
||||
{
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Core\Event\FeatureProduct;
|
||||
use Thelia\Model\FeatureProduct;
|
||||
|
||||
class FeatureProductDeleteEvent extends FeatureProductEvent
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Core\Event\FeatureProduct;
|
||||
use Thelia\Model\FeatureProduct;
|
||||
|
||||
|
||||
class FeatureProductUpdateEvent extends FeatureProductEvent
|
||||
{
|
||||
|
||||
@@ -219,7 +219,6 @@ final class TheliaEvents
|
||||
const COUNTRY_UPDATE = "action.updateCountry";
|
||||
const COUNTRY_DELETE = "action.deleteCountry";
|
||||
const COUNTRY_TOGGLE_DEFAULT = "action.toggleCountryDefault";
|
||||
//const COUNTRY_UPDATE_POSITION = "action.updateFolderPosition";
|
||||
|
||||
const BEFORE_CREATECOUNTRY = "action.before_createCountry";
|
||||
const AFTER_CREATECOUNTRY = "action.after_createCountry";
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Core\EventListener;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
|
||||
use Thelia\Core\Factory\ActionEventFactory;
|
||||
use Thelia\Core\Template\ParserContext;
|
||||
|
||||
/**
|
||||
*
|
||||
* Action are dispatched here.
|
||||
*
|
||||
* A factory is used for creating appropriate action object
|
||||
*
|
||||
* Class ControllerListener
|
||||
* @package Thelia\Core\EventListener
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class ControllerListener implements EventSubscriberInterface
|
||||
{
|
||||
/**
|
||||
* @var ParserContext the parser context
|
||||
*/
|
||||
protected $parserContext;
|
||||
|
||||
public function __construct(ParserContext $parserContext)
|
||||
{
|
||||
$this->parserContext = $parserContext;
|
||||
}
|
||||
|
||||
public function onKernelController(FilterControllerEvent $event)
|
||||
{
|
||||
$dispatcher = $event->getDispatcher();
|
||||
$request = $event->getRequest();
|
||||
|
||||
if (false !== $action = $request->get("action")) {
|
||||
//search corresponding action
|
||||
$event = new ActionEventFactory($request, $action, $event->getKernel()->getContainer()->getParameter("thelia.actionEvent"));
|
||||
$actionEvent = $event->createActionEvent();
|
||||
$dispatcher->dispatch("action.".$action, $actionEvent);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return array(
|
||||
KernelEvents::CONTROLLER => array('onKernelController', 0)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,6 @@ use Symfony\Component\Routing\Matcher\RequestMatcherInterface;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
use Symfony\Component\Routing\RouterInterface;
|
||||
use Thelia\Exception\RedirectException;
|
||||
use Thelia\Exception\UrlRewritingException;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Tools\Redirect;
|
||||
@@ -161,7 +160,6 @@ class RewritingRouter implements RouterInterface, RequestMatcherInterface
|
||||
*
|
||||
* @throws \Exception|\Thelia\Exception\UrlRewritingException
|
||||
* @throws \Symfony\Component\Routing\Exception\ResourceNotFoundException
|
||||
* @throws \Thelia\Exception\RedirectException
|
||||
* @return array An array of parameters
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,7 +30,6 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
|
||||
use Thelia\Core\Template\Loop\Argument\Argument;
|
||||
|
||||
use Thelia\Model\AccessoryQuery;
|
||||
use Thelia\Type;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -31,7 +31,6 @@ use Thelia\Core\Template\Loop\Argument\Argument;
|
||||
|
||||
use Thelia\Model\ProductAssociatedContentQuery;
|
||||
use Thelia\Model\CategoryAssociatedContentQuery;
|
||||
use Thelia\Type;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -36,7 +36,6 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
|
||||
use Thelia\Coupon\Type\CouponInterface;
|
||||
use Thelia\Model\Coupon as MCoupon;
|
||||
use Thelia\Model\CouponQuery;
|
||||
use Thelia\Type;
|
||||
|
||||
/**
|
||||
* Coupon Loop
|
||||
|
||||
@@ -165,8 +165,6 @@ class Document extends BaseI18nLoop implements PropelSearchLoopInterface
|
||||
$source_id = $this->getSourceId();
|
||||
$id = $this->getId();
|
||||
|
||||
// echo "source = ".$this->getSource().", id=".$source_id." - ".$this->getArg('source_id')->getValue()."<br />";
|
||||
|
||||
if (is_null($source_id) && is_null($id)) {
|
||||
throw new \InvalidArgumentException("If 'source' argument is specified, 'id' or 'source_id' argument should be specified");
|
||||
}
|
||||
|
||||
@@ -180,8 +180,6 @@ class Image extends BaseI18nLoop implements PropelSearchLoopInterface
|
||||
$source_id = $this->getSourceId();
|
||||
$id = $this->getId();
|
||||
|
||||
//echo "source = ".$this->getSourceId()."source_id=$source_id, id=$id<br />";
|
||||
|
||||
if (is_null($source_id) && is_null($id)) {
|
||||
throw new \InvalidArgumentException("If 'source' argument is specified, 'id' or 'source_id' argument should be specified");
|
||||
}
|
||||
@@ -235,7 +233,6 @@ class Image extends BaseI18nLoop implements PropelSearchLoopInterface
|
||||
if (!is_null($exclude))
|
||||
$search->filterById($exclude, Criteria::NOT_IN);
|
||||
|
||||
// echo "sql=".$search->toString();
|
||||
return $search;
|
||||
|
||||
}
|
||||
@@ -273,10 +270,6 @@ class Image extends BaseI18nLoop implements PropelSearchLoopInterface
|
||||
}
|
||||
|
||||
foreach ($loopResult->getResultDataCollection() as $result) {
|
||||
// Create image processing event
|
||||
|
||||
// ERO : following is duplicated, guess it's useless at this point
|
||||
//$event = new ImageEvent($this->request);
|
||||
|
||||
// Setup required transformations
|
||||
if (! is_null($width)) $event->setWidth($width);
|
||||
|
||||
@@ -78,19 +78,11 @@ class OrderCoupon extends BaseLoop implements PropelSearchLoopInterface
|
||||
/** @var OrderCoupon $orderCoupon */
|
||||
foreach ($loopResult->getResultDataCollection() as $orderCoupon) {
|
||||
$loopResultRow = new LoopResultRow($orderCoupon);
|
||||
/*$conditions = $conditionFactory->unserializeConditionCollection(
|
||||
$orderCoupon->getSerializedConditions()
|
||||
);*/
|
||||
|
||||
$now = time();
|
||||
$datediff = $orderCoupon->getExpirationDate()->getTimestamp() - $now;
|
||||
$daysLeftBeforeExpiration = floor($datediff/(60*60*24));
|
||||
|
||||
/*$cleanedConditions = array();
|
||||
|
||||
foreach ($conditions->getConditions() as $condition) {
|
||||
$cleanedConditions[] = $condition->getToolTip();
|
||||
}*/
|
||||
$loopResultRow->set("ID", $orderCoupon->getId())
|
||||
->set("CODE", $orderCoupon->getCode())
|
||||
->set("TITLE", $orderCoupon->getTitle())
|
||||
@@ -100,8 +92,6 @@ class OrderCoupon extends BaseLoop implements PropelSearchLoopInterface
|
||||
->set("IS_CUMULATIVE", $orderCoupon->getIsCumulative())
|
||||
->set("IS_REMOVING_POSTAGE", $orderCoupon->getIsRemovingPostage())
|
||||
->set("IS_AVAILABLE_ON_SPECIAL_OFFERS", $orderCoupon->getIsAvailableOnSpecialOffers())
|
||||
//->set("AMOUNT", $orderCoupon->getAmount())
|
||||
//->set("APPLICATION_CONDITIONS", $cleanedConditions)
|
||||
->set("DAY_LEFT_BEFORE_EXPIRATION", $daysLeftBeforeExpiration)
|
||||
;
|
||||
$loopResult->addRow($loopResultRow);
|
||||
|
||||
@@ -170,12 +170,6 @@ class DataAccessFunctions extends AbstractSmartyPlugin
|
||||
{
|
||||
switch ($params["ask"]) {
|
||||
case "default":
|
||||
/*if (array_key_exists('defaultCountry', self::$dataAccessCache)) {
|
||||
$defaultCountry = self::$dataAccessCache['defaultCountry'];
|
||||
} else {
|
||||
$defaultCountry = CountryQuery::create()->findOneByByDefault(1);
|
||||
self::$dataAccessCache['defaultCountry'] = $defaultCountry;
|
||||
}*/
|
||||
$defaultCountry = CountryQuery::create()->filterByByDefault(1)->limit(1);
|
||||
|
||||
return $this->dataAccessWithI18n("defaultCountry", $params, $defaultCountry);
|
||||
|
||||
@@ -186,7 +186,6 @@ class UrlGenerator extends AbstractSmartyPlugin
|
||||
|
||||
protected function getCurrentUrl()
|
||||
{
|
||||
//return URL::getInstance()->retrieveCurrent($this->request)->toString();
|
||||
return $this->request->getUri();
|
||||
}
|
||||
|
||||
|
||||
@@ -82,8 +82,6 @@ class SmartyParser extends Smarty implements ParserInterface
|
||||
$this->setForceCompile(false);
|
||||
}
|
||||
|
||||
//$this->enableSecurity();
|
||||
|
||||
// The default HTTP status
|
||||
$this->status = 200;
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ class TheliaHttpKernel extends HttpKernel
|
||||
*/
|
||||
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
|
||||
{
|
||||
//$request->headers->set('X-Php-Ob-Level', ob_get_level());
|
||||
if ($type == HttpKernelInterface::MASTER_REQUEST) {
|
||||
$request = $this->initSession($request);
|
||||
$this->initParam($request);
|
||||
|
||||
@@ -66,8 +66,8 @@ class Database
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($sql); $i ++) {
|
||||
$size = count($sql);
|
||||
for ($i = 0; $i < $size; $i ++) {
|
||||
if (!empty($sql[$i])) {
|
||||
$this->connection->query($sql[$i]);
|
||||
}
|
||||
@@ -87,8 +87,8 @@ class Database
|
||||
$query = array();
|
||||
|
||||
$tab = explode(";\n", $sql);
|
||||
|
||||
for ($i=0; $i<count($tab); $i++) {
|
||||
$size = count($tab);
|
||||
for ($i=0; $i<$size; $i++) {
|
||||
$queryTemp = str_replace("-CODE-", ";',", $tab[$i]);
|
||||
$queryTemp = str_replace("|", ";", $queryTemp);
|
||||
$query[] = $queryTemp;
|
||||
|
||||
@@ -73,7 +73,8 @@ class Update
|
||||
$logger->debug("begin transaction");
|
||||
$database = new Database($con->getWrappedConnection());
|
||||
try {
|
||||
for ($i = ++$index; $i < count(self::$version); $i++) {
|
||||
$size = count(self::$version);
|
||||
for ($i = ++$index; $i < $size; $i++) {
|
||||
$this->updateToVersion(self::$version[$i], $database, $logger);
|
||||
$updatedVersions[] = self::$version[$i];
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Thelia\Model;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\Join;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Thelia\Model\Base\OrderQuery as BaseOrderQuery;
|
||||
|
||||
use Thelia\Model\Map\OrderProductTableMap;
|
||||
|
||||
@@ -91,8 +91,6 @@ trait UrlRewritingTrait
|
||||
|
||||
$urlFilePart = rtrim($cleanString, '.-~_') . ".html";
|
||||
|
||||
// TODO :
|
||||
// check if URL url already exists, and add a numeric suffix, or the like
|
||||
try {
|
||||
$i=0;
|
||||
while (URL::getInstance()->resolve($urlFilePart)) {
|
||||
|
||||
@@ -216,31 +216,6 @@ class Calculator
|
||||
$untaxedPrice -= $currentFixTax;
|
||||
$untaxedPrice = $untaxedPrice / (1+$currentTaxFactor);
|
||||
|
||||
/*do {
|
||||
|
||||
$taxType = $taxRule->getTypeInstance();
|
||||
$taxType->loadRequirements( $taxRule->getRequirements() );
|
||||
|
||||
$untaxedPrice -= $taxType->fixAmountRetriever();
|
||||
|
||||
} while ($taxRule = $this->taxRulesCollection->getPrevious());
|
||||
|
||||
$taxRule = $this->taxRulesCollection->getLast();
|
||||
|
||||
$currentTaxFactor = 0;
|
||||
do {
|
||||
|
||||
$taxType = $taxRule->getTypeInstance();
|
||||
$taxType->loadRequirements( $taxRule->getRequirements() );
|
||||
|
||||
$currentTaxFactor += $taxType->pricePercentRetriever($untaxedPrice);
|
||||
|
||||
$toto = true;
|
||||
|
||||
} while ($taxRule = $this->taxRulesCollection->getPrevious());
|
||||
|
||||
$untaxedPrice = $untaxedPrice / (1+$currentTaxFactor);*/
|
||||
|
||||
return $untaxedPrice;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,8 @@ class IntToCombinedIntsListType extends BaseType
|
||||
$openingParenthesesCount = 0;
|
||||
$closingParenthesesCount = 0;
|
||||
|
||||
for ($i=0; $i<strlen($noSpaceString); $i++) {
|
||||
$length = strlen($noSpaceString);
|
||||
for ($i=0; $i< $length; $i++) {
|
||||
$char = $noSpaceString[$i];
|
||||
if ($char == '(') {
|
||||
/* must be :
|
||||
|
||||
@@ -89,7 +89,8 @@ class IntToCombinedStringsListType extends BaseType
|
||||
$openingParenthesesCount = 0;
|
||||
$closingParenthesesCount = 0;
|
||||
|
||||
for ($i=0; $i<strlen($noSpaceString); $i++) {
|
||||
$length = strlen($noSpaceString);
|
||||
for ($i=0; $i< $length; $i++) {
|
||||
$char = $noSpaceString[$i];
|
||||
if ($char == '(') {
|
||||
/* must be :
|
||||
|
||||
Reference in New Issue
Block a user