Beispiel #1
0
 public function setApp($app)
 {
     if (!is_string($app)) {
         throw new Bll_Service_Exception('Invalid App Name');
     }
     if (is_null(self::$apps)) {
         self::$apps = APF::get_instance()->get_config('apps', 'acenter');
     }
     if (!isset(self::$apps[$app])) {
         throw new Bll_Service_Exception('Cannot find config for app:' . $app);
     }
     // 加载appId和appKey
     $this->app = $app;
     $this->appId = self::$apps[$this->app]['appId'];
     $this->appKey = self::$apps[$this->app]['appKey'];
     return $this;
 }