示例#1
0
 /**
  * (non-PHPdoc)
  * @see Ding\Bean\Lifecycle.ILifecycleListener::afterConfig()
  */
 public function afterConfig()
 {
     try {
         $bean = $this->_container->getBean('messageSource');
         $this->_container->setMessageSource($bean);
     } catch (\Exception $e) {
     }
 }
示例#2
0
 /**
  * (non-PHPdoc)
  * @see Ding\Bean\Lifecycle.IAfterConfigListener::afterConfig()
  */
 public function afterConfig()
 {
     $holder = $this->_container->getBean('PropertiesHolder');
     foreach ($holder->getLocations() as $location) {
         if (is_string($location)) {
             $resource = $this->_resourceLoader->getResource(trim($location));
         } else {
             $resource = $location;
         }
         $contents = stream_get_contents($resource->getStream());
         $this->_container->registerProperties(parse_ini_string($contents, false));
     }
 }
示例#3
0
 /**
  * Creates a new bean (prototypes).
  *
  * @param MethodInvocation $invocation The call.
  *
  * @return object
  */
 public function invoke(MethodInvocation $invocation)
 {
     return $this->_container->getBean($this->_beanName);
 }