1 | <?php |
||
12 | class Stencil_Upgrader { |
||
13 | |||
14 | /** |
||
15 | * Check for upgrades once a day. |
||
16 | */ |
||
17 | const DAY_TIMESTAMP = 86400; // 60*60*24 = one da |
||
18 | |||
19 | /** |
||
20 | * Packages that can be upgraded |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $upgrades = array(); |
||
25 | |||
26 | /** |
||
27 | * Installables instance. |
||
28 | * |
||
29 | * @var Stencil_Installables |
||
30 | */ |
||
31 | protected $installables; |
||
32 | |||
33 | /** |
||
34 | * * Transient name to use for periodical upgrade checks. |
||
35 | */ |
||
36 | const TRANSIENT_NAME = 'stencil_upgrader_upgrader:last_check_timestamp'; |
||
37 | |||
38 | /** |
||
39 | * Stencil_Upgrader constructor. |
||
40 | */ |
||
41 | public function __construct() { |
||
61 | |||
62 | /** |
||
63 | * Get transient name to use. |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | protected function get_option_name() { |
||
70 | |||
71 | /** |
||
72 | * Get the periodically check timeout. |
||
73 | * |
||
74 | * @return int |
||
75 | */ |
||
76 | protected function get_upgrade_timeout() { |
||
79 | |||
80 | /** |
||
81 | * Get available upgrades. |
||
82 | * |
||
83 | * @return array |
||
84 | */ |
||
85 | public function get_upgrades() { |
||
88 | |||
89 | /** |
||
90 | * Check for all upgrades |
||
91 | * |
||
92 | * @return bool |
||
93 | */ |
||
94 | public function check_for_upgrades() { |
||
108 | |||
109 | /** |
||
110 | * Upgrade packages |
||
111 | */ |
||
112 | public function upgrade_all() { |
||
121 | |||
122 | /** |
||
123 | * Save upgrade information to the database. |
||
124 | */ |
||
125 | private function save_upgrade_information() { |
||
135 | } |
||
136 |