Skip to content

Development

Bruno Casali edited this page Dec 19, 2022 · 2 revisions

How to use a git version from meilisearch-php?

Sometimes you want to develop a feature/fix from both libraries meilisearch-php and meilisearch-symfony, here is how you can setup your local environment to use that:

# composer.json

  "require": {
    "php": "^7.4|^8.0",
    "ext-json": "*",
    "doctrine/doctrine-bundle": "^2.4",
    "illuminate/collections": "^8.47",
-   "meilisearch/meilisearch-php": "^0.24.0",
+   "meilisearch/meilisearch-php": "dev-main as 1.2.3",
    "symfony/filesystem": "^4.4 || ^5.0 || ^6.0",
    "symfony/property-access": "^4.4 || ^5.0 || ^6.0",
    "symfony/serializer": "^4.4 || ^5.0 || ^6.0"
  },
+  "repositories": [
+    {
+      "type": "vcs",
+      "url": "/home/meili-php"
+    }
+  ],


# docker-compose.yml

  environment:
    - MEILISEARCH_HOST=http://meilisearch:7700
  depends_on:
    - meilisearch
  links:
    - meilisearch
  volumes:
    - ./:/home/package:rw,cached
+   - ../meilisearch-php/:/home/meili-php

Restart your container, remove the composer.lock and run composer install.

How to use a local directory version from meilisearch-symfony?

# composer.json

  "require": {
    "php": "^7.4|^8.0",
    "ext-json": "*",
    "doctrine/doctrine-bundle": "^2.4",
    "illuminate/collections": "^8.47",
-   "meilisearch/meilisearch-php": "^0.24.0",
+   "meilisearch/meilisearch-php": "@dev",
    "symfony/filesystem": "^4.4 || ^5.0 || ^6.0",
    "symfony/property-access": "^4.4 || ^5.0 || ^6.0",
    "symfony/serializer": "^4.4 || ^5.0 || ^6.0"
  },
+  "repositories": [
+    {
+      "type": "path",
+      "url": "/home/meili-symfony"
+    }
+  ],


# docker-compose.yml

  environment:
    - MEILISEARCH_HOST=http://meilisearch:7700
  depends_on:
    - meilisearch
  links:
    - meilisearch
  volumes:
    - ./:/home/package:rw,cached
+   - ../meilisearch-symfony/:/home/meili-symfony

Restart your container, remove the composer.lock and run composer install.