Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
Wp Migrations
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
Library
Wp Migrations
Commits
88deb535
Verified
Commit
88deb535
authored
2 years ago
by
Bartek Jaskulski
Browse files
Options
Downloads
Plain Diff
Merge branch 'devel'
parents
d9efdece
cb0dc2a9
No related branches found
Branches containing commit
Tags
1.0.0
Tags containing commit
No related merge requests found
Pipeline
#8986
failed with stages
in 27 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
composer.lock
+18
-18
18 additions, 18 deletions
composer.lock
src/WpdbMigrator.php
+16
-0
16 additions, 0 deletions
src/WpdbMigrator.php
with
34 additions
and
18 deletions
composer.lock
+
18
−
18
View file @
88deb535
...
...
@@ -107,16 +107,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.
6.8
",
"version": "1.
7.14
",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "
d76498c5531232cb8386ceb6004f7e013138d3ba
"
"reference": "
e6f145f196a59c7ca91ea926c87ef3d936c4305f
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/
d76498c5531232cb8386ceb6004f7e013138d3ba
",
"reference": "
d76498c5531232cb8386ceb6004f7e013138d3ba
",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/
e6f145f196a59c7ca91ea926c87ef3d936c4305f
",
"reference": "
e6f145f196a59c7ca91ea926c87ef3d936c4305f
",
"shasum": ""
},
"require": {
...
...
@@ -142,7 +142,7 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.
6.8
"
"source": "https://github.com/phpstan/phpstan/tree/1.
7.14
"
},
"funding": [
{
...
...
@@ -162,20 +162,20 @@
"type": "tidelift"
}
],
"time": "2022-0
5
-1
0T06:54:21
+00:00"
"time": "2022-0
6
-1
4T13:09:35
+00:00"
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.
6.2
",
"version": "3.
7.0
",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "
5e4e71592f69da17871dba6e80dd51bce74a351a
"
"reference": "
a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/
5e4e71592f69da17871dba6e80dd51bce74a351a
",
"reference": "
5e4e71592f69da17871dba6e80dd51bce74a351a
",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/
a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563
",
"reference": "
a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563
",
"shasum": ""
},
"require": {
...
...
@@ -218,20 +218,20 @@
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
"time": "202
1-12-12T21:44:5
8+00:00"
"time": "202
2-06-13T06:31:3
8+00:00"
},
{
"name": "symfony/polyfill-php73",
"version": "v1.2
5
.0",
"version": "v1.2
6
.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
"reference": "
cc5db0e22b3cb4111010e48785a97f670b350ca
5"
"reference": "
e440d35fa0286f77fb45b79a03fedbeda9307e8
5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/
cc5db0e22b3cb4111010e48785a97f670b350ca
5",
"reference": "
cc5db0e22b3cb4111010e48785a97f670b350ca
5",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/
e440d35fa0286f77fb45b79a03fedbeda9307e8
5",
"reference": "
e440d35fa0286f77fb45b79a03fedbeda9307e8
5",
"shasum": ""
},
"require": {
...
...
@@ -240,7 +240,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.2
3
-dev"
"dev-main": "1.2
6
-dev"
},
"thanks": {
"name": "symfony/polyfill",
...
...
@@ -281,7 +281,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php73/tree/v1.2
5
.0"
"source": "https://github.com/symfony/polyfill-php73/tree/v1.2
6
.0"
},
"funding": [
{
...
...
@@ -297,7 +297,7 @@
"type": "tidelift"
}
],
"time": "202
1
-0
6-05T21:20:04
+00:00"
"time": "202
2
-0
5-24T11:49:31
+00:00"
},
{
"name": "szepeviktor/phpstan-wordpress",
...
...
This diff is collapsed.
Click to expand it.
src/WpdbMigrator.php
+
16
−
0
View file @
88deb535
...
...
@@ -88,9 +88,25 @@ class WpdbMigrator implements Migrator {
return
new
Version
(
get_option
(
$this
->
option_name
,
''
)
);
}
private
function
needs_migration
():
bool
{
$migrations
=
$this
->
migrations_repository
->
get_migrations
();
$last_migration
=
end
(
$migrations
);
if
(
$last_migration
===
false
)
{
return
false
;
}
if
(
$this
->
comparator
->
compare
(
$last_migration
->
get_version
(),
$this
->
get_current_version
()
)
)
{
return
true
;
}
return
false
;
}
public
function
migrate
():
void
{
require_once
ABSPATH
.
'wp-admin/includes/upgrade.php'
;
if
(
!
$this
->
needs_migration
()
)
{
return
;
}
$this
->
logger
->
info
(
'DB update start'
);
$current_version
=
$this
->
get_current_version
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment