PHP code example of cmsig / seal-spiral-bridge

1. Go to this page and download the library: Download cmsig/seal-spiral-bridge library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cmsig / seal-spiral-bridge example snippets




// app/config/cmsig_seal.php

return [
    'schemas' => [
        'app' => [
            'dir' => 'app/schemas',
        ],
    ],
    'engines' => [
        'default' => [
            'adapter' => 'meilisearch://127.0.0.1:7700',
        ],
    ],
];



// app/config/cmsig_seal.php

return [
    'schemas' => [
        'app' => [
            'dir' => 'app/schemas/app',
            'engine' => 'meilisearch',
        ],
        'other' => [
            'dir' => 'app/schemas/other',
            'engine' => 'algolia',
        ],
    ],
    'engines' => [
        'algolia' => [
            'adapter' => 'algolia://' . env('ALGOLIA_APPLICATION_ID') . ':' . env('ALGOLIA_ADMIN_API_KEY'),
        ],
        'elasticsearch' => [
            'adapter' => 'elasticsearch://127.0.0.1:9200',
        ],
        'meilisearch' => [
            'adapter' => 'meilisearch://127.0.0.1:7700',
        ],
        'memory' => [
            'adapter' => 'memory://',
        ],
        'opensearch' => [
            'adapter' => 'opensearch://127.0.0.1:9200',
        ],
        'redisearch' => [
            'adapter' => 'redis://[email protected]:6379',
        ],
        'solr' => [
            'adapter' => 'solr://127.0.0.1:8983',
        ],
        'typesense' => [
            'adapter' => 'typesense://[email protected]:8108',
        ],

        // ...
        'multi' => [
            'adapter' => 'multi://elasticsearch?adapters[]=opensearch',
        ],
        'read-write' => [
            'adapter' => 'read-write://elasticsearch?write=multi',
        ],
    ],
    'index_name_prefix' => '',
    'reindex_providers' => [
        \App\Search\BlogReindexProvider::class,
    ],
];

class Some {
    public function __construct(
        private readonly \CmsIg\Seal\EngineInterface $engine,
    ) {
    }
}

class Some {
    private Engine $engine;

    public function __construct(
        private readonly \CmsIg\Seal\EngineRegistry $engineRegistry,
    ) {
        $this->engine = $this->engineRegistry->get('algolia');
    }
}
bash
php app.php cmsig:seal:index-create --help
bash
php app.php cmsig:seal:index-drop --help
bash
php app.php cmsig:seal:reindex --help