ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
@@ -0,0 +1,61 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Indexer\Model\Config;
use Magento\Framework\Exception\ConfigurationMismatchException;
class ConverterTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \Magento\Framework\Indexer\Config\Converter
*/
protected $model;
protected function setUp(): void
{
$this->model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create(\Magento\Framework\Indexer\Config\Converter::class);
}
public function testConverter()
{
$pathFiles = __DIR__ . '/_files';
$expectedResult = require $pathFiles . '/result.php';
$path = $pathFiles . '/indexer.xml';
$domDocument = new \DOMDocument();
$domDocument->load($path);
$result = $this->model->convert($domDocument);
$this->assertEquals($expectedResult, $result);
}
/**
* @return void
*/
public function testConverterWithCircularDependency()
{
$pathFiles = __DIR__ . '/_files';
$path = $pathFiles . '/indexer_with_circular_dependency.xml';
$domDocument = new \DOMDocument();
$domDocument->load($path);
$this->expectException(ConfigurationMismatchException::class);
$this->expectExceptionMessage('Circular dependency references from');
$this->model->convert($domDocument);
}
/**
* @return void
*/
public function testConverterWithDependencyOnNotExistingIndexer()
{
$pathFiles = __DIR__ . '/_files';
$path = $pathFiles . '/dependency_on_not_existing_indexer.xml';
$domDocument = new \DOMDocument();
$domDocument->load($path);
$this->expectException(ConfigurationMismatchException::class);
$this->expectExceptionMessage("Dependency declaration 'indexer_4' in 'indexer_2' to the non-existing indexer.");
$this->model->convert($domDocument);
}
}
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd">
<indexer id="indexer_2" view_id="indexer_2"
class="Magento\Module\IndexerSecond">
<dependencies>
<indexer id="indexer_4" />
</dependencies>
</indexer>
<indexer id="indexer_3" view_id="indexer_3"
class="Magento\Module\IndexerThird">
</indexer>
</config>
@@ -0,0 +1,48 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd">
<indexer id="catalogsearch_fulltext" view_id="catalogsearch_fulltext"
class="Magento\CatalogSearch\Model\Indexer\Fulltext"
primary="first">
<title translate="true">Catalog Search</title>
<description translate="true">Rebuild Catalog product fulltext search index</description>
<fieldset name="first" source="MagentoModule\ServiceClassOrRepositoryClass"
provider="Magento\Indexer\Model\Fieldset\ProductFieldset">
<field name="title_alias" origin="title" xsi:type="searchable" dataType="text">
<filter class="Magento\Framework\Search\Index\Filter\LowercaseFilter"/>
</field>
<field name="identifier" xsi:type="filterable" handler="Magento\Framework\Search\Index\Handler"/>
</fieldset>
<fieldset name="second" source="MagentoModule\ServiceClassOrRepositoryClass">
<reference fieldset="first" from="id_field" to="second_entity_id"/>
<field name="title" xsi:type="searchable"/>
</fieldset>
<saveHandler class="Magento\Cms\Model\Indexer\StoreResource"/>
<structure class="Magento\Cms\Model\Indexer\IndexStructure"/>
<dependencies>
<indexer id="indexer_2"/>
</dependencies>
</indexer>
<indexer id="indexer_2" view_id="indexer_2"
class="Magento\Module\IndexerSecond">
<dependencies>
<indexer id="indexer_4" />
</dependencies>
</indexer>
<indexer id="indexer_3" view_id="indexer_3"
class="Magento\Module\IndexerThird">
</indexer>
<indexer id="indexer_4" view_id="indexer_4"
class="Magento\Module\IndexerFourth">
</indexer>
</config>
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd">
<indexer id="catalogsearch_fulltext" view_id="catalogsearch_fulltext"
class="Magento\CatalogSearch\Model\Indexer\Fulltext"
primary="first">
<title translate="true">Catalog Search</title>
<description translate="true">Rebuild Catalog product fulltext search index</description>
<fieldset name="first" source="MagentoModule\ServiceClassOrRepositoryClass"
provider="Magento\Indexer\Model\Fieldset\ProductFieldset">
<field name="title_alias" origin="title" xsi:type="searchable" dataType="text">
<filter class="Magento\Framework\Search\Index\Filter\LowercaseFilter"/>
</field>
<field name="identifier" xsi:type="filterable" handler="Magento\Framework\Search\Index\Handler"/>
</fieldset>
<fieldset name="second" source="MagentoModule\ServiceClassOrRepositoryClass">
<reference fieldset="first" from="id_field" to="second_entity_id"/>
<field name="title" xsi:type="searchable"/>
</fieldset>
<saveHandler class="Magento\Cms\Model\Indexer\StoreResource"/>
<structure class="Magento\Cms\Model\Indexer\IndexStructure"/>
<dependencies>
<indexer id="indexer_2"/>
</dependencies>
</indexer>
<indexer id="indexer_2" view_id="indexer_2"
class="Magento\Module\IndexerSecond">
<dependencies>
<indexer id="indexer_4" />
</dependencies>
</indexer>
<indexer id="indexer_3" view_id="indexer_3"
class="Magento\Module\IndexerThird">
</indexer>
<indexer id="indexer_4" view_id="indexer_4"
class="Magento\Module\IndexerFourth">
<dependencies>
<indexer id="catalogsearch_fulltext" />
</dependencies>
</indexer>
</config>
@@ -0,0 +1,107 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
return [
'indexer_4' => [
'indexer_id' => 'indexer_4',
'view_id' => 'indexer_4',
'primary' => null,
'action_class' => 'Magento\Module\IndexerFourth',
'shared_index' => null,
'title' => '',
'description' => '',
'dependencies' => [],
],
'indexer_2' => [
'indexer_id' => 'indexer_2',
'view_id' => 'indexer_2',
'primary' => null,
'action_class' => 'Magento\Module\IndexerSecond',
'shared_index' => null,
'title' => '',
'description' => '',
'fieldsets' => [],
'dependencies' => [
'indexer_4'
],
],
'catalogsearch_fulltext' => [
'indexer_id' => 'catalogsearch_fulltext',
'shared_index' => null,
'primary' => 'first',
'view_id' => 'catalogsearch_fulltext',
'action_class' => \Magento\CatalogSearch\Model\Indexer\Fulltext::class,
'title' => __('Catalog Search'),
'description' => __('Rebuild Catalog product fulltext search index'),
'fieldsets' => [
[
'source' => 'MagentoModule\\ServiceClassOrRepositoryClass',
'name' => 'first',
'provider' => \Magento\Indexer\Model\Fieldset\ProductFieldset::class,
'fields' => [
'title_alias' => [
'name' => 'title_alias',
'handler' => null,
'origin' => 'title',
'dataType' => 'text',
'type' => 'searchable',
'filters' =>
[
0 => \Magento\Framework\Search\Index\Filter\LowercaseFilter::class,
],
],
'identifier' => [
'name' => 'identifier',
'handler' => \Magento\Framework\Search\Index\Handler::class,
'origin' => 'identifier',
'dataType' => null,
'type' => 'filterable',
'filters' =>
[],
],
],
],
[
'source' => 'MagentoModule\\ServiceClassOrRepositoryClass',
'name' => 'second',
'provider' => null,
'fields' => [
'title' =>
[
'name' => 'title',
'handler' => null,
'origin' => 'title',
'dataType' => null,
'type' => 'searchable',
'filters' =>
[],
],
],
'references' => [
'first' =>
[
'fieldset' => 'first',
'from' => 'id_field',
'to' => 'second_entity_id',
]
],
],
],
'saveHandler' => \Magento\Cms\Model\Indexer\StoreResource::class,
'structure' => \Magento\Cms\Model\Indexer\IndexStructure::class,
'dependencies' => ['indexer_2'],
],
'indexer_3' => [
'indexer_id' => 'indexer_3',
'view_id' => 'indexer_3',
'primary' => null,
'action_class' => 'Magento\Module\IndexerThird',
'shared_index' => null,
'title' => '',
'description' => '',
'dependencies' => [],
],
];