{"id":21900675,"url":"https://github.com/php-cmsig/seal-read-write-adapter","last_synced_at":"2025-04-15T19:54:12.339Z","repository":{"id":64998547,"uuid":"580550537","full_name":"PHP-CMSIG/seal-read-write-adapter","owner":"PHP-CMSIG","description":"The ReadWriteAdapter allows to use one adapter instance for reading and one for writing. Part of the https://github.com/php-cmsig/search project. READ-ONLY Repository","archived":false,"fork":false,"pushed_at":"2025-03-19T16:36:11.000Z","size":196,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"0.7","last_synced_at":"2025-04-15T19:54:05.529Z","etag":null,"topics":["cmsig","php","seal-adapter","seal-php-adapter"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PHP-CMSIG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["alexander-schranz"],"custom":["https://paypal.me/L91"]}},"created_at":"2022-12-20T20:54:01.000Z","updated_at":"2025-03-18T11:27:00.000Z","dependencies_parsed_at":"2023-01-13T15:11:02.225Z","dependency_job_id":"7afc9258-1afa-4633-88fe-c27cae15f412","html_url":"https://github.com/PHP-CMSIG/seal-read-write-adapter","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"0168162f400d82c1fc453a8c068a7fd0dc90d46c"},"previous_names":["php-cmsig/seal-read-write-adapter"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHP-CMSIG%2Fseal-read-write-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHP-CMSIG%2Fseal-read-write-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHP-CMSIG%2Fseal-read-write-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHP-CMSIG%2Fseal-read-write-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PHP-CMSIG","download_url":"https://codeload.github.com/PHP-CMSIG/seal-read-write-adapter/tar.gz/refs/heads/0.7","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249145296,"owners_count":21219966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmsig","php","seal-adapter","seal-php-adapter"],"created_at":"2024-11-28T15:09:30.616Z","updated_at":"2025-04-15T19:54:12.333Z","avatar_url":"https://github.com/PHP-CMSIG.png","language":"PHP","funding_links":["https://github.com/sponsors/alexander-schranz","https://paypal.me/L91"],"categories":[],"sub_categories":[],"readme":"\u003e **Note**:\n\u003e This is part of the `cmsig/search` project create issues in the [main repository](https://github.com/php-cmsig/search).\n\n---\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg alt=\"SEAL Logo with an abstract seal sitting on a telescope.\" src=\"https://avatars.githubusercontent.com/u/120221538?s=400\u0026v=6\" width=\"200\" height=\"200\"\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003eLogo created by \u003ca href=\"https://cargocollective.com/meinewilma\"\u003eMeine Wilma\u003c/a\u003e\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003eSEAL \u003cbr /\u003e Read Write Adapter\u003c/h1\u003e\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\nThe `ReadWriteAdapter` allows to use one adapter instance for reading\nand one for writing. This is useful if you want to reindex something\nwithout a downtime.\n\n\u003e **Note**:\n\u003e This project is heavily under development and any feedback is greatly appreciated.\n\n## Installation\n\nUse [composer](https://getcomposer.org/) for install the package:\n\n```bash\ncomposer require cmsig/seal cmsig/seal-read-write-adapter\n```\n\n## Usage\n\nTo use the adapter an instance of `ReadWriteAdapter` need to be created\nwhich get a `$readAdapter` and `$writeAdapter` which are instances of the\n`AdapterInterface`.\n\nThe following code shows how to create an Engine using this Adapter:\n\n```php\n\u003c?php\n\nuse CmsIg\\Seal\\Adapter\\Elasticsearch\\ElasticsearchAdapter;\nuse CmsIg\\Seal\\Adapter\\ReadWrite\\ReadWriteAdapter;\nuse CmsIg\\Seal\\Engine;\n\n$readAdapter = new ElasticsearchAdapter(/* .. */); // can be any adapter\n$writeAdapter = new ElasticsearchAdapter(/* .. */); // can be any adapter\n\n$engine = new Engine(\n    new ReadWriteAdapter(\n        $readAdapter,\n        $writeAdapter\n    ),\n    $schema,\n);\n```\n\nVia DSN for your favorite framework:\n\n```env\nmulti://readAdapter?adapters[]=writeAdapter\nread-write://readAdapter?write=multiAdapter\n```\n\n\u003e **Note**\n\u003e Read a document and partial update it based on the read document should be avoided\n\u003e when using this adapter, as the read document could already be outdated. So always\n\u003e fully update the document and never do based on read documents.\n\u003e Have a look at the `MultiAdapter` to write into read and write adapter.\n\n## Authors\n\n- [Alexander Schranz](https://github.com/alexander-schranz/)\n- [The Community Contributors](https://github.com/php-cmsig/search/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-cmsig%2Fseal-read-write-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-cmsig%2Fseal-read-write-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-cmsig%2Fseal-read-write-adapter/lists"}