Пример #1
0
 /**
  * @return string
  */
 public function ServiceRaw()
 {
     $sResult = '';
     $sRawError = '';
     $sAction = empty($this->aPaths[2]) ? '' : $this->aPaths[2];
     $oException = null;
     try {
         $sRawError = 'Invalid action';
         if (0 !== \strlen($sAction)) {
             $sMethodName = 'Raw' . $sAction;
             if (\method_exists($this->oActions, $sMethodName)) {
                 $sRawError = '';
                 $this->oActions->SetActionParams(array('RawKey' => empty($this->aPaths[3]) ? '' : $this->aPaths[3], 'Params' => $this->aPaths), $sMethodName);
                 if (!\call_user_func(array($this->oActions, $sMethodName))) {
                     $sRawError = 'False result';
                 } else {
                     $sRawError = '';
                 }
             } else {
                 $sRawError = 'Unknown action "' . $sAction . '"';
             }
         } else {
             $sRawError = 'Empty action';
         }
     } catch (\RainLoop\Exceptions\ClientException $oException) {
         $sRawError = 'Exception as result';
         switch ($oException->getCode()) {
             case \RainLoop\Notifications::AuthError:
                 $sRawError = 'Authentication failed';
                 break;
         }
     } catch (\Exception $oException) {
         $sRawError = 'Exception as result';
     }
     if (0 < \strlen($sRawError)) {
         $this->oActions->Logger()->Write($sRawError, \MailSo\Log\Enumerations\Type::ERROR);
         $this->oActions->Logger()->WriteDump($this->aPaths, \MailSo\Log\Enumerations\Type::ERROR, 'PATHS');
     }
     if ($oException) {
         $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR, 'RAW');
     }
     return $sResult;
 }