Shortcut for a success

@param string $msg
@param string $url
@return SS_HTTPResponse
8240
protected function success($msg, $url = null)
    {
        return $this->msg($msg, self::MSG_GOOD, $url);
    }
711777
public function sendLinkMsg($title, $text, $picUrl = '', $messageUrl)
    {
        $query = [
            'msgtype' => 'link',
            'link' => [
                'title' => $title,
                'text' => $text,
                'picUrl' => $picUrl,
                'messageUrl' => $messageUrl
            ],
        ];
        return $this->sendMsg($query);
    }
883768
public function ip($msg)
    {
        if(strlen(trim($this->_value)) > 0 && filter_var($this->_value, FILTER_VALIDATE_IP) === FALSE) {
            $this->_errors[] = $msg;
        }
        return $this;
    }
762729
function post($url, $parameters = array(), $multi = false) {
    $response = $this->oAuthRequest($url, 'POST', $parameters, $multi );
    if ($this->format === 'json' && $this->decode_json) {
      return json_decode($response, true);
    }
    return $response;
  }
1198616
public function onClientHandlerMessage(ClientHandlerJobRequest $msg)
    {
        $request = new Request($msg->getRequestId(), $msg->getActionName(), $msg->getParameters());
        $this->addRequest($request);

        $this->getStream('clientHandler')->send(
            new ClientHandlerJobResponse(
                $msg->getRequestId(),
                $this->getId()
            )
        );
    }
808047
public function request($url)
    {
        $curlOpts = array_replace($this->curlOpts, [CURLOPT_URL => $url]);

        $ch = curl_init();
        foreach ($curlOpts as $opt => $optVal) {
            curl_setopt($ch, $opt, $optVal);
        }

        $resp = curl_exec($ch);
        $info = (object) curl_getinfo($ch);
        curl_close($ch);

        //Check response
        $httpCode = (string) $info->http_code;
        if ($httpCode{0} != '2') {
            $msg = sprintf('HTTP Request Failed (code %s): %s', $info->http_code, $resp);
            throw new HttpException($resp, $msg, $httpCode);
        } elseif (strlen(trim($resp)) == 0) {
            throw new HttpException($resp, 'HTTP Response Empty');
        }

        return $resp;
    }
294926
public static function processMessage ($msg)
  {
    $msg = preg_replace_callback ('#<path>([^<]*)</path>#', function ($m) {
      return ErrorConsole::errorLink ($m[1], 1, 1, self::shortFileName ($m[1]));
    }, $msg);
    return $msg;
  }
338311
protected function exec($url)
    {
        $client = $this->getRequest();
        $response = $client->request('GET',$url);
        return $this->handleResponse($response->getBody());
    }
929571
public function link($title, $url = null, $options = array(), $confirmMessage = false) {
		$exit = false;
		if (isset($options['onActive'])){
			list($url,$options) = $this->_onActive($url,$options);
		}

		if (isset($options['onHide'])){
			list($url,$options,$exit)= $this->_onHide($url,$options);
		}

		if (isset($options['onDisabled'])){
			list($url,$options) = $this->_onDisabled($url,$options);
		}		
		return  ($exit)? false : $this->_link($title,$url,$options,$confirmMessage);
	}
228267
public static function post(string $url, array $params = null, array $headers = null)
    {
        return static::quickRequest($url, self::POST, $params, $headers);
    }
1210601
private function _alert( $type, $msg , $url  ) {
			$messages = CakeSession::read('Alerts');
		if ($messages === null){
			$messages = array();
		}
		
		$messages[] = array('type' => $type , 'msg' => $msg );
		CakeSession::write('Alerts',$messages);
		if($url){
			return $this->controller->redirect($url);
		}		
		
	//	$this->setFlash( $msg , $element , array( 'class' => $class ,'global'=> $global ) );

    }
549229
protected function success($msg = '', $url = '', $data = '', $wait = 3, $header = [])
    {
        $this->jump(CodeConstant::CODE_SUCCESS, $msg, $url, $data, $wait, $header);
    }
335981
private function onMessage($msg, $socket) {
        try {
            $payload = @json_decode($msg, true);
            if (!$payload) {
                $this->response($socket, ['error' => 403, 'message' => 'error request']);

                return;
            }
            $command = isset($payload['command']) ? $payload['command'] : 'status';
            $service = isset($payload['args']['service']) ? $payload['args']['service'] : '';
            switch ($command) {
                case 'stop':
                    if ($service) {
                        $rst = $this->stopService($service);
                        $this->response($socket, ['status' => $rst ? 'done' : 'fail']);
                    } else {
                        $this->response($socket, ['status' => 'done']);
                        $this->shutdown = true;
                        $this->rSignal  = SIGTERM;
                    }
                    break;
                case 'start':
                    if ($service) {
                        $rst = $this->startService($service);
                        $this->response($socket, ['status' => $rst ? 'done' : 'fail']);
                    } else {
                        $this->response($socket, ['status' => 'fail']);
                    }
                    break;
                case 'reload':
                    $rst = $this->reloadConfig(null, $service);
                    $this->response($socket, ['status' => $rst ? 'done' : 'fail']);
                    break;
                case 'ps':
                    if ($service) {
                        if (isset($this->services[ $service ])) {
                            $pids = isset($this->services[ $service ]['pids']) ? $this->services[ $service ]['pids'] : [];
                            $this->response($socket, [
                                'ps'   => [$service => $pids],
                                'ssid' => posix_getpid()
                            ]);
                        } else {
                            $this->response($socket, ['ps' => [], 'ssid' => posix_getpid()]);
                        }
                    } else {
                        $ps = [];
                        foreach ($this->services as $s => $ser) {
                            $ps[ $s ] = isset($ser['pids']) ? $ser['pids'] : [];
                        }
                        $this->response($socket, ['ps' => $ps, 'ssid' => posix_getpid()]);
                    }
                    break;
                case 'status':
                default:
                    if ($service) {
                        if (isset($this->services[ $service ])) {
                            $this->response($socket, [
                                'status' => $this->services[ $service ]['status'],
                                'detail' => $this->services[ $service ]
                            ]);
                        } else {
                            $this->response($socket, ['status' => 'unknown', 'detail' => []]);
                        }
                    } else {
                        $this->response($socket, ['status' => 'running', 'services' => $this->services]);
                    }
            }
        } catch (\Exception $e) {
            $this->response($socket, ['error' => 500, 'msg' => $e->getMessage()]);
        }
    }
1283892
protected function exec($url)
    {
        $client = $this->getRequest();
        try{
            $response = $client->request('POST',$this->buildRequestUrl(),[
                'json' => [
                    'longUrl' => $url
                ]
            ]);
        } catch (\GuzzleHttp\Exception\ClientException $e){
            $response = $e->getResponse();
        }
        return $this->handleResponse($response->getBody());
    }
987685
protected function error($msg = '', $url = '', $data = '', $wait = 3)
    {
        return $this->jump(0, $msg, $url, $data, $wait);
    }
62276
public function aSuccess($message,$url='',$data=[])
    {
        $url=is_null($url) || $url=='' ? 'javascript:history.back(-1)' : $url;
        if(Request::isAjax() ){
            return $this->json(0,$message,array_merge($data,['url'=>url($url)]));
        }else{
            return $this->success($message,$url);
        }
    }
508205
protected function jump($code = 1, $msg = '', $url = '', $data = '', $wait = 3)
    {
        $jump = Format::formatJump($code, $msg, $url, $data, $wait);
        if (Request::instance()->isAjax()) {
            responseReturn($jump, 'json', true);
        } else {
            $this->site_title || $this->site_title = $msg;
            
            $this->assign('jump', $jump);
            
            return $this->fetch('common/jump');
        }
    }