Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-init
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-init
Commits
19c05c0f
Verified
Commit
19c05c0f
authored
10 months ago
by
Bartek Jaskulski
Committed by
Bartek Jaskulski
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
feat: Add legacy extension support based on configuration
parent
7776ea61
No related branches found
No related tags found
2 merge requests
!5
feat: remove compilation command
,
!4
feat: remove compilation command
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Init.php
+1
-1
1 addition, 1 deletion
src/Init.php
src/Kernel.php
+17
-1
17 additions, 1 deletion
src/Kernel.php
with
18 additions
and
2 deletions
src/Init.php
+
1
−
1
View file @
19c05c0f
...
@@ -68,7 +68,7 @@ final class Init {
...
@@ -68,7 +68,7 @@ final class Init {
new
ConditionalExtension
()
new
ConditionalExtension
()
);
);
if
(
class_exists
(
\WPDesk_Plugin_Info
::
class
)
)
{
if
(
$this
->
config
->
get
(
'legacy'
,
false
)
&&
class_exists
(
\WPDesk_Plugin_Info
::
class
)
)
{
$extensions
->
add
(
new
LegacyExtension
()
);
$extensions
->
add
(
new
LegacyExtension
()
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/Kernel.php
+
17
−
1
View file @
19c05c0f
...
@@ -7,10 +7,14 @@ use DI\Container;
...
@@ -7,10 +7,14 @@ use DI\Container;
use
DI\ContainerBuilder
as
DiBuilder
;
use
DI\ContainerBuilder
as
DiBuilder
;
use
Psr\Container\ContainerInterface
;
use
Psr\Container\ContainerInterface
;
use
WPDesk\Init\Binding\Binder\CallableBinder
;
use
WPDesk\Init\Binding\Binder\CallableBinder
;
use
WPDesk\Init\Binding\Binder\CollectionBinder
;
use
WPDesk\Init\Binding\Binder\CompositeBinder
;
use
WPDesk\Init\Binding\Binder\CompositeBinder
;
use
WPDesk\Init\Binding\Binder\HookableBinder
;
use
WPDesk\Init\Binding\Binder\HookableBinder
;
use
WPDesk\Init\Binding\Binder\StoppableBinder
;
use
WPDesk\Init\Binding\Binder\StoppableBinder
;
use
WPDesk\Init\Binding\Loader\ClusteredLoader
;
use
WPDesk\Init\Binding\Loader\CompositeBindingLoader
;
use
WPDesk\Init\Binding\Loader\CompositeBindingLoader
;
use
WPDesk\Init\Binding\Loader\DebugBindingLoader
;
use
WPDesk\Init\Binding\Loader\OrderedBindingLoader
;
use
WPDesk\Init\Configuration\Configuration
;
use
WPDesk\Init\Configuration\Configuration
;
use
WPDesk\Init\DependencyInjection\ContainerBuilder
;
use
WPDesk\Init\DependencyInjection\ContainerBuilder
;
use
WPDesk\Init\Extension\ExtensionsSet
;
use
WPDesk\Init\Extension\ExtensionsSet
;
...
@@ -99,6 +103,10 @@ final class Kernel {
...
@@ -99,6 +103,10 @@ final class Kernel {
$builder
=
new
ContainerBuilder
(
$original_builder
);
$builder
=
new
ContainerBuilder
(
$original_builder
);
if
(
!
function_exists
(
'WPDesk\Init\DI\create'
)
)
{
require
__DIR__
.
'/di-functions.php'
;
}
foreach
(
$this
->
extensions
as
$extension
)
{
foreach
(
$this
->
extensions
as
$extension
)
{
$extension
->
build
(
$builder
,
$plugin
,
$this
->
config
);
$extension
->
build
(
$builder
,
$plugin
,
$this
->
config
);
}
}
...
@@ -112,6 +120,14 @@ final class Kernel {
...
@@ -112,6 +120,14 @@ final class Kernel {
$loader
->
add
(
$extension
->
bindings
(
$container
)
);
$loader
->
add
(
$extension
->
bindings
(
$container
)
);
}
}
$loader
=
new
OrderedBindingLoader
(
new
ClusteredLoader
(
$loader
)
);
if
(
$this
->
config
->
get
(
'debug'
,
false
)
)
{
$loader
=
new
DebugBindingLoader
(
$loader
);
}
$driver
=
new
GenericDriver
(
$driver
=
new
GenericDriver
(
$loader
,
$loader
,
new
StoppableBinder
(
new
StoppableBinder
(
...
@@ -123,7 +139,7 @@ final class Kernel {
...
@@ -123,7 +139,7 @@ final class Kernel {
)
)
);
);
if
(
class_exists
(
\WPDesk_Plugin_Info
::
class
)
)
{
if
(
$this
->
config
->
get
(
'legacy'
,
false
)
)
{
$driver
=
new
CompositeDriver
(
$driver
=
new
CompositeDriver
(
$driver
,
$driver
,
new
LegacyDriver
(
$container
)
new
LegacyDriver
(
$container
)
...
...
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