Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
-- Define the name of the database and the quantity desired for the clean
SET @db_name = 'prestashop';
set @quantity_needed = '1000000';
-- Retrieve the eventbus_incremental_sync table name with prefix
SET @eventbus_incremental_sync_table = (SELECT table_name
FROM information_schema.tables
WHERE table_schema = @db_name
AND table_name LIKE '%_eventbus_incremental_sync');
-- Retrieve the _eventbus_type_sync table name with prefix
SET @eventbus_type_sync_table = (SELECT table_name
FROM information_schema.tables
WHERE table_schema = @db_name
AND table_name LIKE '%_eventbus_type_sync');
-- enable full-sync for selected shop content
SET @enable_full_sync = CONCAT('
UPDATE ', @eventbus_type_sync_table, '
SET `offset` = 0, full_sync_finished = 0
WHERE type IN (
SELECT type
FROM (
SELECT type, COUNT(*) as incr_type_count
FROM ', @eventbus_incremental_sync_table, '
GROUP BY type
HAVING COUNT(*) > ', @quantity_needed, '
) AS subquery
);
');
-- Execute dynamic query
PREPARE enable_full_sync FROM @enable_full_sync;
EXECUTE enable_full_sync;
-- Delete entries with more than X entries of this type (set above via the variable @quantity_needed)
SET @delete_query = CONCAT('
DELETE FROM ', @eventbus_incremental_sync_table, '
WHERE type IN (
SELECT type
FROM (
SELECT type, COUNT(*) as incr_type_count
FROM ', @eventbus_incremental_sync_table, '
GROUP BY type
HAVING COUNT(*) > ', @quantity_needed, '
) AS subquery
);
');
-- Execute dynamic query
PREPARE delete_query FROM @delete_query;
EXECUTE delete_query;

View File

@@ -0,0 +1,22 @@
-- Define the name of the database and the quantity desired for the clean
SET @db_name = 'prestashop';
set @quantity_needed = '1000000';
-- Retrieve the eventbus_incremental_sync table name with prefix
SET @eventbus_incremental_sync_table = (SELECT table_name
FROM information_schema.tables
WHERE table_schema = @db_name
AND table_name LIKE '%_eventbus_incremental_sync');
-- Retrieves the input quantity and associated type
SET @get_content_with_extra_counts = CONCAT('
SELECT type,
COUNT(*) as incr_type_count
FROM ', @eventbus_incremental_sync_table, '
GROUP BY type
HAVING COUNT(*) > ', @quantity_needed, '
');
-- Execute dynamic query
PREPARE get_content_with_extra_counts FROM @get_content_with_extra_counts;
EXECUTE get_content_with_extra_counts;

View File

@@ -0,0 +1,137 @@
#!/bin/bash
# Define colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
# Parameters
REPO_URL="https://github.com/PrestaShop/PrestaShop.git"
TABLE_COLUMN="$1"
REPO_PATH="$2"
FILE="install-dev/data/db_structure.sql"
if [ -z "$TABLE_COLUMN" ]; then
echo -e "${RED}❌ Usage : $0 <table.column> [repo_path]${NC}"
echo "Example : $0 connections.ip_address ~/projects/PrestaShop"
exit 1
fi
# Split table and column
TABLE=$(echo "$TABLE_COLUMN" | cut -d '.' -f 1)
COLUMN=$(echo "$TABLE_COLUMN" | cut -d '.' -f 2)
if [ -z "$TABLE" ] || [ -z "$COLUMN" ]; then
echo -e "${RED}❌ Invalid format. Use table.column (e.g., connections.ip_address)${NC}"
exit 1
fi
# Manage the repo (local or clone)
CLEANUP="false"
if [ -z "$REPO_PATH" ]; then
TMP_DIR=$(mktemp -d)
REPO_PATH="$TMP_DIR"
echo -e "${BLUE}🚀 Cloning repository from $REPO_URL...${NC}"
git clone --quiet "$REPO_URL" "$REPO_PATH"
if [ $? -ne 0 ]; then
echo -e "${RED}❌ Failed to clone repository.${NC}"
exit 1
fi
CLEANUP="true"
else
if [ ! -d "$REPO_PATH/.git" ]; then
echo -e "${RED}❌ The provided path is not a valid Git repository: $REPO_PATH${NC}"
exit 1
fi
echo -e "${BLUE}📂 Using local repository: $REPO_PATH${NC}"
fi
cd "$REPO_PATH"
echo -e "${CYAN}🔍 Searching for column '$COLUMN' in table '$TABLE'...${NC}"
LAST_TABLE_BLOCK=""
ERROR_LOGS=""
check_column_in_commit() {
local commit=$1
CONTENT=$(git show "${commit}:${FILE}" 2>/dev/null)
if [ $? -ne 0 ]; then
ERROR_LOGS+="${RED}❌ [$commit] File $FILE does not exist in this commit.${NC}\n"
return 2
fi
TABLE_BLOCK=$(echo "$CONTENT" | awk -v table="PREFIX_${TABLE}" '
BEGIN {capture=0}
(toupper($0) ~ "CREATE[ ]*TABLE" && $0 ~ ("`" table "`")) {capture=1}
capture==1 {print}
capture==1 && $0 ~ /^[ ]*\)[ ]*ENGINE=/ {capture=0}
')
if [ -z "$TABLE_BLOCK" ]; then
ERROR_LOGS+="${RED}❌ [$commit] Table PREFIX_${TABLE} not found.${NC}\n"
return 3
fi
LAST_TABLE_BLOCK="$TABLE_BLOCK"
echo "$TABLE_BLOCK" | grep -q "\`${COLUMN}\`"
if [ $? -eq 0 ]; then
echo -e "${GREEN}🎯 [$commit] Column '${COLUMN}' found in table '${TABLE}'.${NC}"
return 0
else
return 1
fi
}
COMMITS=$(git log --format="%H" --reverse -- "$FILE")
FOUND="false"
for COMMIT in $COMMITS
do
check_column_in_commit "$COMMIT"
RESULT=$?
if [ $RESULT -eq 0 ]; then
echo -e "${GREEN}✅ Column '${COLUMN}' exists in table '${TABLE}' since commit: $COMMIT${NC}"
TAGS=$(git tag --contains $COMMIT)
if [ -z "$TAGS" ]; then
echo -e "${YELLOW}⚠️ No tag found containing this commit (it may be in the development branch)${NC}"
else
CLEAN_TAGS=$(echo "$TAGS" | grep -Ev '^(list|show)$' | sort -V)
FIRST_TAG=$(echo "$CLEAN_TAGS" | head -n 1)
LAST_TAG=$(echo "$CLEAN_TAGS" | tail -n 1)
echo -e "${CYAN}🏷️ Present from tag: ${GREEN}$FIRST_TAG${CYAN} to ${GREEN}$LAST_TAG${NC}"
fi
echo -e "${BLUE}📜 Commit details :${NC}"
git --no-pager log -1 $COMMIT
echo -e "\n${CYAN}📄 Full table definition when the column was introduced:${NC}\n"
echo "$LAST_TABLE_BLOCK"
FOUND="true"
break
fi
done
if [ "$FOUND" == "false" ]; then
echo -e "$ERROR_LOGS"
echo -e "${RED}❌ The column '${COLUMN}' in table '${TABLE}' was not found in the history of $FILE${NC}"
fi
# Cleanup
if [ "$CLEANUP" == "true" ]; then
cd - > /dev/null
rm -rf "$TMP_DIR"
echo -e "${BLUE}🧹 Temporary folder removed.${NC}"
else
cd - > /dev/null
fi

View File

@@ -0,0 +1,35 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/OSL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;