Your project should not commit sensitive files to the repository
- Read doc
- Data leak
- Critical
More information: https://insight.symfony.com/what-we-analyse/git.sensitive_file_committed
-
Core/ClicShopping/External
- vendor
- CommonCurrencies.json
- PasswordHash.php
-
cacert.pem
The sensitive file
cacert.pemis committed to the repository and may expose credentials or private keys. - cert_key_pem_paypal.txt
- update-cacert.sh
Your project uses dangerous command injection functions 16
- Read doc
- Security
- Critical
More information: https://insight.symfony.com/what-we-analyse/php.use_command_injection_function
- }
- if (isset($_POST['download'])) {
- switch ($compress) {
- case 'gzip':
- exec(LOCAL_EXE_GZIP . ' ' . $backup_directory . $backup_file);
- $backup_file .= '.gz';
- break;
- case 'zip':
- exec(LOCAL_EXE_ZIP . ' -j ' . $backup_directory . $backup_file . '.zip ' . $backup_directory . $backup_file);
- unlink($backup_directory . $backup_file);
- case 'gzip':
- exec(LOCAL_EXE_GZIP . ' ' . $backup_directory . $backup_file);
- $backup_file .= '.gz';
- break;
- case 'zip':
- exec(LOCAL_EXE_ZIP . ' -j ' . $backup_directory . $backup_file . '.zip ' . $backup_directory . $backup_file);
- unlink($backup_directory . $backup_file);
- $backup_file .= '.zip';
- }
- header('Content-type: application/x-octet-stream');
- exit;
- } else {
- switch ($compress) {
- case 'gzip':
- exec(LOCAL_EXE_GZIP . ' ' . $backup_directory . $backup_file);
- break;
- case 'zip':
- exec(LOCAL_EXE_ZIP . ' -j ' . $backup_directory . $backup_file . '.zip ' . $backup_directory . $backup_file);
- unlink($backup_directory . $backup_file);
- }
- switch ($compress) {
- case 'gzip':
- exec(LOCAL_EXE_GZIP . ' ' . $backup_directory . $backup_file);
- break;
- case 'zip':
- exec(LOCAL_EXE_ZIP . ' -j ' . $backup_directory . $backup_file . '.zip ' . $backup_directory . $backup_file);
- unlink($backup_directory . $backup_file);
- }
- $CLICSHOPPING_MessageStack->add(CLICSHOPPING::getDef('success_database_saved'), 'success');
- }
- $restore_from = $restore_file;
- $remove_raw = false;
- break;
- case '.gz':
- $restore_from = substr($restore_file, 0, -3);
- exec(LOCAL_EXE_GUNZIP . ' ' . $restore_file . ' -c > ' . $restore_from);
- $remove_raw = true;
- break;
- case 'zip':
- $restore_from = substr($restore_file, 0, -4);
- exec(LOCAL_EXE_UNZIP . ' ' . $restore_file . ' -d ' . $backup_directory);
- exec(LOCAL_EXE_GUNZIP . ' ' . $restore_file . ' -c > ' . $restore_from);
- $remove_raw = true;
- break;
- case 'zip':
- $restore_from = substr($restore_file, 0, -4);
- exec(LOCAL_EXE_UNZIP . ' ' . $restore_file . ' -d ' . $backup_directory);
- $remove_raw = true;
- }
- if (isset($restore_from) && is_file($restore_from) && filesize($restore_from) > 15000) {
- $fd = fopen($restore_from, 'rb');
- 2 => ["pipe", "w"] // stderr
- ];
- $this->logger->info('Starting MCP server process', ['command' => $command]);
- $this->process = proc_open($command, $descriptorspec, $this->pipes);
- if (!is_resource($this->process)) {
- $this->logger->error('Failed to start MCP server process', ['command' => $command]);
- throw new McpConnectionException('Failed to start MCP server process');
- }
- $CLICSHOPPING_Db = Registry::get('Db');
- $Qdate = $CLICSHOPPING_Db->query('select now() as datetime');
- try {
- [$system, $host, $kernel] = preg_split('/[\s,]+/', @exec('uname -a'), 5);
- } catch (\Throwable $e) {
- $system = $host = $kernel = 'unavailable';
- }
- try {
- } catch (\Throwable $e) {
- $system = $host = $kernel = 'unavailable';
- }
- try {
- $uptime = @exec('uptime');
- } catch (\Throwable $e) {
- $uptime = 'unavailable';
- }
- try {
- if (!self::checkExecEnabled()) {
- return false;
- }
- $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer --no-ansi --no-interaction show 2>/dev/null';
- exec($cmd, $output, $return);
- return $return === 0;
- }
- /**
- if (is_null($library) || !self::checkExecute()) {
- return false;
- }
- $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer show ' . escapeshellarg($library) . ' 2>/dev/null';
- exec($cmd, $output, $return);
- return $return === 0;
- }
- /**
- * Verifies if the necessary conditions for executing commands are met.
- if (!self::checkExecute() || is_null($library)) {
- return false;
- }
- $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer show ' . escapeshellarg($library) . ' 2>/dev/null';
- exec($cmd, $output, $return);
- if ($return === 0 && !empty($output)) {
- // Recherche la ligne contenant la version
- foreach ($output as $line) {
- if (str_starts_with($line, 'versions')) {
- if ($library !== null) {
- $cmd .= ' ' . escapeshellarg($library);
- }
- $cmd .= ' 2>&1';
- exec($cmd, $output, $return);
- // Retourne toute la sortie pour plus d'informations, ou une chaîne vide si rien
- return !empty($output) ? implode("\n", $output) : '';
- }
- if (!self::checkExecute() || is_null($library)) {
- return false;
- }
- $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer require ' . escapeshellarg($library) . ' 2>&1';
- exec($cmd, $output, $return);
- return !empty($output) ? implode("\n", $output) : '';
- }
- /**
- if (!self::checkExecute() || is_null($library)) {
- return '';
- }
- $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer remove ' . escapeshellarg($library) . ' 2>&1';
- exec($cmd, $output, $return);
- return !empty($output) ? implode("\n", $output) : '';
- }
- /**
- if (!self::checkExecute()) {
- return '';
- }
- $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer clearcache 2>&1';
- exec($cmd, $output, $return);
- // Retourne toute la sortie pour plus d'informations, ou une chaîne vide si rien
- return !empty($output) ? implode("\n", $output) : '';
- }
- }
Your project uses non-strict array lookups 293
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup
- exit;
- }
- // Validate feedback_type
- $validTypes = ['positive', 'negative', 'correction'];
- if (!in_array($input['feedback_type'], $validTypes)) {
- echo json_encode([
- 'success' => false,
- 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
- ]);
- exit;
- $errors = [];
- // ============================================================================
- // 1. Reset Translation Cache
- // ============================================================================
- if (in_array('translations', $cacheTypes)) {
- try {
- $translationCache = new TranslationCache();
- // Count files before
- $cacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Translation/';
- }
- // ============================================================================
- // 3. Reset Classification Cache
- // ============================================================================
- if (in_array('classification', $cacheTypes)) {
- try {
- $classificationCache = new ClassificationCache();
- // Get stats before
- $statsBefore = $classificationCache->getStatistics();
- }
- // ============================================================================
- // 3. Reset Database Query Cache
- // ============================================================================
- if (in_array('database', $cacheTypes)) {
- try {
- $db = Registry::get('Db');
- $prefix = CLICSHOPPING::getConfig('db_table_prefix');
- // Count entries before
- }
- // ============================================================================
- // 4. Reset Schema Query Cache (TASK 5 - ITEM 1)
- // ============================================================================
- if (in_array('schema', $cacheTypes)) {
- try {
- // Count schema cache files before (new location)
- $schemaCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/SchemaQuery/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 5. Reset Intent Classification Cache (TASK 5.1.7.6)
- // ============================================================================
- if (in_array('intent', $cacheTypes)) {
- try {
- // Count intent cache files before (new location - all files)
- $intentCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Intent/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 6. Reset Ambiguity Cache (TASK 4 - Cache Migration)
- // ============================================================================
- if (in_array('ambiguity', $cacheTypes)) {
- try {
- // Count ambiguity cache files before (new location - all files)
- $ambiguityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Ambiguity/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 7. Reset Translation Ambiguity Cache
- // ============================================================================
- if (in_array('translation_ambiguity', $cacheTypes)) {
- try {
- // Count translation ambiguity cache files before (new location)
- $translationAmbiguityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Translation/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 8. Reset Context Cache
- // ============================================================================
- if (in_array('context', $cacheTypes)) {
- try {
- // Count context cache files before (new location)
- $contextCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Context/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 8.5. Reset Memory Cache (file-based)
- // ============================================================================
- if (in_array('memory', $cacheTypes)) {
- try {
- $memoryCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Memory/';
- $filesBefore = 0;
- if (is_dir($memoryCacheDir)) {
- }
- // ============================================================================
- // 9. Reset Embedding Cache
- // ============================================================================
- if (in_array('embedding', $cacheTypes)) {
- try {
- // Count embedding cache files before (new location)
- $embeddingCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Embedding/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 10. Reset EmbeddingSearch Cache
- // ============================================================================
- if (in_array('embedding_search', $cacheTypes)) {
- try {
- // Count embedding search cache files before (new location)
- $embeddingSearchCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/EmbeddingSearch/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 11. Reset Hybrid Query Cache (TASK 8: Multi-temporal query caching)
- // ============================================================================
- if (in_array('hybrid', $cacheTypes)) {
- try {
- // Count hybrid cache files before
- $hybridCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Hybrid/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 12. Reset Semantic Query Cache (TASK 8: Multi-temporal query caching)
- // ============================================================================
- if (in_array('semantic', $cacheTypes)) {
- try {
- // Count hybrid cache files before
- $semanticCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Semantic/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 13. Reset Embeddings Cache (PHASE 2 - NewVector cache)
- // ============================================================================
- if (in_array('embeddings', $cacheTypes)) {
- try {
- $embeddingsCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Embeddings/';
- $filesBefore = 0;
- if (is_dir($embeddingsCacheDir)) {
- }
- // ============================================================================
- // 14. Reset SQL Query Cache (PHASE 4)
- // ============================================================================
- if (in_array('sql', $cacheTypes)) {
- try {
- $sqlCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/SQL/';
- $filesBefore = 0;
- if (is_dir($sqlCacheDir)) {
- }
- // ============================================================================
- // 15. Reset Security Cache
- // ============================================================================
- if (in_array('security', $cacheTypes)) {
- try {
- $securityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Security/';
- $filesBefore = 0;
- if (is_dir($securityCacheDir)) {
- }
- // ============================================================================
- // 16. Reset Reputation Cache
- // ============================================================================
- if (in_array('reputation', $cacheTypes)) {
- try {
- $reputationCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Reputation/';
- $filesBefore = 0;
- if (is_dir($reputationCacheDir)) {
- }
- // ============================================================================
- // 17. Reset Config Cache
- // ============================================================================
- if (in_array('config', $cacheTypes)) {
- try {
- $configCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Config/';
- $filesBefore = 0;
- if (is_dir($configCacheDir)) {
- unset($this->storage[$scopedKey]);
- unset($this->metadata[$scopedKey]);
- // Remove from the scope's key list
- $scopeKeys = $this->scopes[$this->currentScope] ?? [];
- $index = array_search($scopedKey, $scopeKeys);
- if ($index !== false) {
- array_splice($this->scopes[$this->currentScope], $index, 1);
- }
- // Use higher priority
- $priorities = ['low' => 1, 'medium' => 2, 'high' => 3, 'critical' => 4];
- $priority1 = $priorities[$obj1->getPriority()];
- $priority2 = $priorities[$obj2->getPriority()];
- $combinedPriority = array_search(max($priority1, $priority2), $priorities);
- // Estimate combined time (not just sum, as there may be synergies)
- $estimatedTime = (int)(($obj1->getEstimatedCompletionTime() + $obj2->getEstimatedCompletionTime()) * 0.8);
- return [
- private function translateMonthName(string $monthName, string $languageCode): string
- {
- $englishMonths = ['January', 'February', 'March', 'April', 'May', 'June',
- 'July', 'August', 'September', 'October', 'November', 'December'];
- $monthIndex = array_search(ucfirst(strtolower($monthName)), $englishMonths);
- if ($monthIndex === false) {
- return $monthName; // Return as-is if not found
- }
- $targetMonths = $this->getMonthNames($languageCode);
- $svg .= "<text x='{$x}' y='{$yLbl}' text-anchor='end' font-size='10' fill='#999' transform='rotate(-35 {$x} {$yLbl})'>{$short}</text>";
- }
- // Marqueur + label sur le pic
- $maxVal = max($values);
- $maxIdx = array_search($maxVal, $values);
- $px = $pts[$maxIdx][0];
- $py = $pts[$maxIdx][1];
- $svg .= "<circle cx='{$px}' cy='{$py}' r='5' fill='#36a2eb' stroke='white' stroke-width='2'/>";
- $labelY = max($padT + 16, $py - 10);
- $svg .= "<text x='{$px}' y='{$labelY}' text-anchor='middle' font-size='12' fill='#36a2eb' font-weight='bold'>{$maxVal}</text>";
- if ($intent === null || !is_array($intent)) {
- return null;
- }
- // Validate required fields
- if (!isset($intent['intent']) || !in_array($intent['intent'], ['price_comparison', 'product_discovery', 'market_research', 'trend_analysis'])) {
- return null;
- }
- // Ensure all fields exist with defaults
- $validatedIntent = [
- ];
- // Validate mode_hint if present
- if ($validatedIntent['mode_hint'] !== null) {
- $validModeHints = ['mode_a', 'mode_b', 'mode_c', 'hybrid'];
- if (!in_array($validatedIntent['mode_hint'], $validModeHints)) {
- $validatedIntent['mode_hint'] = null;
- }
- }
- // Normalize target_site to lowercase
- // Note: For production, this should use ModeSelector's STOPWORDS constant
- // or be externalized to database (v2 improvement)
- $stopWords = ['the', 'a', 'an', 'and', 'or', 'but', 'in', 'on', 'at', 'to', 'for', 'new', 'official', 'original'];
- $words = explode(' ', $normalized);
- $words = array_filter($words, function($word) use ($stopWords) {
- return !in_array($word, $stopWords) && strlen($word) > 1;
- });
- return implode(' ', $words);
- }
- if ($field === $idColumn) {
- return true;
- }
- // Exclude system timestamp fields
- if (in_array($field, ['created_at', 'updated_at', 'deleted_at'])) {
- return false;
- }
- // Get column type
- $type = $columnTypes[$field] ?? 'string';
- // Get column type
- $type = $columnTypes[$field] ?? 'string';
- // Include numeric columns (for aggregation)
- if (in_array($type, ['int', 'bigint', 'smallint', 'decimal', 'float', 'double'])) {
- return true;
- }
- // Include date/timestamp columns (for temporal analysis)
- if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
- if (in_array($type, ['int', 'bigint', 'smallint', 'decimal', 'float', 'double'])) {
- return true;
- }
- // Include date/timestamp columns (for temporal analysis)
- if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
- return true;
- }
- // Include text columns (for filtering and grouping)
- if (in_array($type, ['varchar', 'char', 'text', 'enum'])) {
- if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
- return true;
- }
- // Include text columns (for filtering and grouping)
- if (in_array($type, ['varchar', 'char', 'text', 'enum'])) {
- return true;
- }
- // Exclude everything else (binary, blob, json, etc.)
- return false;
- // Prefer 'normalized'; fall back to 'normalized_value' for forward-compat
- $scoreDescription = (float) ($factor['normalized'] ?? $factor['normalized_value'] ?? 0.0);
- }
- }
- $finalQuadrant = in_array($quadrant, ['Q1', 'Q2', 'Q3', 'Q4']) ? $quadrant : 'Q_intermediate';
- return [
- 'quadrant' => $finalQuadrant,
- 'score_x' => (float) ($scoreXResult['score'] ?? 0.0),
- 'score_y' => (float) ($scoreYResult['score'] ?? 0.0),
- $fields = DoctrineOrm::getTableColumns($tableName);
- // Exclude only ID and system timestamp fields
- return array_values(array_filter($fields, function($field) use ($idColumn) {
- return $field !== $idColumn
- && !in_array($field, ['created_at', 'updated_at', 'deleted_at']);
- }));
- } catch (\Exception $e) {
- return [];
- }
- $words = preg_split('/[\s,.:;!?"()]+/u', mb_strtolower($onlyText), -1, PREG_SPLIT_NO_EMPTY);
- $grammar = $this->grammar();
- $counts = [];
- foreach ($words as $w) {
- $w = preg_replace('/[^\p{L}\p{N}\-]/u', '', $w);
- if (mb_strlen($w) > 2 && !in_array($w, $grammar)) {
- $counts[$w] = ($counts[$w] ?? 0) + 1;
- }
- }
- arsort($counts);
- $report['wordcountmax'] = array_slice($counts, 0, 8, true);
- $productData = $this->getProductData($productId);
- if ($productData && !$productData['in_stock']) {
- $messages[] = [
- 'type' => 'error',
- 'code' => 'out_of_stock',
- 'param' => '$.line_items[' . array_search($lineItem, $lineItems) . ']',
- 'content_type' => 'plain',
- 'content' => 'Produit ' . $productData['title'] . ' temporairement indisponible'
- ];
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_ARCHIVE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_ARCHIVE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- // make sure no duplicate category IDs exist which could lock the server in a loop
- $tmp_array = [];
- $n = count($cPath_array);
- for ($i = 0; $i < $n; $i++) {
- if (!in_array($cPath_array[$i], $tmp_array)) {
- $tmp_array[] = $cPath_array[$i];
- }
- }
- return $tmp_array;
- $category_name = $this->getCategoryTreeTitle($category['name']);
- $categories_url = $this->getCategoryTreeUrl($category_link);
- if (($this->follow_cpath === true) && in_array($category_id, $this->cpath_array)) {
- $link_title = $this->cpath_start_string . $category_name . $this->cpath_end_string;
- } else {
- $link_title = $category_name;
- }
- $result .= $this->parent_end_string;
- }
- if (isset($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
- if ($this->follow_cpath === true) {
- if (in_array($category_id, $this->cpath_array)) {
- $result .= $this->buildBranch($category_id, $level + 1);
- }
- } else {
- $result .= $this->buildBranch($category_id, $level + 1);
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_CATEGORIES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_CATEGORIES_INSTALLED', implode(';', $installed));
- $categories_id = HTML::sanitize($this->Id);
- $new_parent_id = HTML::sanitize($this->moveToCategoryID);
- $path = explode('_', $this->categoriesAdmin->getGeneratedCategoryPathIds($new_parent_id));
- if (\in_array($this->Id, $path)) {
- $CLICSHOPPING_MessageStack->add($this->app->getDef('error_cannot_move_directory_to_parent'), 'error');
- $this->app->redirect('Categories&cPath=' . $this->cPath . '&cID=' . $categories_id);
- } else {
- $sql_array = [
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_MANUFACTURERS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_MANUFACTURERS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CATALOG_PRODUCTS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CATALOG_PRODUCTS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_ATTRIBUTES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_ATTRIBUTES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SUPPLIERS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SUPPLIERS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_EMAIL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_EMAIL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_NEWSLETTER_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_NEWSLETTER_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- $allowed = array_map(function ($v) {
- return basename($v, '.php');
- }, glob(CLICSHOPPING::BASE_DIR . 'Apps/Communication/Newsletter/Module/ClicShoppingAdmin/Newsletter/*.php'));
- if (!\in_array($newsletter_module, $allowed)) {
- $CLICSHOPPING_MessageStack->add($CLICSHOPPING_Newsletter->getDef('error_newsletter_module_not_exists'), 'danger');
- $newsletter_error = true;
- }
- if ($newsletters_accept_file == 'on') {
- $allowed = array_map(function ($v) {
- return basename($v, '.php');
- }, glob(CLICSHOPPING::BASE_DIR . 'Apps/Communication/Newsletter/Module/ClicShoppingAdmin/Newsletter/*.php'));
- if (!\in_array($newsletter_module, $allowed)) {
- $CLICSHOPPING_MessageStack->add($CLICSHOPPING_Newsletter->getDef('error_newsletter_module_not_exists'), 'danger');
- $newsletter_error = true;
- }
- if ($newsletters_accept_file == 'on') {
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PAGE_MANAGER_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PAGE_MANAGER_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ADMINISTRATORS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ADMINISTRATORS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- foreach ($Qips as $allowedIp) {
- $ip = $allowedIp['ip'];
- if ($ip === '127.0.0.1' || $ip === 'localhost') {
- if (in_array($clientIp, ['127.0.0.1', '::1'])) {
- self::logSecurityEvent('Localhost access granted', [
- 'api_id' => $api_id,
- 'client_ip' => $clientIp
- ]);
- */
- public static function isLocalEnvironment(): bool
- {
- $ip = HTTP::getIpAddress();
- if (in_array($ip, ['127.0.0.1', '::1'])) {
- return true;
- }
- $serverName = $_SERVER['SERVER_NAME'] ?? '';
- $host = $_SERVER['HTTP_HOST'] ?? '';
- }
- $method = strtoupper($_SERVER["REQUEST_METHOD"]);
- $allowedMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'];
- if (!in_array($method, $allowedMethods)) {
- throw new Exception("Invalid HTTP method: " . $method);
- }
- return $method;
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_API_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_API_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CACHE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CACHE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- foreach ($models as $model) {
- $modelId = $model['id'];
- $provider = $model['provider'] ?? 'openai'; // Default to openai if missing
- // Validate provider name
- if (!in_array($provider, $validProviders)) {
- if (defined('CLICSHOPPING_APP_CHATGPT_CH_DEBUG') && CLICSHOPPING_APP_CHATGPT_CH_DEBUG === 'True') {
- error_log("WARNING: Invalid provider '$provider' for model '$modelId'. Using 'openai' as default.");
- }
- $provider = 'openai';
- }
- 'open-mistral-nemo',
- 'open-codestral-mamba',
- 'mistral-moderation-latest'
- ];
- if (empty($model) || !in_array($model, $valid_models)) {
- $model = 'mistral-large-latest';
- }
- $config = new MistralAIChat();
- $config->apiKey = $api_key;
- }
- // Validate type is one of expected values
- if (isset($response['type'])) {
- $validTypes = ['analytics', 'semantic', 'web_search', 'hybrid', 'error', 'clarification'];
- if (!in_array($response['type'], $validTypes)) {
- $warnings[] = "Unexpected type value: {$response['type']}";
- }
- }
- return [
- if ($productData && !$productData['in_stock']) {
- $messages[] = [
- 'type' => 'error',
- 'code' => 'out_of_stock',
- 'text' => 'Produit ' . $productData['title'] . ' temporairement indisponible',
- 'path' => '$.line_items[' . array_search($lineItem, $lineItems) . ']'
- ];
- }
- }
- // Add promotional messages
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- exit;
- }
- // Validate feedback_type
- $validTypes = ['positive', 'negative', 'correction'];
- if (!in_array($input['feedback_type'], $validTypes)) {
- echo json_encode([
- 'success' => false,
- 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
- ]);
- exit;
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_COUNTRIES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_COUNTRIES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CURRENCY_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CURRENCY_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_LANGUES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_LANGUES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- }
- foreach (glob(CLICSHOPPING::getConfig('dir_root', 'ClicShoppingAdmin') . 'Core/languages/*', GLOB_ONLYDIR) as $dir) {
- $code = basename($dir);
- if (array_search($code, array_column($directories, 'id')) === false) {
- $directories[] = ['id' => $code,
- 'text' => $code
- ];
- }
- }
- }
- foreach (glob(CLICSHOPPING::getConfig('dir_root', 'ClicShoppingAdmin') . 'Core/languages/*', GLOB_ONLYDIR) as $dir) {
- $code = basename($dir);
- if (array_search($code, array_column($directories, 'id')) === false) {
- $directories[] = ['id' => $code,
- 'text' => $code
- ];
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_MODULES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_MODULES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- $module->install();
- $modules_installed = explode(';', \constant($module_key));
- if (!\in_array($class . $file_extension, $modules_installed)) {
- $modules_installed[] = $class . $file_extension;
- }
- Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
- ['configuration_key' => $module_key]
- $module->remove();
- $modules_installed = explode(';', \constant($module_key));
- if (\in_array($class . $file_extension, $modules_installed)) {
- unset($modules_installed[array_search($class . $file_extension, $modules_installed)]);
- }
- Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
- ['configuration_key' => $module_key]
- $module->remove();
- $modules_installed = explode(';', \constant($module_key));
- if (\in_array($class . $file_extension, $modules_installed)) {
- unset($modules_installed[array_search($class . $file_extension, $modules_installed)]);
- }
- Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
- ['configuration_key' => $module_key]
- );
- if ($dir = @dir($module_directory)) {
- while ($file = $dir->read()) {
- if (!is_dir($module_directory . $file)) {
- if (substr($file, strrpos($file, '.')) == $file_extension) {
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- }
- } else {
- if (\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- }
- } else {
- if (\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- } else {
- $new_modules_counter++;
- }
- }
- }
- if (isset($appModuleType)) {
- foreach (Apps::getModules($appModuleType) as $k => $v) {
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- }
- } else {
- if (\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- }
- } else {
- if (\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- } else {
- $new_modules_counter++;
- }
- }
- if ($dir = @dir($module_directory)) {
- while ($file = $dir->read()) {
- if (!is_dir($module_directory . $file)) {
- if (substr($file, strrpos($file, '.')) === $file_extension) {
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- }
- } else {
- if (\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- }
- } else {
- if (\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- } else {
- $new_modules_counter++;
- }
- }
- }
- if (isset($appModuleType)) {
- foreach (Apps::getModules($appModuleType) as $k => $v) {
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- }
- } else {
- if (\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- }
- } else {
- if (\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- } else {
- $new_modules_counter++;
- }
- }
- <tr>
- <td><?php echo $module->title; ?></td>
- <td class="text-start"><?php echo $module->group; ?></td>
- <td class="text-end">
- <?php
- if (\in_array($module->code . $file_extension, $modules_installed) && is_numeric($module->sort_order)) {
- echo $module->sort_order;
- }
- ?>
- </td>
- <td class="text-center">
- $Qcheck = $CLICSHOPPING_Db->get('configuration', 'configuration_value', ['configuration_key' => 'TEMPLATE_BLOCK_GROUPS']);
- if ($Qcheck->fetch() !== false) {
- $tbgroups_array = explode(';', $Qcheck->value('configuration_value'));
- if (!\in_array($module_type, $tbgroups_array)) {
- $tbgroups_array[] = $module_type;
- sort($tbgroups_array);
- $CLICSHOPPING_Db->save('configuration', [
- 'configuration_value' => implode(';', $tbgroups_array),
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ORDERS_STATUS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ORDERS_STATUS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ORDERS_STATUS_INVOICE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ORDERS_STATUS_INVOICE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PROUCTS_LENGTH_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PROUCTS_LENGTH_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_QUANTITY_UNIT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_QUANTITY_UNIT_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SETTINGS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SETTINGS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_TAX_CLASS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_TAX_CLASS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_TAX_GEO_ZONES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_TAX_GEO_ZONES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_TAX_RATES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_TAX_RATES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_TEMPLATE_EMAIL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_TEMPLATE_EMAIL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_WEIGHT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_WEIGHT_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ZONES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ZONES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CUSTOMERS_INFO_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_INFO_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CUSTOMERS_GDPR_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_GDPR_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CUSTOMERS_GROUPS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_GROUPS_INSTALLED', implode(';', $installed));
- for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
- if (str_contains($include_modules[$i]['class'], '\\')) {
- Registry::set('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
- $module = Registry::get('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']));
- if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $payments_unallowed))) {
- $content .= '<div class="row">';
- $content .= '<div class="col-md-5">';
- $content .= '<div class="form-group row">';
- $content .= '<div class="col-md-12">';
- $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
- for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
- if (str_contains($include_modules[$i]['class'], '\\')) {
- Registry::set('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
- $module = Registry::get('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']));
- if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $shipping_unallowed))) {
- $content .= '<div class="col-md-12">';
- $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
- $content .= '<span class="col-md-3">' . $module->title . '</span>';
- $content .= '</div>';
- } elseif ($cInfo->customers_group_id != 0 && !\in_array($module->code, $shipping_unallowed)) {
- if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $shipping_unallowed))) {
- $content .= '<div class="col-md-12">';
- $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
- $content .= '<span class="col-md-3">' . $module->title . '</span>';
- $content .= '</div>';
- } elseif ($cInfo->customers_group_id != 0 && !\in_array($module->code, $shipping_unallowed)) {
- $content .= '<div class="col-md-12">';
- $content .= '<span class="col-md-1"><i class="bi-check text-danger"></i></span>';
- $content .= '<span class="col-md-3">' . $module->title . '</span>';
- $content .= '</div>';
- } elseif ($cInfo->customers_group_id == 0) {
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- <div class="form-group row">
- <div class="col-md-12">
- <ul class="list-group-slider list-group-flush">
- <li class="list-group-item-slider">
- <label class="switch">
- <?php echo HTML::checkboxField('payment_unallowed[' . $i . ']', $module->code, (\in_array($module->code, $payments_unallowed)) ? true : false, 'class="success"'); ?>
- <span class="slider"></span>
- </label>
- </li>
- <span class="text-slider"><?php echo $module->title; ?></span>
- </ul>
- <div class="form-group row">
- <div class="col-md-12">
- <ul class="list-group-slider list-group-flush">
- <li class="list-group-item-slider">
- <label class="switch">
- <?php echo HTML::checkboxField('shipping_unallowed[' . $i . ']', $module->code, (\in_array($module->code, $shipping_unallowed)) ? true : false, 'class="success"'); ?>
- <span class="slider"></span>
- </label>
- </li>
- <span class="text-slider"><?php echo $module->title; ?></span>
- </ul>
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CUSTOMERS_MEMBERS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_MEMBERS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_REVIEWS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_REVIEWS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_BANNER_MANAGER_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_BANNER_MANAGER_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_FAVORITES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_FAVORITES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_FEATURED_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_FEATURED_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_PRODUCT_RECOMMENDATIONS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_PRODUCT_RECOMMENDATIONS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SEO_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SEO_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_SPECIALS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_SPECIALS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- {
- if (!$this->isEnabled()) {
- return $this->skip($this->app->getDef('skip_module_disabled'));
- }
- if (!in_array($invoice_status, [self::STATUS_INVOICE, self::STATUS_CANCEL, self::STATUS_CREDIT_NOTE])) {
- return $this->skip($this->app->getDef('skip_status_not_actionable') . ' (' . $invoice_status . ')');
- }
- if ($this->isAlreadySent($order_id)) {
- return $this->skip($this->app->getDef('skip_already_sent') . ' #' . $order_id);
- $msg = $this->app->getDef('error_oauth2_failed') . ' #' . $order_id;
- $this->writeOrderHistory($order_id, '[ERROR] ' . $msg, false);
- return $this->failure($msg);
- }
- $doc_type = in_array($invoice_status, [self::STATUS_CANCEL, self::STATUS_CREDIT_NOTE]) ? self::TYPE_CREDIT_NOTE : self::TYPE_INVOICE;
- $payload = $this->buildPayload($order_id, $customer, $info, $products, $totals, $doc_type);
- if ($payload === null) {
- $msg = $this->app->getDef('error_payload_failed');
- $this->writeOrderHistory($order_id, '[ERROR] ' . $msg, false);
- // Extract totals from the order totals array
- $ht = $tva = $ttc = 0.0;
- foreach ($totals as $t) {
- $val = (float)str_replace(',', '.', preg_replace('/[^0-9.,\-]/', '', strip_tags($t['text'] ?? '0')));
- $c = $t['class'] ?? '';
- if (in_array($c, ['ot_subtotal', 'ST'])) $ht = $val;
- if (in_array($c, ['ot_tax', 'TX'])) $tva = $val;
- if (in_array($c, ['ot_total', 'TO'])) $ttc = $val;
- }
- // Fallback: compute HT from product lines if ot_subtotal not found
- $ht = $tva = $ttc = 0.0;
- foreach ($totals as $t) {
- $val = (float)str_replace(',', '.', preg_replace('/[^0-9.,\-]/', '', strip_tags($t['text'] ?? '0')));
- $c = $t['class'] ?? '';
- if (in_array($c, ['ot_subtotal', 'ST'])) $ht = $val;
- if (in_array($c, ['ot_tax', 'TX'])) $tva = $val;
- if (in_array($c, ['ot_total', 'TO'])) $ttc = $val;
- }
- // Fallback: compute HT from product lines if ot_subtotal not found
- if ($ht == 0.0) {
- foreach ($totals as $t) {
- $val = (float)str_replace(',', '.', preg_replace('/[^0-9.,\-]/', '', strip_tags($t['text'] ?? '0')));
- $c = $t['class'] ?? '';
- if (in_array($c, ['ot_subtotal', 'ST'])) $ht = $val;
- if (in_array($c, ['ot_tax', 'TX'])) $tva = $val;
- if (in_array($c, ['ot_total', 'TO'])) $ttc = $val;
- }
- // Fallback: compute HT from product lines if ot_subtotal not found
- if ($ht == 0.0) {
- foreach ($products as $p) {
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ORDERS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ORDERS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- if ((int)$check['orders_status_invoice'] === $new_invoice_status) {
- return;
- }
- // Only process actionable statuses
- if (!in_array($new_invoice_status, [
- EInvoiceService::STATUS_INVOICE,
- EInvoiceService::STATUS_CANCEL,
- EInvoiceService::STATUS_CREDIT_NOTE,
- ])) {
- return;
- ?>
- <span class="badge bg-success"><?php echo $CLICSHOPPING_Orders->getDef('badge_transmitted'); ?></span>
- <span class="text-success small"><?php echo $CLICSHOPPING_Orders->getDef('text_transmitted_notice'); ?></span>
- <?php
- } elseif (!in_array($current_invoice_status_id, [EInvoiceService::STATUS_INVOICE, EInvoiceService::STATUS_CANCEL, EInvoiceService::STATUS_CREDIT_NOTE])) {
- ?>
- <span class="badge bg-warning text-dark"><?php echo $CLICSHOPPING_Orders->getDef('badge_pending'); ?></span>
- <span class="text-muted small"><?php echo $CLICSHOPPING_Orders->getDef('text_pending_notice'); ?></span>
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_RETURN_ORDERS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_RETURN_ORDERS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_PAYMENT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_PAYMENT_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_PAYMENT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_PAYMENT_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- // Shared cross-module payment-attempt buffer: remove only this gateway's rows (DELETE, never DROP).
- \ClicShopping\OM\Registry::get('Db')->delete('order_customer_payment_action', ['type_apps_payment' => 'Stripe']);
- $installed = explode(';', MODULE_PAYMENT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_PAYMENT_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_STATS_PRODUCTS_NOTIFICATION_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_STATS_PRODUCTS_NOTIFICATION_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_SHIPPING_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_SHIPPING_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_SHIPPING_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_SHIPPING_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- $CLICSHOPPING_Language = Registry::get('Language');
- $module = HTML::sanitize(str_replace(' ', '', $module));
- if (defined('MODULE_ACTION_RECORDER_INSTALLED') && !is_null(MODULE_ACTION_RECORDER_INSTALLED)) {
- if (!is_null($module) && in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
- if (!class_exists($module)) {
- if (is_file($CLICSHOPPING_Template->getModuleDirectory() . '/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)))) {
- $CLICSHOPPING_Language->loadDefinitions('modules/action_recorder/' . $module);
- include($CLICSHOPPING_Template->getModuleDirectory() . '/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)));
- } else {
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ACTIONS_RECORDER_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ACTIONS_RECORDER_INSTALLED', implode(';', $installed));
- $modules_array[] = $Qmodules->value('module');
- }
- $expired_entries = 0;
- if (isset($_GET['module']) && \in_array($_GET['module'], $modules_array)) {
- $get_module_class = $CLICSHOPPING_ActionsRecorderClass->getClassModule($_GET['module']);
- if (\is_object($get_module_class)) {
- $expired_entries += $get_module_class->expireEntries();
- } else {
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- echo HTML::form('search', $CLICSHOPPING_ActionsRecorder->link('ActionsRecorder'), 'post', '', ['session_id' => true]);
- echo HTML::selectField('module', $modules_list_array, null, 'onchange="this.form.submit();"');
- ?>
- </span>
- <span class="col-md-1 text-end">
- <?php echo HTML::button($CLICSHOPPING_ActionsRecorder->getDef('button_reset'), null, $CLICSHOPPING_ActionsRecorder->link('ActionsRecorder&Expire' . (isset($_POST['module']) && \in_array($_POST['module'], $modules_array) ? '&module=' . $_POST['module'] : '')), 'danger'); ?>
- </span>
- </div>
- </form>
- </div>
- </div>
- </thead>
- <tbody>
- <?php
- $filter = [];
- if (isset($_POST['module']) && \in_array($_POST['module'], $modules_array)) {
- $filter[] = 'module = :module';
- }
- if (isset($_POST['search']) && !empty($_POST['search'])) {
- $filter[] = 'identifier like :identifier';
- $sql_query .= ' order by date_added desc limit :page_set_offset, :page_set_max_results';
- $Qactions = $CLICSHOPPING_ActionsRecorder->db->prepare($sql_query);
- if (!empty($filter)) {
- if (isset($_POST['module']) && \in_array($_POST['module'], $modules_array)) {
- $Qactions->bindValue(':module', $_POST['module']);
- }
- if (isset($_POST['search']) && !empty($_POST['search'])) {
- $Qactions->bindValue(':identifier', '%' . $_POST['search'] . '%');
- <div class="row">
- <div class="col-md-12">
- <div
- class="col-md-6 float-start pagenumber hidden-xs TextDisplayNumberOfLink"><?php echo $Qactions->getPageSetLabel($CLICSHOPPING_ActionsRecorder->getDef('text_display_number_of_link')); ?></div>
- <div
- class="float-end text-end"> <?php echo $Qactions->getPageSetLinks((isset($_POST['module']) && \in_array($_POST['module'], $modules_array) && \is_object($GLOBALS[$_POST['module']]) ? 'module=' . $_POST['module'] : null) . '&' . (isset($_POST['search']) && !empty($_POST['search']) ? 'search=' . $_POST['search'] : null)); ?></div>
- </div>
- </div>
- </div>
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ADMINISTRATOR_MENU_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ADMINISTRATOR_MENU_INSTALLED', implode(';', $installed));
- if (isset($this->Id) && ($this->Id != $this->moveToCategoryID)) {
- $new_parent_id = $this->moveToCategoryID;
- $path = explode('_', AdministratorMenu::getGeneratedAdministratorMenuPathIds($new_parent_id));
- if (\in_array($this->Id, $path)) {
- $CLICSHOPPING_MessageStack->add($this->app->getDef('error_cannot_move_directory_to_parent'), 'error');
- $this->app->redirect('AdministratorMenu&cPath=' . (int)$this->cPath . '&cID=' . (int)$this->Id);
- } else {
- $this->app->db->save('administrator_menu', [
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_APPS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_APPS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_BACKUP_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_BACKUP_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- $dir = dir($backup_directory);
- $contents = [];
- while ($file = $dir->read()) {
- if (!is_dir($backup_directory . $file) && \in_array(substr($file, -3), array('zip', 'sql', '.gz'))) {
- $contents[] = $file;
- }
- }
- sort($contents);
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CRONJOB_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CRONJOB_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_DATA_BASE_TABLES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_DATA_BASE_TABLES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- ['id' => 'utf8',
- 'text' => $CLICSHOPPING_DataBaseTables->getDef('action_utf8_conversion')
- ]);
- if (isset($_POST['action'])) {
- if (\in_array($_POST['action'], array('check', 'analyze', 'optimize', 'repair', 'utf8'))) {
- if (isset($_POST['id']) && \is_array($_POST['id']) && !empty($_POST['id'])) {
- $tables = Database::getDtTables();
- foreach ($_POST['id'] as $key => $value) {
- if (!\in_array($value, $tables)) {
- if (\in_array($_POST['action'], array('check', 'analyze', 'optimize', 'repair', 'utf8'))) {
- if (isset($_POST['id']) && \is_array($_POST['id']) && !empty($_POST['id'])) {
- $tables = Database::getDtTables();
- foreach ($_POST['id'] as $key => $value) {
- if (!\in_array($value, $tables)) {
- unset($_POST['id'][$key]);
- }
- }
- if (!empty($_POST['id'])) {
- while ($Qaction->fetch()) {
- $table_data[] = [
- ($table != $current_table) ? HTML::outputProtected($table) : '',
- $Qaction->valueProtected('Msg_type'),
- $Qaction->valueProtected('Msg_text'),
- ($table != $current_table) ? HTML::checkboxField('id[]', $table, isset($_POST['id']) && \in_array($table, $_POST['id'])) : ''
- ];
- $current_table = $table;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_DEFINE_LANGUAGE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_DEFINE_LANGUAGE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_EDIT_DESIGN_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_EDIT_DESIGN_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_EDIT_LOG_ERROR_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_EDIT_LOG_ERROR_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- * @param array $checks An array of check results, each with a 'status' key.
- * @return string The overall status: 'error', 'warning', or 'healthy'.
- */
- private function determineOverallStatus(array $checks): string
- {
- if (in_array('error', array_column($checks, 'status'))) {
- return 'error';
- }
- if (in_array('warning', array_column($checks, 'status'))) {
- return 'warning';
- }
- private function determineOverallStatus(array $checks): string
- {
- if (in_array('error', array_column($checks, 'status'))) {
- return 'error';
- }
- if (in_array('warning', array_column($checks, 'status'))) {
- return 'warning';
- }
- return 'healthy';
- }
- foreach ($Qips as $allowedIp) {
- $ip = $allowedIp['ip'];
- if ($ip === '127.0.0.1' || $ip === 'localhost') {
- if (in_array($clientIp, ['127.0.0.1', '::1'])) {
- self::logSecurityEvent('Localhost access granted', [
- 'mcp_id' => $mcp_id,
- 'client_ip' => $clientIp
- ]);
- */
- public static function isLocalEnvironment(): bool
- {
- $ip = HTTP::getIpAddress();
- if (in_array($ip, ['127.0.0.1', '::1'])) {
- return true;
- }
- $serverName = $_SERVER['SERVER_NAME'] ?? '';
- $host = $_SERVER['HTTP_HOST'] ?? '';
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_MCP_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_MCP_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- /**
- * Valide une clé d'API pour un niveau d'accès donné
- */
- public function validateMcpKey(string $mcpKey, string $accessLevel): bool {
- if (!in_array($accessLevel, $this->accessLevels)) {
- return false;
- }
- if (!isset($this->validMcpKeys[$accessLevel])) {
- return false;
- if (!isset($this->validMcpKeys[$accessLevel])) {
- return false;
- }
- return in_array($mcpKey, $this->validMcpKeys[$accessLevel]);
- }
- /**
- * Valide les headers de sécurité requis
- */
- 'ssl_enabled' => $sslEnabled,
- 'origin' => $origin
- ];
- // Add to allowed origins list
- if (!in_array($origin, $this->allowedOrigins)) {
- $this->allowedOrigins[] = $origin;
- }
- }
- // Fallback to localhost if no configurations found
- /**
- * Check if an origin is allowed
- */
- public function isOriginAllowed(string $origin): bool {
- return in_array($origin, $this->allowedOrigins);
- }
- /**
- * Valide une clé d'API pour un niveau d'accès donné
- */
- /**
- * Valide une clé d'API pour un niveau d'accès donné
- */
- public function validateMcpKey(string $mcpKey, string $accessLevel): bool {
- if (!in_array($accessLevel, $this->accessLevels)) {
- return false;
- }
- if (!isset($this->validMcpKeys[$accessLevel])) {
- return false;
- if (!isset($this->validMcpKeys[$accessLevel])) {
- return false;
- }
- return in_array($mcpKey, $this->validMcpKeys[$accessLevel]);
- }
- /**
- * Valide les headers de sécurité requis
- */
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_MODULES_HOOKS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_MODULES_HOOKS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SEC_DIR_PERMISSIONS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SEC_DIR_PERMISSIONS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- if ($handle = opendir($path)) {
- while (false !== ($filename = readdir($handle))) {
- if (!\in_array($filename, $exclude_array)) {
- $file = ['name' => $path . $filename,
- 'is_dir' => is_dir($path . $filename),
- 'writable' => FileSystem::isWritable($path . $filename)
- ];
- <th
- scope="row"><?php echo substr($file['name'], \strlen(CLICSHOPPING::getConfig('dir_root', 'Shop'))); ?></th>
- <td
- class="text-center"><?php echo $file['writable'] === true ? '<i class="bi-check text-success"></i>' : '<i class="bi bi-x text-danger"></i>'; ?></td>
- <td
- class="text-center"><?php echo(\in_array(substr($file['name'], \strlen(CLICSHOPPING::getConfig('dir_root', 'Shop'))), $whitelist_array) ? '<i class="bi-check text-success"></i>' : '<i class="bi bi-x text-danger"></i>'); ?></td>
- </tr>
- <?php
- }
- }
- ?>
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SECURITY_CHECK_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SECURITY_CHECK_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- <?php
- foreach ($modules as $module) {
- $secCheck = $module['instance'];
- if (!\in_array($secCheck->type, $types)) {
- $secCheck->type = 'info';
- }
- $output = '';
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SERVICE_APP_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SERVICE_APP_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_UPGRADE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_UPGRADE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_WHOS_ONLINE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_WHOS_ONLINE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- continue;
- }
- $fullClass = self::NAMESPACE_PREFIX . $fileInfo->getBasename('.php');
- if (class_exists($fullClass) && in_array(ActionToolsInterface::class, class_implements($fullClass))) {
- try {
- /** @var ActionToolsInterface $toolInstance */
- $toolInstance = new $fullClass();
- $toolName = $toolInstance->getName();
- $this->tools[$toolName] = $fullClass;
- $details_string = preg_replace('/comment\(.+\)$/', '', $details_string);
- $details = array_filter(explode(' ', $details_string), fn($v) => $v !== null && $v !== '');
- $details = array_values($details);
- }
- $is_binary = array_search('binary', $details);
- if (is_int($is_binary)) {
- array_splice($details, $is_binary, 1);
- $schema['col'][$field_name]['binary'] = true;
- }
- if (is_int($is_binary)) {
- array_splice($details, $is_binary, 1);
- $schema['col'][$field_name]['binary'] = true;
- }
- $is_unsigned = array_search('unsigned', $details);
- if (is_int($is_unsigned)) {
- array_splice($details, $is_unsigned, 1);
- $schema['col'][$field_name]['unsigned'] = true;
- }
- if (is_int($is_unsigned)) {
- array_splice($details, $is_unsigned, 1);
- $schema['col'][$field_name]['unsigned'] = true;
- }
- $is_not_null = array_search('not_null', $details);
- if (is_int($is_not_null)) {
- array_splice($details, $is_not_null, 1);
- $schema['col'][$field_name]['not_null'] = true;
- }
- if (is_int($is_not_null)) {
- array_splice($details, $is_not_null, 1);
- $schema['col'][$field_name]['not_null'] = true;
- }
- $is_auto_increment = array_search('auto_increment', $details);
- if (preg_match('/on_update\(([^)]+)\)/', $details_string, $on_update_match)) {
- $schema['col'][$field_name]['on_update'] = $on_update_match[1];
- $details_string = preg_replace('/on_update\([^)]+\)/', '', $details_string);
- $details = array_values(array_filter(explode(' ', $details_string)));
- $needs_quotes = true;
- }
- // Special keywords that don't need quotes
- $keywords = ['CURRENT_TIMESTAMP', 'NULL', 'NOW()', 'CURRENT_DATE', 'CURRENT_TIME'];
- if (in_array(strtoupper($default_value), $keywords)) {
- $needs_quotes = false;
- }
- // Add DEFAULT clause
- if ($needs_quotes && !in_array(strtoupper($default_value), $keywords)) {
- if (in_array(strtoupper($default_value), $keywords)) {
- $needs_quotes = false;
- }
- // Add DEFAULT clause
- if ($needs_quotes && !in_array(strtoupper($default_value), $keywords)) {
- $row .= " DEFAULT '" . addslashes($default_value) . "'";
- } else {
- $row .= ' DEFAULT ' . $default_value;
- }
- }
- $this->result = $this->cache_data;
- } else {
- $fetch_argument = $args[0] ?? null;
- $ctor_args = $args[1] ?? [];
- if (in_array($fetch_style, [PDO::FETCH_COLUMN])) {
- $this->result = parent::fetchAll($fetch_style, $fetch_argument);
- } elseif (in_array($fetch_style, [PDO::FETCH_CLASS, PDO::FETCH_FUNC])) {
- $this->result = parent::fetchAll($fetch_style, $fetch_argument, $ctor_args);
- } else {
- $this->result = parent::fetchAll($fetch_style);
- $fetch_argument = $args[0] ?? null;
- $ctor_args = $args[1] ?? [];
- if (in_array($fetch_style, [PDO::FETCH_COLUMN])) {
- $this->result = parent::fetchAll($fetch_style, $fetch_argument);
- } elseif (in_array($fetch_style, [PDO::FETCH_CLASS, PDO::FETCH_FUNC])) {
- $this->result = parent::fetchAll($fetch_style, $fetch_argument, $ctor_args);
- } else {
- $this->result = parent::fetchAll($fetch_style);
- }
- */
- public function setExcludeEntries(?array $entries)
- {
- if (is_array($entries)) {
- foreach ($entries as $value) {
- if (!in_array($value, $this->exclude_entries)) {
- $this->exclude_entries[] = $value;
- }
- }
- } elseif (is_string($entries)) {
- if (!in_array($entries, $this->exclude_entries)) {
- if (!in_array($value, $this->exclude_entries)) {
- $this->exclude_entries[] = $value;
- }
- }
- } elseif (is_string($entries)) {
- if (!in_array($entries, $this->exclude_entries)) {
- $this->exclude_entries[] = $entries;
- }
- }
- }
- $this->listing = array();
- }
- if ($dir = @dir($directory)) {
- while (($entry = $dir->read()) !== false) {
- if (!in_array($entry, $this->exclude_entries)) {
- if (($this->include_files === true) && is_file($dir->path . DIRECTORY_SEPARATOR . $entry)) {
- if (empty($this->check_extension) || in_array(mb_strtolower(substr($entry, strrpos($entry, '.') + 1)), $this->check_extension)) {
- if ($this->adddirectory_to_filename === true) {
- if ($dir->path !== $this->directory) {
- $entry = substr($dir->path, strlen($this->directory) + 1) . DIRECTORY_SEPARATOR . $entry;
- if ($dir = @dir($directory)) {
- while (($entry = $dir->read()) !== false) {
- if (!in_array($entry, $this->exclude_entries)) {
- if (($this->include_files === true) && is_file($dir->path . DIRECTORY_SEPARATOR . $entry)) {
- if (empty($this->check_extension) || in_array(mb_strtolower(substr($entry, strrpos($entry, '.') + 1)), $this->check_extension)) {
- if ($this->adddirectory_to_filename === true) {
- if ($dir->path !== $this->directory) {
- $entry = substr($dir->path, strlen($this->directory) + 1) . DIRECTORY_SEPARATOR . $entry;
- }
- }
- * @param string $type The type of the module to check for.
- * @return bool Returns true if the module exists, false otherwise.
- */
- final public function hasModule(string $module, string $type): bool
- {
- return isset($this->modules[$type]) && in_array($module, $this->modules[$type]);
- }
- /**
- * Sets the app information by reflecting the current class and loading data
- * from a metafile. Assigns the app's code, vendor, title, version, and modules
- $field .= ' id="' . static::output(substr($parameters, $offset + 4, strpos($parameters, '"', $offset + 4) - ($offset + 4))) . '_' . $counter . '"';
- }
- $field .= ' value="' . static::output($selection_value) . '"';
- if (isset($default) && (($default === true) || (!is_array($default) && ((string)$default == (string)$selection_value)) || (is_array($default) && in_array($selection_value, $default)))) {
- $field .= ' checked="checked"';
- }
- if (!empty($parameters)) {
- $field .= ' ' . $parameters;
- if (!isset($params['type'])) {
- $params['type'] = 'submit';
- }
- if (!in_array($params['type'], $types)) {
- $params['type'] = 'submit';
- }
- if (($params['type'] == 'submit') && isset($link)) {
- $params['type'] = 'button';
- if (($params['type'] == 'submit') && isset($link)) {
- $params['type'] = 'button';
- }
- if (isset($style) && !in_array($style, $styles)) {
- unset($style);
- }
- if (isset($size) && !in_array($size, $size_button)) {
- unset($size);
- if (isset($style) && !in_array($style, $styles)) {
- unset($style);
- }
- if (isset($size) && !in_array($size, $size_button)) {
- unset($size);
- }
- $button = '';
- if (!isset($data['cafile'])) {
- $data['cafile'] = CLICSHOPPING::BASE_DIR . 'External/cacert.pem';
- }
- if (isset($data['format']) && !in_array($data['format'], ['json'])) {
- trigger_error('HttpRequest::getResponse(): Unknown "format": ' . $data['format']);
- unset($data['format']);
- }
- ];
- $domain = strtolower(substr(strrchr($email, "@"), 1));
- if (in_array($domain, $temp_domains)) {
- return true;
- }
- }
- return false;
- $stack = [
- 'text' => $message,
- 'type' => $type
- ];
- if (!$this->exists($group) || !in_array($stack, $this->data[$group])) {
- $this->data[$group][] = $stack;
- }
- }
- /**
- protected function validateExtension(string $filename): bool
- {
- $extension = mb_strtolower(substr($filename, strrpos($filename, '.') + 1));
- // Check against dangerous extensions
- if (in_array($extension, $this->_dangerousExtensions)) {
- return false;
- }
- // If specific extensions are configured, check against them
- if (!empty($this->_extensions)) {
- return false;
- }
- // If specific extensions are configured, check against them
- if (!empty($this->_extensions)) {
- return in_array($extension, $this->_extensions);
- }
- return true;
- }
- public function isInstalled()
- {
- $module = HTML::sanitize(str_replace(' ', '', $this->_module));
- if (defined('MODULE_ACTION_RECORDER_INSTALLED') && !is_null(MODULE_ACTION_RECORDER_INSTALLED)) {
- if (!is_null($module) && \in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
- if (!class_exists($module)) {
- if (is_file(CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Core/modules/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)))) {
- $this->lang->loadDefinitions('Shop/Module/ActionRecorder/' . $module);
- $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
- foreach ($contents as $item) {
- $fileInfo = pathinfo($item);
- if (array_key_exists('extension', $fileInfo) && \in_array($fileInfo['extension'], $fileTypes)) {
- $found[] = $item;
- }
- }
- if ($found) { // Check the $found array is not empty
- sort($select_array);
- $values_array = explode(';', $values);
- $output = '';
- foreach ($select_array as $file) {
- $output .= HTML::checkboxField('ht_datepicker_jquery_file[]', $file, \in_array($file, $values_array)) . ' ' . HTML::outputProtected($file) . '<br />';
- }
- if (!empty($output)) {
- $output = '<br />' . substr($output, 0, -6);
- }
- $Qproducts->bindInt(':language_id', (int)$CLICSHOPPING_Language->getId());
- $Qproducts->execute();
- while ($Qproducts->fetch()) {
- if (MODE_B2B_B2C == 'True') {
- if (!in_array($Qproducts->valueInt('products_id'), $exclude)) {
- $Qprice = $CLICSHOPPING_Db->prepare('select customers_group_price,
- customers_group_id
- from :table_products_groups
- where products_id = :products_id
- $price_string = '';
- $sde = 0;
- //while(list($sdek,$sdev)=each($all_groups)){
- foreach ($all_groups as $sdek => $sdev) {
- if (!in_array($Qproducts->valueInt('products_id') . ":" . (int)$sdek, $exclude)) {
- if ($sde)
- $price_string .= ' - ';
- $price_string .= $sdev . ' : ' . $CLICSHOPPING_Currencies->format(isset($product_prices[$sdek]) ? $product_prices[$sdek] : $Qproducts->valueDecimal('products_price'));
- $sde = 1;
- }
- // Ajouter VISITOR_NAME . ': ' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) pour permettre d'afficher le prix des clients qui ne font pas partie d'un groupe B2B(
- $select_string .= '<option value="' . $Qproducts->valueInt('products_id') . '">' . HTML::outputProtected($Qproducts->value('products_name')) . ' (' . CLICSHOPPING::getDef('visitor_name') . ': ' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) . ' - ' . $price_string . ')</option>';
- }
- } else {
- if (!in_array($Qproducts->valueInt('products_id'), $exclude)) {
- $select_string .= '<option value="' . $Qproducts->valueInt('products_id') . '">' . HTML::outputProtected($Qproducts->value('products_name')) . ' (' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) . ')</option>';
- }
- }
- // ####### END #######
- {
- if (is_dir($source) === true) {
- $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::CHILD_FIRST);
- foreach ($files as $file) {
- if (in_array($file->getBasename(), array('.', '..')) !== true) {
- if ($file->isDir() === true) {
- rmdir($file->getPathName());
- } elseif (($file->isFile() === true) || ($file->isLink() === true)) {
- unlink($file->getPathname());
- }
- $fileTypes = ['php']; // Create an array of file types
- $found = []; // Traverse the folder, and add filename to $found array if type matches
- foreach ($contents as $item) {
- $fileInfo = pathinfo($item);
- if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
- $found[] = $item;
- }
- }
- if ($found) { // Check the $found array is not empty
- $QpaymentsNotAllowed->execute();
- $payments_not_allowed = $QpaymentsNotAllowed->fetch();
- $payments_unallowed = explode(",", $payments_not_allowed['group_payment_unallowed']);
- $clearance = (in_array($pay_check, $payments_unallowed)) ? true : false;
- } elseif ($CLICSHOPPING_Customer->isLoggedOn()) {
- $clearance = true;
- } else {
- $clearance = false;
- $Qpayments->execute();
- $payments_not_allowed = $Qpayments->fetch();
- $payments_unallowed = explode(",", $payments_not_allowed['group_payment_unallowed']);
- $clearance = (!in_array($pay_check, $payments_unallowed)) ? true : false;
- return $clearance;
- }
- }
- $QshippingNotAllowed->execute();
- $shipping_not_allowed = $QshippingNotAllowed->fetch();
- $shipping_unallowed = explode(",", $shipping_not_allowed['group_shipping_unallowed']);
- $shipping_clearance = (in_array($shipping_check, $shipping_unallowed)) ? true : false;
- } elseif ($CLICSHOPPING_Customer->isLoggedOn()) {
- $shipping_clearance = true;
- } else {
- $shipping_clearance = false;
- }
- $shipping_not_allowed = $Qshipping->fetch();
- if (!empty($shipping_not_allowed['group_payment_unallowed'])) {
- $shipping_unallowed = explode(',', $shipping_not_allowed['group_payment_unallowed']);
- $shipping_clearance = (!in_array($shipping_check, $shipping_unallowed)) ? true : false;
- } else {
- $shipping_clearance = false;
- }
- return $shipping_clearance;
- $string = '';
- if (is_array($array) && !empty($array)) {
- foreach ($array as $key => $value) {
- if (!in_array($key, $exclude)) {
- $string .= $key . '=' . $value . '&';
- }
- }
- $string = substr($string, 0, -1);
- $Qglobal->execute();
- $global = $Qglobal->fetch();
- if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] === $_SESSION['sessiontoken'])) {
- if (isset($_POST['product_global']) && is_numeric($_POST['product_global']) && in_array($_POST['product_global'], ['0', '1'])) {
- $product_global = (int)$_POST['product_global'];
- } else {
- $product_global = 0;
- }
- } elseif (count($products) > 0) {
- $products_parsed = [];
- foreach ($products as $value) {
- if (is_numeric($value) && !in_array($value, $products_parsed)) {
- $products_parsed[] = $value;
- }
- }
- if (count($products_parsed) > 0) {
- if (defined('MODULE_PAYMENT_INSTALLED') && !is_null(MODULE_PAYMENT_INSTALLED)) {
- $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
- $include_modules = [];
- if ((!is_null($module)) && (in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules, true) || in_array($module, $this->modules))) {
- $this->selected_module = $module;
- if (str_contains($module, '\\')) {
- $class = Apps::getModuleClass($module, 'Payment');
- if (($this->getCountPaymentModules() == 1) && (!isset($_SESSION['payment']) || ($_SESSION['payment'] != $include_modules[0]['class']))) {
- $_SESSION['payment'] = $include_modules[0]['class'];
- }
- if ((!is_null($module)) && (in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules, true) || in_array($module, $this->modules))) {
- if (str_contains($module, '\\')) {
- $CLICSHOPPING_PM = Registry::get('Payment_' . str_replace('\\', '_', $module));
- if (isset($CLICSHOPPING_PM->form_action_url)) {
- /**
- $code = $vendor . '\\' . $app . '\\' . $module;
- }
- }
- if (isset($code) && (in_array($code . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules) || in_array($code, $this->modules))) {
- if (str_contains($code, '\\')) {
- $class = Apps::getModuleClass($code, 'Shipping');
- $include_modules[] = [
- 'class' => $code,
- include($this->_directoryIncludes . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
- }
- }
- // exclude $modules_boxe and search if the modules exist
- if (is_numeric(array_search($group, $this->getReadModulesDefaultDirectories())) && $group != $modules_boxes) {
- $result = array_search($group, $this->getReadModulesDefaultDirectories());
- if (!is_null($result)) {
- if (is_file($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
- include($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
- }
- }
- // exclude $modules_boxe and search if the modules exist
- if (is_numeric(array_search($group, $this->getReadModulesDefaultDirectories())) && $group != $modules_boxes) {
- $result = array_search($group, $this->getReadModulesDefaultDirectories());
- if (!is_null($result)) {
- if (is_file($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
- include($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
- } elseif (is_file($this->getDefaultTemplateDirectory() . DIRECTORY_SEPARATOR . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
- $currentParent = $newParentId;
- $visitedCategories = [];
- // Traverse up the parent chain to check for circular reference
- while ($currentParent !== 0) {
- if (in_array($currentParent, $visitedCategories)) {
- return true; // Already visited, indicates circular reference
- }
- if ($currentParent === $categoryId) {
- return true; // Found the original category in the parent chain
- // Validate numeric fields
- if (isset($data['suppliers_country_id']) && !is_numeric($data['suppliers_country_id'])) {
- $errors[] = 'Country ID must be numeric';
- }
- if (isset($data['suppliers_status']) && !in_array($data['suppliers_status'], [0, 1])) {
- $errors[] = 'Supplier status must be 0 or 1';
- }
- if (isset($data['languages_id']) && !is_numeric($data['languages_id'])) {
- $errors[] = 'Language ID must be numeric';
- while ($file = $dir->read()) {
- if (!is_dir($backup_directory . $file)) {
- $ext = substr($file, strrpos($file, '.') + 1);
- if (in_array($ext, ['zip', 'sql', 'gz']) && !isset($contents[$ext])) {
- $contents[$ext] = $file;
- if ($ext !== 'sql') { // zip and gz (binaries) prioritised over sql (plain text)
- break;
- }
- }
- } else {
- $products_attributes_image = '';
- }
- $checked = \is_array($selected_attributes) && \in_array($value['id'], $selected_attributes) ? ' checked' : '';
- $chk_id = 'chk_' . $QproductsOptionsName->valueInt('products_options_id') . '_' . $value['id'];
- $products_options_content_display .= '<div class="col-md-12">';
- $products_options_content_display .= '<span class="ModuleProductsInfoOptionsPullDownMenu">';
- $products_options_content_display .= '<div class="custom-control custom-checkbox">';
Your project should not contain PHP files defining multiple classes
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/php.file_contains_more_than_one_class
Your project uses legacy callable syntax instead of first-class callable syntax 5
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/php.use_first_class_callable_syntax
- $config = [];
- foreach ($embeddingTables as $embeddingTable) {
- // Extract entity type: clic_products_embedding -> products
- $entityType = str_replace([$prefix, '_embedding'], '', $embeddingTable);
- $table = $prefix . $entityType;
- // Get ID column from EntityRegistry (reuse existing logic)
- $idColumn = $entityRegistry->getIdColumnForEntityType($entityType);
- $config = [];
- foreach ($embeddingTables as $embeddingTable) {
- // Extract entity type: clic_products_embedding -> products
- $entityType = str_replace([$prefix, '_embedding'], '', $embeddingTable);
- $table = $prefix . $entityType;
- // Get ID column from EntityRegistry (reuse existing logic)
- $idColumn = $entityRegistry->getIdColumnForEntityType($entityType);
- * @return string
- */
- private function normalizeTableName(string $fullTableName): string
- {
- $prefix = CLICSHOPPING::getConfig('db_table_prefix');
- return str_replace([$prefix, '_embedding'], '', $fullTableName);
- }
- /**
- * Attempts to extract entity_type from SQL query by analyzing table names
- *
- }
- $prefix = CLICSHOPPING::getConfig('db_table_prefix');
- // Remove prefix and '_embedding' suffix to get entity type
- $entityType = str_replace([$prefix, '_embedding'], '', $tableName);
- // Get ID column for this entity type
- $idColumn = $this->getIdColumnForEntityType($entityType);
- // Cache the result
- public function getEntityTypeForTable(string $tableName): string
- {
- $prefix = CLICSHOPPING::getConfig('db_table_prefix');
- // Remove prefix and '_embedding' suffix
- $entityType = str_replace([$prefix, '_embedding'], '', $tableName);
- return $entityType;
- }
- /**
Your project should use dedicated PHP string functions 6
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/php.use_string_function
- // Extract type from column info (now returns array with 'type' and 'comment')
- $type = is_array($columnInfo) ? $columnInfo['type'] : $columnInfo;
- // Detect ID columns that could be foreign keys
- if (preg_match('/_id$/', $column) && str_contains($type, 'int')) {
- $relatedTable = str_replace('_id', '', $column);
- // Validate related table name
- $safeRelatedTable = InputValidator::sanitizeIdentifier($relatedTable);
- if (in_array($fieldName, $skipFields, true)) {
- return null;
- }
- // Remove _id suffix for non-ID fields
- if ($fieldName !== 'id' && preg_match('/_id$/', $fieldName)) {
- return null;
- }
- return $fieldName;
- }
- * @param string $tableName Table name
- * @return bool True if junction table
- */
- private function isJunctionTable(string $tableName): bool
- {
- return preg_match('/_to_/', $tableName) === 1;
- }
- /**
- * Calculate cosine similarity between two vectors
- *
- while ($Qconfiguration->fetch()) {
- if ($Qconfiguration->hasValue('use_function') && !\is_null($Qconfiguration->value('use_function'))) {
- $use_function = $Qconfiguration->value('use_function');
- if (preg_match('/->/', $use_function)) {
- $class_method = explode('->', $use_function);
- if (!\is_object($class_method[0])) {
- include_once('Core/classes/' . $class_method[0] . '.php');
- ${$class_method[0]} = new $class_method[0]();
- while ($Qconfiguration->fetch()) {
- if ($Qconfiguration->hasValue('use_function') && !\is_null($Qconfiguration->value('use_function'))) {
- $use_function = $Qconfiguration->value('use_function');
- if (preg_match('/->/', $use_function)) {
- $class_method = explode('->', $use_function);
- if (!\is_object($class_method[0])) {
- include_once('Core/classes/' . $class_method[0] . '.php');
- $class_method[0] = new $class_method[0]();
- // Also clear old embedding cache files from root cache directory (excluding embedding_search)
- $oldEmbeddingFiles = glob($generalCacheDir . 'embedding_*.cache');
- if ($oldEmbeddingFiles) {
- // Filter out embedding_search files
- $oldEmbeddingFiles = array_filter($oldEmbeddingFiles, function($file) {
- return strpos(basename($file), 'embedding_search_') !== 0;
- });
- $cleared = 0;
- foreach ($oldEmbeddingFiles as $file) {
- if (unlink($file)) {
gyakutsuki