distantnative / search-for-kirby

Kirby 3 plugin for adding a search index (sqlite or Algolia).
43 stars 3 forks source link

Custom folder setup #11

Closed iskrisis closed 4 years ago

iskrisis commented 4 years ago

Not sure how to go around this but i use custom "storage" folder for config and accounts. So the when running the ./site/plugins/search/index this is not taken into account. This is not the case for the panel rebuild index field but its confusing because the panel field wasn't giving me error messages even though it errored.

distantnative commented 4 years ago

@iskrisis I am not sure I got completely the issue:

iskrisis commented 4 years ago

Sorry for bad explanation. In the CLI script Kirby is initialized https://github.com/distantnative/search-for-kirby/blob/139811cb2ed4b93a47c907baf61cf269ea5da034/index#L16 without any config meaning none of the settings will be visible in https://getkirby.com/docs/guide/configuration#custom-folder-setup if you change location of config. It always expects default config/config.php

Now there is probably no other solution than to edit the index cli script but that could kind of suck if you gonna update it with composer.

Sidenote maybe the cli script shouldn't be called index. I understand it is to index db but now you have index and index.php completely unrelated things. I can imagine people setting their cron pointing it to index.php. Maybe indexdb.php instead of index?

distantnative commented 4 years ago

I will move the script to bin/index. And yes, you will have to create your own script for custom folder setups. I will add a note. I would suggest to create your custom script outside the plugin folder to prevent it overwritten by updates. Since it's only used when called by you (manually or cron), place it wherever you want.