Exemplo n.º 1
0
 /**
  * Instantiates a new Facebook super-class object
  *
  * @param array $config
  *
  * @throws \Facebook\Exceptions\FacebookSDKException;
  */
 public function __construct(array $config = [])
 {
     if (!count($config)) {
         $sysConfig = ZFactory::getConfig();
         $config = ['app_id' => $sysConfig->social->facebook->appID, 'app_secret' => $sysConfig->social->facebook->appSecret, 'permissions' => $sysConfig->social->facebook->permissions, 'default_graph_version' => $sysConfig->social->facebook->defaultGraphVersion ? $sysConfig->social->facebook->defaultGraphVersion : 'v2.2'];
     }
     parent::__construct($config);
 }
Exemplo n.º 2
0
 /**
  * Instantiates a new ZGoogle
  *
  * @param array $config
  */
 public function __construct(array $config = [])
 {
     if (!count($config)) {
         $sysConfig = ZFactory::getConfig();
         $config = ['clientID' => $sysConfig->social->google->clientID, 'clientSecret' => $sysConfig->social->google->clientSecret, 'scope' => $sysConfig->social->google->scope->toArray()];
     }
     $this->config = $config;
     $this->_initGoogleClient();
 }
Exemplo n.º 3
0
 /**
  * Init config
  *
  * @param $config
  */
 private function _initConfig($config)
 {
     if ($config) {
         $this->config = $config;
     } else {
         $this->config = ZFactory::getConfig();
     }
     $this->message = Swift_Message::newInstance();
     if ($this->config->mail->mailType == 'smtp') {
         $this->message->setFrom($this->config->mail->smtpUser, $this->config->mail->mailName);
         $transporter = Swift_SmtpTransport::newInstance($this->config->mail->smtpHost, $this->config->mail->smtpPort, $this->config->mail->smtpSecure)->setUsername($this->config->mail->smtpUser)->setPassword($this->config->mail->smtpPass);
         $this->mailer = Swift_Mailer::newInstance($transporter);
     } else {
         $this->message->setFrom($this->config->mail->mailFrom, $this->config->mail->mailName);
         $transporter = Swift_SendmailTransport::newInstance($this->config->mail->sendMail . ' -bs');
         $this->mailer = Swift_Mailer::newInstance($transporter);
     }
 }