Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
ksup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
lib
unicaen
ksup
Commits
b9c162dd
Commit
b9c162dd
authored
5 years ago
by
David Surville
Browse files
Options
Downloads
Plain Diff
Merge branch 'zf-3.x'
parents
b9709199
ec64a0f1
Branches
master
Tags
3.0.0
No related merge requests found
Pipeline
#5602
failed
5 years ago
Stage: publish
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/UnicaenKsup/Mvc/Service/ViewKsupStrategyFactory.php
+16
-4
16 additions, 4 deletions
src/UnicaenKsup/Mvc/Service/ViewKsupStrategyFactory.php
src/UnicaenKsup/Service/KsupServiceFactory.php
+18
-6
18 additions, 6 deletions
src/UnicaenKsup/Service/KsupServiceFactory.php
with
34 additions
and
10 deletions
src/UnicaenKsup/Mvc/Service/ViewKsupStrategyFactory.php
+
16
−
4
View file @
b9c162dd
...
...
@@ -3,6 +3,7 @@
namespace
UnicaenKsup\Mvc\Service
;
use
Application\View\Renderer\PhpRenderer
;
use
Interop\Container\ContainerInterface
;
use
UnicaenKsup\Service\KsupService
;
use
Zend\ServiceManager\FactoryInterface
;
use
Zend\ServiceManager\ServiceLocatorInterface
;
...
...
@@ -11,16 +12,27 @@ use UnicaenKsup\View\Strategy\KsupStrategy;
class
ViewKsupStrategyFactory
implements
FactoryInterface
{
public
function
createService
(
ServiceLocatorInterface
$serviceLocator
)
/**
* @param ContainerInterface $container
* @param string $requestedName
* @param array|null $options
* @return object|KsupStrategy
*/
public
function
__invoke
(
ContainerInterface
$container
,
$requestedName
,
array
$options
=
null
)
{
/** @var PhpRenderer $renderer */
$renderer
=
$
serviceLocato
r
->
get
(
'ViewRenderer'
);
$renderer
=
$
containe
r
->
get
(
'ViewRenderer'
);
/** @var KsupService $service */
$service
=
$
serviceLocato
r
->
get
(
'ksup'
);
$service
=
$
containe
r
->
get
(
'ksup'
);
$strategy
=
new
KsupStrategy
(
$renderer
);
$strategy
->
setServiceKsup
(
$service
);
return
$strategy
;
}
public
function
createService
(
ServiceLocatorInterface
$container
)
{
return
$this
(
$container
,
KsupStrategy
::
class
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/UnicaenKsup/Service/KsupServiceFactory.php
+
18
−
6
View file @
b9c162dd
...
...
@@ -2,18 +2,25 @@
namespace
UnicaenKsup\Service
;
use
Interop\Container\ContainerInterface
;
use
UnicaenKsup\View\Strategy\KsupStrategy
;
use
Zend\ServiceManager\FactoryInterface
;
use
Zend\ServiceManager\ServiceLocatorInterface
;
use
Zend\View\Helper\BasePath
;
class
KsupServiceFactory
implements
FactoryInterface
{
public
function
createService
(
ServiceLocatorInterface
$serviceLocator
)
/**
* @param ContainerInterface $container
* @param string $requestedName
* @param array|null $options
* @return object|KsupService
*/
public
function
__invoke
(
ContainerInterface
$container
,
$requestedName
,
array
$options
=
null
)
{
$service
=
new
KsupService
();
$config
=
$
serviceLocato
r
->
get
(
'config'
);
$config
=
$
containe
r
->
get
(
'config'
);
if
(
isset
(
$config
[
'unicaen-ksup'
]))
{
$config
=
$config
[
'unicaen-ksup'
];
}
else
{
...
...
@@ -22,9 +29,14 @@ class KsupServiceFactory implements FactoryInterface
$service
->
setConfig
(
$config
);
/** @var BasePath $basePath */
$basePath
=
$
serviceLocato
r
->
get
(
'
v
iewHelperManager'
)
->
get
(
'basePath'
);
$basePath
=
$
containe
r
->
get
(
'
V
iewHelperManager'
)
->
get
(
'basePath'
);
$service
->
setBasePath
(
$basePath
);
return
$service
;
}
public
function
createService
(
ServiceLocatorInterface
$container
)
{
return
$this
(
$container
,
KsupService
::
class
);
}
}
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