PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / Donations / Migrations / SetAutomaticFormattingOption.php

SetAutomaticFormattingOption.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/Donations/Migrations/SetAutomaticFormattingOption.php

37 lines 753 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Give\Donations\Migrations;
6
7 use Give\Framework\Migrations\Contracts\Migration;
8 use NumberFormatter;
9
10 /**
11 * Sets the initial automatic formatting option based on whether the intl extension is installed.
12 *
13 * @since 2.24.2
14 */
15 class SetAutomaticFormattingOption extends Migration
16 {
17 public static function id(): string
18 {
19 return 'set_automatic_formatting_option';
20 }
21
22 public static function timestamp(): int
23 {
24 return strtotime('2022-01-20');
25 }
26
27 /**
28 * @inheritDoc
29 */
30 public function run()
31 {
32 $hasIntlExtension = class_exists(NumberFormatter::class);
33
34 give_update_option('auto_format_currency', $hasIntlExtension ? 'on' : false);
35 }
36 }
37