Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wplang
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Noblogs
wplang
Commits
d47885a4
Unverified
Commit
d47885a4
authored
3 years ago
by
Daniel Seifert
Browse files
Options
Downloads
Patches
Plain Diff
make compatible to Composer 2
parent
3194a2a7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
composer.json
+1
-1
1 addition, 1 deletion
composer.json
src/Translatable.php
+1
-1
1 addition, 1 deletion
src/Translatable.php
src/Wplang.php
+12
-3
12 additions, 3 deletions
src/Wplang.php
with
14 additions
and
5 deletions
composer.json
+
1
−
1
View file @
d47885a4
...
...
@@ -11,7 +11,7 @@
}
],
"require"
:
{
"composer-plugin-api"
:
"^
1
.0"
"composer-plugin-api"
:
"^
2
.0"
},
"autoload"
:
{
"psr-4"
:
{
...
...
This diff is collapsed.
Click to expand it.
src/Translatable.php
+
1
−
1
View file @
d47885a4
...
...
@@ -60,7 +60,7 @@ class Translatable {
* @param string $type The package type: 'plugin', 'theme' or 'core'.
* @param string $slug The plugin/theme slug, E.g. 'query-monitor'. In case of core, this is 'wordpress'.
* @param string $version The package version.
* @param
string
$languages Array of the languages we are using.
* @param
array
$languages Array of the languages we are using.
* @param string $wpLanguageDir Full path to the language files target directory.
*/
public
function
__construct
(
$type
,
$slug
,
$version
,
$languages
,
$wpLanguageDir
)
{
...
...
This diff is collapsed.
Click to expand it.
src/Wplang.php
+
12
−
3
View file @
d47885a4
...
...
@@ -3,7 +3,7 @@
namespace
BJ\Wplang
;
use
Composer\Composer
;
use
Composer\
Script\Event
;
use
Composer\
DependencyResolver\Operation\UpdateOperation
;
use
Composer\EventDispatcher\EventSubscriberInterface
;
use
Composer\IO\IOInterface
;
use
Composer\Plugin\PluginInterface
;
...
...
@@ -50,10 +50,19 @@ class Wplang implements PluginInterface, EventSubscriberInterface {
}
if
(
!
empty
(
$extra
[
'wordpress-language-dir'
]
)
)
{
$this
->
wpLanguageDir
=
dirname
(
dirname
(
dirname
(
dirname
(
__DIR__
)
)
)
)
.
'/'
.
$extra
[
'wordpress-language-dir'
];
$this
->
wpLanguageDir
=
dirname
(
__DIR__
,
4
)
.
'/'
.
$extra
[
'wordpress-language-dir'
];
}
}
public
function
deactivate
(
Composer
$composer
,
IOInterface
$io
)
{
// do nothing
}
public
function
uninstall
(
Composer
$composer
,
IOInterface
$io
)
{
// do nothing
}
/**
* Subscribe to Composer events.
...
...
@@ -77,7 +86,7 @@ class Wplang implements PluginInterface, EventSubscriberInterface {
* @param PackageEvent $event The package event object.
*/
public
function
onPackageAction
(
PackageEvent
$event
)
{
if
(
'update'
===
$event
->
getOperation
()
->
getJobType
()
)
{
if
(
$event
->
getOperation
()
instanceof
UpdateOperation
)
{
$package
=
$event
->
getOperation
()
->
getTargetPackage
();
}
else
{
$package
=
$event
->
getOperation
()
->
getPackage
();
...
...
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