src/mg/Ding/Container/Impl/ContainerImpl.php
private function _setupInitAndShutdown($bean, BeanDefinition $definition)
    {
        if ($definition->hasInitMethod()) {
            $initMethod = $definition->getInitMethod();
            $bean->$initMethod();
        }
        if ($definition->hasDestroyMethod()) {
            $destroyMethod = $definition->getDestroyMethod();
            $this->registerShutdownMethod($bean, $destroyMethod);
        }
    }
private function _setupInitAndShutdown($bean, BeanDefinition $definition)
    {
        if ($definition->hasInitMethod()) {
            $initMethod = $definition->getInitMethod();
            $bean->$initMethod();
        }
        if ($definition->hasDestroyMethod()) {
            $destroyMethod = $definition->getDestroyMethod();
            $this->registerShutdownMethod($bean, $destroyMethod);
        }
    }
Calls init method and register shutdown method.

@param object $bean
@param BeanDefinition $definition

@return void