PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / 6.0.13
Kirki – Freeform Page Builder, Website Builder & Customizer v6.0.13
6.1.1 6.1.0 6.0.14 6.0.13 6.0.12 6.0.11 6.0.10 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.19 4.0.20 4.0.21 4.0.22 4.0.23 4.0.24 4.1 4.2.0 5.0.0 5.1.0 5.1.1 5.2.0 5.2.1 5.2.2 5.2.3 6.0.0 trunk 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.1.0 3.1.1 3.1.2
kirki / libraries / framework / Database / Migrations / MigrationRepository.php
kirki / libraries / framework / Database / Migrations Last commit date
MigrationRepository.php 3 weeks ago Migrator.php 3 weeks ago
MigrationRepository.php
79 lines
1 <?php
2
3 /**
4 * Persists applied migration class names in WordPress options and reads registered migrations from container tags.
5 * Tracks which migrations have run and supports rollback state queries.
6 * Bridges the migrator with WordPress option storage.
7 *
8 * @package Framework
9 * @subpackage Database\Migrations
10 * @since 1.0.0
11 */
12 namespace Kirki\Framework\Database\Migrations;
13
14 \defined('ABSPATH') || exit;
15 use Kirki\Framework\Constants\OptionKeys;
16 use Kirki\Framework\Supports\Facades\Option;
17 use function Kirki\Framework\app;
18 class MigrationRepository
19 {
20 /**
21 * Get the previous migrations.
22 *
23 * @return array
24 *
25 * @since 1.0.0
26 */
27 public function get_previous_migrations()
28 {
29 return Option::get(OptionKeys::MIGRATIONS, []);
30 }
31 /**
32 * Update the migrations.
33 *
34 * @param array $migrations The migrations.
35 *
36 * @return void
37 *
38 * @since 1.0.0
39 */
40 public function update_migrations(array $migrations)
41 {
42 Option::set(OptionKeys::MIGRATIONS, $migrations);
43 }
44 /**
45 * Remove the migrations.
46 *
47 * @return void
48 *
49 * @since 1.0.0
50 */
51 public function remove_migrations()
52 {
53 Option::delete(OptionKeys::MIGRATIONS);
54 }
55 /**
56 * Get the registered migrations.
57 *
58 * @return array
59 *
60 * @since 1.0.0
61 */
62 public function get_registered_migrations()
63 {
64 return app()->tagged('app.migrations');
65 }
66 /**
67 * Check if the rollback is enabled.
68 *
69 * @return bool
70 *
71 * @since 1.0.0
72 */
73 public function is_rollback_enabled()
74 {
75 return \true;
76 // @todo: will be handled later
77 }
78 }
79