sarziv/clean-tool

该包的最新版本(1)没有可用的许可证信息。

1 2023-04-19 07:07 UTC

This package is auto-updated.

Last update: 2024-09-23 06:43:25 UTC


README

安装

git clone {repository}
cd {folder}
composer install
cp ./src/Examples/.credentials.php ./src/Examples/credentials.php
php {location}/src/Examples/runLocally.php

本地开发

凭证

  • ConfigurationId - 助手的配置ID
  • Domain - PM系统域
  • Token - 通过 AccessToken 或 PM Storage 生成

配置ID可以在以下位置找到

  • 网络(F12),然后打开配置助手
  • GET {{plentymarketHost}}/rest/PlentymarketsShopwareCore/test?model=Configuration

检查记录

示例中的最后一行代码是用于链式任务 $tasker->

<?php

namespace ShopwareCheckTool;
require_once('../../vendor/autoload.php');

use ShopwareCheckTool\Download\DownloadMarketplace;use ShopwareCheckTool\Models\Marketplace;use ShopwareCheckTool\Requests\Shopware;use ShopwareCheckTool\Task\Tasker;

$credentials = include __DIR__ . '/credentials.php'; //files for credentials

$marketplace = new Marketplace();
$marketplace->setDomain($credentials['domain']);
$marketplace->setToken($credentials['token']);

$downloadMarketplace = new DownloadMarketplace($marketplace, true);
$downloadMarketplace->download();

$shopware = new Shopware($credentials['configurationId']);
$tasker = new Tasker($shopware);

$tasker->all()->allImages();

删除记录

通常不应修改此文件,因为它使用任务生成的文件。删除记录只能在检查之后进行,因为它们会生成无效的ID日志。

<?php

namespace ShopwareCheckTool;
require_once('../../vendor/autoload.php');

use ShopwareCheckTool\Models\Marketplace;
use ShopwareCheckTool\Requests\Shopware;
use ShopwareCheckTool\Task\Tasker;

$credentials = include __DIR__ . '/credentials.php'; //files for credentials

$marketplace = new Marketplace();
$marketplace->setDomain($credentials['domain']);
$marketplace->setToken($credentials['token']);

$shopware = new Shopware($credentials['configurationId']);
$tasker = new Tasker($shopware);
$tasker->remove($marketplace);

任务

  • AttributeTask - 从V1.0.9>的属性
  • AttributeReworkTask - 从V1.0.9<的属性
  • CategoryTask - 分类检查
  • DeliveryTask - 单位检查
  • ManufacturerTask - 厂商检查
  • MeasurementTask - 度量检查
  • PropertyTask - 属性检查
  • TagTask - 标签检查
  • ImagesTask - 图片检查
  • ImageDeepTask - 检查图片、媒体文件、缩略图
  • ImageDeepInvalidTask - 删除无效的媒体文件
  • ProductVisibilityTask - 产品可见性检查
  • ProductConfiguratorTask - 产品配置检查
  • ShopwareErrorDuplicateProductNumberTask - 检查Shopware错误文件并按产品编号删除产品

日志

    └── Logs
        ├── Completed
        │   └── {host}
        │         ├── *.log files - Generated with tasks
        │         └── Invalid
        │             └── Inavlid *.log files - Checked with removing tasks
        ├── Downloaded
        │   └── Plugin files for the current scan
        └── *.log - General log