|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* |
|
4
|
|
|
* PayPal Donation extension for the phpBB Forum Software package. |
|
5
|
|
|
* |
|
6
|
|
|
* @copyright (c) 2015 Skouat |
|
7
|
|
|
* @license GNU General Public License, version 2 (GPL-2.0) |
|
8
|
|
|
* |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace skouat\ppde\migrations\v31x; |
|
12
|
|
|
|
|
13
|
|
|
class v310_m3_currency_data extends \phpbb\db\migration\migration |
|
14
|
|
|
{ |
|
15
|
|
|
public static function depends_on() |
|
16
|
|
|
{ |
|
17
|
|
|
return array('\skouat\ppde\migrations\v31x\v310_m2_data'); |
|
18
|
|
|
} |
|
19
|
|
|
|
|
20
|
|
|
public function update_data() |
|
21
|
|
|
{ |
|
22
|
|
|
return array( |
|
23
|
|
|
// Run custom actions |
|
24
|
|
|
array('custom', array(array(&$this, 'add_ppde_currency_data'))), |
|
25
|
|
|
); |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* Add initial currency data to the database |
|
30
|
|
|
* |
|
31
|
|
|
* @return null |
|
32
|
|
|
* @access public |
|
33
|
|
|
*/ |
|
34
|
|
|
public function add_ppde_currency_data() |
|
35
|
|
|
{ |
|
36
|
|
|
// Define data |
|
37
|
|
|
$currency_data = array( |
|
38
|
|
|
array( |
|
39
|
|
|
'currency_name' => 'U.S. Dollar', |
|
40
|
|
|
'currency_iso_code' => 'USD', |
|
41
|
|
|
'currency_symbol' => '$', |
|
42
|
|
|
'currency_enable' => true, |
|
43
|
|
|
'currency_on_left' => true, |
|
44
|
|
|
'currency_order' => 1, |
|
45
|
|
|
), |
|
46
|
|
|
array( |
|
47
|
|
|
'currency_name' => 'Euro', |
|
48
|
|
|
'currency_iso_code' => 'EUR', |
|
49
|
|
|
'currency_symbol' => '€', |
|
50
|
|
|
'currency_enable' => true, |
|
51
|
|
|
'currency_on_left' => false, |
|
52
|
|
|
'currency_order' => 2, |
|
53
|
|
|
), |
|
54
|
|
|
array( |
|
55
|
|
|
'currency_name' => 'Australian Dollar', |
|
56
|
|
|
'currency_iso_code' => 'AUD', |
|
57
|
|
|
'currency_symbol' => '$', |
|
58
|
|
|
'currency_enable' => true, |
|
59
|
|
|
'currency_on_left' => true, |
|
60
|
|
|
'currency_order' => 3, |
|
61
|
|
|
), |
|
62
|
|
|
array( |
|
63
|
|
|
'currency_name' => 'Canadian Dollar', |
|
64
|
|
|
'currency_iso_code' => 'CAD', |
|
65
|
|
|
'currency_symbol' => '$', |
|
66
|
|
|
'currency_enable' => true, |
|
67
|
|
|
'currency_on_left' => true, |
|
68
|
|
|
'currency_order' => 4, |
|
69
|
|
|
), |
|
70
|
|
|
array( |
|
71
|
|
|
'currency_name' => 'Hong Kong Dollar', |
|
72
|
|
|
'currency_iso_code' => 'HKD', |
|
73
|
|
|
'currency_symbol' => '$', |
|
74
|
|
|
'currency_enable' => true, |
|
75
|
|
|
'currency_on_left' => true, |
|
76
|
|
|
'currency_order' => 5, |
|
77
|
|
|
), |
|
78
|
|
|
array( |
|
79
|
|
|
'currency_name' => 'Pound Sterling', |
|
80
|
|
|
'currency_iso_code' => 'GBP', |
|
81
|
|
|
'currency_symbol' => '£', |
|
82
|
|
|
'currency_enable' => true, |
|
83
|
|
|
'currency_on_left' => true, |
|
84
|
|
|
'currency_order' => 6, |
|
85
|
|
|
), |
|
86
|
|
|
array( |
|
87
|
|
|
'currency_name' => 'Yen', |
|
88
|
|
|
'currency_iso_code' => 'JPY', |
|
89
|
|
|
'currency_symbol' => '¥', |
|
90
|
|
|
'currency_enable' => true, |
|
91
|
|
|
'currency_on_left' => false, |
|
92
|
|
|
'currency_order' => 7, |
|
93
|
|
|
), |
|
94
|
|
|
); |
|
95
|
|
|
|
|
96
|
|
|
// Insert data |
|
97
|
|
|
$this->db->sql_multi_insert($this->table_prefix . 'ppde_currency', $currency_data); |
|
98
|
|
|
} |
|
99
|
|
|
} |
|
100
|
|
|
|