Skip to content

Commit 0780d62

Browse files
use config file for load mapping
1 parent f930d08 commit 0780d62

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

api/app/Rules/FormPropertyLogicRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class FormPropertyLogicRule implements DataAwareRule, ValidationRule
2323
public static function getConditionMapping()
2424
{
2525
if (self::$conditionMappingData === null) {
26-
self::$conditionMappingData = json_decode(file_get_contents(resource_path('data/open_filters.json')), true);
26+
self::$conditionMappingData = config('opnform.condition_mapping');
2727
}
2828
return self::$conditionMappingData;
2929
}

api/config/opnform.php

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
'template_editor_emails' => explode(',', env('TEMPLATE_EDITOR_EMAILS') ?? ''),
77
'extra_pro_users_emails' => explode(',', env('EXTRA_PRO_USERS_EMAILS') ?? ''),
88
'show_official_templates' => env('SHOW_OFFICIAL_TEMPLATES', true),
9+
'condition_mapping' => json_decode(file_get_contents(resource_path('data/open_filters.json')), true),
910
];

api/vapor.yml

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ environments:
2525
- "php artisan disposable:update"
2626
deploy:
2727
- "php artisan migrate --force"
28+
- "php artisan optimize"
2829
firewall:
2930
rate-limit: 1000
3031
timeout: 60
@@ -42,6 +43,7 @@ environments:
4243
- "php artisan disposable:update"
4344
deploy:
4445
- "php artisan migrate --force"
46+
- "php artisan optimize"
4547
firewall:
4648
rate-limit: 1000
4749
timeout: 60

docker/php-fpm-entrypoint

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ main() {
1010
prep_storage
1111
wait_for_db
1212
apply_db_migrations
13-
run_init_project
13+
run_init_project
14+
optimize_application
1415
run_server "$@"
1516
fi
1617
}
@@ -57,6 +58,11 @@ run_init_project() {
5758
./artisan app:init-project
5859
}
5960

61+
optimize_application() {
62+
echo "Optimizing application"
63+
./artisan optimize
64+
}
65+
6066
run_server() {
6167
echo "Starting server $@"
6268
exec "$@"

0 commit comments

Comments
 (0)