Skip to content
This repository has been archived by the owner on May 14, 2018. It is now read-only.

Commit

Permalink
add AuthorizeAwareInterface and SM initializer to inject the Authoriz…
Browse files Browse the repository at this point in the history
…e service
  • Loading branch information
bjyoungblood committed Sep 19, 2012
1 parent e750d26 commit b4eb019
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Module.php
Expand Up @@ -32,6 +32,13 @@ public function onBootstrap(EventInterface $e)
public function getServiceConfig() public function getServiceConfig()
{ {
return array( return array(
'initializers' => array(
function ($instance, $sm) {
if ($instance instanceof Service\AuthorizeAwareInterface) {
$instance->setAuthorizeService($sm->get('BjyAuthorize\Service\Authorize'));
}
}
),
'factories' => array( 'factories' => array(
'BjyAuthorize\Service\Authorize' => 'BjyAuthorize\Service\AuthorizeFactory', 'BjyAuthorize\Service\Authorize' => 'BjyAuthorize\Service\AuthorizeFactory',


Expand Down
8 changes: 8 additions & 0 deletions src/BjyAuthorize/Service/AuthorizeAwareInterface.php
@@ -0,0 +1,8 @@
<?php

namespace BjyAuthorize\Service;

interface AuthorizeAwareInterface
{
public function setAuthorizeService(Authorize $auth);
}

0 comments on commit b4eb019

Please sign in to comment.