コード例 #1
0
ファイル: Module.php プロジェクト: liuxuezhan/my_tool
 public function getServiceConfig()
 {
     return array('factories' => array('User\\Model\\QQ' => function ($sm) {
         $config = $sm->get('config');
         $user = new QQ($config['platform'][QQ::ePlatform_QQ]['appid'], $config['platform'][QQ::ePlatform_QQ]['appkey']);
         $user->setServiceLocator($sm);
         return $user;
     }, 'User\\Model\\WX' => function ($sm) {
         $config = $sm->get('config');
         $user = new WX($config['platform'][WX::ePlatform_Weixin]['appid'], $config['platform'][WX::ePlatform_Weixin]['appkey']);
         $user->setServiceLocator($sm);
         return $user;
     }));
 }