remove some unused variables
This commit is contained in:
@@ -74,7 +74,6 @@ class Attribute extends BaseAction implements EventSubscriberInterface
|
||||
*/
|
||||
public function update(AttributeUpdateEvent $event)
|
||||
{
|
||||
$search = AttributeQuery::create();
|
||||
|
||||
if (null !== $attribute = AttributeQuery::create()->findPk($event->getAttributeId())) {
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@ class AttributeAv extends BaseAction implements EventSubscriberInterface
|
||||
*/
|
||||
public function update(AttributeAvUpdateEvent $event)
|
||||
{
|
||||
$search = AttributeAvQuery::create();
|
||||
|
||||
if (null !== $attribute = AttributeAvQuery::create()->findPk($event->getAttributeAvId())) {
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class Cache extends BaseAction implements EventSubscriberInterface
|
||||
$directoryBrowser = new \DirectoryIterator($dir);
|
||||
|
||||
$fs = new Filesystem();
|
||||
$fs->remove($dir);
|
||||
$fs->remove($directoryBrowser);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class Cart extends BaseAction implements EventSubscriberInterface
|
||||
{
|
||||
if (null !== $cartItemId = $event->getCartItem()) {
|
||||
$cart = $event->getCart();
|
||||
$cartItem = CartItemQuery::create()
|
||||
CartItemQuery::create()
|
||||
->filterByCartId($cart->getId())
|
||||
->filterById($cartItemId)
|
||||
->delete();
|
||||
|
||||
@@ -58,7 +58,6 @@ class Config extends BaseAction implements EventSubscriberInterface
|
||||
*/
|
||||
public function setValue(ConfigUpdateEvent $event)
|
||||
{
|
||||
$search = ConfigQuery::create();
|
||||
|
||||
if (null !== $config = $search->findPk($event->getConfigId())) {
|
||||
|
||||
@@ -78,7 +77,6 @@ class Config extends BaseAction implements EventSubscriberInterface
|
||||
*/
|
||||
public function modify(ConfigUpdateEvent $event)
|
||||
{
|
||||
$search = ConfigQuery::create();
|
||||
|
||||
if (null !== $config = ConfigQuery::create()->findPk($event->getConfigId())) {
|
||||
|
||||
|
||||
@@ -95,7 +95,6 @@ class Currency extends BaseAction implements EventSubscriberInterface
|
||||
*/
|
||||
public function setDefault(CurrencyUpdateEvent $event)
|
||||
{
|
||||
$search = CurrencyQuery::create();
|
||||
|
||||
if (null !== $currency = CurrencyQuery::create()->findPk($event->getCurrencyId())) {
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ class Feature extends BaseAction implements EventSubscriberInterface
|
||||
*/
|
||||
public function update(FeatureUpdateEvent $event)
|
||||
{
|
||||
$search = FeatureQuery::create();
|
||||
|
||||
if (null !== $feature = FeatureQuery::create()->findPk($event->getFeatureId())) {
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@ class FeatureAv extends BaseAction implements EventSubscriberInterface
|
||||
*/
|
||||
public function update(FeatureAvUpdateEvent $event)
|
||||
{
|
||||
$search = FeatureAvQuery::create();
|
||||
|
||||
if (null !== $feature = FeatureAvQuery::create()->findPk($event->getFeatureAvId())) {
|
||||
|
||||
|
||||
@@ -355,7 +355,7 @@ class Image extends BaseCachedFile implements EventSubscriberInterface
|
||||
|
||||
$delta_x = $delta_y = $border_width = $border_height = 0;
|
||||
|
||||
if ($width_diff > 1 AND $height_diff > 1) {
|
||||
if ($width_diff > 1 && $height_diff > 1) {
|
||||
|
||||
$next_width = $width_orig;
|
||||
$next_height = $height_orig;
|
||||
|
||||
@@ -68,7 +68,6 @@ class Message extends BaseAction implements EventSubscriberInterface
|
||||
*/
|
||||
public function modify(MessageUpdateEvent $event)
|
||||
{
|
||||
$search = MessageQuery::create();
|
||||
|
||||
if (null !== $message = MessageQuery::create()->findPk($event->getMessageId())) {
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ class Order extends BaseAction implements EventSubscriberInterface
|
||||
// Build subject and body
|
||||
$message->build($parser, $instance);
|
||||
|
||||
$mail = $this->getMailer()->send($instance);
|
||||
$this->getMailer()->send($instance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -378,7 +378,7 @@ class Product extends BaseAction implements EventSubscriberInterface
|
||||
*/
|
||||
public function deleteFeatureProductValue(FeatureProductDeleteEvent $event)
|
||||
{
|
||||
$featureProduct = FeatureProductQuery::create()
|
||||
FeatureProductQuery::create()
|
||||
->filterByProductId($event->getProductId())
|
||||
->filterByFeatureId($event->getFeatureId())
|
||||
->delete()
|
||||
|
||||
@@ -74,7 +74,6 @@ class Template extends BaseAction implements EventSubscriberInterface
|
||||
*/
|
||||
public function update(TemplateUpdateEvent $event)
|
||||
{
|
||||
$search = TemplateQuery::create();
|
||||
|
||||
if (null !== $template = TemplateQuery::create()->findPk($event->getTemplateId())) {
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class TheliaConsoleOutput extends ConsoleOutput
|
||||
foreach ($messages as $message) {
|
||||
$length = ($strlen($message) > $length) ? $strlen($message) : $length;
|
||||
}
|
||||
$ouput = array();
|
||||
$output = array();
|
||||
foreach ($messages as $message) {
|
||||
$output[] = "<" . $style . ">" . " " . $message . str_repeat(' ', $length - $strlen($message)) . " </" . $style . ">";
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class UpdateCommand extends ContainerAwareCommand
|
||||
$update = new Update();
|
||||
|
||||
try {
|
||||
$updatedVersions = $update->process();
|
||||
$update->process();
|
||||
|
||||
$output->writeln(array(
|
||||
'',
|
||||
@@ -64,8 +64,6 @@ class UpdateCommand extends ContainerAwareCommand
|
||||
''
|
||||
));
|
||||
} catch (PropelException $e) {
|
||||
$errorMsg = $e->getMessage();
|
||||
|
||||
$output->writeln(array(
|
||||
'',
|
||||
sprintf('<error>Error during update process with message : %s</error>', $e->getMessage()),
|
||||
|
||||
@@ -40,7 +40,7 @@ class DefinePropel
|
||||
{
|
||||
$connection = $this->processorConfig["connection"];
|
||||
|
||||
return $conf = array(
|
||||
return array(
|
||||
"dsn" => $connection["dsn"],
|
||||
"user" => $connection["user"],
|
||||
"password" => $connection["password"],
|
||||
|
||||
@@ -154,9 +154,6 @@ class BaseAdminController extends BaseController
|
||||
// Log the problem
|
||||
$this->adminLogAppend(implode(",", $resources), implode(",", $accesses), "User is not granted for resources %s with accesses %s", implode(", ", $resources), implode(", ", $accesses));
|
||||
|
||||
// Generate the proper response
|
||||
$response = new Response();
|
||||
|
||||
return $this->errorPage($this->getTranslator()->trans("Sorry, you're not allowed to perform this action"), 403);
|
||||
}
|
||||
|
||||
|
||||
@@ -278,7 +278,6 @@ class LangController extends BaseAdminController
|
||||
$data = $form->getData();
|
||||
$event = new LangUrlEvent();
|
||||
foreach ($data as $key => $value) {
|
||||
$pos= strpos($key, LangUrlForm::LANG_PREFIX);
|
||||
if (false !== strpos($key, LangUrlForm::LANG_PREFIX)) {
|
||||
$event->addUrl(substr($key,strlen(LangUrlForm::LANG_PREFIX)), $value);
|
||||
}
|
||||
@@ -316,8 +315,6 @@ class LangController extends BaseAdminController
|
||||
{
|
||||
if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE, array(), AccessManager::UPDATE)) return $response;
|
||||
|
||||
$error_msg = false;
|
||||
|
||||
ConfigQuery::create()
|
||||
->filterByName('one_domain_foreach_lang')
|
||||
->update(array('Value' => $activate));
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Thelia\Controller\Admin;
|
||||
|
||||
use Thelia\Form\AdminLogin;
|
||||
use Thelia\Core\Security\Authentication\AdminUsernamePasswordFormAuthenticator;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
use Thelia\Model\AdminLog;
|
||||
use Thelia\Core\Security\Exception\AuthenticationException;
|
||||
use Thelia\Tools\URL;
|
||||
@@ -53,7 +54,7 @@ class SessionController extends BaseAdminController
|
||||
$this->adminLogAppend("admin", "LOGIN", "Successful token authentication");
|
||||
|
||||
// Update the cookie
|
||||
$cookie = $this->createAdminRememberMeCookie($user);
|
||||
$this->createAdminRememberMeCookie($user);
|
||||
|
||||
// Render the home page
|
||||
return $this->render("home");
|
||||
|
||||
@@ -38,8 +38,6 @@ class TranslationsController extends BaseAdminController
|
||||
{
|
||||
protected function renderTemplate()
|
||||
{
|
||||
// Find modules
|
||||
$modules = ModuleQuery::create()->joinI18n($this->getCurrentEditionLocale())->orderByPosition()->find();
|
||||
|
||||
// Get related strings, if all input data are here
|
||||
$item_to_translate = $this->getRequest()->get('item_to_translate');
|
||||
|
||||
@@ -115,7 +115,7 @@ class ViewListener implements EventSubscriberInterface
|
||||
{
|
||||
$request = $this->container->get('request');
|
||||
|
||||
if (null === $view = $request->attributes->get('_view')) {
|
||||
if (null === $request->attributes->get('_view')) {
|
||||
$request->attributes->set('_view', $this->findView($request));
|
||||
}
|
||||
|
||||
|
||||
@@ -34,11 +34,6 @@ use Symfony\Component\HttpFoundation\Request as BaseRequest;
|
||||
class Request extends BaseRequest
|
||||
{
|
||||
|
||||
private $excludeContent = array(
|
||||
'username',
|
||||
'password'
|
||||
);
|
||||
|
||||
public function getProductId()
|
||||
{
|
||||
return $this->get("product_id");
|
||||
|
||||
@@ -104,12 +104,8 @@ class SecurityContext
|
||||
// Check if user's roles matches required roles
|
||||
$userRoles = $user->getRoles();
|
||||
|
||||
$roleFound = false;
|
||||
|
||||
foreach ($userRoles as $role) {
|
||||
if (in_array($role, $roles)) {
|
||||
$roleFound = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,6 @@ class Argument
|
||||
|
||||
public function setValue($value)
|
||||
{
|
||||
$x = $value === null;
|
||||
|
||||
if ($value === null) {
|
||||
$this->value = null;
|
||||
} else {
|
||||
@@ -70,7 +68,6 @@ class Argument
|
||||
$this->value = (string) $value;
|
||||
}
|
||||
}
|
||||
//$this->value = $value === null ? null : (string) $value;
|
||||
}
|
||||
|
||||
public static function createAnyTypeArgument($name, $default=null, $mandatory=false, $empty=true)
|
||||
|
||||
@@ -79,10 +79,6 @@ class Attribute extends BaseI18nLoop implements PropelSearchLoopInterface
|
||||
{
|
||||
$search = AttributeQuery::create();
|
||||
|
||||
$backendContext = $this->getBackend_context();
|
||||
|
||||
$lang = $this->getLang();
|
||||
|
||||
/* manage translations */
|
||||
$this->configureI18nProcessing($search);
|
||||
|
||||
|
||||
@@ -219,9 +219,6 @@ class Document extends BaseI18nLoop implements PropelSearchLoopInterface
|
||||
if (!is_null($exclude))
|
||||
$search->filterById($exclude, Criteria::NOT_IN);
|
||||
|
||||
// Create document processing event
|
||||
$event = new DocumentEvent($this->request);
|
||||
|
||||
return $search;
|
||||
|
||||
}
|
||||
|
||||
@@ -62,12 +62,8 @@ class ProductTemplate extends BaseI18nLoop implements PropelSearchLoopInterface
|
||||
{
|
||||
$search = TemplateQuery::create();
|
||||
|
||||
$backendContext = $this->getBackend_context();
|
||||
|
||||
$lang = $this->getLang();
|
||||
|
||||
/* manage translations */
|
||||
$this->configureI18nProcessing($search, $columns = array('NAME'));
|
||||
$this->configureI18nProcessing($search, array('NAME'));
|
||||
|
||||
$id = $this->getId();
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ class DataAccessFunctions extends AbstractSmartyPlugin
|
||||
return $this->dataAccess("Lang", $params, $this->request->getSession()->getLang());
|
||||
}
|
||||
|
||||
public function ConfigDataAccess($params, $smarty)
|
||||
public function configDataAccess($params, $smarty)
|
||||
{
|
||||
$key = $this->getParam($params, 'key', false);
|
||||
|
||||
@@ -253,7 +253,7 @@ class DataAccessFunctions extends AbstractSmartyPlugin
|
||||
return ConfigQuery::read($key, $default);
|
||||
}
|
||||
|
||||
public function StatsAccess($params, $smarty)
|
||||
public function statsAccess($params, $smarty)
|
||||
{
|
||||
if (false === array_key_exists("key", $params)) {
|
||||
throw new \InvalidArgumentException(sprintf("missing key attribute in stats access function"));
|
||||
@@ -459,8 +459,8 @@ class DataAccessFunctions extends AbstractSmartyPlugin
|
||||
new SmartyPluginDescriptor('function', 'lang', $this, 'langDataAccess'),
|
||||
new SmartyPluginDescriptor('function', 'cart', $this, 'cartDataAccess'),
|
||||
new SmartyPluginDescriptor('function', 'order', $this, 'orderDataAccess'),
|
||||
new SmartyPluginDescriptor('function', 'config', $this, 'ConfigDataAccess'),
|
||||
new SmartyPluginDescriptor('function', 'stats', $this, 'StatsAccess'),
|
||||
new SmartyPluginDescriptor('function', 'config', $this, 'configDataAccess'),
|
||||
new SmartyPluginDescriptor('function', 'stats', $this, 'statsAccess'),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class Cart extends BaseCart
|
||||
|
||||
public function getLastCartItemAdded()
|
||||
{
|
||||
$items = CartItemQuery::create()
|
||||
return CartItemQuery::create()
|
||||
->filterByCartId($this->getId())
|
||||
->orderByCreatedAt(Criteria::DESC)
|
||||
->findOne()
|
||||
|
||||
@@ -61,7 +61,6 @@ class Order extends BaseOrder
|
||||
$tax = 0;
|
||||
|
||||
/* browse all products */
|
||||
$orderProductIds = array();
|
||||
foreach($this->getOrderProducts() as $orderProduct) {
|
||||
$taxAmountQuery = OrderProductTaxQuery::create();
|
||||
|
||||
|
||||
@@ -284,31 +284,4 @@ class URL
|
||||
strtolower($clean) :
|
||||
$clean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Genenerate the file part of a rewritten URL from a given baseString, using a view, a view id and a locale
|
||||
*
|
||||
* @param $view
|
||||
* @param $viewId
|
||||
* @param $viewLocale
|
||||
* @param $baseString the string to be converted in a valid URL
|
||||
*
|
||||
* @return A valid file part URL.
|
||||
*/
|
||||
public function generateRewritenUrl($view, $viewId, $viewLocale, $baseString)
|
||||
{
|
||||
// Borrowed from http://stackoverflow.com/questions/2668854/sanitizing-strings-to-make-them-url-and-filename-safe
|
||||
|
||||
// Replace all weird characters with dashes
|
||||
$string = preg_replace('/[^\w\-~_\.]+/u', '-', $baseString);
|
||||
|
||||
// Only allow one dash separator at a time (and make string lowercase)
|
||||
$cleanString = mb_strtolower(preg_replace('/--+/u', '-', $string), 'UTF-8');
|
||||
|
||||
$urlFilePart = $cleanString . ".html";
|
||||
|
||||
// TODO :
|
||||
// check if URL url already exists, and add a numeric suffix, or the like
|
||||
// insert the URL in the rewriting table
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ class IntToCombinedIntsListType extends BaseType
|
||||
|
||||
return false;
|
||||
}
|
||||
$x = 3;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ class IntToCombinedStringsListType extends BaseType
|
||||
|
||||
return false;
|
||||
}
|
||||
$x = 3;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ use Thelia\Condition\ConditionCollection;
|
||||
use Thelia\Coupon\Type\RemoveXAmount;
|
||||
use Thelia\Coupon\Type\RemoveXPercent;
|
||||
|
||||
|
||||
require __DIR__ . '/../core/bootstrap.php';
|
||||
|
||||
$thelia = new Thelia\Core\Thelia("dev", true);
|
||||
@@ -311,11 +310,11 @@ try {
|
||||
|
||||
$image = new \Thelia\Model\FolderImage();
|
||||
$image->setFolderId($folder->getId());
|
||||
generate_image($image, 1, 'folder', $folder->getId());
|
||||
generate_image($image, 'folder', $folder->getId());
|
||||
|
||||
$document = new \Thelia\Model\FolderDocument();
|
||||
$document->setFolderId($folder->getId());
|
||||
generate_document($document, 1, 'folder', $folder->getId());
|
||||
generate_document($document, 'folder', $folder->getId());
|
||||
|
||||
for ($j=0; $j<3; $j++) {
|
||||
$subfolder = new Thelia\Model\Folder();
|
||||
@@ -328,11 +327,11 @@ try {
|
||||
|
||||
$image = new \Thelia\Model\FolderImage();
|
||||
$image->setFolderId($subfolder->getId());
|
||||
generate_image($image, 1, 'folder', $subfolder->getId());
|
||||
generate_image($image, 'folder', $subfolder->getId());
|
||||
|
||||
$document = new \Thelia\Model\FolderDocument();
|
||||
$document->setFolderId($folder->getId());
|
||||
generate_document($document, 1, 'folder', $subfolder->getId());
|
||||
generate_document($document, 'folder', $subfolder->getId());
|
||||
|
||||
for ($k=0; $k<4; $k++) {
|
||||
$content = new Thelia\Model\Content();
|
||||
@@ -353,11 +352,11 @@ try {
|
||||
|
||||
$image = new \Thelia\Model\ContentImage();
|
||||
$image->setContentId($contentId);
|
||||
generate_image($image, 1, 'content', $contentId);
|
||||
generate_image($image, 'content', $contentId);
|
||||
|
||||
$document = new \Thelia\Model\ContentDocument();
|
||||
$document->setContentId($contentId);
|
||||
generate_document($document, 1, 'content', $contentId);
|
||||
generate_document($document, 'content', $contentId);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -549,17 +548,17 @@ function createCategory($faker, $parent, $position, &$categoryIdList, $contentId
|
||||
|
||||
$image = new \Thelia\Model\CategoryImage();
|
||||
$image->setCategoryId($categoryId);
|
||||
generate_image($image, 1, 'category', $categoryId);
|
||||
generate_image($image, 'category', $categoryId);
|
||||
|
||||
$document = new \Thelia\Model\CategoryDocument();
|
||||
$document->setCategoryId($categoryId);
|
||||
generate_document($document, 1, 'category', $categoryId);
|
||||
generate_document($document, 'category', $categoryId);
|
||||
|
||||
return $category;
|
||||
}
|
||||
|
||||
function generate_image($image, $position, $typeobj, $id) {
|
||||
|
||||
function generate_image($image, $typeobj, $id)
|
||||
{
|
||||
global $faker;
|
||||
|
||||
$image
|
||||
@@ -606,8 +605,8 @@ function generate_image($image, $position, $typeobj, $id) {
|
||||
$image->save($image_file);
|
||||
}
|
||||
|
||||
function generate_document($document, $position, $typeobj, $id) {
|
||||
|
||||
function generate_document($document, $typeobj, $id)
|
||||
{
|
||||
global $faker;
|
||||
|
||||
$document
|
||||
@@ -709,7 +708,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua
|
||||
$coupon1->setIsAvailableOnSpecialOffers(true);
|
||||
$coupon1->save();
|
||||
|
||||
|
||||
// Coupons
|
||||
$coupon2 = new Thelia\Model\Coupon();
|
||||
$coupon2->setCode('SPRINGBREAK');
|
||||
@@ -756,7 +754,6 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua
|
||||
$coupon2->setIsAvailableOnSpecialOffers(true);
|
||||
$coupon2->save();
|
||||
|
||||
|
||||
// Coupons
|
||||
$coupon3 = new Thelia\Model\Coupon();
|
||||
$coupon3->setCode('OLD');
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
<?php
|
||||
use Thelia\Model\ProductImage;
|
||||
use Thelia\Model\CategoryImage;
|
||||
use Thelia\Model\FolderImage;
|
||||
use Thelia\Model\ContentImage;
|
||||
use Imagine\Image\Color;
|
||||
use Imagine\Image\Point;
|
||||
|
||||
require __DIR__ . '/../core/bootstrap.php';
|
||||
|
||||
@@ -170,4 +164,3 @@ function setI18n($faker, &$object, $fields = array('Title' => 20, 'Description'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
<?php
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Thelia\Condition\Implementation\MatchForTotalAmount;
|
||||
use Thelia\Condition\Implementation\MatchForXArticles;
|
||||
use Thelia\Condition\Operators;
|
||||
|
||||
|
||||
require __DIR__ . '/../core/bootstrap.php';
|
||||
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
use Thelia\Condition\Implementation\MatchForTotalAmount;
|
||||
use Thelia\Condition\Implementation\MatchForXArticles;
|
||||
|
||||
|
||||
require __DIR__ . '/../core/bootstrap.php';
|
||||
|
||||
$thelia = new Thelia\Core\Thelia("dev", true);
|
||||
@@ -45,7 +41,6 @@ try {
|
||||
$stmt = $con->prepare("SET foreign_key_checks = 1");
|
||||
$stmt->execute();
|
||||
|
||||
|
||||
$categories = createCategories($con);
|
||||
$color = createColors($con);
|
||||
$brand = createBrand($con);
|
||||
@@ -76,8 +71,6 @@ try {
|
||||
|
||||
createProduct($faker, $categories, $template, $color, $brand, $con);
|
||||
|
||||
|
||||
|
||||
$con->commit();
|
||||
} catch (Exception $e) {
|
||||
echo "error : ".$e->getMessage()."\n";
|
||||
@@ -109,7 +102,6 @@ function createProduct($faker, $categories, $template, $attribute, $feature, $co
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$product
|
||||
->setLocale('en_US')
|
||||
->setTitle($data[1])
|
||||
@@ -145,7 +137,6 @@ function createProduct($faker, $categories, $template, $attribute, $feature, $co
|
||||
|
||||
$pses = explode(";", $data[12]);
|
||||
|
||||
|
||||
foreach ($pses as $pse) {
|
||||
if(empty($pse)) continue;
|
||||
$stock = new \Thelia\Model\ProductSaleElements();
|
||||
@@ -198,8 +189,6 @@ function createProduct($faker, $categories, $template, $attribute, $feature, $co
|
||||
->save($con)
|
||||
;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
echo "end creating products\n";
|
||||
@@ -261,6 +250,7 @@ function createCategories($con)
|
||||
fclose($handle);
|
||||
}
|
||||
echo "categories created successfully\n";
|
||||
|
||||
return $categories;
|
||||
}
|
||||
|
||||
@@ -293,6 +283,7 @@ function createColors($con)
|
||||
fclose($handle);
|
||||
}
|
||||
echo "colors attributes created with success\n";
|
||||
|
||||
return $attribute;
|
||||
}
|
||||
|
||||
@@ -362,7 +353,6 @@ function clearTables($con)
|
||||
->find($con);
|
||||
$product->delete($con);
|
||||
|
||||
|
||||
$accessory = Thelia\Model\AccessoryQuery::create()
|
||||
->find($con);
|
||||
$accessory->delete($con);
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
<?php
|
||||
use Thelia\Condition\Implementation\MatchForTotalAmount;
|
||||
use Thelia\Condition\Implementation\MatchForXArticles;
|
||||
use Imagine\Image\Point;
|
||||
|
||||
require __DIR__ . '/../core/bootstrap.php';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
use Thelia\Core\HttpKernel\HttpCache\HttpCache;
|
||||
//use Thelia\Core\HttpKernel\HttpCache\HttpCache;
|
||||
use Thelia\Core\Thelia;
|
||||
use Thelia\Core\HttpFoundation\Request;
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ if($_REQUEST['lang']){
|
||||
$_SESSION['install']['lang'] = $_REQUEST['lang'];
|
||||
}
|
||||
|
||||
$trans = new Translator();
|
||||
$trans->setLocale($_SESSION['install']['lang']);
|
||||
$trans = new Translator($_SESSION['install']['lang']);
|
||||
$trans->addLoader("php", new Symfony\Component\Translation\Loader\PhpFileLoader());
|
||||
$trans->addResource('php', __DIR__.'/I18n/'.$_SESSION['install']['lang'].'.php', $_SESSION['install']['lang']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user